aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/attrib.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-01-16 16:08:57 +0000
committermarha <marha@users.sourceforge.net>2011-01-16 16:08:57 +0000
commit367c91bebcdc1f5ba4278b68eb8715218d9640ad (patch)
tree7ddef803c402f1b84e293793c5fd3d0e95d3de0a /mesalib/src/mesa/main/attrib.c
parent6feea7e6cdde235d7e3727c4155ca9f8d90df3ca (diff)
downloadvcxsrv-367c91bebcdc1f5ba4278b68eb8715218d9640ad.tar.gz
vcxsrv-367c91bebcdc1f5ba4278b68eb8715218d9640ad.tar.bz2
vcxsrv-367c91bebcdc1f5ba4278b68eb8715218d9640ad.zip
mesalib git update 16/1/2011
Diffstat (limited to 'mesalib/src/mesa/main/attrib.c')
-rw-r--r--mesalib/src/mesa/main/attrib.c47
1 files changed, 33 insertions, 14 deletions
diff --git a/mesalib/src/mesa/main/attrib.c b/mesalib/src/mesa/main/attrib.c
index 4404c9b30..f97ec08e5 100644
--- a/mesalib/src/mesa/main/attrib.c
+++ b/mesalib/src/mesa/main/attrib.c
@@ -954,20 +954,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],