Commit c8403ec1 by Alexis Hetu Committed by Alexis Hétu

Fix glBlitFramebuffer validation for BGRA8 IOSurfaces

The format comparison for blitting from a multisampled buffer was not ES2 specific, so the ES3 check was removed. That had been added to fix blitting to the backbuffer on MacOS, which is now instead fixed by allowing BGRA8 and RGBA8 to be accepted interchangeably as draw and read formats. Fixes dEQP-GLES3.functional.negative_api.buffer.blit_framebuffer_multisample Change-Id: Id577372791007a780c542b0986378147e1e7bc1b Reviewed-on: https://swiftshader-review.googlesource.com/18888Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 596f653f
...@@ -4145,12 +4145,14 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1 ...@@ -4145,12 +4145,14 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1
return error(GL_INVALID_OPERATION); return error(GL_INVALID_OPERATION);
} }
// From the ANGLE_framebuffer_blit extension: if((readRenderbuffer->getSamples() > 0) && (readFormat != drawFormat))
// "Calling BlitFramebufferANGLE will result in an INVALID_OPERATION error if <mask>
// includes COLOR_BUFFER_BIT and the source and destination color formats to not match."
if((clientVersion < 3) && (readRenderbuffer->getSamples() > 0) && (readFormat != drawFormat))
{ {
return error(GL_INVALID_OPERATION); // RGBA8 and BGRA8 should be interchangeable here
if(!(((readFormat == GL_RGBA8) && (drawFormat == GL_BGRA8_EXT)) ||
((readFormat == GL_BGRA8_EXT) && (drawFormat == GL_RGBA8))))
{
return error(GL_INVALID_OPERATION);
}
} }
blitRenderTarget = true; blitRenderTarget = 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