summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-03-21 11:57:30 -0600
committerBrian <[email protected]>2007-03-21 11:57:30 -0600
commit23d31efc167f09d47635352f697ffcb087d3ebbd (patch)
tree782f5bdcda8a4374501cae05a94a024fe1c26777 /src/mesa/swrast
parent180cc2f8458c13ce415f7cdf9a425ae59cb6ad8b (diff)
parent88db19a48412cbe89196b1cc06e8ecf8ccae78b0 (diff)
merge from master
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_accum.c4
-rw-r--r--src/mesa/swrast/s_copypix.c7
-rw-r--r--src/mesa/swrast/s_depth.c2
-rw-r--r--src/mesa/swrast/s_drawpix.c11
-rw-r--r--src/mesa/swrast/s_readpix.c6
-rw-r--r--src/mesa/swrast/s_stencil.c2
6 files changed, 25 insertions, 7 deletions
diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c
index 69e9404c55c..f53e7f52c5e 100644
--- a/src/mesa/swrast/s_accum.c
+++ b/src/mesa/swrast/s_accum.c
@@ -136,7 +136,9 @@ _swrast_clear_accum_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
return;
}
- assert(rb);
+ if (!rb || !rb->Data)
+ return;
+
assert(rb->_BaseFormat == GL_RGBA);
/* add other types in future? */
assert(rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT);
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index afab7c4d37a..2051e1f3b73 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -199,7 +199,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
GLint sy, dy, stepy, row;
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
GLint overlapping;
- const GLuint transferOps = ctx->_ImageTransferState;
+ GLuint transferOps = ctx->_ImageTransferState;
SWspan span;
if (!ctx->ReadBuffer->_ColorReadBuffer) {
@@ -211,6 +211,11 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
copy_conv_rgba_pixels(ctx, srcx, srcy, width, height, destx, desty);
return;
}
+ else if (ctx->Pixel.Convolution1DEnabled) {
+ /* make sure we don't apply 1D convolution */
+ transferOps &= ~(IMAGE_CONVOLUTION_BIT |
+ IMAGE_POST_CONVOLUTION_SCALE_BIAS);
+ }
/* Determine if copy should be done bottom-to-top or top-to-bottom */
if (srcy < desty) {
diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
index 408174c990f..dde2b1db83a 100644
--- a/src/mesa/swrast/s_depth.c
+++ b/src/mesa/swrast/s_depth.c
@@ -1350,7 +1350,7 @@ _swrast_clear_depth_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
GLuint clearValue;
GLint x, y, width, height;
- if (!rb || !ctx->Depth.Mask) {
+ if (!rb || !ctx->Depth.Mask || !rb->Data) {
/* no depth buffer, or writing to it is disabled */
return;
}
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index 595fd5c5cde..50147f329f6 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -452,7 +452,8 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
&& !scaleOrBias
&& !zoom
&& ctx->Visual.rgbMode
- && width <= MAX_WIDTH) {
+ && width <= MAX_WIDTH
+ && !unpack->SwapBytes) {
/* Special case: directly write 16-bit depth values */
GLint row;
for (row = 0; row < height; row++) {
@@ -472,7 +473,8 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
&& !scaleOrBias
&& !zoom
&& ctx->Visual.rgbMode
- && width <= MAX_WIDTH) {
+ && width <= MAX_WIDTH
+ && !unpack->SwapBytes) {
/* Special case: shift 32-bit values down to Visual.depthBits */
const GLint shift = 32 - ctx->DrawBuffer->Visual.depthBits;
GLint row;
@@ -617,6 +619,11 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
type = GL_FLOAT;
transferOps &= IMAGE_POST_CONVOLUTION_BITS;
}
+ else if (ctx->Pixel.Convolution1DEnabled) {
+ /* we only want to apply 1D convolution to glTexImage1D */
+ transferOps &= ~(IMAGE_CONVOLUTION_BIT |
+ IMAGE_POST_CONVOLUTION_SCALE_BIAS);
+ }
if (ctx->DrawBuffer->_NumColorDrawBuffers[0] > 0 &&
ctx->DrawBuffer->_ColorDrawBuffers[0][0]->DataType != GL_FLOAT &&
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index 383d61ce06e..fe9a70f4eae 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -119,7 +119,7 @@ read_depth_pixels( GLcontext *ctx,
&& !biasOrScale && !packing->SwapBytes) {
/* Special case: directly read 24-bit unsigned depth values. */
GLint j;
- ASSERT(rb->InternalFormat == GL_DEPTH_COMPONENT32);
+ ASSERT(rb->InternalFormat == GL_DEPTH_COMPONENT24);
ASSERT(rb->DataType == GL_UNSIGNED_INT);
for (j = 0; j < height; j++, y++) {
GLuint *dest = (GLuint *)
@@ -410,6 +410,10 @@ read_rgba_pixels( GLcontext *ctx,
= (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
format, type, 0, 0);
+ /* make sure we don't apply 1D convolution */
+ transferOps &= ~(IMAGE_CONVOLUTION_BIT |
+ IMAGE_POST_CONVOLUTION_SCALE_BIAS);
+
for (row = 0; row < height; row++, y++) {
/* Get float rgba pixels */
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index a8aa1d4b6dc..43475c0e816 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -1154,7 +1154,7 @@ _swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
const GLuint stencilMax = (1 << stencilBits) - 1;
GLint x, y, width, height;
- if (!rb || mask == 0)
+ if (!rb || mask == 0 || !rb->Data)
return;
ASSERT(rb->DataType == GL_UNSIGNED_BYTE ||