zink: clamp zink_gfx_lib_cache::stages_present for generated tcs

this otherwise does not reflect reality

Fixes: d786f52f1f ("zink: prevent crash when freeing")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27358>
(cherry picked from commit 36e7350e0b)
This commit is contained in:
Mike Blumenkrantz 2024-02-15 14:16:08 -05:00 committed by Eric Engestrom
parent a9c5611b49
commit 10eb12968b
2 changed files with 3 additions and 1 deletions

View file

@ -3214,7 +3214,7 @@
"description": "zink: clamp zink_gfx_lib_cache::stages_present for generated tcs",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "d786f52f1ff10fba42e87530933a2a4c68de49a8",
"notes": null

View file

@ -1006,6 +1006,8 @@ create_lib_cache(struct zink_gfx_program *prog, bool generated_tcs)
{
struct zink_gfx_lib_cache *libs = CALLOC_STRUCT(zink_gfx_lib_cache);
libs->stages_present = prog->stages_present;
if (generated_tcs)
libs->stages_present &= ~BITFIELD_BIT(MESA_SHADER_TESS_CTRL);
simple_mtx_init(&libs->lock, mtx_plain);
if (generated_tcs)
_mesa_set_init(&libs->libs, NULL, hash_pipeline_lib_generated_tcs, equals_pipeline_lib_generated_tcs);