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) ||
- (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);
}