diff options
Diffstat (limited to 'src/mesa/main/attrib.c')
-rw-r--r-- | src/mesa/main/attrib.c | 59 |
1 files changed, 34 insertions, 25 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index fb6fbe5b6d..ae7f633b8d 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -43,6 +43,7 @@ #include "lines.h" #include "macros.h" #include "matrix.h" +#include "mfeatures.h" #include "multisample.h" #include "points.h" #include "polygon.h" @@ -124,9 +125,6 @@ struct gl_enable_attrib GLbitfield Texture[MAX_TEXTURE_UNITS]; GLbitfield TexGen[MAX_TEXTURE_UNITS]; - /* SGI_texture_color_table */ - GLboolean TextureColorTable[MAX_TEXTURE_UNITS]; - /* GL_ARB_vertex_program / GL_NV_vertex_program */ GLboolean VertexProgram; GLboolean VertexProgramPointSize; @@ -310,7 +308,6 @@ _mesa_PushAttrib(GLbitfield mask) for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { attr->Texture[i] = ctx->Texture.Unit[i].Enabled; attr->TexGen[i] = ctx->Texture.Unit[i].TexGenEnabled; - attr->TextureColorTable[i] = ctx->Texture.Unit[i].ColorTableEnabled; } /* GL_NV_vertex_program */ attr->VertexProgram = ctx->VertexProgram.Enabled; @@ -656,9 +653,6 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib *enable) _mesa_set_enable(ctx, GL_TEXTURE_GEN_Q, (genEnabled & Q_BIT) ? GL_TRUE : GL_FALSE); } - - /* GL_SGI_texture_color_table */ - ctx->Texture.Unit[i].ColorTableEnabled = enable->TextureColorTable[i]; } _mesa_ActiveTextureARB(GL_TEXTURE0 + curTexUnitSave); @@ -701,10 +695,6 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate) (unit->Enabled & TEXTURE_2D_ARRAY_BIT) ? GL_TRUE : GL_FALSE); } - if (ctx->Extensions.SGI_texture_color_table) { - _mesa_set_enable(ctx, GL_TEXTURE_COLOR_TABLE_SGI, - unit->ColorTableEnabled); - } _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, unit->EnvMode); _mesa_TexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, unit->EnvColor); _mesa_TexGeni(GL_S, GL_TEXTURE_GEN_MODE, unit->GenS.Mode); @@ -953,20 +943,39 @@ _mesa_PopAttrib(void) _mesa_set_enable(ctx, GL_BLEND, (color->BlendEnabled & 1)); } } - _mesa_BlendFuncSeparateEXT(color->BlendSrcRGB, - color->BlendDstRGB, - color->BlendSrcA, - color->BlendDstA); - /* This special case is because glBlendEquationSeparateEXT - * cannot take GL_LOGIC_OP as a parameter. - */ - if ( color->BlendEquationRGB == color->BlendEquationA ) { - _mesa_BlendEquation(color->BlendEquationRGB); - } - else { - _mesa_BlendEquationSeparateEXT(color->BlendEquationRGB, - color->BlendEquationA); - } + if (ctx->Color._BlendFuncPerBuffer || + ctx->Color._BlendEquationPerBuffer) { + /* set blend per buffer */ + GLuint buf; + for (buf = 0; buf < ctx->Const.MaxDrawBuffers; buf++) { + _mesa_BlendFuncSeparatei(buf, color->Blend[buf].SrcRGB, + color->Blend[buf].DstRGB, + color->Blend[buf].SrcA, + color->Blend[buf].DstA); + _mesa_BlendEquationSeparatei(buf, + color->Blend[buf].EquationRGB, + color->Blend[buf].EquationA); + } + } + else { + /* set same blend modes for all buffers */ + _mesa_BlendFuncSeparateEXT(color->Blend[0].SrcRGB, + color->Blend[0].DstRGB, + color->Blend[0].SrcA, + color->Blend[0].DstA); + /* This special case is because glBlendEquationSeparateEXT + * cannot take GL_LOGIC_OP as a parameter. + */ + if (color->Blend[0].EquationRGB == + color->Blend[0].EquationA) { + _mesa_BlendEquation(color->Blend[0].EquationRGB); + } + else { + _mesa_BlendEquationSeparateEXT( + color->Blend[0].EquationRGB, + color->Blend[0].EquationA); + } + } _mesa_BlendColor(color->BlendColor[0], color->BlendColor[1], color->BlendColor[2], |