aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/blend.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-05-25 15:19:41 +0200
committermarha <marha@users.sourceforge.net>2012-05-25 15:19:41 +0200
commiteef864d36de97903007f04fad9fa43afe297745b (patch)
tree28dd3cae5f699b493e4d72e7e7d468a5a2cae7f4 /mesalib/src/mesa/main/blend.c
parentf543ceaca6820260f15a4eff86938214cf43c7d2 (diff)
downloadvcxsrv-eef864d36de97903007f04fad9fa43afe297745b.tar.gz
vcxsrv-eef864d36de97903007f04fad9fa43afe297745b.tar.bz2
vcxsrv-eef864d36de97903007f04fad9fa43afe297745b.zip
fontconfig xserver xkeyboard-config pixman git update 2012
Diffstat (limited to 'mesalib/src/mesa/main/blend.c')
-rw-r--r--mesalib/src/mesa/main/blend.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/blend.c b/mesalib/src/mesa/main/blend.c
index bc446edca..5bc40a028 100644
--- a/mesalib/src/mesa/main/blend.c
+++ b/mesalib/src/mesa/main/blend.c
@@ -166,6 +166,24 @@ _mesa_BlendFunc( GLenum sfactor, GLenum dfactor )
_mesa_BlendFuncSeparateEXT(sfactor, dfactor, sfactor, dfactor);
}
+static GLboolean
+blend_factor_is_dual_src(GLenum factor)
+{
+ return (factor == GL_SRC1_COLOR ||
+ factor == GL_SRC1_ALPHA ||
+ factor == GL_ONE_MINUS_SRC1_COLOR ||
+ factor == GL_ONE_MINUS_SRC1_ALPHA);
+}
+
+static void
+update_uses_dual_src(struct gl_context *ctx, int buf)
+{
+ ctx->Color.Blend[buf]._UsesDualSrc =
+ (blend_factor_is_dual_src(ctx->Color.Blend[buf].SrcRGB) ||
+ blend_factor_is_dual_src(ctx->Color.Blend[buf].DstRGB) ||
+ blend_factor_is_dual_src(ctx->Color.Blend[buf].SrcA) ||
+ blend_factor_is_dual_src(ctx->Color.Blend[buf].DstA));
+}
/**
* Set the separate blend source/dest factors for all draw buffers.
@@ -220,6 +238,7 @@ _mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB,
ctx->Color.Blend[buf].DstRGB = dfactorRGB;
ctx->Color.Blend[buf].SrcA = sfactorA;
ctx->Color.Blend[buf].DstA = dfactorA;
+ update_uses_dual_src(ctx, buf);
}
ctx->Color._BlendFuncPerBuffer = GL_FALSE;
@@ -282,6 +301,7 @@ _mesa_BlendFuncSeparatei(GLuint buf, GLenum sfactorRGB, GLenum dfactorRGB,
ctx->Color.Blend[buf].DstRGB = dfactorRGB;
ctx->Color.Blend[buf].SrcA = sfactorA;
ctx->Color.Blend[buf].DstA = dfactorA;
+ update_uses_dual_src(ctx, buf);
ctx->Color._BlendFuncPerBuffer = GL_TRUE;
if (ctx->Driver.BlendFuncSeparatei) {