Commit aef92166 by Qin Jiajia Committed by Commit Bot

Move the early-return case of zero mask to Context::blitFramebuffer

When the mask is zero, no buffers are copied in BlitFramebuffer. But we still need to check all the error situations. So mask of zero should be put in blitFramebuffer not the validation file. Meanwhile, we adjust the checking sequence to pass the deqp case. BUG=angleproject:2375 TEST=dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.blit_framebuffer Change-Id: I73c78ffb8853153f70fc30e8ae0e704e08e454ac Reviewed-on: https://chromium-review.googlesource.com/938573Reviewed-by: 's avatarJiawei Shao <jiawei.shao@intel.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 06a87ec8
...@@ -2930,6 +2930,13 @@ void Context::blitFramebuffer(GLint srcX0, ...@@ -2930,6 +2930,13 @@ void Context::blitFramebuffer(GLint srcX0,
GLbitfield mask, GLbitfield mask,
GLenum filter) GLenum filter)
{ {
if (mask == 0)
{
// ES3.0 spec, section 4.3.2 specifies that a mask of zero is valid and no
// buffers are copied.
return;
}
Framebuffer *drawFramebuffer = mGLState.getDrawFramebuffer(); Framebuffer *drawFramebuffer = mGLState.getDrawFramebuffer();
ASSERT(drawFramebuffer); ASSERT(drawFramebuffer);
......
...@@ -1231,13 +1231,6 @@ bool ValidateBlitFramebufferParameters(Context *context, ...@@ -1231,13 +1231,6 @@ bool ValidateBlitFramebufferParameters(Context *context,
return false; return false;
} }
if (mask == 0)
{
// ES3.0 spec, section 4.3.2 specifies that a mask of zero is valid and no
// buffers are copied.
return false;
}
// ES3.0 spec, section 4.3.2 states that linear filtering is only available for the // ES3.0 spec, section 4.3.2 states that linear filtering is only available for the
// color buffer, leaving only nearest being unfiltered from above // color buffer, leaving only nearest being unfiltered from above
if ((mask & ~GL_COLOR_BUFFER_BIT) != 0 && filter != GL_NEAREST) if ((mask & ~GL_COLOR_BUFFER_BIT) != 0 && filter != GL_NEAREST)
...@@ -1256,21 +1249,21 @@ bool ValidateBlitFramebufferParameters(Context *context, ...@@ -1256,21 +1249,21 @@ bool ValidateBlitFramebufferParameters(Context *context,
return false; return false;
} }
if (readFramebuffer->id() == drawFramebuffer->id()) if (readFramebuffer->checkStatus(context) != GL_FRAMEBUFFER_COMPLETE)
{ {
context->handleError(InvalidOperation()); context->handleError(InvalidFramebufferOperation());
return false; return false;
} }
if (readFramebuffer->checkStatus(context) != GL_FRAMEBUFFER_COMPLETE) if (drawFramebuffer->checkStatus(context) != GL_FRAMEBUFFER_COMPLETE)
{ {
context->handleError(InvalidFramebufferOperation()); context->handleError(InvalidFramebufferOperation());
return false; return false;
} }
if (drawFramebuffer->checkStatus(context) != GL_FRAMEBUFFER_COMPLETE) if (readFramebuffer->id() == drawFramebuffer->id())
{ {
context->handleError(InvalidFramebufferOperation()); context->handleError(InvalidOperation());
return false; return false;
} }
......
...@@ -1192,7 +1192,6 @@ ...@@ -1192,7 +1192,6 @@
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.bind_buffer_range = FAIL 1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.bind_buffer_range = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.read_pixels_format_mismatch = FAIL 1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.read_pixels_format_mismatch = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.framebuffer_texture2d = FAIL 1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.framebuffer_texture2d = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.blit_framebuffer = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.invalidate_sub_framebuffer = FAIL 1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.invalidate_sub_framebuffer = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.copyteximage2d_invalid_format = FAIL 1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.copyteximage2d_invalid_format = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.copyteximage2d_inequal_width_height_cube = FAIL 1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.copyteximage2d_inequal_width_height_cube = FAIL
......
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