zink: unset generated TCS if its parent TESS is unset

ensure this doesn't get pulled in during the next program update

Fixes: 334759d850 ("zink: implement passthrough tcs shader injection")

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9504>
This commit is contained in:
Mike Blumenkrantz 2021-02-15 14:09:51 -05:00 committed by Dylan Baker
parent dcfff5cc89
commit 5d313fb5ec

View file

@ -698,7 +698,15 @@ static void
zink_bind_tes_state(struct pipe_context *pctx,
void *cso)
{
bind_stage(zink_context(pctx), PIPE_SHADER_TESS_EVAL, cso);
struct zink_context *ctx = zink_context(pctx);
if (!!ctx->gfx_stages[PIPE_SHADER_TESS_EVAL] != !!cso) {
if (!cso) {
/* if unsetting a TESS that uses a generated TCS, ensure the TCS is unset */
if (ctx->gfx_stages[PIPE_SHADER_TESS_EVAL]->generated)
ctx->gfx_stages[PIPE_SHADER_TESS_CTRL] = NULL;
}
}
bind_stage(ctx, PIPE_SHADER_TESS_EVAL, cso);
}
static void