From a7290370de226cb5e59bd8e0c88c2e7cf02a24ee Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sat, 22 Oct 2022 10:55:25 -0700 Subject: [PATCH] freedreno: Dirty the TCS state if patch_vertices change If using a passthrough TCS shader, we can't rely on having a new TCS stage bound, so we need to invalidate the TCS state when the # of patch_vertices changes. Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/freedreno_program.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gallium/drivers/freedreno/freedreno_program.c b/src/gallium/drivers/freedreno/freedreno_program.c index 1108799919f..b5b968615c1 100644 --- a/src/gallium/drivers/freedreno/freedreno_program.c +++ b/src/gallium/drivers/freedreno/freedreno_program.c @@ -48,7 +48,17 @@ fd_set_patch_vertices(struct pipe_context *pctx, uint8_t patch_vertices) in_dt { struct fd_context *ctx = fd_context(pctx); + if (ctx->patch_vertices == patch_vertices) + return; + ctx->patch_vertices = patch_vertices; + + /* If we have tessellation this dirties the TCS state. Check for TES + * stage as TCS could be NULL (passthrough) + */ + if (ctx->prog.ds || ctx->prog.hs) { + fd_context_dirty_shader(ctx, PIPE_SHADER_TESS_CTRL, FD_DIRTY_SHADER_PROG); + } } static void