[Mesa-dev] [PATCH] mesa: use implementation specified MAX_VERTEX_ATTRIBS rather than hardcoded value

Ilia Mirkin imirkin at alum.mit.edu
Tue Jul 7 16:50:26 PDT 2015


Assuming the comment is correct, this is

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

src/mesa/main/get_hash_params.py:  [ "MAX_VERTEX_ATTRIBS_ARB",
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxAttribs),
extra_ARB_vertex_program_api_es2" ],

Quickly looked over the code, and the comment does seem correct.

Perhaps not going over 80 chars by so much would be better, your call
whether to fix that or not.


On Tue, Jul 7, 2015 at 7:42 PM, Timothy Arceri <t_arceri at yahoo.com.au> wrote:
> ---
>  src/glsl/linker.cpp | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index 6a69c15..2f5a36f 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -3084,12 +3084,7 @@ 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;
>     }
>
> --
> 2.4.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list