From 597b2648d2dbe4dff21c7eeb95729c02d8e5e01d Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Thu, 8 Dec 2022 13:13:33 +0100 Subject: [PATCH] zink: do not leave needless shader temps around MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This used to not matter, but since we started emitting shader-temps properly, this causes issues where we end up with samplers and images as shader-temps. That causes asserts while emitting them. So let's remove the unused vars as well. This fixes a piglit regression that somehow went unnoticed on CI. Fixes: 85964945e7c ("zink: emit vars with nir_var_shader_temp mode") Tested-by: Martin Roukala (né Peres) Part-of: --- src/gallium/drivers/zink/zink_compiler.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index 87e9363..6cfb9f4 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -2497,6 +2497,7 @@ prune_io(nir_shader *nir) if (!find_var_deref(nir, var)) var->data.mode = nir_var_shader_temp; } + NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_shader_temp, NULL); } VkShaderModule -- 2.7.4