Commit 7d798558 by shrekshao Committed by Commit Bot

Skip validating draw buffers when RASTERIZER_DISCARD is enabled.

Bug: 962555, 962636 Change-Id: I4a22f83689252b7b7e51bbb3fc80e8f0d601a43f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1610701Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Shrek Shao <shrekshao@google.com>
parent 0a1eeb80
......@@ -2778,7 +2778,8 @@ const char *ValidateDrawStates(Context *context)
return kVertexShaderTypeMismatch;
}
if (!context->getState().getBlendState().allChannelsMasked())
if (!context->getState().getRasterizerState().rasterizerDiscard &&
!context->getState().getBlendState().allChannelsMasked())
{
// Detect that if there's active color buffer without fragment shader output
if (!ValidateFragmentShaderColorBufferMaskMatch(context))
......
......@@ -444,6 +444,11 @@ TEST_P(DrawBuffersWebGL2Test, TwoProgramsWithDifferentOutputsAndClear)
setDrawBuffers(kMaxBuffers, allBufs);
drawQuad(program, positionAttrib(), 0.5, 1.0f, true);
ASSERT_GL_ERROR(GL_INVALID_OPERATION);
// Exception: when RASTERIZER_DISCARD is enabled.
glEnable(GL_RASTERIZER_DISCARD);
drawQuad(program, positionAttrib(), 0.5, 1.0f, true);
ASSERT_GL_NO_ERROR();
glDisable(GL_RASTERIZER_DISCARD);
// Exception: when all 4 channels of color mask are set to false.
glColorMask(false, false, false, false);
drawQuad(program, positionAttrib(), 0.5, 1.0f, true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment