[Mesa-dev] [PATCH] meta: move vertex array enables for mipmap generation

Jose Fonseca jfonseca at vmware.com
Fri May 31 09:06:02 PDT 2013


Yeah, that looks even better than my fix.

Jose

----- Original Message -----
> Before, on the second call to GenerateMipmap were enabling two
> vertex arrays for the current vertex array object, rather than
> the private generate-mipmap vertex array object.  This caused
> things to blow up elsewhere.
> 
> This patch moves the array enables into the block where the
> generate-mipmap vertex array object is created, as we do in
> the setup_ff_generate_mipmap() function.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60518
> NOTE: This is a candidate for the stable branches.
> 
> Tested-by: core13 at gmx.net
> ---
>  src/mesa/drivers/common/meta.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
> index ca5f5a1..1ab603a 100644
> --- a/src/mesa/drivers/common/meta.c
> +++ b/src/mesa/drivers/common/meta.c
> @@ -3397,6 +3397,8 @@ setup_glsl_generate_mipmap(struct gl_context *ctx,
>                                     sizeof(struct vertex), OFFSET(x));
>        _mesa_VertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE,
>                                     sizeof(struct vertex), OFFSET(tex));
> +      _mesa_EnableVertexAttribArray(0);
> +      _mesa_EnableVertexAttribArray(1);
>     }
>  
>     /* Generate a fragment shader program appropriate for the texture target
>     */
> @@ -3468,8 +3470,6 @@ setup_glsl_generate_mipmap(struct gl_context *ctx,
>     _mesa_DeleteObjectARB(vs);
>     _mesa_BindAttribLocation(mipmap->ShaderProg, 0, "position");
>     _mesa_BindAttribLocation(mipmap->ShaderProg, 1, "texcoords");
> -   _mesa_EnableVertexAttribArray(0);
> -   _mesa_EnableVertexAttribArray(1);
>     link_program_with_debug(ctx, mipmap->ShaderProg);
>     sampler->shader_prog = mipmap->ShaderProg;
>     ralloc_free(mem_ctx);
> --
> 1.7.10.4
> 
> _______________________________________________
> 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