radeonsi: do not DCE texture vars
authorKarol Herbst <kherbst@redhat.com>
Wed, 26 Oct 2022 14:59:19 +0000 (16:59 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 10 Nov 2022 10:21:34 +0000 (10:21 +0000)
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19381>

src/gallium/drivers/radeonsi/si_shader_nir.c

index 0472241324095c2afe53745ea729790b17c09ab9..6fac0ae9f5d51a122ee52f853db77105108e33b2 100644 (file)
@@ -350,6 +350,7 @@ char *si_finalize_nir(struct pipe_screen *screen, void *nirptr)
    /* Remove uniforms because those should have been lowered to UBOs already. */
    nir_foreach_variable_with_modes_safe(var, nir, nir_var_uniform) {
       if (!glsl_type_get_image_count(var->type) &&
+          !glsl_type_get_texture_count(var->type) &&
           !glsl_type_get_sampler_count(var->type))
          exec_node_remove(&var->node);
    }