From 9f692f5aa646bad8958e8c12e73d1059b754023b Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 26 Oct 2022 13:10:57 +0000 Subject: [PATCH] radv: do not unconditionally disable NGG streamout lowering in NIR This is still always disabled because use_ngg_streamout is FALSE but it will be turned on at some point. Signed-off-by: Samuel Pitoiset Reviewed-by: Rhys Perry Part-of: --- src/amd/vulkan/radv_shader.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index ac58fe36a9c..4991703ba11 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -1331,7 +1331,7 @@ radv_consider_culling(const struct radv_physical_device *pdevice, struct nir_sha } static void -setup_ngg_lds_layout(nir_shader *nir, struct radv_shader_info *info, +setup_ngg_lds_layout(struct radv_device *device, nir_shader *nir, struct radv_shader_info *info, unsigned max_vtx_in) { unsigned scratch_lds_base = 0; @@ -1346,7 +1346,7 @@ setup_ngg_lds_layout(nir_shader *nir, struct radv_shader_info *info, unsigned pervertex_lds_bytes = ac_ngg_nogs_get_pervertex_lds_size(stage, nir->num_outputs, - false, /* streamout */ + device->physical_device->use_ngg_streamout, info->outinfo.export_prim_id, false, /* user edge flag */ info->has_ngg_culling, @@ -1370,7 +1370,7 @@ setup_ngg_lds_layout(nir_shader *nir, struct radv_shader_info *info, ac_ngg_get_scratch_lds_size(stage, info->workgroup_size, info->wave_size, - false, /* streamout */ + device->physical_device->use_ngg_streamout, info->has_ngg_culling); /* Get total LDS usage. */ @@ -1428,7 +1428,7 @@ void radv_lower_ngg(struct radv_device *device, struct radv_pipeline_stage *ngg_ /* Invocations that process an input vertex */ unsigned max_vtx_in = MIN2(256, ngg_info->hw_max_esverts); - setup_ngg_lds_layout(nir, &ngg_stage->info, max_vtx_in); + setup_ngg_lds_layout(device, nir, &ngg_stage->info, max_vtx_in); ac_nir_lower_ngg_options options = {0}; options.family = device->physical_device->rad_info.family; @@ -1436,7 +1436,7 @@ void radv_lower_ngg(struct radv_device *device, struct radv_pipeline_stage *ngg_ options.max_workgroup_size = info->workgroup_size; options.wave_size = info->wave_size; options.can_cull = nir->info.stage != MESA_SHADER_GEOMETRY && info->has_ngg_culling; - options.disable_streamout = true; + options.disable_streamout = !device->physical_device->use_ngg_streamout; if (nir->info.stage == MESA_SHADER_VERTEX || nir->info.stage == MESA_SHADER_TESS_EVAL) {