summaryrefslogtreecommitdiff
path: root/src/mesa/main/texcompress_s3tc.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-05-20 16:19:48 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-05-20 16:19:48 +0000
commitb0b6d1abe5c7e629baebd4bf3d3ee3b17ba6ff08 (patch)
treeebac2d5b8cf7d29a38beb6bc7854b5f67a8b9524 /src/mesa/main/texcompress_s3tc.c
parent226d0187b530482684f3a0dddd0934bd015eb986 (diff)
In gl_texture_image, replace ImageStride with an ImageOffsets array.
Some hardware lays out 3D mipmaps in a manner that can't be expressed with a simple image stride. The ImageOffsets array is allocated and initialized to typical defaults in the _mesa_init_teximage_fields() function. If needed, a driver will then have to replace these offsets. TexStore and TexelFetch routines updated to use offsets array.
Diffstat (limited to 'src/mesa/main/texcompress_s3tc.c')
-rw-r--r--src/mesa/main/texcompress_s3tc.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c
index c572e19e49..656a3d329c 100644
--- a/src/mesa/main/texcompress_s3tc.c
+++ b/src/mesa/main/texcompress_s3tc.c
@@ -88,7 +88,7 @@ _mesa_init_texture_s3tc( GLcontext *ctx )
dxtlibhandle = dlopen (DXTN_EXT, RTLD_LAZY | RTLD_GLOBAL);
if (!dxtlibhandle) {
_mesa_warning(ctx, "couldn't open " DXTN_EXT ", software DXTn "
- "compression/decompression unavailable\n");
+ "compression/decompression unavailable");
}
else {
/* the fetch functions are not per context! Might be problematic... */
@@ -109,7 +109,7 @@ _mesa_init_texture_s3tc( GLcontext *ctx )
if (ext_tx_compress_dxtn == NULL) {
_mesa_warning(ctx, "couldn't reference all symbols in "
DXTN_EXT ", software DXTn compression/decompression "
- "unavailable\n");
+ "unavailable");
fetch_ext_rgb_dxt1 = NULL;
fetch_ext_rgba_dxt1 = NULL;
fetch_ext_rgba_dxt3 = NULL;
@@ -122,7 +122,7 @@ _mesa_init_texture_s3tc( GLcontext *ctx )
}
if (dxtlibhandle) {
ctx->Mesa_DXTn = GL_TRUE;
- _mesa_warning(ctx, "software DXTn compression/decompression available\n");
+ _mesa_warning(ctx, "software DXTn compression/decompression available");
}
#else
(void) ctx;
@@ -133,7 +133,7 @@ _mesa_init_texture_s3tc( GLcontext *ctx )
* Called via TexFormat->StoreImage to store an RGB_DXT1 texture.
*/
static GLboolean
-texstore_rgb_dxt1(STORE_PARAMS)
+texstore_rgb_dxt1(TEXSTORE_PARAMS)
{
const GLchan *pixels;
GLint srcRowStride;
@@ -145,7 +145,8 @@ texstore_rgb_dxt1(STORE_PARAMS)
ASSERT(dstXoffset % 4 == 0);
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset % 4 == 0);
- (void) dstZoffset; (void) dstImageStride;
+ (void) dstZoffset;
+ (void) dstImageOffsets;
if (srcFormat != GL_RGB ||
srcType != CHAN_TYPE ||
@@ -195,7 +196,7 @@ texstore_rgb_dxt1(STORE_PARAMS)
* Called via TexFormat->StoreImage to store an RGBA_DXT1 texture.
*/
static GLboolean
-texstore_rgba_dxt1(STORE_PARAMS)
+texstore_rgba_dxt1(TEXSTORE_PARAMS)
{
const GLchan *pixels;
GLint srcRowStride;
@@ -207,7 +208,8 @@ texstore_rgba_dxt1(STORE_PARAMS)
ASSERT(dstXoffset % 4 == 0);
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset % 4 == 0);
- (void) dstZoffset; (void) dstImageStride;
+ (void) dstZoffset;
+ (void) dstImageOffsets;
if (srcFormat != GL_RGBA ||
srcType != CHAN_TYPE ||
@@ -256,7 +258,7 @@ texstore_rgba_dxt1(STORE_PARAMS)
* Called via TexFormat->StoreImage to store an RGBA_DXT3 texture.
*/
static GLboolean
-texstore_rgba_dxt3(STORE_PARAMS)
+texstore_rgba_dxt3(TEXSTORE_PARAMS)
{
const GLchan *pixels;
GLint srcRowStride;
@@ -268,7 +270,8 @@ texstore_rgba_dxt3(STORE_PARAMS)
ASSERT(dstXoffset % 4 == 0);
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset % 4 == 0);
- (void) dstZoffset; (void) dstImageStride;
+ (void) dstZoffset;
+ (void) dstImageOffsets;
if (srcFormat != GL_RGBA ||
srcType != CHAN_TYPE ||
@@ -316,7 +319,7 @@ texstore_rgba_dxt3(STORE_PARAMS)
* Called via TexFormat->StoreImage to store an RGBA_DXT5 texture.
*/
static GLboolean
-texstore_rgba_dxt5(STORE_PARAMS)
+texstore_rgba_dxt5(TEXSTORE_PARAMS)
{
const GLchan *pixels;
GLint srcRowStride;
@@ -328,7 +331,8 @@ texstore_rgba_dxt5(STORE_PARAMS)
ASSERT(dstXoffset % 4 == 0);
ASSERT(dstYoffset % 4 == 0);
ASSERT(dstZoffset % 4 == 0);
- (void) dstZoffset; (void) dstImageStride;
+ (void) dstZoffset;
+ (void) dstImageOffsets;
if (srcFormat != GL_RGBA ||
srcType != CHAN_TYPE ||