v3d: Return the right gl_SampleMaskIn[] value.
authorEric Anholt <eric@anholt.net>
Mon, 3 Dec 2018 16:51:29 +0000 (08:51 -0800)
committerEric Anholt <eric@anholt.net>
Sat, 8 Dec 2018 00:48:23 +0000 (16:48 -0800)
It's supposed to be the dispatched sample mask for this pixel, not the GL
state's sample mask.

src/broadcom/compiler/nir_to_vir.c
src/broadcom/compiler/v3d_compiler.h
src/gallium/drivers/v3d/v3d_uniforms.c

index 13109d4f88fa617d7ee098abad05972fc72947be..446ac53e95f90c484e2e15afa99dd165e458ffac 100644 (file)
@@ -1579,8 +1579,7 @@ ntq_emit_intrinsic(struct v3d_compile *c, nir_intrinsic_instr *instr)
                 break;
 
         case nir_intrinsic_load_sample_mask_in:
-                ntq_store_dest(c, &instr->dest, 0,
-                               vir_uniform(c, QUNIFORM_SAMPLE_MASK, 0));
+                ntq_store_dest(c, &instr->dest, 0, vir_MSF(c));
                 break;
 
         case nir_intrinsic_load_front_face:
index 219b7d563779161326f9080dedb58a4abb2086dc..7423edc85c78c3072bfab6f3a13369f954e22132 100644 (file)
@@ -246,7 +246,6 @@ enum quniform_contents {
         QUNIFORM_TEXTURE_BORDER_COLOR,
 
         QUNIFORM_ALPHA_REF,
-        QUNIFORM_SAMPLE_MASK,
 
         /**
          * Returns the the offset of the scratch buffer for register spilling.
index d2e3e710237be6eb18480d6f93bba84220faec6c..ebf65b6099350ae1647eb3abb6d8ba87ab5102e6 100644 (file)
@@ -354,10 +354,6 @@ v3d_write_uniforms(struct v3d_context *v3d, struct v3d_compiled_shader *shader,
                                      v3d->zsa->base.alpha.ref_value);
                         break;
 
-                case QUNIFORM_SAMPLE_MASK:
-                        cl_aligned_u32(&uniforms, v3d->sample_mask);
-                        break;
-
                 case QUNIFORM_UBO_ADDR:
                         if (uinfo->data[i] == 0) {
                                 cl_aligned_reloc(&job->indirect, &uniforms,
@@ -466,10 +462,6 @@ v3d_set_shader_uniform_dirty_flags(struct v3d_compiled_shader *shader)
                         dirty |= VC5_DIRTY_ZSA;
                         break;
 
-                case QUNIFORM_SAMPLE_MASK:
-                        dirty |= VC5_DIRTY_SAMPLE_STATE;
-                        break;
-
                 default:
                         assert(quniform_contents_is_texture_p0(shader->prog_data.base->uniforms.contents[i]));
                         dirty |= VC5_DIRTY_FRAGTEX | VC5_DIRTY_VERTTEX;