Commit 58ead9ec by Alexis Hetu Committed by Alexis Hétu

Fixed blitFramebuffer issue with Depth/Stencil

A condition was overly aggressive in producing an INVALID_OPERATION when the read depth/stencil framebuffer is multisampled. When the formats are the same and source and destination rectangles are the same, performing a blitFramebuffer operation is allowed. Change-Id: I29e52cb546ae1bf248ac0107492c97ea82406613 Reviewed-on: https://swiftshader-review.googlesource.com/8212Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent f4f68e16
...@@ -4111,8 +4111,16 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1 ...@@ -4111,8 +4111,16 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1
return error(GL_INVALID_OPERATION); // Only whole-buffer copies are permitted return error(GL_INVALID_OPERATION); // Only whole-buffer copies are permitted
} }
// OpenGL ES 3.0.4 spec, p.199:
// ...an INVALID_OPERATION error is generated if the formats of the read
// and draw framebuffers are not identical or if the source and destination
// rectangles are not defined with the same(X0, Y 0) and (X1, Y 1) bounds.
// If SAMPLE_BUFFERS for the draw framebuffer is greater than zero, an
// INVALID_OPERATION error is generated.
if((drawDSBuffer && drawDSBuffer->getSamples() > 1) || if((drawDSBuffer && drawDSBuffer->getSamples() > 1) ||
(readDSBuffer && readDSBuffer->getSamples() > 1)) ((readDSBuffer && readDSBuffer->getSamples() > 1) &&
((srcX0 != dstX0 || srcY0 != dstY0 || srcX1 != dstX1 || srcY1 != dstY1) ||
(drawDSBuffer->getFormat() != readDSBuffer->getFormat()))))
{ {
return error(GL_INVALID_OPERATION); return error(GL_INVALID_OPERATION);
} }
......
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