summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-10-31 17:36:23 +0000
committerBrian Paul <[email protected]>2004-10-31 17:36:23 +0000
commitbd3b40ad75d50483aaa99ad2d08a3dd8f20cdb42 (patch)
treebb8cdda4e93bdd60f41e494f7b79f9c9bda36e78 /src/mesa/swrast
parentd56928f10dee6a60f0df83391564550ec9d44b80 (diff)
PBO support for glConvolutionFilter1D/2D, glGetConvolutionFilter, etc.
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_imaging.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_imaging.c b/src/mesa/swrast/s_imaging.c
index 52c809f7a9b..a15cc0ba57c 100644
--- a/src/mesa/swrast/s_imaging.c
+++ b/src/mesa/swrast/s_imaging.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.3
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -85,6 +85,7 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLchan rgba[MAX_CONVOLUTION_WIDTH][4];
+ struct gl_buffer_object *bufferSave;
/* Select buffer to read from */
_swrast_use_read_buffer(ctx);
@@ -100,9 +101,16 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
/* 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;
+
/* store as convolution filter */
_mesa_ConvolutionFilter1D(target, internalFormat, width,
GL_RGBA, CHAN_TYPE, rgba);
+
+ /* restore PBO binding */
+ ctx->Unpack.BufferObj = bufferSave;
}
@@ -115,6 +123,7 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
struct gl_pixelstore_attrib packSave;
GLchan rgba[MAX_CONVOLUTION_HEIGHT][MAX_CONVOLUTION_WIDTH][4];
GLint i;
+ struct gl_buffer_object *bufferSave;
/* Select buffer to read from */
_swrast_use_read_buffer(ctx);
@@ -151,9 +160,16 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
ctx->Unpack.BufferObj = ctx->Array.NullBufferObj;
ctx->NewState |= _NEW_PACKUNPACK;
+ /* save PBO binding */
+ bufferSave = ctx->Unpack.BufferObj;
+ ctx->Unpack.BufferObj = ctx->Array.NullBufferObj;
+
_mesa_ConvolutionFilter2D(target, internalFormat, width, height,
GL_RGBA, CHAN_TYPE, rgba);
+ /* restore PBO binding */
+ ctx->Unpack.BufferObj = bufferSave;
+
ctx->Unpack = packSave; /* restore pixel packing params */
ctx->NewState |= _NEW_PACKUNPACK;
}