diff options
author | Brian Paul <brianp@vmware.com> | 2009-10-24 12:04:09 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-10-24 12:04:09 -0600 |
commit | bea245ac2fecc312caec8f4af53174e4fb180103 (patch) | |
tree | 03fca8c7059ded27630f46bebdb51040e5d2fd4e | |
parent | 5c8282769601ba30c00f04dac15d1dad6d67db6e (diff) |
mesa: minor clean-ups in _mesa_store_compressed_texsubimage2d()
-rw-r--r-- | src/mesa/main/texstore.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index ff6931156e..e6a63b8603 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3670,6 +3670,7 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, GLubyte *dest; const GLubyte *src; const gl_format texFormat = texImage->TexFormat; + const GLint destWidth = texImage->Width; GLuint bw, bh; _mesa_get_format_block_size(texFormat, &bw, &bh); @@ -3693,15 +3694,15 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, srcRowStride = _mesa_compressed_row_stride(texFormat, width); src = (const GLubyte *) data; - destRowStride = _mesa_compressed_row_stride(texFormat, texImage->Width); + destRowStride = _mesa_compressed_row_stride(texFormat, destWidth); dest = _mesa_compressed_image_address(xoffset, yoffset, 0, - texFormat, - texImage->Width, + texFormat, destWidth, (GLubyte *) texImage->Data); - bytesPerRow = srcRowStride; + bytesPerRow = srcRowStride; /* bytes per row of blocks */ rows = height / bh; /* rows in blocks */ + /* copy rows of blocks */ for (i = 0; i < rows; i++) { MEMCPY(dest, src, bytesPerRow); dest += destRowStride; |