summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstore.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r--src/mesa/main/texstore.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 615ba63362e..3314e557c0a 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -1360,10 +1360,17 @@ _mesa_store_compressed_texsubimage(struct gl_context *ctx, GLuint dims,
if (dstMap) {
/* copy rows of blocks */
- for (i = 0; i < store.CopyRowsPerSlice; i++) {
- memcpy(dstMap, src, store.CopyBytesPerRow);
- dstMap += dstRowStride;
- src += store.TotalBytesPerRow;
+ if (dstRowStride == store.TotalBytesPerRow &&
+ dstRowStride == store.CopyBytesPerRow) {
+ memcpy(dstMap, src, store.CopyBytesPerRow * store.CopyRowsPerSlice);
+ src += store.CopyBytesPerRow * store.CopyRowsPerSlice;
+ }
+ else {
+ for (i = 0; i < store.CopyRowsPerSlice; i++) {
+ memcpy(dstMap, src, store.CopyBytesPerRow);
+ dstMap += dstRowStride;
+ src += store.TotalBytesPerRow;
+ }
}
ctx->Driver.UnmapTextureImage(ctx, texImage, slice + zoffset);