freedreno/a6xx: fix helper_invocation (sampler mask/id)
authorRob Clark <robdclark@gmail.com>
Mon, 18 Feb 2019 15:34:06 +0000 (10:34 -0500)
committerRob Clark <robdclark@gmail.com>
Mon, 18 Feb 2019 15:37:54 +0000 (10:37 -0500)
Since gl_HelperInvocation is lowered to:

  !((1 << sample_id) & sample_mask_in))

Not setting these enable bits was causing it be broken.  (And probably a
bunch of other stuff too.)

Fixes dEQP-GLES31.functional.shaders.helper_invocation.*

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/a6xx/fd6_program.c

index 5527b8cfd76d537e6ddd0a0f003ade22a1452bbb..3e7aed63897a98750d0ee973b0543cfbfa38e64d 100644 (file)
@@ -555,7 +555,12 @@ setup_stateobj(struct fd_ringbuffer *ring,
                                        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_RING(ring,
+                       COND(samp_mask_regid != regid(63, 0),
+                               A6XX_RB_RENDER_CONTROL1_SAMPLEMASK) |
+                       COND(samp_id_regid != regid(63, 0),
+                               A6XX_RB_RENDER_CONTROL1_SAMPLEID) |
+                       COND(s[FS].v->frag_face, A6XX_RB_RENDER_CONTROL1_FACENESS));
 
        OUT_PKT4(ring, REG_A6XX_SP_FS_OUTPUT_REG(0), 8);
        for (i = 0; i < 8; i++) {