Mesa (master): intel: Fix googleearth by avoiding GL_VIEWPORT_BIT in meta clear push/pop

Eric Anholt anholt at kemper.freedesktop.org
Fri Aug 7 21:09:43 UTC 2009


Module: Mesa
Branch: master
Commit: a2a3d8d7f056a9c3c613da62ddc2618bf5227ce6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a2a3d8d7f056a9c3c613da62ddc2618bf5227ce6

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Aug  6 13:55:09 2009 -0700

intel: Fix googleearth by avoiding GL_VIEWPORT_BIT in meta clear push/pop

I have no idea why this fixes things, but being more efficient sounds good
anyway.  Fixes regression in 99d07d0f91ddd37926d08f4e7f10d55cac28d9a7
where most of the lit half of the world was not drawn.

---

 src/mesa/drivers/dri/common/dri_metaops.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/common/dri_metaops.c b/src/mesa/drivers/dri/common/dri_metaops.c
index fe183c2..cdbea34 100644
--- a/src/mesa/drivers/dri/common/dri_metaops.c
+++ b/src/mesa/drivers/dri/common/dri_metaops.c
@@ -357,6 +357,7 @@ meta_clear_tris(struct dri_metaops *meta, GLbitfield mask)
    GLuint saved_shader_program = 0;
    unsigned int saved_active_texture;
    struct gl_array_object *arraySave = NULL;
+   GLfloat saved_near, saved_far;
 
    if (!meta->clear.arrayObj)
       meta_init_clear(meta);
@@ -370,8 +371,7 @@ meta_clear_tris(struct dri_metaops *meta, GLbitfield mask)
 		    GL_POLYGON_BIT |
 		    GL_STENCIL_BUFFER_BIT |
 		    GL_TRANSFORM_BIT |
-		    GL_CURRENT_BIT |
-		    GL_VIEWPORT_BIT);
+		    GL_CURRENT_BIT);
    saved_active_texture = ctx->Texture.CurrentUnit;
 
    /* Disable existing GL state we don't want to apply to a clear. */
@@ -440,6 +440,8 @@ meta_clear_tris(struct dri_metaops *meta, GLbitfield mask)
    /* The ClearDepth value is unaffected by DepthRange, so do a default
     * mapping.
     */
+   saved_near = ctx->Viewport.Near;
+   saved_far = ctx->Viewport.Far;
    _mesa_DepthRange(0.0, 1.0);
 
    /* Prepare the vertices, which are the same regardless of which buffer we're
@@ -519,6 +521,7 @@ meta_clear_tris(struct dri_metaops *meta, GLbitfield mask)
    if (saved_shader_program)
       _mesa_UseProgramObjectARB(saved_shader_program);
 
+   _mesa_DepthRange(saved_near, saved_far);
    _mesa_PopAttrib();
 
    /* restore current array object */




More information about the mesa-commit mailing list