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 <[email protected]>
---
 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;
    }
-- 
1.7.7.6

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to