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

Tapani Pälli tapani.palli at intel.com
Tue May 22 23:33:31 PDT 2012


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;
    }
-- 
1.7.7.6



More information about the mesa-dev mailing list