Mesa (mesa_7_6_branch): intel: fix GL state bugs in intel_texture_bitmap()

Brian Paul brianp at kemper.freedesktop.org
Mon Oct 26 21:34:37 UTC 2009


Module: Mesa
Branch: mesa_7_6_branch
Commit: 48dad9c93fd6fb46bf33a58a87de79eb5ffd6e67
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=48dad9c93fd6fb46bf33a58a87de79eb5ffd6e67

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Oct 26 10:42:45 2009 -0600

intel: fix GL state bugs in intel_texture_bitmap()

Need to push texture state and polygon state too.
Fixes rendering glitches seen in progs/demos/engine when changing
the rendering mode (wireframe, texture modes).
This makes bitmap rendering a little slower, unfortunately.

---

 src/mesa/drivers/dri/intel/intel_pixel_bitmap.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
index b543a0b..18e6ebd 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
@@ -435,13 +435,14 @@ intel_texture_bitmap(GLcontext * ctx,
    }
 
    /* Save GL state before we start setting up our drawing */
-   _mesa_PushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT |
-		    GL_VIEWPORT_BIT);
+   _mesa_PushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT | GL_POLYGON_BIT |
+                    GL_TEXTURE_BIT | GL_VIEWPORT_BIT);
    _mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT |
 			  GL_CLIENT_PIXEL_STORE_BIT);
    old_active_texture = ctx->Texture.CurrentUnit;
 
    _mesa_Disable(GL_POLYGON_STIPPLE);
+   _mesa_PolygonMode(GL_FRONT_AND_BACK, GL_FILL);
 
    /* Upload our bitmap data to an alpha texture */
    _mesa_ActiveTextureARB(GL_TEXTURE0_ARB);
@@ -501,8 +502,6 @@ intel_texture_bitmap(GLcontext * ctx,
    meta_restore_vertex_program(&intel->meta);
 
    _mesa_PopClientAttrib();
-   _mesa_Disable(GL_TEXTURE_2D); /* asserted that it was disabled at entry */
-   _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + old_active_texture);
    _mesa_PopAttrib();
 
    _mesa_DeleteTextures(1, &texname);




More information about the mesa-commit mailing list