a4xx: hook up centroid ij coords
authorIlia Mirkin <imirkin@alum.mit.edu>
Mon, 6 Jul 2020 03:16:33 +0000 (23:16 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 6 Jul 2020 20:20:11 +0000 (20:20 +0000)
This is necessary now that the compiler respects centroid interpolation,
even in non-MSAA mode. Otherwise the interpolation doesn't work. Fixes a
bunch of dEQP centroid transform feedback tests.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5778>

src/gallium/drivers/freedreno/a4xx/fd4_program.c

index ef44ce57168eb66cb3123082a1a15aa7ea91196a..b5b13dc288e8f1a5d83a7d927465f43d2b603c8e 100644 (file)
@@ -239,7 +239,8 @@ fd4_program_emit(struct fd_ringbuffer *ring, struct fd4_emit *emit,
        /* XXX left out centroid/sample for now */
        OUT_RING(ring, A4XX_HLSQ_CONTROL_3_REG_IJ_PERSP_PIXEL(ij_regid[IJ_PERSP_PIXEL]) |
                        A4XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_PIXEL(ij_regid[IJ_LINEAR_PIXEL]) |
-                       0xfcfc0000);
+                       A4XX_HLSQ_CONTROL_3_REG_IJ_PERSP_CENTROID(ij_regid[IJ_PERSP_CENTROID]) |
+                       A4XX_HLSQ_CONTROL_3_REG_IJ_LINEAR_CENTROID(ij_regid[IJ_LINEAR_CENTROID]));
        OUT_RING(ring, 0x00fcfcfc);   /* XXX HLSQ_CONTROL_4 */
 
        OUT_PKT0(ring, REG_A4XX_HLSQ_VS_CONTROL_REG, 5);
@@ -390,11 +391,13 @@ fd4_program_emit(struct fd_ringbuffer *ring, struct fd4_emit *emit,
                        CONDREG(face_regid, A4XX_GRAS_CNTL_IJ_PERSP) |
                        CONDREG(zwcoord_regid, A4XX_GRAS_CNTL_IJ_PERSP) |
                        CONDREG(ij_regid[IJ_PERSP_PIXEL], A4XX_GRAS_CNTL_IJ_PERSP) |
-                       CONDREG(ij_regid[IJ_LINEAR_PIXEL], A4XX_GRAS_CNTL_IJ_LINEAR));
+                       CONDREG(ij_regid[IJ_LINEAR_PIXEL], A4XX_GRAS_CNTL_IJ_LINEAR) |
+                       CONDREG(ij_regid[IJ_PERSP_CENTROID], A4XX_GRAS_CNTL_IJ_PERSP));
 
        OUT_PKT0(ring, REG_A4XX_RB_RENDER_CONTROL2, 1);
        OUT_RING(ring, A4XX_RB_RENDER_CONTROL2_MSAA_SAMPLES(0) |
                        CONDREG(ij_regid[IJ_PERSP_PIXEL], A4XX_RB_RENDER_CONTROL2_IJ_PERSP_PIXEL) |
+                       CONDREG(ij_regid[IJ_PERSP_CENTROID], A4XX_RB_RENDER_CONTROL2_IJ_PERSP_CENTROID) |
                        CONDREG(ij_regid[IJ_LINEAR_PIXEL], A4XX_RB_RENDER_CONTROL2_SIZE) |
                        COND(s[FS].v->frag_face, A4XX_RB_RENDER_CONTROL2_FACENESS) |
                        COND(s[FS].v->fragcoord_compmask != 0,