Enabling alphaToCoverage

Added the alphaToCoverage functionality with some
end2end tests. There is no validation for disabling alphaToCoverage
mode if SV_Coverage is statically used by the shader yet.

Bug: dawn:494
Change-Id: I9df15b35697ea05a064b092edae9d5d20f73c4d8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25761
Commit-Queue: Tomek Ponitka <tommek@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Tomek Ponitka
2020-07-29 11:44:41 +00:00
committed by Commit Bot service account
parent 9ecb99344f
commit ab04da48f4
9 changed files with 331 additions and 46 deletions

View File

@@ -258,6 +258,11 @@ namespace dawn_native { namespace opengl {
ApplyDepthStencilState(gl, GetDepthStencilStateDescriptor(), &persistentPipelineState);
gl.SampleMaski(0, GetSampleMask());
if (IsAlphaToCoverageEnabled()) {
gl.Enable(GL_SAMPLE_ALPHA_TO_COVERAGE);
} else {
gl.Disable(GL_SAMPLE_ALPHA_TO_COVERAGE);
}
for (uint32_t attachmentSlot : IterateBitSet(GetColorAttachmentsMask())) {
ApplyColorState(gl, attachmentSlot, GetColorStateDescriptor(attachmentSlot));