From fd5511d27fc44096117c47ab503fb5b47f993061 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 Dec 2009 16:17:14 -0700 Subject: mesa: implement per-buffer color masking This is part of the GL_EXT_draw_buffers2 extension and part of GL 3.0. The ctx->Color.ColorMask field is now a 2-D array. Until drivers are modified to support per-buffer color masking, they can just look at the 0th color mask. The new _mesa_ColorMaskIndexed() function will be called by glColorMaskIndexedEXT() or glColorMaski(). --- src/mesa/main/get_gen.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/mesa/main/get_gen.py') diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 8b6500fae1..18708be260 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -126,10 +126,10 @@ StateVars = [ ( "GL_COLOR_MATERIAL_PARAMETER", GLenum, ["ctx->Light.ColorMaterialMode"], "", None ), ( "GL_COLOR_WRITEMASK", GLint, - [ "ctx->Color.ColorMask[RCOMP] ? 1 : 0", - "ctx->Color.ColorMask[GCOMP] ? 1 : 0", - "ctx->Color.ColorMask[BCOMP] ? 1 : 0", - "ctx->Color.ColorMask[ACOMP] ? 1 : 0" ], "", None ), + [ "ctx->Color.ColorMask[0][RCOMP] ? 1 : 0", + "ctx->Color.ColorMask[0][GCOMP] ? 1 : 0", + "ctx->Color.ColorMask[0][BCOMP] ? 1 : 0", + "ctx->Color.ColorMask[0][ACOMP] ? 1 : 0" ], "", None ), ( "GL_CULL_FACE", GLboolean, ["ctx->Polygon.CullFlag"], "", None ), ( "GL_CULL_FACE_MODE", GLenum, ["ctx->Polygon.CullFaceMode"], "", None ), ( "GL_CURRENT_COLOR", GLfloatN, @@ -1035,7 +1035,14 @@ StateVars = [ # These are queried via glGetIntegetIndexdvEXT() or glGetIntegeri_v() IndexedStateVars = [ - ( "GL_BLEND", GLint, ["((ctx->Color.BlendEnabled >> index) & 1)"], "MAX_DRAW_BUFFERS", None ), + ( "GL_BLEND", GLint, ["((ctx->Color.BlendEnabled >> index) & 1)"], + "ctx->Const.MaxDrawBuffers", None ), + ( "GL_COLOR_WRITEMASK", GLint, + [ "ctx->Color.ColorMask[index][RCOMP] ? 1 : 0", + "ctx->Color.ColorMask[index][GCOMP] ? 1 : 0", + "ctx->Color.ColorMask[index][BCOMP] ? 1 : 0", + "ctx->Color.ColorMask[index][ACOMP] ? 1 : 0" ], + "ctx->Const.MaxDrawBuffers", None ), # XXX more to come... ] -- cgit v1.2.3