Module: Mesa Branch: main Commit: 7e3be0b3ce9a62a500155748f36382517d63645f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7e3be0b3ce9a62a500155748f36382517d63645f
Author: Samuel Pitoiset <[email protected]> Date: Mon Oct 31 10:27:28 2022 +0100 radv: assign IO var locations for VS/TES with NGG streamout NGG streamout lowering requires nir_shader::num_outputs to be set to the total number of outputs in order to compute the pervertex LDS size correctly. This is wasting LDS memory but it's currently the only viable solution. This fixes a bunch of dEQP-VK.transform_feedback.* failures. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19436> --- src/amd/vulkan/radv_shader.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index c705287e6e5..0ad42cfca55 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -1217,6 +1217,11 @@ radv_lower_io(struct radv_device *device, nir_shader *nir) if (device->physical_device->use_ngg_streamout && nir->xfb_info) { NIR_PASS_V(nir, nir_io_add_intrinsic_xfb_info); + + /* The total number of shader outputs is required for computing the pervertex LDS size for + * VS/TES when lowering NGG streamout. + */ + nir_assign_io_var_locations(nir, nir_var_shader_out, &nir->num_outputs, nir->info.stage); } }
