Commit 1677d5c0aebe8edb54aa3236294acede536013f3 (mesa: fix-up blend
enable/disable code in _mesa_PopAttrib()) changed main/attrib.c to fix
the blend enable/disable functions, due to changes introduced by commit
3728673bd1b974e54858fbab6ff62d3607b0d3f0 (mesa: per-buffer blend enabled flags).
But some DRI drivers (at least r600 and intel) still had problems with
rendering: some OpenGL screensavers from xscreensaver, for instance, left
artifacts behind them which wouldn't clear.
As suggested by taiu on Freenode/#radeon, replicate these same fixes into
drivers/common/meta.c. This indeed fixes the problem.
---
src/mesa/drivers/common/meta.c | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 0676173..8846f35 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -336,9 +336,13 @@ _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 +576,13 @@ _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)
--
1.6.6
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev