Module: Mesa
Branch: main
Commit: 00288d4f53fa792b3931437bcd2810290bc18441
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=00288d4f53fa792b3931437bcd2810290bc18441

Author: Mike Blumenkrantz <[email protected]>
Date:   Thu Feb 23 16:25:17 2023 -0500

zink: delete dead uniform variables

this just obfuscate nir, so delete them now

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>

---

 src/gallium/drivers/zink/zink_compiler.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_compiler.c 
b/src/gallium/drivers/zink/zink_compiler.c
index a81b7808320..0e3371b55fa 100644
--- a/src/gallium/drivers/zink/zink_compiler.c
+++ b/src/gallium/drivers/zink/zink_compiler.c
@@ -4445,6 +4445,10 @@ zink_shader_create(struct zink_screen *screen, struct 
nir_shader *nir,
                else
                   ret->bindings[ztype][ret->num_bindings[ztype]].size = 1;
                ret->num_bindings[ztype]++;
+            } else if (var->data.mode == nir_var_uniform) {
+               /* this is a dead uniform */
+               var->data.mode = 0;
+               exec_node_remove(&var->node);
             }
          }
       }

Reply via email to