radv: run nir_opt_cse before lowering FS intrinsics
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 15 Sep 2022 12:56:28 +0000 (14:56 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 20 Sep 2022 09:52:37 +0000 (09:52 +0000)
Otherwise, there might be redundant barycentric_at_sample intrinsics
that will be lowered and this will increase code size.

No fossils-db changes.

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

src/amd/vulkan/radv_pipeline.c

index 0810ca1..d3836d4 100644 (file)
@@ -3683,6 +3683,7 @@ radv_postprocess_nir(struct radv_pipeline *pipeline,
    assert(stage->info.wave_size && stage->info.workgroup_size);
 
    if (stage->stage == MESA_SHADER_FRAGMENT) {
+      NIR_PASS(_, stage->nir, nir_opt_cse);
       NIR_PASS(_, stage->nir, radv_lower_fs_intrinsics, stage, pipeline_key);
    }