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/9057>
This commit is contained in:
Mike Blumenkrantz 2021-02-15 14:09:51 -05:00 committed by Marge Bot
parent fc6b5be666
commit 942ba4e341

View file

@ -855,8 +855,14 @@ zink_bind_tes_state(struct pipe_context *pctx,
void *cso)
{
struct zink_context *ctx = zink_context(pctx);
if (!!ctx->gfx_stages[PIPE_SHADER_TESS_EVAL] != !!cso)
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;
}
ctx->dirty_shader_stages |= BITFIELD_BIT(PIPE_SHADER_VERTEX);
}
bind_stage(ctx, PIPE_SHADER_TESS_EVAL, cso);
}