aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texcompress_s3tc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/texcompress_s3tc.c')
-rw-r--r--src/mesa/main/texcompress_s3tc.c39
1 files changed, 7 insertions, 32 deletions
diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c
index ed7eae4f46d..995e079fd89 100644
--- a/src/mesa/main/texcompress_s3tc.c
+++ b/src/mesa/main/texcompress_s3tc.c
@@ -165,15 +165,10 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS)
{
const GLubyte *pixels;
GLubyte *dst;
- const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */
const GLubyte *tempImage = NULL;
ASSERT(dstFormat == MESA_FORMAT_RGB_DXT1 ||
dstFormat == MESA_FORMAT_SRGB_DXT1);
- ASSERT(dstXoffset % 4 == 0);
- ASSERT(dstYoffset % 4 == 0);
- ASSERT(dstZoffset % 4 == 0);
- (void) dstZoffset;
if (srcFormat != GL_RGB ||
srcType != GL_UNSIGNED_BYTE ||
@@ -197,9 +192,7 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS)
srcFormat, srcType, 0, 0);
}
- dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
- dstFormat,
- texWidth, dstSlices[0]);
+ dst = dstSlices[0];
if (ext_tx_compress_dxtn) {
(*ext_tx_compress_dxtn)(3, srcWidth, srcHeight, pixels,
@@ -225,15 +218,10 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS)
{
const GLubyte *pixels;
GLubyte *dst;
- const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */
const GLubyte *tempImage = NULL;
ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT1 ||
dstFormat == MESA_FORMAT_SRGBA_DXT1);
- ASSERT(dstXoffset % 4 == 0);
- ASSERT(dstYoffset % 4 == 0);
- ASSERT(dstZoffset % 4 == 0);
- (void) dstZoffset;
if (srcFormat != GL_RGBA ||
srcType != GL_UNSIGNED_BYTE ||
@@ -257,9 +245,8 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS)
srcFormat, srcType, 0, 0);
}
- dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
- dstFormat,
- texWidth, dstSlices[0]);
+ dst = dstSlices[0];
+
if (ext_tx_compress_dxtn) {
(*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels,
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
@@ -284,15 +271,10 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS)
{
const GLubyte *pixels;
GLubyte *dst;
- const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */
const GLubyte *tempImage = NULL;
ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT3 ||
dstFormat == MESA_FORMAT_SRGBA_DXT3);
- ASSERT(dstXoffset % 4 == 0);
- ASSERT(dstYoffset % 4 == 0);
- ASSERT(dstZoffset % 4 == 0);
- (void) dstZoffset;
if (srcFormat != GL_RGBA ||
srcType != GL_UNSIGNED_BYTE ||
@@ -315,9 +297,8 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS)
srcFormat, srcType, 0, 0);
}
- dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
- dstFormat,
- texWidth, dstSlices[0]);
+ dst = dstSlices[0];
+
if (ext_tx_compress_dxtn) {
(*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels,
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,
@@ -342,15 +323,10 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS)
{
const GLubyte *pixels;
GLubyte *dst;
- const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */
const GLubyte *tempImage = NULL;
ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT5 ||
dstFormat == MESA_FORMAT_SRGBA_DXT5);
- ASSERT(dstXoffset % 4 == 0);
- ASSERT(dstYoffset % 4 == 0);
- ASSERT(dstZoffset % 4 == 0);
- (void) dstZoffset;
if (srcFormat != GL_RGBA ||
srcType != GL_UNSIGNED_BYTE ||
@@ -373,9 +349,8 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS)
srcFormat, srcType, 0, 0);
}
- dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
- dstFormat,
- texWidth, dstSlices[0]);
+ dst = dstSlices[0];
+
if (ext_tx_compress_dxtn) {
(*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels,
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,