summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_imaging.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-10-31 17:56:28 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-10-31 17:56:28 +0000
commit66f3231322c8c1c398cc95617813da5b4aa6bddc (patch)
treea5012697f419ddc4d43489c318d985616eb1c8ab /src/mesa/swrast/s_imaging.c
parentbd3b40ad75d50483aaa99ad2d08a3dd8f20cdb42 (diff)
PBO support for glColorTable, glColorSubTable, glGetColorTable, etc.
Diffstat (limited to 'src/mesa/swrast/s_imaging.c')
-rw-r--r--src/mesa/swrast/s_imaging.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_imaging.c b/src/mesa/swrast/s_imaging.c
index a15cc0ba57..088215d535 100644
--- a/src/mesa/swrast/s_imaging.c
+++ b/src/mesa/swrast/s_imaging.c
@@ -39,6 +39,7 @@ _swrast_CopyColorTable( GLcontext *ctx,
GLint x, GLint y, GLsizei width)
{
GLchan data[MAX_WIDTH][4];
+ struct gl_buffer_object *bufferSave;
/* Select buffer to read from */
_swrast_use_read_buffer(ctx);
@@ -52,7 +53,14 @@ _swrast_CopyColorTable( GLcontext *ctx,
/* Restore reading from draw buffer (the default) */
_swrast_use_draw_buffer(ctx);
+ /* save PBO binding */
+ bufferSave = ctx->Unpack.BufferObj;
+ ctx->Unpack.BufferObj = ctx->Array.NullBufferObj;
+
_mesa_ColorTable(target, internalformat, width, GL_RGBA, CHAN_TYPE, data);
+
+ /* restore PBO binding */
+ ctx->Unpack.BufferObj = bufferSave;
}
@@ -61,6 +69,7 @@ _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start,
GLint x, GLint y, GLsizei width)
{
GLchan data[MAX_WIDTH][4];
+ struct gl_buffer_object *bufferSave;
/* Select buffer to read from */
_swrast_use_read_buffer(ctx);
@@ -74,7 +83,14 @@ _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start,
/* Restore reading from draw buffer (the default) */
_swrast_use_draw_buffer(ctx);
+ /* save PBO binding */
+ bufferSave = ctx->Unpack.BufferObj;
+ ctx->Unpack.BufferObj = ctx->Array.NullBufferObj;
+
_mesa_ColorSubTable(target, start, width, GL_RGBA, CHAN_TYPE, data);
+
+ /* restore PBO binding */
+ ctx->Unpack.BufferObj = bufferSave;
}