Add caps for transform feedback limits from table 6.34.
BUG=angle:658
Change-Id: Ifd8c620080c8de486ffb7c8f9e985be1aba516c1
Reviewed-on: https://chromium-review.googlesource.com/207376
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 5f66f4a..d1bfadc 100644
--- a/src/libGLESv2/libGLESv2.cpp
+++ b/src/libGLESv2/libGLESv2.cpp
@@ -5636,8 +5636,10 @@
case GL_TRANSFORM_FEEDBACK_BUFFER_START:
case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:
case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
- if (index >= context->getMaxTransformFeedbackBufferBindings())
+ if (index >= caps.maxTransformFeedbackSeparateAttributes)
+ {
return gl::error(GL_INVALID_VALUE);
+ }
break;
case GL_UNIFORM_BUFFER_START:
case GL_UNIFORM_BUFFER_SIZE:
@@ -5770,7 +5772,7 @@
switch (target)
{
case GL_TRANSFORM_FEEDBACK_BUFFER:
- if (index >= context->getMaxTransformFeedbackBufferBindings())
+ if (index >= caps.maxTransformFeedbackSeparateAttributes)
{
return gl::error(GL_INVALID_VALUE);
}
@@ -5842,7 +5844,7 @@
switch (target)
{
case GL_TRANSFORM_FEEDBACK_BUFFER:
- if (index >= context->getMaxTransformFeedbackBufferBindings())
+ if (index >= caps.maxTransformFeedbackSeparateAttributes)
{
return gl::error(GL_INVALID_VALUE);
}
@@ -5896,12 +5898,13 @@
return gl::error(GL_INVALID_VALUE);
}
+ const gl::Caps &caps = context->getCaps();
switch (bufferMode)
{
case GL_INTERLEAVED_ATTRIBS:
break;
case GL_SEPARATE_ATTRIBS:
- if (static_cast<GLuint>(count) > context->getMaxTransformFeedbackBufferBindings())
+ if (static_cast<GLuint>(count) > caps.maxTransformFeedbackSeparateAttributes)
{
return gl::error(GL_INVALID_VALUE);
}
@@ -7139,8 +7142,10 @@
case GL_TRANSFORM_FEEDBACK_BUFFER_START:
case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:
case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
- if (index >= context->getMaxTransformFeedbackBufferBindings())
+ if (index >= caps.maxTransformFeedbackSeparateAttributes)
+ {
return gl::error(GL_INVALID_VALUE);
+ }
break;
case GL_UNIFORM_BUFFER_START:
case GL_UNIFORM_BUFFER_SIZE: