[Mesa-dev] [PATCH] mesa: update color material in GetMaterialfv

Brian Paul brianp at vmware.com
Wed May 23 07:53:42 PDT 2012


On 05/23/2012 12:33 AM, Tapani Pälli wrote:
> color material state gets reseted when vertices are flushed,
> update state after flush. this change is written against piglit
> test 'colormaterial-query'.
>
> Signed-off-by: Tapani Pälli<tapani.palli at intel.com>
> ---
>   src/mesa/main/light.c |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
> index 38ec1b6..7b7d72c 100644
> --- a/src/mesa/main/light.c
> +++ b/src/mesa/main/light.c
> @@ -761,6 +761,10 @@ _mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params )
>
>      FLUSH_CURRENT(ctx, 0); /* update ctx->Light.Material from vertex buffer */
>
> +   /* flush vertices resets state, update color material */
> +   if(ctx->Light.ColorMaterialEnabled)
> +      _mesa_update_color_material(ctx,ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
> +
>      if (face==GL_FRONT) {
>         f = 0;
>      }

I tried your new piglit test with Mesa/master as of today and the test 
passes.

It looks like this commit from May 8 fixed the problem:

commit 1bc16bf98a1b5a4cca0c0ae2a80ba7982c6e4651
Author: Brian Paul <brianp at vmware.com>
Date:   Tue May 8 11:41:03 2012 -0600

     mesa: fix glMaterial / dlist bug


Can you test Mesa/master without your patch and see what happens?

-Brian


More information about the mesa-dev mailing list