zink: store the spirv_shader to the zink_shader struct for generated tcs

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14976>
This commit is contained in:
Mike Blumenkrantz
2022-02-09 15:45:49 -05:00
committed by Marge Bot
parent 6c0740c129
commit a9d2b86c2c
2 changed files with 6 additions and 1 deletions

View File

@@ -1162,7 +1162,10 @@ zink_shader_compile(struct zink_screen *screen, struct zink_shader *zs, nir_shad
ralloc_free(nir); ralloc_free(nir);
/* TODO: determine if there's any reason to cache spirv output? */ /* TODO: determine if there's any reason to cache spirv output? */
ralloc_free(spirv); if (zs->is_generated)
zs->spirv = spirv;
else
ralloc_free(spirv);
return mod; return mod;
} }
@@ -1961,6 +1964,7 @@ zink_shader_free(struct zink_context *ctx, struct zink_shader *shader)
} }
_mesa_set_destroy(shader->programs, NULL); _mesa_set_destroy(shader->programs, NULL);
ralloc_free(shader->nir); ralloc_free(shader->nir);
ralloc_free(shader->spirv);
FREE(shader); FREE(shader);
} }

View File

@@ -88,6 +88,7 @@ struct zink_shader {
uint32_t ubos_used; // bitfield of which ubo indices are used uint32_t ubos_used; // bitfield of which ubo indices are used
uint32_t ssbos_used; // bitfield of which ssbo indices are used uint32_t ssbos_used; // bitfield of which ssbo indices are used
bool bindless; bool bindless;
struct spirv_shader *spirv;
simple_mtx_t lock; simple_mtx_t lock;
struct set *programs; struct set *programs;