summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/pixelstore.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-06-20 11:31:05 -0600
committerKeith Whitwell <[email protected]>2008-09-21 22:13:55 -0700
commitbb00f09f1bfb195206ffac6481d83ecf57fd37ce (patch)
tree311b65ac8c76d6fe6cb382852c75d8f339d4cfc7 /src/mesa/main/pixelstore.c
parent9b8b58b79a1837f75cec44089589a308ccd865f1 (diff)
mesa: refactor: move initialization of DefaultPacking state.
Diffstat (limited to 'src/mesa/main/pixelstore.c')
-rw-r--r--src/mesa/main/pixelstore.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/main/pixelstore.c b/src/mesa/main/pixelstore.c
index 3bf89bd3e18..ff1a6344cc9 100644
--- a/src/mesa/main/pixelstore.c
+++ b/src/mesa/main/pixelstore.c
@@ -260,4 +260,24 @@ _mesa_init_pixelstore( GLcontext *ctx )
#if FEATURE_EXT_pixel_buffer_object
ctx->Unpack.BufferObj = ctx->Array.NullBufferObj;
#endif
+
+ /*
+ * _mesa_unpack_image() returns image data in this format. When we
+ * execute image commands (glDrawPixels(), glTexImage(), etc) from
+ * within display lists we have to be sure to set the current
+ * unpacking parameters to these values!
+ */
+ ctx->DefaultPacking.Alignment = 1;
+ ctx->DefaultPacking.RowLength = 0;
+ ctx->DefaultPacking.SkipPixels = 0;
+ ctx->DefaultPacking.SkipRows = 0;
+ ctx->DefaultPacking.ImageHeight = 0;
+ ctx->DefaultPacking.SkipImages = 0;
+ ctx->DefaultPacking.SwapBytes = GL_FALSE;
+ ctx->DefaultPacking.LsbFirst = GL_FALSE;
+ ctx->DefaultPacking.ClientStorage = GL_FALSE;
+ ctx->DefaultPacking.Invert = GL_FALSE;
+#if FEATURE_EXT_pixel_buffer_object
+ ctx->DefaultPacking.BufferObj = ctx->Array.NullBufferObj;
+#endif
}