summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common/meta.c
diff options
context:
space:
mode:
authorFrancis Galiegue <[email protected]>2010-01-03 09:42:17 -0700
committerBrian Paul <[email protected]>2010-01-03 09:43:24 -0700
commita60084088baca0981e5b0f1512831683cd4f25bc (patch)
tree9678f4e4b2cdde8bfdc1c7452357568ba2ff49ec /src/mesa/drivers/common/meta.c
parentc978ab017d103e60e7e69b6a7857a70baca29e7b (diff)
mesa: fix blend enable/disable calls in meta.c code
Fixes regression in some DRI drivers since the GL_EXT_draw_buffers2 changes. Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/drivers/common/meta.c')
-rw-r--r--src/mesa/drivers/common/meta.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 0676173745c..c4dbfa6d7d9 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -336,9 +336,14 @@ _mesa_meta_begin(GLcontext *ctx, GLbitfield state)
if (state & META_BLEND) {
save->BlendEnabled = ctx->Color.BlendEnabled;
if (ctx->Color.BlendEnabled) {
- GLuint i;
- for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
- _mesa_set_enablei(ctx, GL_BLEND, i, GL_FALSE);
+ if (ctx->Extensions.EXT_draw_buffers2) {
+ GLuint i;
+ for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
+ _mesa_set_enablei(ctx, GL_BLEND, i, GL_FALSE);
+ }
+ }
+ else {
+ _mesa_set_enable(ctx, GL_BLEND, GL_FALSE);
}
}
save->ColorLogicOpEnabled = ctx->Color.ColorLogicOpEnabled;
@@ -572,9 +577,14 @@ _mesa_meta_end(GLcontext *ctx)
if (state & META_BLEND) {
if (ctx->Color.BlendEnabled != save->BlendEnabled) {
- GLuint i;
- for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
- _mesa_set_enablei(ctx, GL_BLEND, i, (save->BlendEnabled >> i) & 1);
+ if (ctx->Extensions.EXT_draw_buffers2) {
+ GLuint i;
+ for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
+ _mesa_set_enablei(ctx, GL_BLEND, i, (save->BlendEnabled >> i) & 1);
+ }
+ }
+ else {
+ _mesa_set_enable(ctx, GL_BLEND, (save->BlendEnabled & 1));
}
}
if (ctx->Color.ColorLogicOpEnabled != save->ColorLogicOpEnabled)