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

Author: Mike Blumenkrantz <[email protected]>
Date:   Tue Mar 28 18:39:29 2023 -0400

zink: add and populate a shader_info struct to zink_shader

this avoids the need to use the nir pointer to access shader info

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

---

 src/gallium/drivers/zink/zink_compiler.c | 2 ++
 src/gallium/drivers/zink/zink_types.h    | 1 +
 2 files changed, 3 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_compiler.c 
b/src/gallium/drivers/zink/zink_compiler.c
index fc7ae2f3b1d..44490ee8105 100644
--- a/src/gallium/drivers/zink/zink_compiler.c
+++ b/src/gallium/drivers/zink/zink_compiler.c
@@ -4901,6 +4901,7 @@ zink_shader_create(struct zink_screen *screen, struct 
nir_shader *nir,
          NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_shader_temp, NULL);
       }
    }
+   memcpy(&ret->info, &nir->info, sizeof(nir->info));
 
    ret->can_inline = true;
 
@@ -5142,6 +5143,7 @@ zink_shader_tcs_create(struct zink_screen *screen, struct 
zink_shader *vs, unsig
    NIR_PASS_V(nir, nir_convert_from_ssa, true);
 
    ret->nir = nir;
+   memcpy(&ret->info, &nir->info, sizeof(nir->info));
    ret->non_fs.is_generated = true;
    return ret;
 }
diff --git a/src/gallium/drivers/zink/zink_types.h 
b/src/gallium/drivers/zink/zink_types.h
index 25af57be7c4..7379b90bb47 100644
--- a/src/gallium/drivers/zink/zink_types.h
+++ b/src/gallium/drivers/zink/zink_types.h
@@ -734,6 +734,7 @@ struct zink_shader {
    struct util_live_shader base;
    uint32_t hash;
    struct nir_shader *nir;
+   struct shader_info info;
 
    struct zink_shader_info sinfo;
 

Reply via email to