summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstore.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-05-05 00:28:01 +0000
committerBrian Paul <[email protected]>2004-05-05 00:28:01 +0000
commit9c1b13ff6a2fb873cada61271f382a912ad99631 (patch)
tree9b9ef946ddf83bd87b6dece5136e116bc5c99870 /src/mesa/main/texstore.c
parent07cc9af601301eb3c447833337f549fef51b932a (diff)
fix a few bugs when using GL_REDUCE convolution mode
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r--src/mesa/main/texstore.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index bcc6f1dd539..75845b11bac 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -430,9 +430,9 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims,
srcFormat, srcType,
img, 0, 0);
for (row = 0; row < srcHeight; row++) {
- _mesa_unpack_color_span_chan(ctx, srcWidth, logicalBaseFormat,
- dst, srcFormat, srcType, src,
- srcPacking, transferOps);
+ _mesa_unpack_color_span_chan(ctx, srcWidth, logicalBaseFormat, dst,
+ srcFormat, srcType, src, srcPacking,
+ transferOps);
dst += srcWidth * components;
src += srcStride;
}
@@ -644,7 +644,7 @@ _mesa_texstore_rgba(GLcontext *ctx, GLuint dims,
srcFormat, srcType, srcAddr,
srcPacking);
const GLchan *src = tempImage;
- const GLint bytesPerRow = srcWidth * components * sizeof(GLchan);
+ GLint bytesPerRow;
GLubyte *dstImage = (GLubyte *) dstAddr
+ dstZoffset * dstImageStride
+ dstYoffset * dstRowStride
@@ -653,6 +653,7 @@ _mesa_texstore_rgba(GLcontext *ctx, GLuint dims,
if (!tempImage)
return GL_FALSE;
_mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight);
+ bytesPerRow = srcWidth * components * sizeof(GLchan);
for (img = 0; img < srcDepth; img++) {
GLubyte *dstRow = dstImage;
for (row = 0; row < srcHeight; row++) {
@@ -1537,7 +1538,7 @@ _mesa_texstore_rgba_float32(STORE_PARAMS)
srcFormat, srcType, srcAddr,
srcPacking);
const GLfloat *src = tempImage;
- const GLint bytesPerRow = srcWidth * components * sizeof(GLfloat);
+ GLint bytesPerRow;
GLubyte *dstImage = (GLubyte *) dstAddr
+ dstZoffset * dstImageStride
+ dstYoffset * dstRowStride
@@ -1546,6 +1547,7 @@ _mesa_texstore_rgba_float32(STORE_PARAMS)
if (!tempImage)
return GL_FALSE;
_mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight);
+ bytesPerRow = srcWidth * components * sizeof(GLfloat);
for (img = 0; img < srcDepth; img++) {
GLubyte *dst = dstImage;
for (row = 0; row < srcHeight; row++) {
@@ -1812,7 +1814,7 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level,
dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat,width);
}
else {
- dstRowStride = width * texImage->TexFormat->TexelBytes;
+ dstRowStride = postConvWidth * texImage->TexFormat->TexelBytes;
}
ASSERT(texImage->TexFormat->StoreImage);
success = texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,