diff options
Diffstat (limited to 'src/3rdparty/angle/src/libGLESv2/validationES3.cpp')
-rw-r--r-- | src/3rdparty/angle/src/libGLESv2/validationES3.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/3rdparty/angle/src/libGLESv2/validationES3.cpp b/src/3rdparty/angle/src/libGLESv2/validationES3.cpp index 251c6ad2c4..2d3a039e13 100644 --- a/src/3rdparty/angle/src/libGLESv2/validationES3.cpp +++ b/src/3rdparty/angle/src/libGLESv2/validationES3.cpp @@ -542,7 +542,8 @@ bool ValidateES3TexImageParameters(Context *context, GLenum target, GLint level, return false; } - size_t copyBytes = widthSize * heightSize * depthSize * pixelBytes; + const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(sizedFormat); + size_t copyBytes = formatInfo.computeBlockSize(type, width, height); size_t offset = reinterpret_cast<size_t>(pixels); if (!rx::IsUnsignedAdditionSafe(offset, copyBytes) || @@ -555,12 +556,15 @@ bool ValidateES3TexImageParameters(Context *context, GLenum target, GLint level, // ...data is not evenly divisible into the number of bytes needed to store in memory a datum // indicated by type. - size_t dataBytesPerPixel = static_cast<size_t>(gl::GetTypeInfo(type).bytes); - - if ((offset % dataBytesPerPixel) != 0) + if (!isCompressed) { - context->recordError(Error(GL_INVALID_OPERATION)); - return false; + size_t dataBytesPerPixel = static_cast<size_t>(gl::GetTypeInfo(type).bytes); + + if ((offset % dataBytesPerPixel) != 0) + { + context->recordError(Error(GL_INVALID_OPERATION)); + return false; + } } // ...the buffer object's data store is currently mapped. @@ -872,13 +876,14 @@ bool ValidateES3CopyTexImageParameters(Context *context, GLenum target, GLint le gl::Framebuffer *framebuffer = context->getState().getReadFramebuffer(); - if (framebuffer->completeness() != GL_FRAMEBUFFER_COMPLETE) + if (framebuffer->completeness(context->getData()) != GL_FRAMEBUFFER_COMPLETE) { context->recordError(Error(GL_INVALID_FRAMEBUFFER_OPERATION)); return false; } - if (context->getState().getReadFramebuffer()->id() != 0 && framebuffer->getSamples() != 0) + if (context->getState().getReadFramebuffer()->id() != 0 && + framebuffer->getSamples(context->getData()) != 0) { context->recordError(Error(GL_INVALID_OPERATION)); return false; @@ -1258,7 +1263,7 @@ bool ValidateClearBuffer(Context *context) } const gl::Framebuffer *fbo = context->getState().getDrawFramebuffer(); - if (!fbo || fbo->completeness() != GL_FRAMEBUFFER_COMPLETE) + if (!fbo || fbo->completeness(context->getData()) != GL_FRAMEBUFFER_COMPLETE) { context->recordError(Error(GL_INVALID_FRAMEBUFFER_OPERATION)); return false; |