radv: enable pipelinestat query emulation for legacy GS
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 19 Jul 2023 07:08:31 +0000 (09:08 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 27 Jul 2023 07:13:11 +0000 (09:13 +0200)
This will allow us to fix a bug with the number of geometry shader
invocations which increase for NGG VS or TES but shouldn't. And also
for simplifying the NGG vs legacy query path.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24231>

src/amd/vulkan/radv_pipeline.c

index 1997c5e..ec5fd4d 100644 (file)
@@ -639,11 +639,13 @@ radv_postprocess_nir(struct radv_device *device, const struct radv_pipeline_layo
                     stage->info.outinfo.export_prim_id, false, false, stage->info.force_vrs_per_vertex);
 
       } else {
+         bool emulate_ngg_gs_query_pipeline_stat = device->physical_device->emulate_ngg_gs_query_pipeline_stat;
+
          ac_nir_gs_output_info gs_out_info = {
             .streams = stage->info.gs.output_streams,
             .usage_mask = stage->info.gs.output_usage_mask,
          };
-         NIR_PASS_V(stage->nir, ac_nir_lower_legacy_gs, false, false, &gs_out_info);
+         NIR_PASS_V(stage->nir, ac_nir_lower_legacy_gs, false, emulate_ngg_gs_query_pipeline_stat, &gs_out_info);
       }
    } else if (stage->stage == MESA_SHADER_FRAGMENT) {
       ac_nir_lower_ps_options options = {