diff --git a/src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c b/src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c index b77199e931c..71af4753abb 100644 --- a/src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c +++ b/src/gallium/frontends/lavapipe/lvp_lower_vulkan_resource.c @@ -210,7 +210,8 @@ void lvp_lower_pipeline_layout(const struct lvp_device *device, nir_shader *shader) { nir_shader_lower_instructions(shader, lower_vulkan_resource_index, lower_vri_instr, layout); - nir_foreach_uniform_variable(var, shader) { + nir_foreach_variable_with_modes(var, shader, nir_var_uniform | + nir_var_mem_image) { const struct glsl_type *type = var->type; enum glsl_base_type base_type = glsl_get_base_type(glsl_without_array(type)); diff --git a/src/gallium/frontends/lavapipe/lvp_pipeline.c b/src/gallium/frontends/lavapipe/lvp_pipeline.c index 80551d4c4f0..ef868dd7cac 100644 --- a/src/gallium/frontends/lavapipe/lvp_pipeline.c +++ b/src/gallium/frontends/lavapipe/lvp_pipeline.c @@ -560,7 +560,8 @@ lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline, NIR_PASS_V(nir, nir_lower_compute_system_values, NULL); NIR_PASS_V(nir, nir_lower_clip_cull_distance_arrays); - NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_uniform, NULL); + NIR_PASS_V(nir, nir_remove_dead_variables, + nir_var_uniform | nir_var_mem_image, NULL); lvp_lower_pipeline_layout(pipeline->device, pipeline->layout, nir);