mesa: use implementation specified MAX_VERTEX_ATTRIBS rather than hardcoded value
authorTimothy Arceri <t_arceri@yahoo.com.au>
Tue, 7 Jul 2015 23:20:40 +0000 (09:20 +1000)
committerTimothy Arceri <t_arceri@yahoo.com.au>
Wed, 8 Jul 2015 01:40:30 +0000 (11:40 +1000)
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/glsl/linker.cpp

index 8d4b40e4f0c939b688dc2b922e91672f335a85fb..b7a783c0984be2fe5c9432f3f22f4d5183ab14d3 100644 (file)
@@ -3070,12 +3070,8 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
       }
    }
 
-   /* FINISHME: The value of the max_attribute_index parameter is
-    * FINISHME: implementation dependent based on the value of
-    * FINISHME: GL_MAX_VERTEX_ATTRIBS.  GL_MAX_VERTEX_ATTRIBS must be
-    * FINISHME: at least 16, so hardcode 16 for now.
-    */
-   if (!assign_attribute_or_color_locations(prog, MESA_SHADER_VERTEX, 16)) {
+   if (!assign_attribute_or_color_locations(prog, MESA_SHADER_VERTEX,
+                                            ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)) {
       goto done;
    }