From: Jonathan Marek Date: Tue, 17 Dec 2019 23:15:45 +0000 (-0500) Subject: turnip: don't set SP_FS_CTRL_REG0_VARYING if only fragcoord is used X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5785bcc8;p=mesa.git turnip: don't set SP_FS_CTRL_REG0_VARYING if only fragcoord is used Fixes artifacts in the subpasses demo, which has a shader using fragcoord without any varyings. It looks like setting this bit when there are no varyings can cause weirdness in some cases (without this change, if the previous shader had <= 8 varyings it would work, but with 9 varyings it would have artifacts). Signed-off-by: Jonathan Marek Reviewed-by: Eric Anholt Tested-by: Marge Bot Part-of: --- diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c index f4f050ab8d9..0c84c567210 100644 --- a/src/freedreno/vulkan/tu_pipeline.c +++ b/src/freedreno/vulkan/tu_pipeline.c @@ -450,7 +450,7 @@ tu6_emit_fs_config(struct tu_cs *cs, struct tu_shader *shader, A6XX_SP_FS_CTRL_REG0_FULLREGFOOTPRINT(fs->info.max_reg + 1) | A6XX_SP_FS_CTRL_REG0_MERGEDREGS | A6XX_SP_FS_CTRL_REG0_BRANCHSTACK(fs->branchstack); - if (fs->total_in > 0 || fs->frag_coord) + if (fs->total_in > 0) sp_fs_ctrl |= A6XX_SP_FS_CTRL_REG0_VARYING; if (fs->need_pixlod) sp_fs_ctrl |= A6XX_SP_FS_CTRL_REG0_PIXLODENABLE;