summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/radeon
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-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
4 files changed, 20 insertions, 39 deletions
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;