summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r200
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2004-01-27 16:34:45 +0000
committerKeith Whitwell <[email protected]>2004-01-27 16:34:45 +0000
commit18fa367ac6e035341f5eb86ecc4231124b2921e3 (patch)
treee0902aabb61e55a785e8742aa809f53dcf5fa16c /src/mesa/drivers/dri/r200
parent740f7de085f143b2bb1fe623d68c5efb3560e1a7 (diff)
Consolidate texObj->Pos/Neg/X/Y/Z and texObj->Image into a single
array, texObj->Image[face][level].
Diffstat (limited to 'src/mesa/drivers/dri/r200')
-rw-r--r--src/mesa/drivers/dri/r200/r200_texmem.c21
-rw-r--r--src/mesa/drivers/dri/r200/r200_texstate.c24
2 files changed, 13 insertions, 32 deletions
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;