Mesa (9.0): meta: Don' t save and restore fog state when there is no fog state

Ian Romanick idr at kemper.freedesktop.org
Mon Sep 3 17:38:55 UTC 2012


Module: Mesa
Branch: 9.0
Commit: 284fe97515998178962b5abb4ed0b828b3497c77
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=284fe97515998178962b5abb4ed0b828b3497c77

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Fri Aug 31 15:26:27 2012 -0700

meta: Don't save and restore fog state when there is no fog state

I wonder if the better solution is to have _mesa_meta_GenerateMipmap not
use MESA_META_ALL for the GLSL path.  Even on compatibility profiles
there is no reason to save and restore fog on this path.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
Tested-by: Lu Hua <huax.lu at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54295
(cherry picked from commit 51b069e7aa81cdc8f38db71554ae3dd12ce0a6c4)

---

 src/mesa/drivers/common/meta.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 4b448fe..36672a7 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -538,7 +538,9 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
          _mesa_set_enable(ctx, GL_DEPTH_TEST, GL_FALSE);
    }
 
-   if (state & MESA_META_FOG) {
+   if ((state & MESA_META_FOG)
+       && ctx->API != API_OPENGL_CORE
+       && ctx->API != API_OPENGLES2) {
       save->Fog = ctx->Fog.Enabled;
       if (ctx->Fog.Enabled)
          _mesa_set_enable(ctx, GL_FOG, GL_FALSE);
@@ -856,7 +858,9 @@ _mesa_meta_end(struct gl_context *ctx)
       _mesa_DepthMask(save->Depth.Mask);
    }
 
-   if (state & MESA_META_FOG) {
+   if ((state & MESA_META_FOG)
+       && ctx->API != API_OPENGL_CORE
+       && ctx->API != API_OPENGLES2) {
       _mesa_set_enable(ctx, GL_FOG, save->Fog);
    }
 




More information about the mesa-commit mailing list