[Mesa-dev] [PATCH] mesa: Return 0 for XFB_VARYING_MAX_LENGTH if no varyings
Matt Turner
mattst88 at gmail.com
Fri Nov 23 00:14:57 PST 2012
We add one for the null terminator, but if we don't have any varyings,
it doesn't make sense to have a null terminator.
Fixes part of es3conform's transform_feedback_init_defaults test.
---
src/mesa/main/shaderapi.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 7271150..19051d6 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -538,11 +538,14 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param
break;
*params = shProg->TransformFeedback.NumVarying;
return;
- case GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH:
+ case GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH: {
+ GLint max_length;
if (!has_xfb)
break;
- *params = longest_feedback_varying_name(shProg) + 1;
+ max_length = longest_feedback_varying_name(shProg);
+ *params = max_length == 0 ? 0 : max_length + 1;
return;
+ }
case GL_TRANSFORM_FEEDBACK_BUFFER_MODE:
if (!has_xfb)
break;
--
1.7.8.6
More information about the mesa-dev
mailing list