zink: do not read is_generated unless in tcs shader
It's undefined behavior in C to read a union member if another member
has been written to more recently. Let's be more careful here!
Fixes: a9d2b86c2c
("zink: store the spirv_shader to the zink_shader struct for generated tcs")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19457>
This commit is contained in:

committed by
Marge Bot

parent
7d7e94066d
commit
090a111c5d
@@ -2348,7 +2348,7 @@ zink_shader_compile(struct zink_screen *screen, struct zink_shader *zs, nir_shad
|
||||
ralloc_free(nir);
|
||||
|
||||
/* TODO: determine if there's any reason to cache spirv output? */
|
||||
if (zs->is_generated)
|
||||
if (zs->nir->info.stage == MESA_SHADER_TESS_CTRL && zs->is_generated)
|
||||
zs->spirv = spirv;
|
||||
else
|
||||
ralloc_free(spirv);
|
||||
|
Reference in New Issue
Block a user