summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/libGLESv2/validationES3.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-11-24 13:37:06 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-11-24 13:39:13 +0100
commit34aba4724f196e34ed02cf50073f41968f119bb6 (patch)
tree0ebdfcabda989ab76ee6de53c6461553c7a767a5 /src/3rdparty/angle/src/libGLESv2/validationES3.cpp
parentb86b2a742afae118bf974c82ba966ddb0cae4afb (diff)
parentb1cf07f495e10c93e53651ac03e46ebdaea0a97e (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts: src/corelib/io/qiodevice.cpp src/plugins/bearer/linux_common/qofonoservice_linux.cpp src/plugins/bearer/linux_common/qofonoservice_linux_p.h src/plugins/platforms/android/qandroidplatformtheme.cpp src/tools/bootstrap/bootstrap.pro src/widgets/styles/qmacstyle_mac.mm Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
Diffstat (limited to 'src/3rdparty/angle/src/libGLESv2/validationES3.cpp')
-rw-r--r--src/3rdparty/angle/src/libGLESv2/validationES3.cpp23
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;