aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/mipmap.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-03-21 19:36:05 +0100
committermarha <marha@users.sourceforge.net>2014-03-21 19:36:05 +0100
commit41fea4472dec859ddec76bdfa7108ebec71de1e3 (patch)
tree385ccec6dc105acc75169122d4e0714046cfbbd5 /mesalib/src/mesa/main/mipmap.c
parentcd8b0d0de3fcb53f6d3ece8ce26d97aaab2c0914 (diff)
downloadvcxsrv-41fea4472dec859ddec76bdfa7108ebec71de1e3.tar.gz
vcxsrv-41fea4472dec859ddec76bdfa7108ebec71de1e3.tar.bz2
vcxsrv-41fea4472dec859ddec76bdfa7108ebec71de1e3.zip
xserver fontconfig libX11 libXext libxcb mesa git update 21 Mar 2014
xserver commit 4fb31e4824d46edc80bb49b4065152899faa5ac6 libxcb commit cb686b576739deea00180c54697c8b62b8419ae0 libX11 commit 8be4610939b833587954957f5963eb4191b43d19 libXext commit 11aad96bd689d54156064d2e81213dc827a689d1 fontconfig commit 5478192f379d784b421329e4bf72cc780818e467 mesa commit 8d8d0cb09eb8735a04fc36cc4d0e2dc9f9d460eb
Diffstat (limited to 'mesalib/src/mesa/main/mipmap.c')
-rw-r--r--mesalib/src/mesa/main/mipmap.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/mesalib/src/mesa/main/mipmap.c b/mesalib/src/mesa/main/mipmap.c
index 521b2d8eb..cc109cc52 100644
--- a/mesalib/src/mesa/main/mipmap.c
+++ b/mesalib/src/mesa/main/mipmap.c
@@ -1548,23 +1548,18 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border,
const GLint dstDepthNB = dstDepth - 2 * border;
GLint img, row;
GLint bytesPerSrcImage, bytesPerDstImage;
- GLint bytesPerSrcRow, bytesPerDstRow;
GLint srcImageOffset, srcRowOffset;
(void) srcDepthNB; /* silence warnings */
-
- bytesPerSrcImage = srcWidth * srcHeight * bpt;
- bytesPerDstImage = dstWidth * dstHeight * bpt;
-
- bytesPerSrcRow = srcWidth * bpt;
- bytesPerDstRow = dstWidth * bpt;
+ bytesPerSrcImage = srcRowStride * srcHeight * bpt;
+ bytesPerDstImage = dstRowStride * dstHeight * bpt;
/* Offset between adjacent src images to be averaged together */
srcImageOffset = (srcDepth == dstDepth) ? 0 : 1;
/* Offset between adjacent src rows to be averaged together */
- srcRowOffset = (srcHeight == dstHeight) ? 0 : srcWidth * bpt;
+ srcRowOffset = (srcHeight == dstHeight) ? 0 : srcRowStride;
/*
* Need to average together up to 8 src pixels for each dest pixel.
@@ -1582,14 +1577,14 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border,
for (img = 0; img < dstDepthNB; img++) {
/* first source image pointer, skipping border */
const GLubyte *imgSrcA = srcPtr[img * 2 + border]
- + bytesPerSrcRow * border + bpt * border;
+ + srcRowStride * border + bpt * border;
/* second source image pointer, skipping border */
const GLubyte *imgSrcB = srcPtr[img * 2 + srcImageOffset + border]
- + bytesPerSrcRow * border + bpt * border;
+ + srcRowStride * border + bpt * border;
/* address of the dest image, skipping border */
GLubyte *imgDst = dstPtr[img + border]
- + bytesPerDstRow * border + bpt * border;
+ + dstRowStride * border + bpt * border;
/* setup the four source row pointers and the dest row pointer */
const GLubyte *srcImgARowA = imgSrcA;
@@ -1605,11 +1600,11 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border,
dstWidthNB, dstImgRow);
/* advance to next rows */
- srcImgARowA += bytesPerSrcRow + srcRowOffset;
- srcImgARowB += bytesPerSrcRow + srcRowOffset;
- srcImgBRowA += bytesPerSrcRow + srcRowOffset;
- srcImgBRowB += bytesPerSrcRow + srcRowOffset;
- dstImgRow += bytesPerDstRow;
+ srcImgARowA += srcRowStride + srcRowOffset;
+ srcImgARowB += srcRowStride + srcRowOffset;
+ srcImgBRowA += srcRowStride + srcRowOffset;
+ srcImgBRowB += srcRowStride + srcRowOffset;
+ dstImgRow += dstRowStride;
}
}
@@ -1638,8 +1633,8 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border,
memcpy(dst, src, bpt);
/* do border along [img][row=dstHeight-1][col=0] */
- src = srcPtr[img * 2] + (srcHeight - 1) * bytesPerSrcRow;
- dst = dstPtr[img] + (dstHeight - 1) * bytesPerDstRow;
+ src = srcPtr[img * 2] + (srcHeight - 1) * srcRowStride;
+ dst = dstPtr[img] + (dstHeight - 1) * dstRowStride;
memcpy(dst, src, bpt);
/* do border along [img][row=0][col=dstWidth-1] */
@@ -1668,10 +1663,10 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border,
/* do border along [img][row=dstHeight-1][col=0] */
srcA = srcPtr[img * 2 + 0]
- + (srcHeight - 1) * bytesPerSrcRow;
+ + (srcHeight - 1) * srcRowStride;
srcB = srcPtr[img * 2 + srcImageOffset]
- + (srcHeight - 1) * bytesPerSrcRow;
- dst = dstPtr[img] + (dstHeight - 1) * bytesPerDstRow;
+ + (srcHeight - 1) * srcRowStride;
+ dst = dstPtr[img] + (dstHeight - 1) * dstRowStride;
do_row(datatype, comps, 1, srcA, srcB, 1, dst);
/* do border along [img][row=0][col=dstWidth-1] */
@@ -1746,6 +1741,7 @@ _mesa_generate_mipmap_level(GLenum target,
}
break;
case GL_TEXTURE_2D_ARRAY_EXT:
+ case GL_TEXTURE_CUBE_MAP_ARRAY:
for (i = 0; i < dstDepth; i++) {
make_2d_mipmap(datatype, comps, border,
srcWidth, srcHeight, srcData[i], srcRowStride,
@@ -1788,7 +1784,8 @@ _mesa_next_mipmap_level_size(GLenum target, GLint border,
}
if ((srcDepth - 2 * border > 1) &&
- (target != GL_TEXTURE_2D_ARRAY_EXT)) {
+ (target != GL_TEXTURE_2D_ARRAY_EXT &&
+ target != GL_TEXTURE_CUBE_MAP_ARRAY)) {
*dstDepth = (srcDepth - 2 * border) / 2 + 2 * border;
}
else {
@@ -2029,7 +2026,8 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
/* only two types of compressed textures at this time */
assert(texObj->Target == GL_TEXTURE_2D ||
texObj->Target == GL_TEXTURE_2D_ARRAY ||
- texObj->Target == GL_TEXTURE_CUBE_MAP_ARB);
+ texObj->Target == GL_TEXTURE_CUBE_MAP_ARB ||
+ texObj->Target == GL_TEXTURE_CUBE_MAP_ARRAY);
/*
* Choose a format for the temporary, uncompressed base image.