Add caps for the aggregate shader limits from table 6.33.
BUG=angle:658
Change-Id: I59d0cd131114fcb925f01d83d218a657f4498a2a
Reviewed-on: https://chromium-review.googlesource.com/207375
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libGLESv2/libGLESv2.cpp b/src/libGLESv2/libGLESv2.cpp
index 40bfbfa..5f66f4a 100644
--- a/src/libGLESv2/libGLESv2.cpp
+++ b/src/libGLESv2/libGLESv2.cpp
@@ -43,7 +43,7 @@
if (context)
{
- if (texture < GL_TEXTURE0 || texture > GL_TEXTURE0 + context->getMaximumCombinedTextureImageUnits() - 1)
+ if (texture < GL_TEXTURE0 || texture > GL_TEXTURE0 + context->getCaps().maxCombinedTextureImageUnits - 1)
{
return gl::error(GL_INVALID_ENUM);
}
@@ -5630,6 +5630,7 @@
return gl::error(GL_INVALID_OPERATION);
}
+ const gl::Caps &caps = context->getCaps();
switch (target)
{
case GL_TRANSFORM_FEEDBACK_BUFFER_START:
@@ -5641,8 +5642,10 @@
case GL_UNIFORM_BUFFER_START:
case GL_UNIFORM_BUFFER_SIZE:
case GL_UNIFORM_BUFFER_BINDING:
- if (index >= context->getMaximumCombinedUniformBufferBindings())
+ if (index >= caps.maxCombinedUniformBlocks)
+ {
return gl::error(GL_INVALID_VALUE);
+ }
break;
default:
return gl::error(GL_INVALID_ENUM);
@@ -5763,6 +5766,7 @@
return gl::error(GL_INVALID_OPERATION);
}
+ const gl::Caps &caps = context->getCaps();
switch (target)
{
case GL_TRANSFORM_FEEDBACK_BUFFER:
@@ -5773,7 +5777,7 @@
break;
case GL_UNIFORM_BUFFER:
- if (index >= context->getMaximumCombinedUniformBufferBindings())
+ if (index >= caps.maxUniformBufferBindings)
{
return gl::error(GL_INVALID_VALUE);
}
@@ -5805,7 +5809,7 @@
case GL_UNIFORM_BUFFER:
// it is an error to bind an offset not a multiple of the alignment
- if (buffer != 0 && (offset % context->getUniformBufferOffsetAlignment()) != 0)
+ if (buffer != 0 && (offset % caps.uniformBufferOffsetAlignment) != 0)
{
return gl::error(GL_INVALID_VALUE);
}
@@ -5834,6 +5838,7 @@
return gl::error(GL_INVALID_OPERATION);
}
+ const gl::Caps &caps = context->getCaps();
switch (target)
{
case GL_TRANSFORM_FEEDBACK_BUFFER:
@@ -5844,7 +5849,7 @@
break;
case GL_UNIFORM_BUFFER:
- if (index >= context->getMaximumCombinedUniformBufferBindings())
+ if (index >= caps.maxUniformBufferBindings)
{
return gl::error(GL_INVALID_VALUE);
}
@@ -6837,7 +6842,7 @@
return gl::error(GL_INVALID_OPERATION);
}
- if (uniformBlockBinding >= context->getMaximumCombinedUniformBufferBindings())
+ if (uniformBlockBinding >= context->getCaps().maxUniformBufferBindings)
{
return gl::error(GL_INVALID_VALUE);
}
@@ -7128,6 +7133,7 @@
return gl::error(GL_INVALID_OPERATION);
}
+ const gl::Caps &caps = context->getCaps();
switch (target)
{
case GL_TRANSFORM_FEEDBACK_BUFFER_START:
@@ -7139,8 +7145,10 @@
case GL_UNIFORM_BUFFER_START:
case GL_UNIFORM_BUFFER_SIZE:
case GL_UNIFORM_BUFFER_BINDING:
- if (index >= context->getMaximumCombinedUniformBufferBindings())
+ if (index >= caps.maxUniformBufferBindings)
+ {
return gl::error(GL_INVALID_VALUE);
+ }
break;
default:
return gl::error(GL_INVALID_ENUM);
@@ -7321,7 +7329,7 @@
return gl::error(GL_INVALID_OPERATION);
}
- if (unit >= context->getMaximumCombinedTextureImageUnits())
+ if (unit >= context->getCaps().maxCombinedTextureImageUnits)
{
return gl::error(GL_INVALID_VALUE);
}