Mesa (staging/21.0): zink: unset generated TCS if its parent TESS is unset
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Mar 10 23:13:59 UTC 2021
Module: Mesa
Branch: staging/21.0
Commit: bc927da1b0f2c75248e1b36a9c86a53c08766ce5
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bc927da1b0f2c75248e1b36a9c86a53c08766ce5
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Mon Feb 15 14:09:51 2021 -0500
zink: unset generated TCS if its parent TESS is unset
ensure this doesn't get pulled in during the next program update
Fixes: 334759d8509 ("zink: implement passthrough tcs shader injection")
Reviewed-by: Hoe Hao Cheng <haochengho12907 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9504>
---
src/gallium/drivers/zink/zink_program.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c
index 9efcd010f86..a0f4a212e8c 100644
--- a/src/gallium/drivers/zink/zink_program.c
+++ b/src/gallium/drivers/zink/zink_program.c
@@ -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
More information about the mesa-commit
mailing list