summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/common/texmem.c2
-rw-r--r--src/mesa/drivers/dri/common/texmem.h13
-rw-r--r--src/mesa/drivers/dri/gamma/gamma_context.h2
-rw-r--r--src/mesa/drivers/dri/gamma/gamma_texstate.c18
-rw-r--r--src/mesa/drivers/dri/i810/i810texstate.c18
-rw-r--r--src/mesa/drivers/dri/i830/i830_texstate.c18
-rw-r--r--src/mesa/drivers/dri/mga/mga_texstate.c20
-rw-r--r--src/mesa/drivers/dri/mga/mgatexmem.c2
-rw-r--r--src/mesa/drivers/dri/r128/r128_texmem.c2
-rw-r--r--src/mesa/drivers/dri/r128/r128_texstate.c22
-rw-r--r--src/mesa/drivers/dri/r200/r200_texmem.c21
-rw-r--r--src/mesa/drivers/dri/r200/r200_texstate.c24
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_subset_tex.c12
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_swtcl.c2
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texmem.c21
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texstate.c24
-rw-r--r--src/mesa/drivers/dri/sis/sis_texstate.c6
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_tex.c20
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_texman.c26
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_texstate.c12
20 files changed, 124 insertions, 161 deletions
diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c
index 53e87b95930..a40d33f1e9d 100644
--- a/src/mesa/drivers/dri/common/texmem.c
+++ b/src/mesa/drivers/dri/common/texmem.c
@@ -1183,7 +1183,7 @@ driCalculateTextureFirstLastLevel( driTextureObject * t )
{
struct gl_texture_object * const tObj = t->tObj;
const struct gl_texture_image * const baseImage =
- tObj->Image[tObj->BaseLevel];
+ tObj->Image[0][tObj->BaseLevel];
/* These must be signed values. MinLod and MaxLod can be negative numbers,
* and having firstLevel and lastLevel as signed prevents the need for
diff --git a/src/mesa/drivers/dri/common/texmem.h b/src/mesa/drivers/dri/common/texmem.h
index 9afbb0c865b..f0c416fc611 100644
--- a/src/mesa/drivers/dri/common/texmem.h
+++ b/src/mesa/drivers/dri/common/texmem.h
@@ -89,16 +89,17 @@ struct dri_texture_object {
* the framebuffer.
*/
- unsigned firstLevel; /**< Image in \c tObj->Image that
+ unsigned firstLevel; /**< Image in \c tObj->Image[0] that
* corresponds to the base-level of
* this texture object.
*/
- unsigned lastLevel; /**< Last image in \c tObj->Image used
- * by the current LOD settings of this
- * texture object. This value must be
- * greater than or equal to
- * \c firstLevel.
+ unsigned lastLevel; /**< Last image in \c tObj->Image[0]
+ * used by the
+ * current LOD settings of
+ * this texture object. This
+ * value must be greater than
+ * or equal to \c firstLevel.
*/
};
diff --git a/src/mesa/drivers/dri/gamma/gamma_context.h b/src/mesa/drivers/dri/gamma/gamma_context.h
index 92836178b62..3db5b23cb04 100644
--- a/src/mesa/drivers/dri/gamma/gamma_context.h
+++ b/src/mesa/drivers/dri/gamma/gamma_context.h
@@ -149,7 +149,7 @@ struct gamma_texture_object_t {
GLuint max_level;
GLuint dirty_images;
- GLint firstLevel, lastLevel; /* upload tObj->Image[first .. lastLevel] */
+ GLint firstLevel, lastLevel; /* upload tObj->Image[0][first .. lastLevel] */
struct {
const struct gl_texture_image *image;
diff --git a/src/mesa/drivers/dri/gamma/gamma_texstate.c b/src/mesa/drivers/dri/gamma/gamma_texstate.c
index dfd82b489c4..a8d1b253c7b 100644
--- a/src/mesa/drivers/dri/gamma/gamma_texstate.c
+++ b/src/mesa/drivers/dri/gamma/gamma_texstate.c
@@ -17,7 +17,7 @@ static void gammaSetTexImages( gammaContextPtr gmesa,
{
GLuint height, width, pitch, i, log_pitch;
gammaTextureObjectPtr t = (gammaTextureObjectPtr) tObj->DriverData;
- const struct gl_texture_image *baseImage = tObj->Image[tObj->BaseLevel];
+ const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
GLint firstLevel, lastLevel, numLevels;
GLint log2Width, log2Height;
@@ -49,15 +49,15 @@ static void gammaSetTexImages( gammaContextPtr gmesa,
numLevels = lastLevel - firstLevel + 1;
- log2Width = tObj->Image[firstLevel]->WidthLog2;
- log2Height = tObj->Image[firstLevel]->HeightLog2;
+ log2Width = tObj->Image[0][firstLevel]->WidthLog2;
+ log2Height = tObj->Image[0][firstLevel]->HeightLog2;
/* Figure out the amount of memory required to hold all the mipmap
* levels. Choose the smallest pitch to accomodate the largest
* mipmap:
*/
- width = tObj->Image[firstLevel]->Width * t->texelBytes;
+ width = tObj->Image[0][firstLevel]->Width * t->texelBytes;
for (pitch = 32, log_pitch=2 ; pitch < width ; pitch *= 2 )
log_pitch++;
@@ -65,7 +65,7 @@ static void gammaSetTexImages( gammaContextPtr gmesa,
* lines required:
*/
for ( height = i = 0 ; i < numLevels ; i++ ) {
- t->image[i].image = tObj->Image[firstLevel + i];
+ t->image[i].image = tObj->Image[0][firstLevel + i];
t->image[i].offset = height * pitch;
t->image[i].internalFormat = baseImage->Format;
height += t->image[i].image->Height;
@@ -86,7 +86,7 @@ static void gammaUpdateTexEnv( GLcontext *ctx, GLuint unit )
{
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
const struct gl_texture_object *tObj = texUnit->_Current;
- const GLuint format = tObj->Image[tObj->BaseLevel]->Format;
+ const GLuint format = tObj->Image[0][tObj->BaseLevel]->Format;
gammaTextureObjectPtr t = (gammaTextureObjectPtr)tObj->DriverData;
GLuint tc;
@@ -167,7 +167,7 @@ static void gammaUpdateTexUnit( GLcontext *ctx, GLuint unit )
}
#if 0
- if (tObj->Image[tObj->BaseLevel]->Border > 0) {
+ if (tObj->Image[0][tObj->BaseLevel]->Border > 0) {
FALLBACK( gmesa, GAMMA_FALLBACK_TEXTURE, GL_TRUE );
return;
}
@@ -185,8 +185,8 @@ static void gammaUpdateTexUnit( GLcontext *ctx, GLuint unit )
/* Update texture environment if texture object image format or
* texture environment state has changed.
*/
- if (tObj->Image[tObj->BaseLevel]->Format != gmesa->TexEnvImageFmt[unit]) {
- gmesa->TexEnvImageFmt[unit] = tObj->Image[tObj->BaseLevel]->Format;
+ if (tObj->Image[0][tObj->BaseLevel]->Format != gmesa->TexEnvImageFmt[unit]) {
+ gmesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->Format;
gammaUpdateTexEnv( ctx, unit );
}
}
diff --git a/src/mesa/drivers/dri/i810/i810texstate.c b/src/mesa/drivers/dri/i810/i810texstate.c
index 05f685c5881..e100c565cbf 100644
--- a/src/mesa/drivers/dri/i810/i810texstate.c
+++ b/src/mesa/drivers/dri/i810/i810texstate.c
@@ -46,7 +46,7 @@ static void i810SetTexImages( i810ContextPtr imesa,
{
GLuint height, width, pitch, i, textureFormat, log_pitch;
i810TextureObjectPtr t = (i810TextureObjectPtr) tObj->DriverData;
- const struct gl_texture_image *baseImage = tObj->Image[tObj->BaseLevel];
+ const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
GLint numLevels;
GLint log2Width, log2Height;
@@ -84,14 +84,14 @@ static void i810SetTexImages( i810ContextPtr imesa,
numLevels = t->base.lastLevel - t->base.firstLevel + 1;
- log2Width = tObj->Image[t->base.firstLevel]->WidthLog2;
- log2Height = tObj->Image[t->base.firstLevel]->HeightLog2;
+ log2Width = tObj->Image[0][t->base.firstLevel]->WidthLog2;
+ log2Height = tObj->Image[0][t->base.firstLevel]->HeightLog2;
/* Figure out the amount of memory required to hold all the mipmap
* levels. Choose the smallest pitch to accomodate the largest
* mipmap:
*/
- width = tObj->Image[t->base.firstLevel]->Width * t->texelBytes;
+ width = tObj->Image[0][t->base.firstLevel]->Width * t->texelBytes;
for (pitch = 32, log_pitch=2 ; pitch < width ; pitch *= 2 )
log_pitch++;
@@ -99,7 +99,7 @@ static void i810SetTexImages( i810ContextPtr imesa,
* lines required:
*/
for ( height = i = 0 ; i < numLevels ; i++ ) {
- t->image[i].image = tObj->Image[t->base.firstLevel + i];
+ t->image[i].image = tObj->Image[0][t->base.firstLevel + i];
t->image[i].offset = height * pitch;
t->image[i].internalFormat = baseImage->Format;
height += t->image[i].image->Height;
@@ -553,7 +553,7 @@ static void i810UpdateTexEnv( GLcontext *ctx, GLuint unit )
i810ContextPtr imesa = I810_CONTEXT(ctx);
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
const struct gl_texture_object *tObj = texUnit->_Current;
- const GLuint format = tObj->Image[tObj->BaseLevel]->Format;
+ const GLuint format = tObj->Image[0][tObj->BaseLevel]->Format;
GLuint color_combine, alpha_combine;
switch (texUnit->EnvMode) {
@@ -692,7 +692,7 @@ static void i810UpdateTexUnit( GLcontext *ctx, GLuint unit )
}
}
- if (tObj->Image[tObj->BaseLevel]->Border > 0) {
+ if (tObj->Image[0][tObj->BaseLevel]->Border > 0) {
FALLBACK( imesa, I810_FALLBACK_TEXTURE, GL_TRUE );
return;
}
@@ -712,8 +712,8 @@ static void i810UpdateTexUnit( GLcontext *ctx, GLuint unit )
/* Update texture environment if texture object image format or
* texture environment state has changed.
*/
- if (tObj->Image[tObj->BaseLevel]->Format != imesa->TexEnvImageFmt[unit]) {
- imesa->TexEnvImageFmt[unit] = tObj->Image[tObj->BaseLevel]->Format;
+ if (tObj->Image[0][tObj->BaseLevel]->Format != imesa->TexEnvImageFmt[unit]) {
+ imesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->Format;
i810UpdateTexEnv( ctx, unit );
}
}
diff --git a/src/mesa/drivers/dri/i830/i830_texstate.c b/src/mesa/drivers/dri/i830/i830_texstate.c
index 34f13d81338..8e93a5b8fef 100644
--- a/src/mesa/drivers/dri/i830/i830_texstate.c
+++ b/src/mesa/drivers/dri/i830/i830_texstate.c
@@ -61,7 +61,7 @@ static void i830SetTexImages( i830ContextPtr imesa,
{
GLuint total_height, pitch, i, textureFormat;
i830TextureObjectPtr t = (i830TextureObjectPtr) tObj->DriverData;
- const struct gl_texture_image *baseImage = tObj->Image[tObj->BaseLevel];
+ const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
GLint numLevels;
switch( baseImage->TexFormat->MesaFormat ) {
@@ -135,11 +135,11 @@ static void i830SetTexImages( i830ContextPtr imesa,
*/
if (0) {
pitch = 128;
- while (pitch < tObj->Image[t->base.firstLevel]->Width * t->texelBytes)
+ while (pitch < tObj->Image[0][t->base.firstLevel]->Width * t->texelBytes)
pitch *= 2;
}
else {
- pitch = tObj->Image[t->base.firstLevel]->Width * t->texelBytes;
+ pitch = tObj->Image[0][t->base.firstLevel]->Width * t->texelBytes;
pitch = (pitch + 3) & ~3;
}
@@ -148,7 +148,7 @@ static void i830SetTexImages( i830ContextPtr imesa,
* lines required:
*/
for ( total_height = i = 0 ; i < numLevels ; i++ ) {
- t->image[0][i].image = tObj->Image[t->base.firstLevel + i];
+ t->image[0][i].image = tObj->Image[0][t->base.firstLevel + i];
if (!t->image[0][i].image)
break;
@@ -160,8 +160,8 @@ static void i830SetTexImages( i830ContextPtr imesa,
t->Pitch = pitch;
t->base.totalSize = total_height*pitch;
t->Setup[I830_TEXREG_TM0S1] =
- (((tObj->Image[t->base.firstLevel]->Height - 1) << TM0S1_HEIGHT_SHIFT) |
- ((tObj->Image[t->base.firstLevel]->Width - 1) << TM0S1_WIDTH_SHIFT) |
+ (((tObj->Image[0][t->base.firstLevel]->Height - 1) << TM0S1_HEIGHT_SHIFT) |
+ ((tObj->Image[0][t->base.firstLevel]->Width - 1) << TM0S1_WIDTH_SHIFT) |
textureFormat);
t->Setup[I830_TEXREG_TM0S2] =
((((pitch / 4) - 1) << TM0S2_PITCH_SHIFT));
@@ -1328,7 +1328,7 @@ static GLboolean enable_tex_common( GLcontext *ctx, GLuint unit )
i830TextureObjectPtr t = (i830TextureObjectPtr)tObj->DriverData;
/* Fallback if there's a texture border */
- if ( tObj->Image[tObj->BaseLevel]->Border > 0 ) {
+ if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 ) {
return GL_FALSE;
}
@@ -1366,9 +1366,9 @@ static GLboolean enable_tex_common( GLcontext *ctx, GLuint unit )
* missed (need to update last stage flag?). Call
* i830UpdateTexEnv always.
*/
- if (tObj->Image[tObj->BaseLevel]->Format !=
+ if (tObj->Image[0][tObj->BaseLevel]->Format !=
imesa->TexEnvImageFmt[unit]) {
- imesa->TexEnvImageFmt[unit] = tObj->Image[tObj->BaseLevel]->Format;
+ imesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->Format;
}
i830UpdateTexEnv( ctx, unit );
imesa->TexEnabledMask |= I830_TEX_UNIT_ENABLED(unit);
diff --git a/src/mesa/drivers/dri/mga/mga_texstate.c b/src/mesa/drivers/dri/mga/mga_texstate.c
index e22a69e052c..5f63d5ca463 100644
--- a/src/mesa/drivers/dri/mga/mga_texstate.c
+++ b/src/mesa/drivers/dri/mga/mga_texstate.c
@@ -65,7 +65,7 @@ mgaSetTexImages( mgaContextPtr mmesa,
const struct gl_texture_object * tObj )
{
mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData;
- struct gl_texture_image *baseImage = tObj->Image[ tObj->BaseLevel ];
+ struct gl_texture_image *baseImage = tObj->Image[0][ tObj->BaseLevel ];
GLint totalSize;
GLint width, height;
GLint i;
@@ -110,12 +110,12 @@ mgaSetTexImages( mgaContextPtr mmesa,
log2Width = 0;
log2Height = 0;
} else {
- log2Width = tObj->Image[t->base.firstLevel]->WidthLog2;
- log2Height = tObj->Image[t->base.firstLevel]->HeightLog2;
+ log2Width = tObj->Image[0][t->base.firstLevel]->WidthLog2;
+ log2Height = tObj->Image[0][t->base.firstLevel]->HeightLog2;
}
- width = tObj->Image[t->base.firstLevel]->Width;
- height = tObj->Image[t->base.firstLevel]->Height;
+ width = tObj->Image[0][t->base.firstLevel]->Width;
+ height = tObj->Image[0][t->base.firstLevel]->Height;
numLevels = MIN2( t->base.lastLevel - t->base.firstLevel + 1,
MGA_IS_G200(mmesa) ? G200_TEX_MAXLEVELS : G400_TEX_MAXLEVELS);
@@ -124,7 +124,7 @@ mgaSetTexImages( mgaContextPtr mmesa,
totalSize = 0;
for ( i = 0 ; i < numLevels ; i++ ) {
const struct gl_texture_image * const texImage =
- tObj->Image[ i + t->base.firstLevel ];
+ tObj->Image[0][ i + t->base.firstLevel ];
int size;
if (texImage == NULL)
@@ -204,7 +204,7 @@ static void mgaUpdateTextureEnvG200( GLcontext *ctx, GLuint unit )
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
struct gl_texture_object *tObj = ctx->Texture.Unit[0]._Current;
mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData;
- GLenum format = tObj->Image[tObj->BaseLevel]->Format;
+ GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
if (tObj != ctx->Texture.Unit[0].Current2D &&
tObj != ctx->Texture.Unit[0].CurrentRect)
@@ -536,7 +536,7 @@ static GLboolean mgaUpdateTextureEnvBlend( GLcontext *ctx, int unit )
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
const struct gl_texture_object *tObj = texUnit->_Current;
GLuint *reg = ((GLuint *)&mmesa->setup.tdualstage0 + unit);
- GLenum format = tObj->Image[tObj->BaseLevel]->Format;
+ GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
*reg = 0;
@@ -633,7 +633,7 @@ static void mgaUpdateTextureEnvG400( GLcontext *ctx, GLuint unit )
const struct gl_texture_object *tObj = texUnit->_Current;
GLuint *reg = ((GLuint *)&mmesa->setup.tdualstage0 + unit);
mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData;
- GLenum format = tObj->Image[tObj->BaseLevel]->Format;
+ GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
if (tObj != ctx->Texture.Unit[source].Current2D &&
tObj != ctx->Texture.Unit[source].CurrentRect)
@@ -780,7 +780,7 @@ static GLboolean update_tex_common( GLcontext *ctx, int unit )
mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData;
/* Fallback if there's a texture border */
- if ( tObj->Image[tObj->BaseLevel]->Border > 0 ) {
+ if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 ) {
return GL_FALSE;
}
diff --git a/src/mesa/drivers/dri/mga/mgatexmem.c b/src/mesa/drivers/dri/mga/mgatexmem.c
index 66c69bf3e5e..01acb9ee736 100644
--- a/src/mesa/drivers/dri/mga/mgatexmem.c
+++ b/src/mesa/drivers/dri/mga/mgatexmem.c
@@ -105,7 +105,7 @@ static void mgaUploadSubImage( mgaContextPtr mmesa,
return;
}
- texImage = t->base.tObj->Image[level];
+ texImage = t->base.tObj->Image[0][level];
if ( texImage == NULL ) {
fprintf( stderr, "[%s:%d] Image[%d] = NULL\n", __FILE__, __LINE__,
level );
diff --git a/src/mesa/drivers/dri/r128/r128_texmem.c b/src/mesa/drivers/dri/r128/r128_texmem.c
index 7bffaf46287..63ef0f17b44 100644
--- a/src/mesa/drivers/dri/r128/r128_texmem.c
+++ b/src/mesa/drivers/dri/r128/r128_texmem.c
@@ -93,7 +93,7 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t,
if ( ( level < 0 ) || ( level > R128_MAX_TEXTURE_LEVELS ) )
return;
- image = t->base.tObj->Image[level];
+ image = t->base.tObj->Image[0][level];
if ( !image )
return;
diff --git a/src/mesa/drivers/dri/r128/r128_texstate.c b/src/mesa/drivers/dri/r128/r128_texstate.c
index 3c43eb45286..3965bbdb399 100644
--- a/src/mesa/drivers/dri/r128/r128_texstate.c
+++ b/src/mesa/drivers/dri/r128/r128_texstate.c
@@ -51,7 +51,7 @@ static void r128SetTexImages( r128ContextPtr rmesa,
const struct gl_texture_object *tObj )
{
r128TexObjPtr t = (r128TexObjPtr) tObj->DriverData;
- struct gl_texture_image *baseImage = tObj->Image[tObj->BaseLevel];
+ struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
int log2Pitch, log2Height, log2Size, log2MinSize;
int totalSize;
int i;
@@ -96,8 +96,8 @@ static void r128SetTexImages( r128ContextPtr rmesa,
firstLevel = t->base.firstLevel;
lastLevel = t->base.lastLevel;
- log2Pitch = tObj->Image[firstLevel]->WidthLog2;
- log2Height = tObj->Image[firstLevel]->HeightLog2;
+ log2Pitch = tObj->Image[0][firstLevel]->WidthLog2;
+ log2Height = tObj->Image[0][firstLevel]->HeightLog2;
log2Size = MAX2(log2Pitch, log2Height);
log2MinSize = log2Size;
@@ -106,7 +106,7 @@ static void r128SetTexImages( r128ContextPtr rmesa,
for ( i = firstLevel; i <= lastLevel; i++ ) {
const struct gl_texture_image *texImage;
- texImage = tObj->Image[i];
+ texImage = tObj->Image[0][i];
if ( !texImage || !texImage->Data ) {
lastLevel = i - 1;
break;
@@ -115,14 +115,14 @@ static void r128SetTexImages( r128ContextPtr rmesa,
log2MinSize = texImage->MaxLog2;
t->image[i - firstLevel].offset = totalSize;
- t->image[i - firstLevel].width = tObj->Image[i]->Width;
- t->image[i - firstLevel].height = tObj->Image[i]->Height;
+ t->image[i - firstLevel].width = tObj->Image[0][i]->Width;
+ t->image[i - firstLevel].height = tObj->Image[0][i]->Height;
t->base.dirty_images[0] |= (1 << i);
- totalSize += (tObj->Image[i]->Height *
- tObj->Image[i]->Width *
- tObj->Image[i]->TexFormat->TexelBytes);
+ totalSize += (tObj->Image[0][i]->Height *
+ tObj->Image[0][i]->Width *
+ tObj->Image[0][i]->TexFormat->TexelBytes);
/* Offsets must be 32-byte aligned for host data blits and tiling */
totalSize = (totalSize + 31) & ~31;
@@ -199,7 +199,7 @@ static GLboolean r128UpdateTextureEnv( GLcontext *ctx, int unit )
GLint source = rmesa->tmu_source[unit];
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
const struct gl_texture_object *tObj = texUnit->_Current;
- const GLenum format = tObj->Image[tObj->BaseLevel]->Format;
+ const GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
GLuint combine;
if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
@@ -535,7 +535,7 @@ static GLboolean update_tex_common( GLcontext *ctx, int unit )
/* Fallback if there's a texture border */
- if ( tObj->Image[tObj->BaseLevel]->Border > 0 ) {
+ if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 ) {
return GL_FALSE;
}
diff --git a/src/mesa/drivers/dri/r200/r200_texmem.c b/src/mesa/drivers/dri/r200/r200_texmem.c
index 1929397bfb6..ed0ca586903 100644
--- a/src/mesa/drivers/dri/r200/r200_texmem.c
+++ b/src/mesa/drivers/dri/r200/r200_texmem.c
@@ -304,26 +304,7 @@ static void uploadSubImage( r200ContextPtr rmesa, r200TexObjPtr t,
return;
}
- switch (face) {
- case 0:
- texImage = t->base.tObj->Image[level];
- break;
- case 1:
- texImage = t->base.tObj->NegX[level];
- break;
- case 2:
- texImage = t->base.tObj->PosY[level];
- break;
- case 3:
- texImage = t->base.tObj->NegY[level];
- break;
- case 4:
- texImage = t->base.tObj->PosZ[level];
- break;
- case 5:
- texImage = t->base.tObj->NegZ[level];
- break;
- }
+ texImage = t->base.tObj->Image[face][level];
if ( !texImage ) {
if ( R200_DEBUG & DEBUG_TEXTURE )
diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c
index 2eb6962189b..8e171669c43 100644
--- a/src/mesa/drivers/dri/r200/r200_texstate.c
+++ b/src/mesa/drivers/dri/r200/r200_texstate.c
@@ -102,7 +102,7 @@ static void r200SetTexImages( r200ContextPtr rmesa,
struct gl_texture_object *tObj )
{
r200TexObjPtr t = (r200TexObjPtr)tObj->DriverData;
- const struct gl_texture_image *baseImage = tObj->Image[tObj->BaseLevel];
+ const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
GLint curOffset;
GLint i;
GLint numLevels;
@@ -129,9 +129,9 @@ static void r200SetTexImages( r200ContextPtr rmesa,
*/
driCalculateTextureFirstLastLevel( (driTextureObject *) t );
- log2Width = tObj->Image[t->base.firstLevel]->WidthLog2;
- log2Height = tObj->Image[t->base.firstLevel]->HeightLog2;
- log2Depth = tObj->Image[t->base.firstLevel]->DepthLog2;
+ log2Width = tObj->Image[0][t->base.firstLevel]->WidthLog2;
+ log2Height = tObj->Image[0][t->base.firstLevel]->HeightLog2;
+ log2Depth = tObj->Image[0][t->base.firstLevel]->DepthLog2;
numLevels = t->base.lastLevel - t->base.firstLevel + 1;
@@ -147,7 +147,7 @@ static void r200SetTexImages( r200ContextPtr rmesa,
const struct gl_texture_image *texImage;
GLuint size;
- texImage = tObj->Image[i + t->base.firstLevel];
+ texImage = tObj->Image[0][i + t->base.firstLevel];
if ( !texImage )
break;
@@ -255,17 +255,17 @@ static void r200SetTexImages( r200ContextPtr rmesa,
(log2Height << R200_FACE_HEIGHT_4_SHIFT));
}
- t->pp_txsize = (((tObj->Image[t->base.firstLevel]->Width - 1) << 0) |
- ((tObj->Image[t->base.firstLevel]->Height - 1) << 16));
+ t->pp_txsize = (((tObj->Image[0][t->base.firstLevel]->Width - 1) << 0) |
+ ((tObj->Image[0][t->base.firstLevel]->Height - 1) << 16));
/* Only need to round to nearest 32 for textures, but the blitter
* requires 64-byte aligned pitches, and we may/may not need the
* blitter. NPOT only!
*/
if (baseImage->IsCompressed)
- t->pp_txpitch = (tObj->Image[t->base.firstLevel]->Width + 63) & ~(63);
+ t->pp_txpitch = (tObj->Image[0][t->base.firstLevel]->Width + 63) & ~(63);
else
- t->pp_txpitch = ((tObj->Image[t->base.firstLevel]->Width * baseImage->TexFormat->TexelBytes) + 63) & ~(63);
+ t->pp_txpitch = ((tObj->Image[0][t->base.firstLevel]->Width * baseImage->TexFormat->TexelBytes) + 63) & ~(63);
t->pp_txpitch -= 32;
t->dirty_state = TEX_ALL;
@@ -736,7 +736,7 @@ static GLboolean r200UpdateTextureEnv( GLcontext *ctx, int unit )
}
else {
const struct gl_texture_object *tObj = texUnit->_Current;
- const GLenum format = tObj->Image[tObj->BaseLevel]->Format;
+ const GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
GLuint color_arg[3], alpha_arg[3];
GLuint i, numColorArgs = 0, numAlphaArgs = 0;
GLuint RGBshift = texUnit->CombineScaleShiftRGB;
@@ -1606,7 +1606,7 @@ static GLboolean update_tex_common( GLcontext *ctx, int unit )
GLenum format;
/* Fallback if there's a texture border */
- if ( tObj->Image[tObj->BaseLevel]->Border > 0 )
+ if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 )
return GL_FALSE;
/* Update state if this is a different texture object to last
@@ -1653,7 +1653,7 @@ static GLboolean update_tex_common( GLcontext *ctx, int unit )
rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
}
- format = tObj->Image[tObj->BaseLevel]->Format;
+ format = tObj->Image[0][tObj->BaseLevel]->Format;
if ( rmesa->state.texture.unit[unit].format != format ||
rmesa->state.texture.unit[unit].envMode != texUnit->EnvMode ) {
rmesa->state.texture.unit[unit].format = format;
diff --git a/src/mesa/drivers/dri/radeon/radeon_subset_tex.c b/src/mesa/drivers/dri/radeon/radeon_subset_tex.c
index e401779513f..90004d2a33e 100644
--- a/src/mesa/drivers/dri/radeon/radeon_subset_tex.c
+++ b/src/mesa/drivers/dri/radeon/radeon_subset_tex.c
@@ -152,7 +152,7 @@ static void radeonUploadSubImage( radeonContextPtr rmesa,
drmRadeonTexImage tmp;
level += t->firstLevel;
- texImage = t->tObj->Image[level];
+ texImage = t->tObj->Image[0][level];
if ( !texImage || !texImage->Data )
return;
@@ -200,7 +200,7 @@ static void radeonSetTexImages( radeonContextPtr rmesa,
struct gl_texture_object *tObj )
{
radeonTexObjPtr t = (radeonTexObjPtr)tObj->DriverData;
- const struct gl_texture_image *baseImage = tObj->Image[tObj->BaseLevel];
+ const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
GLint totalSize;
GLint texelsPerDword = 0, blitWidth = 0, blitPitch = 0;
GLint x, y, width, height;
@@ -273,11 +273,11 @@ static void radeonSetTexImages( radeonContextPtr rmesa,
numLevels = lastLevel - firstLevel + 1;
- log2Width = tObj->Image[firstLevel]->WidthLog2;
- log2Height = tObj->Image[firstLevel]->HeightLog2;
+ log2Width = tObj->Image[0][firstLevel]->WidthLog2;
+ log2Height = tObj->Image[0][firstLevel]->HeightLog2;
for ( i = 0 ; i < numLevels ; i++ ) {
- const struct gl_texture_image *texImage = tObj->Image[i + firstLevel];
+ const struct gl_texture_image *texImage = tObj->Image[0][i + firstLevel];
if ( !texImage )
break;
@@ -524,7 +524,7 @@ static void radeonUpdateTextureEnv( GLcontext *ctx, int unit )
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
const struct gl_texture_object *tObj = texUnit->_Current;
- const GLenum format = tObj->Image[tObj->BaseLevel]->Format;
+ const GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
GLuint color_combine = radeon_color_combine[unit][RADEON_DISABLE];
GLuint alpha_combine = radeon_alpha_combine[unit][RADEON_DISABLE];
diff --git a/src/mesa/drivers/dri/radeon/radeon_swtcl.c b/src/mesa/drivers/dri/radeon/radeon_swtcl.c
index d7f9df762e5..fd14e76d444 100644
--- a/src/mesa/drivers/dri/radeon/radeon_swtcl.c
+++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.c
@@ -704,7 +704,7 @@ static GLboolean run_texrect_stage( GLcontext *ctx,
if (stage->changed_inputs & VERT_BIT_TEX(i)) {
struct gl_texture_object *texObj = ctx->Texture.Unit[i].CurrentRect;
- struct gl_texture_image *texImage = texObj->Image[texObj->BaseLevel];
+ struct gl_texture_image *texImage = texObj->Image[0][texObj->BaseLevel];
const GLfloat iw = 1.0/texImage->Width;
const GLfloat ih = 1.0/texImage->Height;
GLfloat *in = (GLfloat *)VB->TexCoordPtr[i]->data;
diff --git a/src/mesa/drivers/dri/radeon/radeon_texmem.c b/src/mesa/drivers/dri/radeon/radeon_texmem.c
index 284efb225ac..09289bab670 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texmem.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texmem.c
@@ -200,26 +200,7 @@ static void uploadSubImage( radeonContextPtr rmesa, radeonTexObjPtr t,
return;
}
- switch (face) {
- case 0:
- texImage = t->base.tObj->Image[level];
- break;
- case 1:
- texImage = t->base.tObj->NegX[level];
- break;
- case 2:
- texImage = t->base.tObj->PosY[level];
- break;
- case 3:
- texImage = t->base.tObj->NegY[level];
- break;
- case 4:
- texImage = t->base.tObj->PosZ[level];
- break;
- case 5:
- texImage = t->base.tObj->NegZ[level];
- break;
- }
+ texImage = t->base.tObj->Image[face][level];
if ( !texImage ) {
if ( RADEON_DEBUG & DEBUG_TEXTURE )
diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c
index 0bece3e8b9b..f4991a70a2b 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texstate.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c
@@ -104,7 +104,7 @@ static void radeonSetTexImages( radeonContextPtr rmesa,
struct gl_texture_object *tObj )
{
radeonTexObjPtr t = (radeonTexObjPtr)tObj->DriverData;
- const struct gl_texture_image *baseImage = tObj->Image[tObj->BaseLevel];
+ const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
GLint curOffset;
GLint i;
GLint numLevels;
@@ -131,9 +131,9 @@ static void radeonSetTexImages( radeonContextPtr rmesa,
*/
driCalculateTextureFirstLastLevel( (driTextureObject *) t );
- log2Width = tObj->Image[t->base.firstLevel]->WidthLog2;
- log2Height = tObj->Image[t->base.firstLevel]->HeightLog2;
- log2Depth = tObj->Image[t->base.firstLevel]->DepthLog2;
+ log2Width = tObj->Image[0][t->base.firstLevel]->WidthLog2;
+ log2Height = tObj->Image[0][t->base.firstLevel]->HeightLog2;
+ log2Depth = tObj->Image[0][t->base.firstLevel]->DepthLog2;
numLevels = t->base.lastLevel - t->base.firstLevel + 1;
@@ -149,7 +149,7 @@ static void radeonSetTexImages( radeonContextPtr rmesa,
const struct gl_texture_image *texImage;
GLuint size;
- texImage = tObj->Image[i + t->base.firstLevel];
+ texImage = tObj->Image[0][i + t->base.firstLevel];
if ( !texImage )
break;
@@ -214,17 +214,17 @@ static void radeonSetTexImages( radeonContextPtr rmesa,
t->pp_txformat |= ((log2Width << RADEON_TXFORMAT_WIDTH_SHIFT) |
(log2Height << RADEON_TXFORMAT_HEIGHT_SHIFT));
- t->pp_txsize = (((tObj->Image[t->base.firstLevel]->Width - 1) << 0) |
- ((tObj->Image[t->base.firstLevel]->Height - 1) << 16));
+ t->pp_txsize = (((tObj->Image[0][t->base.firstLevel]->Width - 1) << 0) |
+ ((tObj->Image[0][t->base.firstLevel]->Height - 1) << 16));
/* Only need to round to nearest 32 for textures, but the blitter
* requires 64-byte aligned pitches, and we may/may not need the
* blitter. NPOT only!
*/
if (baseImage->IsCompressed)
- t->pp_txpitch = (tObj->Image[t->base.firstLevel]->Width + 63) & ~(63);
+ t->pp_txpitch = (tObj->Image[0][t->base.firstLevel]->Width + 63) & ~(63);
else
- t->pp_txpitch = ((tObj->Image[t->base.firstLevel]->Width * baseImage->TexFormat->TexelBytes) + 63) & ~(63);
+ t->pp_txpitch = ((tObj->Image[0][t->base.firstLevel]->Width * baseImage->TexFormat->TexelBytes) + 63) & ~(63);
t->pp_txpitch -= 32;
t->dirty_state = TEX_ALL;
@@ -779,7 +779,7 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit )
}
else {
const struct gl_texture_object *tObj = texUnit->_Current;
- const GLenum format = tObj->Image[tObj->BaseLevel]->Format;
+ const GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
GLuint color_arg[3], alpha_arg[3];
GLuint i, numColorArgs = 0, numAlphaArgs = 0;
GLuint RGBshift = texUnit->CombineScaleShiftRGB;
@@ -1496,7 +1496,7 @@ static GLboolean update_tex_common( GLcontext *ctx, int unit )
GLenum format;
/* Fallback if there's a texture border */
- if ( tObj->Image[tObj->BaseLevel]->Border > 0 ) {
+ if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 ) {
fprintf(stderr, "%s: border\n", __FUNCTION__);
return GL_FALSE;
}
@@ -1549,7 +1549,7 @@ static GLboolean update_tex_common( GLcontext *ctx, int unit )
rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
}
- format = tObj->Image[tObj->BaseLevel]->Format;
+ format = tObj->Image[0][tObj->BaseLevel]->Format;
if ( rmesa->state.texture.unit[unit].format != format ||
rmesa->state.texture.unit[unit].envMode != texUnit->EnvMode ) {
rmesa->state.texture.unit[unit].format = format;
diff --git a/src/mesa/drivers/dri/sis/sis_texstate.c b/src/mesa/drivers/dri/sis/sis_texstate.c
index 001eb18a140..a18ad06bd48 100644
--- a/src/mesa/drivers/dri/sis/sis_texstate.c
+++ b/src/mesa/drivers/dri/sis/sis_texstate.c
@@ -317,7 +317,7 @@ sis_set_texobj_parm( GLcontext *ctx, struct gl_texture_object *texObj,
lastLevel = texObj->BaseLevel + (GLint)(texObj->MaxLod + 0.5);
lastLevel = MAX2(lastLevel, texObj->BaseLevel);
lastLevel = MIN2(lastLevel, texObj->BaseLevel +
- texObj->Image[texObj->BaseLevel]->MaxLog2);
+ texObj->Image[0][texObj->BaseLevel]->MaxLog2);
lastLevel = MIN2(lastLevel, texObj->MaxLevel);
lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */
}
@@ -437,9 +437,9 @@ sis_set_texobj_parm( GLcontext *ctx, struct gl_texture_object *texObj,
}
current->texture[hw_unit].hwTextureSet |=
- texObj->Image[firstLevel]->WidthLog2 << 4;
+ texObj->Image[0][firstLevel]->WidthLog2 << 4;
current->texture[hw_unit].hwTextureSet |=
- texObj->Image[firstLevel]->HeightLog2;
+ texObj->Image[0][firstLevel]->HeightLog2;
if (hw_unit == 0)
smesa->GlobalFlag |= GFLAG_TEXTUREADDRESS;
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c
index 515ae7c809a..8c4ea2d46d5 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c
@@ -171,20 +171,20 @@ static void RevalidateTexture(GLcontext *ctx, struct gl_texture_object *tObj)
minl = maxl = tObj->BaseLevel;
- if (tObj->Image[minl]) {
- maxl = MIN2(tObj->MaxLevel, tObj->Image[minl]->MaxLog2);
+ if (tObj->Image[0][minl]) {
+ maxl = MIN2(tObj->MaxLevel, tObj->Image[0][minl]->MaxLog2);
/* compute largeLodLog2, aspect ratio and texcoord scale factors */
- tdfxTexGetInfo(ctx, tObj->Image[minl]->Width, tObj->Image[minl]->Height,
+ tdfxTexGetInfo(ctx, tObj->Image[0][minl]->Width, tObj->Image[0][minl]->Height,
&ti->info.largeLodLog2,
&ti->info.aspectRatioLog2,
&(ti->sScale), &(ti->tScale), NULL, NULL);
}
- if (tObj->Image[maxl] && (tObj->MinFilter != GL_NEAREST) && (tObj->MinFilter != GL_LINEAR)) {
+ if (tObj->Image[0][maxl] && (tObj->MinFilter != GL_NEAREST) && (tObj->MinFilter != GL_LINEAR)) {
/* mipmapping: need to compute smallLodLog2 */
- tdfxTexGetInfo(ctx, tObj->Image[maxl]->Width,
- tObj->Image[maxl]->Height,
+ tdfxTexGetInfo(ctx, tObj->Image[0][maxl]->Width,
+ tObj->Image[0][maxl]->Height,
&ti->info.smallLodLog2, NULL,
NULL, NULL, NULL, NULL);
}
@@ -1282,11 +1282,11 @@ tdfxTestProxyTexImage(GLcontext *ctx, GLenum target,
assert(ti);
/* assign the parameters to test against */
- tObj->Image[level]->Width = width;
- tObj->Image[level]->Height = height;
- tObj->Image[level]->Border = border;
+ tObj->Image[0][level]->Width = width;
+ tObj->Image[0][level]->Height = height;
+ tObj->Image[0][level]->Border = border;
#if 0
- tObj->Image[level]->IntFormat = internalFormat;
+ tObj->Image[0][level]->IntFormat = internalFormat;
#endif
if (level == 0) {
/* don't use mipmap levels > 0 */
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_texman.c b/src/mesa/drivers/dri/tdfx/tdfx_texman.c
index b34779c21fe..9bfd5de5f9e 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_texman.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_texman.c
@@ -655,7 +655,7 @@ tdfxTMDownloadTexture(tdfxContextPtr fxMesa, struct gl_texture_object *tObj)
case TDFX_TMU1:
if (ti->tm[targetTMU]) {
for (l = ti->minLevel; l <= ti->maxLevel
- && tObj->Image[l]->Data; l++) {
+ && tObj->Image[0][l]->Data; l++) {
GrLOD_t glideLod = ti->info.largeLodLog2 - l + tObj->BaseLevel;
fxMesa->Glide.grTexDownloadMipMapLevel(targetTMU,
ti->tm[targetTMU]->startAddr,
@@ -664,14 +664,14 @@ tdfxTMDownloadTexture(tdfxContextPtr fxMesa, struct gl_texture_object *tObj)
ti->info.aspectRatioLog2,
ti->info.format,
GR_MIPMAPLEVELMASK_BOTH,
- tObj->Image[l]->Data);
+ tObj->Image[0][l]->Data);
}
}
break;
case TDFX_TMU_SPLIT:
if (ti->tm[TDFX_TMU0] && ti->tm[TDFX_TMU1]) {
for (l = ti->minLevel; l <= ti->maxLevel
- && tObj->Image[l]->Data; l++) {
+ && tObj->Image[0][l]->Data; l++) {
GrLOD_t glideLod = ti->info.largeLodLog2 - l + tObj->BaseLevel;
fxMesa->Glide.grTexDownloadMipMapLevel(GR_TMU0,
ti->tm[TDFX_TMU0]->startAddr,
@@ -680,7 +680,7 @@ tdfxTMDownloadTexture(tdfxContextPtr fxMesa, struct gl_texture_object *tObj)
ti->info.aspectRatioLog2,
ti->info.format,
GR_MIPMAPLEVELMASK_ODD,
- tObj->Image[l]->Data);
+ tObj->Image[0][l]->Data);
fxMesa->Glide.grTexDownloadMipMapLevel(GR_TMU1,
ti->tm[TDFX_TMU1]->startAddr,
@@ -689,14 +689,14 @@ tdfxTMDownloadTexture(tdfxContextPtr fxMesa, struct gl_texture_object *tObj)
ti->info.aspectRatioLog2,
ti->info.format,
GR_MIPMAPLEVELMASK_EVEN,
- tObj->Image[l]->Data);
+ tObj->Image[0][l]->Data);
}
}
break;
case TDFX_TMU_BOTH:
if (ti->tm[TDFX_TMU0] && ti->tm[TDFX_TMU1]) {
for (l = ti->minLevel; l <= ti->maxLevel
- && tObj->Image[l]->Data; l++) {
+ && tObj->Image[0][l]->Data; l++) {
GrLOD_t glideLod = ti->info.largeLodLog2 - l + tObj->BaseLevel;
fxMesa->Glide.grTexDownloadMipMapLevel(GR_TMU0,
ti->tm[TDFX_TMU0]->startAddr,
@@ -705,7 +705,7 @@ tdfxTMDownloadTexture(tdfxContextPtr fxMesa, struct gl_texture_object *tObj)
ti->info.aspectRatioLog2,
ti->info.format,
GR_MIPMAPLEVELMASK_BOTH,
- tObj->Image[l]->Data);
+ tObj->Image[0][l]->Data);
fxMesa->Glide.grTexDownloadMipMapLevel(GR_TMU1,
ti->tm[TDFX_TMU1]->startAddr,
@@ -714,7 +714,7 @@ tdfxTMDownloadTexture(tdfxContextPtr fxMesa, struct gl_texture_object *tObj)
ti->info.aspectRatioLog2,
ti->info.format,
GR_MIPMAPLEVELMASK_BOTH,
- tObj->Image[l]->Data);
+ tObj->Image[0][l]->Data);
}
}
break;
@@ -750,7 +750,7 @@ tdfxTMReloadMipMapLevel(GLcontext *ctx, struct gl_texture_object *tObj,
ti->info.aspectRatioLog2,
ti->info.format,
GR_MIPMAPLEVELMASK_BOTH,
- tObj->Image[level]->Data);
+ tObj->Image[0][level]->Data);
break;
case TDFX_TMU_SPLIT:
fxMesa->Glide.grTexDownloadMipMapLevel(GR_TMU0,
@@ -760,7 +760,7 @@ tdfxTMReloadMipMapLevel(GLcontext *ctx, struct gl_texture_object *tObj,
ti->info.aspectRatioLog2,
ti->info.format,
GR_MIPMAPLEVELMASK_ODD,
- tObj->Image[level]->Data);
+ tObj->Image[0][level]->Data);
fxMesa->Glide.grTexDownloadMipMapLevel(GR_TMU1,
ti->tm[GR_TMU1]->startAddr,
@@ -769,7 +769,7 @@ tdfxTMReloadMipMapLevel(GLcontext *ctx, struct gl_texture_object *tObj,
ti->info.aspectRatioLog2,
ti->info.format,
GR_MIPMAPLEVELMASK_EVEN,
- tObj->Image[level]->Data);
+ tObj->Image[0][level]->Data);
break;
case TDFX_TMU_BOTH:
fxMesa->Glide.grTexDownloadMipMapLevel(GR_TMU0,
@@ -779,7 +779,7 @@ tdfxTMReloadMipMapLevel(GLcontext *ctx, struct gl_texture_object *tObj,
ti->info.aspectRatioLog2,
ti->info.format,
GR_MIPMAPLEVELMASK_BOTH,
- tObj->Image[level]->Data);
+ tObj->Image[0][level]->Data);
fxMesa->Glide.grTexDownloadMipMapLevel(GR_TMU1,
ti->tm[GR_TMU1]->startAddr,
@@ -788,7 +788,7 @@ tdfxTMReloadMipMapLevel(GLcontext *ctx, struct gl_texture_object *tObj,
ti->info.aspectRatioLog2,
ti->info.format,
GR_MIPMAPLEVELMASK_BOTH,
- tObj->Image[level]->Data);
+ tObj->Image[0][level]->Data);
break;
default:
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c
index e20938bf282..318d3a1c8f0 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c
@@ -1483,8 +1483,8 @@ static void print_state(tdfxContextPtr fxMesa)
GLcontext *ctx = fxMesa->glCtx;
struct gl_texture_object *tObj0 = ctx->Texture.Unit[0].Current2D;
struct gl_texture_object *tObj1 = ctx->Texture.Unit[1].Current2D;
- GLenum base0 = tObj0->Image[tObj0->BaseLevel] ? tObj0->Image[tObj0->BaseLevel]->Format : 99;
- GLenum base1 = tObj1->Image[tObj1->BaseLevel] ? tObj1->Image[tObj1->BaseLevel]->Format : 99;
+ GLenum base0 = tObj0->Image[0][tObj0->BaseLevel] ? tObj0->Image[0][tObj0->BaseLevel]->Format : 99;
+ GLenum base1 = tObj1->Image[0][tObj1->BaseLevel] ? tObj1->Image[0][tObj1->BaseLevel]->Format : 99;
printf("Unit 0: Enabled: GL=%d Gr=%d\n", ctx->Texture.Unit[0]._ReallyEnabled,
fxMesa->TexState.Enabled[0]);
@@ -1517,7 +1517,7 @@ static void setupTextureSingleTMU(GLcontext * ctx, GLuint unit)
GLenum envMode, baseFormat;
tObj = ctx->Texture.Unit[unit].Current2D;
- if (tObj->Image[tObj->BaseLevel]->Border > 0) {
+ if (tObj->Image[0][tObj->BaseLevel]->Border > 0) {
FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_BORDER, GL_TRUE);
return;
}
@@ -1539,7 +1539,7 @@ static void setupTextureSingleTMU(GLcontext * ctx, GLuint unit)
/* Check if we really need to update the texenv state */
envMode = ctx->Texture.Unit[unit].EnvMode;
- baseFormat = tObj->Image[tObj->BaseLevel]->Format;
+ baseFormat = tObj->Image[0][tObj->BaseLevel]->Format;
if (TDFX_IS_NAPALM(fxMesa)) {
/* see if we really need to update the unit */
@@ -1826,8 +1826,8 @@ static void setupTextureDoubleTMU(GLcontext * ctx)
struct gl_texture_object *tObj1 = ctx->Texture.Unit[1].Current2D;
tdfxTexInfo *ti0 = TDFX_TEXTURE_DATA(tObj0);
tdfxTexInfo *ti1 = TDFX_TEXTURE_DATA(tObj1);
- struct gl_texture_image *baseImage0 = tObj0->Image[tObj0->BaseLevel];
- struct gl_texture_image *baseImage1 = tObj1->Image[tObj1->BaseLevel];
+ struct gl_texture_image *baseImage0 = tObj0->Image[0][tObj0->BaseLevel];
+ struct gl_texture_image *baseImage1 = tObj1->Image[0][tObj1->BaseLevel];
const GLenum envMode0 = ctx->Texture.Unit[0].EnvMode;
const GLenum envMode1 = ctx->Texture.Unit[1].EnvMode;