aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/shaderapi.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-11-29 07:56:51 +0100
committermarha <marha@users.sourceforge.net>2012-11-29 07:56:51 +0100
commitd2d73da59e64acdc4718e4e6790a69d967bee875 (patch)
tree5c0148abbbb1473bb80ddc7da286beae9c1f2c3d /mesalib/src/mesa/main/shaderapi.c
parent38eb7612c4b39dd69df4baf4450ba512e888effa (diff)
downloadvcxsrv-d2d73da59e64acdc4718e4e6790a69d967bee875.tar.gz
vcxsrv-d2d73da59e64acdc4718e4e6790a69d967bee875.tar.bz2
vcxsrv-d2d73da59e64acdc4718e4e6790a69d967bee875.zip
fontconfig xserver mesa git update 29 nov 2012
xserver: 1712a45422a63f11b2146541279616fcfda09ec6 fontconfig: faea1cac85ac3b0fd6a983e1c0adeb68e115e06c mesa: c1023608002c985b9d72edc64732cd666de2a206
Diffstat (limited to 'mesalib/src/mesa/main/shaderapi.c')
-rw-r--r--mesalib/src/mesa/main/shaderapi.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c
index 727115015..5c0a923e4 100644
--- a/mesalib/src/mesa/main/shaderapi.c
+++ b/mesalib/src/mesa/main/shaderapi.c
@@ -180,25 +180,6 @@ validate_shader_target(const struct gl_context *ctx, GLenum type)
}
-/**
- * Find the length of the longest transform feedback varying name
- * which was specified with glTransformFeedbackVaryings().
- */
-static GLint
-longest_feedback_varying_name(const struct gl_shader_program *shProg)
-{
- GLuint i;
- GLint max = 0;
- for (i = 0; i < shProg->TransformFeedback.NumVarying; i++) {
- GLint len = strlen(shProg->TransformFeedback.VaryingNames[i]);
- if (len > max)
- max = len;
- }
- return max;
-}
-
-
-
static GLboolean
is_program(struct gl_context *ctx, GLuint name)
{
@@ -538,11 +519,24 @@ 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: {
+ unsigned i;
+ GLint max_len = 0;
if (!has_xfb)
break;
- *params = longest_feedback_varying_name(shProg) + 1;
+
+ for (i = 0; i < shProg->TransformFeedback.NumVarying; i++) {
+ /* Add one for the terminating NUL character.
+ */
+ const GLint len = strlen(shProg->TransformFeedback.VaryingNames[i]) + 1;
+
+ if (len > max_len)
+ max_len = len;
+ }
+
+ *params = max_len;
return;
+ }
case GL_TRANSFORM_FEEDBACK_BUFFER_MODE:
if (!has_xfb)
break;