zink: avoid replacing valid tcs with injected one

need to check both arrays here since we only want to use an injected shader
if we don't have a real one, not just if the real one isn't being updated

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

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8271>
This commit is contained in:
Mike Blumenkrantz
2020-12-30 09:55:58 -05:00
committed by Marge Bot
parent 7c3140db22
commit 2f5f542460

View File

@@ -319,7 +319,8 @@ update_shader_modules(struct zink_context *ctx, struct zink_shader *stages[ZINK_
dirty[tgsi_processor_to_shader_stage(type)] = stages[type];
}
if (ctx->dirty_shader_stages & (1 << PIPE_SHADER_TESS_EVAL)) {
if (dirty[MESA_SHADER_TESS_EVAL] && !dirty[MESA_SHADER_TESS_CTRL]) {
if (dirty[MESA_SHADER_TESS_EVAL] && !dirty[MESA_SHADER_TESS_CTRL] &&
!stages[PIPE_SHADER_TESS_CTRL]) {
dirty[MESA_SHADER_TESS_CTRL] = stages[PIPE_SHADER_TESS_CTRL] = zink_shader_tcs_create(ctx, stages[PIPE_SHADER_VERTEX]);
dirty[MESA_SHADER_TESS_EVAL]->generated = stages[PIPE_SHADER_TESS_CTRL];
}