summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/pixel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/pixel.c')
-rw-r--r--src/mesa/main/pixel.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c
index 6800170faae..8e2b55fc347 100644
--- a/src/mesa/main/pixel.c
+++ b/src/mesa/main/pixel.c
@@ -24,6 +24,7 @@
#include "glheader.h"
#include "imports.h"
+#include "image.h"
#include "colormac.h"
#include "context.h"
#include "macros.h"
@@ -1682,7 +1683,8 @@ void _mesa_update_pixel( GLcontext *ctx, GLuint new_state )
/***** Initialization *****/
/**********************************************************************/
-void _mesa_init_pixel( GLcontext * ctx )
+void
+_mesa_init_pixel( GLcontext * ctx )
{
int i;
@@ -1774,6 +1776,9 @@ void _mesa_init_pixel( GLcontext * ctx )
ctx->Pack.LsbFirst = GL_FALSE;
ctx->Pack.ClientStorage = GL_FALSE;
ctx->Pack.Invert = GL_FALSE;
+#if FEATURE_EXT_pixel_buffer_object
+ ctx->Pack.BufferObj = ctx->Array.NullBufferObj;
+#endif
ctx->Unpack.Alignment = 4;
ctx->Unpack.RowLength = 0;
ctx->Unpack.ImageHeight = 0;
@@ -1784,6 +1789,29 @@ void _mesa_init_pixel( GLcontext * ctx )
ctx->Unpack.LsbFirst = GL_FALSE;
ctx->Unpack.ClientStorage = GL_FALSE;
ctx->Unpack.Invert = GL_FALSE;
+#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
if (ctx->Visual.doubleBufferMode) {
ctx->Pixel.ReadBuffer = GL_BACK;