<field name="Varying offset V0" size="4" start="0" type="uint"/>
</packet>
+ <packet code="91" name="Sample State">
+ <field name="Coverage" size="16" start="16" type="uint"/> <!-- float-1-8-7 -->
+ <field name="Mask" size="4" start="0" type="uint"/>
+ </packet>
+
<packet code="92" name="Occlusion Query Counter">
<field name="address" size="32" start="0" type="address"/>
</packet>
<field name="Varying offset V0" size="4" start="0" type="uint"/>
</packet>
+ <packet code="91" name="Sample State">
+ <field name="Coverage" size="16" start="16" type="uint"/> <!-- float-1-8-7 -->
+ <field name="Mask" size="4" start="0" type="uint"/>
+ </packet>
+
<packet code="92" name="Occlusion Query Counter">
<field name="address" size="32" start="0" type="address"/>
</packet>
#define VC5_DIRTY_BLEND_COLOR (1 << 7)
#define VC5_DIRTY_STENCIL_REF (1 << 8)
-#define VC5_DIRTY_SAMPLE_MASK (1 << 9)
+#define VC5_DIRTY_SAMPLE_STATE (1 << 9)
#define VC5_DIRTY_FRAMEBUFFER (1 << 10)
#define VC5_DIRTY_STIPPLE (1 << 11)
#define VC5_DIRTY_VIEWPORT (1 << 12)
VC5_DIRTY_FRAMEBUFFER |
VC5_DIRTY_ZSA |
VC5_DIRTY_RASTERIZER |
- VC5_DIRTY_SAMPLE_MASK |
+ VC5_DIRTY_SAMPLE_STATE |
VC5_DIRTY_FRAGTEX |
VC5_DIRTY_UNCOMPILED_FS))) {
return;
break;
case QUNIFORM_SAMPLE_MASK:
- dirty |= VC5_DIRTY_SAMPLE_MASK;
+ dirty |= VC5_DIRTY_SAMPLE_STATE;
break;
default:
config.enable_depth_offset =
v3d->rasterizer->base.offset_tri;
+ /* V3D follows GL behavior where the sample mask only
+ * applies when MSAA is enabled. Gallium has sample
+ * mask apply anyway, and the MSAA blit shaders will
+ * set sample mask without explicitly setting
+ * rasterizer oversample. Just force it on here,
+ * since the blit shaders are the only way to have
+ * !multisample && samplemask != 0xf.
+ */
config.rasterizer_oversample_mode =
- v3d->rasterizer->base.multisample;
+ v3d->rasterizer->base.multisample ||
+ v3d->sample_mask != 0xf;
config.direct3d_provoking_vertex =
v3d->rasterizer->base.flatshade_first;
}
}
}
+
+#if V3D_VERSION >= 40
+ if (v3d->dirty & VC5_DIRTY_SAMPLE_STATE) {
+ cl_emit(&job->bcl, SAMPLE_STATE, state) {
+ /* Note: SampleCoverage was handled at the
+ * state_tracker level by converting to sample_mask.
+ */
+ state.coverage = fui(1.0) >> 16;
+ state.mask = job->msaa ? v3d->sample_mask : 0xf;
+ }
+ }
+#endif
}
{
struct v3d_context *v3d = v3d_context(pctx);
v3d->sample_mask = sample_mask & ((1 << VC5_MAX_SAMPLES) - 1);
- v3d->dirty |= VC5_DIRTY_SAMPLE_MASK;
+ v3d->dirty |= VC5_DIRTY_SAMPLE_STATE;
}
static uint16_t