turnip: don't set SP_FS_CTRL_REG0_VARYING if only fragcoord is used
authorJonathan Marek <jonathan@marek.ca>
Tue, 17 Dec 2019 23:15:45 +0000 (18:15 -0500)
committerJonathan Marek <jonathan@marek.ca>
Thu, 19 Dec 2019 00:03:37 +0000 (19:03 -0500)
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 <jonathan@marek.ca>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3143>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3143>

src/freedreno/vulkan/tu_pipeline.c

index f4f050ab8d9e1c7ebc76a4c94bb87c4d197f7086..0c84c5672101f63db9a35d300a77f48cb9d5898c 100644 (file)
@@ -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;