freedreno/a6xx: Front facing needs UNK3 bit
authorKristian H. Kristensen <hoegsberg@chromium.org>
Tue, 12 Feb 2019 05:51:09 +0000 (21:51 -0800)
committerKristian H. Kristensen <hoegsberg@chromium.org>
Wed, 13 Feb 2019 19:14:06 +0000 (11:14 -0800)
We need to set UNK3 in GRAS_CNTL and RB_RENDER_CONTROL0 for the value
to be reliably delivered.

Fixes:

  dEQP-GLES3.functional.shaders.builtin_variable.frontfacing

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
src/gallium/drivers/freedreno/a6xx/fd6_program.c

index 9fde74201dd1e4d88cf475a5705a0abb22d1526a..470bacfd5fe1fc8e35050f4d869a0ead3c74cb8a 100644 (file)
@@ -549,7 +549,8 @@ setup_stateobj(struct fd_ringbuffer *ring,
                                        A6XX_GRAS_CNTL_XCOORD |
                                        A6XX_GRAS_CNTL_YCOORD |
                                        A6XX_GRAS_CNTL_ZCOORD |
-                                       A6XX_GRAS_CNTL_WCOORD));
+                                       A6XX_GRAS_CNTL_WCOORD) |
+                       COND(s[FS].v->frag_face, A6XX_GRAS_CNTL_UNK3));
 
        OUT_PKT4(ring, REG_A6XX_RB_RENDER_CONTROL0, 2);
        OUT_RING(ring, COND(enable_varyings, A6XX_RB_RENDER_CONTROL0_VARYING |
@@ -559,7 +560,9 @@ setup_stateobj(struct fd_ringbuffer *ring,
                                        A6XX_RB_RENDER_CONTROL0_XCOORD |
                                        A6XX_RB_RENDER_CONTROL0_YCOORD |
                                        A6XX_RB_RENDER_CONTROL0_ZCOORD |
-                                       A6XX_RB_RENDER_CONTROL0_WCOORD));
+                                       A6XX_RB_RENDER_CONTROL0_WCOORD) |
+                       COND(s[FS].v->frag_face, A6XX_RB_RENDER_CONTROL0_UNK3));
+
        OUT_RING(ring, COND(s[FS].v->frag_face, A6XX_RB_RENDER_CONTROL1_FACENESS));
 
        OUT_PKT4(ring, REG_A6XX_SP_FS_OUTPUT_REG(0), 8);