intel: save/restore GL matrix mode in intel_meta_set_passthrough_transform(), intel_m...
authorBrian Paul <brianp@vmware.com>
Wed, 28 Jan 2009 23:55:16 +0000 (16:55 -0700)
committerAlan Hourihane <alanh@vmware.com>
Thu, 29 Jan 2009 00:59:53 +0000 (00:59 +0000)
(cherry picked from master, commit 723648f2ee2a8e529063c9da84e9dff9c8c6be99)

src/mesa/drivers/dri/intel/intel_context.h
src/mesa/drivers/dri/intel/intel_pixel.c

index 048286c196bb9659ec49be3f077e6bb43834abd1..348da347ddc923a28755fcf418b7ceaeef7149a9 100644 (file)
@@ -168,6 +168,7 @@ struct intel_context
 
       GLint saved_vp_x, saved_vp_y;
       GLsizei saved_vp_width, saved_vp_height;
+      GLenum saved_matrix_mode;
    } meta;
 
    GLint refcount;
index cf2f32d38453623f956dceca209ce64b37b0872f..5e32288844c48b0eb664866d5391f45d260aaf42 100644 (file)
@@ -181,6 +181,7 @@ intel_meta_set_passthrough_transform(struct intel_context *intel)
    intel->meta.saved_vp_y = ctx->Viewport.Y;
    intel->meta.saved_vp_width = ctx->Viewport.Width;
    intel->meta.saved_vp_height = ctx->Viewport.Height;
+   intel->meta.saved_matrix_mode = ctx->Transform.MatrixMode;
 
    _mesa_Viewport(0, 0, ctx->DrawBuffer->Width, ctx->DrawBuffer->Height);
 
@@ -202,6 +203,8 @@ intel_meta_restore_transform(struct intel_context *intel)
    _mesa_MatrixMode(GL_MODELVIEW);
    _mesa_PopMatrix();
 
+   _mesa_MatrixMode(intel->meta.saved_matrix_mode);
+
    _mesa_Viewport(intel->meta.saved_vp_x, intel->meta.saved_vp_y,
                  intel->meta.saved_vp_width, intel->meta.saved_vp_height);
 }