zink: add and populate a shader_info struct to zink_shader
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 28 Mar 2023 22:39:29 +0000 (18:39 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 4 Apr 2023 01:37:40 +0000 (01:37 +0000)
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
src/gallium/drivers/zink/zink_types.h

index fc7ae2f..44490ee 100644 (file)
@@ -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;
 }
index 25af57b..7379b90 100644 (file)
@@ -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;