Implement sampleMask in D3D12 and OpenGL.

Some tests are not enabled in D3D12 yet because SPIRV-Cross lacks
support for gl_SampleMask.

Bug: dawn:491

Change-Id: I6cce56b5d0ab883f39b8d58987246c08a23b6410
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25580
Reviewed-by: Tomek Ponitka <tommek@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez
2020-07-23 16:26:16 +00:00
committed by Commit Bot service account
parent 4d9cadd58a
commit c7ae7a0012
4 changed files with 17 additions and 16 deletions

View File

@@ -162,6 +162,7 @@ namespace dawn_native { namespace opengl {
mFunctions.Enable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
mFunctions.Enable(GL_MULTISAMPLE);
mFunctions.Enable(GL_FRAMEBUFFER_SRGB);
mFunctions.Enable(GL_SAMPLE_MASK);
mPCIInfo.name = reinterpret_cast<const char*>(mFunctions.GetString(GL_RENDERER));

View File

@@ -257,6 +257,8 @@ namespace dawn_native { namespace opengl {
ApplyDepthStencilState(gl, GetDepthStencilStateDescriptor(), &persistentPipelineState);
gl.SampleMaski(0, GetSampleMask());
for (uint32_t attachmentSlot : IterateBitSet(GetColorAttachmentsMask())) {
ApplyColorState(gl, attachmentSlot, GetColorStateDescriptor(attachmentSlot));
}