{
nir_ssa_def *frag_color = intr->src[0].ssa;
- if (c->fs_key->sample_coverage) {
- vc4_nir_store_sample_mask(c, b, nir_load_sample_mask_in(b));
- } else if (c->fs_key->sample_alpha_to_coverage) {
+ if (c->fs_key->sample_alpha_to_coverage) {
nir_ssa_def *a = nir_channel(b, frag_color, 3);
/* XXX: We should do a nice dither based on the fragment
nir_metadata_dominance);
}
}
+
+ /* If we didn't do alpha-to-coverage on the output color, we still
+ * need to pass glSampleMask() through.
+ */
+ if (c->fs_key->sample_coverage && !c->fs_key->sample_alpha_to_coverage) {
+ nir_function_impl *impl = nir_shader_get_entrypoint(s);
+ nir_builder b;
+ nir_builder_init(&b, impl);
+ b.cursor = nir_after_block(nir_impl_last_block(impl));
+
+ vc4_nir_store_sample_mask(c, &b, nir_load_sample_mask_in(&b));
+ }
}