diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 2ac66fd60ea..9125e533448 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -179,8 +179,8 @@ radv_optimize_nir(struct nir_shader *shader, bool optimize_conservatively) _mesa_set_destroy(skip, NULL); NIR_PASS(progress, shader, nir_opt_shrink_vectors); - NIR_PASS(progress, shader, nir_remove_dead_variables, nir_var_function_temp | nir_var_shader_in | nir_var_shader_out, - NULL); + NIR_PASS(progress, shader, nir_remove_dead_variables, + nir_var_function_temp | nir_var_shader_in | nir_var_shader_out | nir_var_mem_shared, NULL); if (shader->info.stage == MESA_SHADER_FRAGMENT && (shader->info.fs.uses_discard || shader->info.fs.uses_demote)) { NIR_PASS(progress, shader, nir_opt_conditional_discard);