array, texObj->Image[face][level].
switch( ctx->Texture.Set[ctx->Texture.CurrentSet].EnvMode )
{
case GL_MODULATE:
- if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Format == GL_RGBA )
+ if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Format == GL_RGBA )
dwFunc = pContext->pShared->dwTexFunc[d3dtblend_modulatealpha];
else
dwFunc = pContext->pShared->dwTexFunc[d3dtblend_modulate];
break;
case GL_DECAL:
- if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Format == GL_RGBA )
+ if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Format == GL_RGBA )
dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decalalpha];
else
dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decal];
CreateTMgrHAL( pContext->pShared,
texName,
0,
- ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Format,
+ ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Format,
(RECT *)NULL,
- ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Width,
- ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Height,
+ ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Width,
+ ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Height,
TM_ACTION_BIND,
- (void *)ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Data );
+ (void *)ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Data );
// }
bTexture = TRUE;
}
textName = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name;
DPF(( 0, "\tTexture Name:\t%d", textName ));
DPF(( 0, "\tTexture Format:\t%s",
- (ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Format == GL_RGBA) ?
+ (ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Format == GL_RGBA) ?
"GL_RGBA" : "GLRGB" ));
}
{
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
* 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.
*/
};
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;
{
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;
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++;
* 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;
{
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;
}
#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;
}
/* 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 );
}
}
{
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;
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++;
* 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;
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) {
}
}
- if (tObj->Image[tObj->BaseLevel]->Border > 0) {
+ if (tObj->Image[0][tObj->BaseLevel]->Border > 0) {
FALLBACK( imesa, I810_FALLBACK_TEXTURE, GL_TRUE );
return;
}
/* 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 );
}
}
{
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 ) {
*/
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;
}
* 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;
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));
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;
}
* 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);
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;
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);
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)
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)
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;
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)
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;
}
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 );
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;
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;
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;
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;
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;
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 ) {
/* 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;
}
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 )
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;
*/
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;
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;
(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;
}
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;
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
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;
drmRadeonTexImage tmp;
level += t->firstLevel;
- texImage = t->tObj->Image[level];
+ texImage = t->tObj->Image[0][level];
if ( !texImage || !texImage->Data )
return;
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;
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;
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];
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;
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 )
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;
*/
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;
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;
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;
}
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;
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;
}
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;
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 */
}
}
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;
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);
}
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 */
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,
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,
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,
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,
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,
ti->info.aspectRatioLog2,
ti->info.format,
GR_MIPMAPLEVELMASK_BOTH,
- tObj->Image[l]->Data);
+ tObj->Image[0][l]->Data);
}
}
break;
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,
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,
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,
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,
ti->info.aspectRatioLog2,
ti->info.format,
GR_MIPMAPLEVELMASK_BOTH,
- tObj->Image[level]->Data);
+ tObj->Image[0][level]->Data);
break;
default:
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]);
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;
}
/* 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 */
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;
ctx->Texture.Unit[0].EnvColor[3] != 1)) {
return FX_FALLBACK_TEXTURE_ENV;
}
- if (ctx->Texture.Unit[0]._Current->Image[0]->Border > 0)
+ if (ctx->Texture.Unit[0]._Current->Image[0][0]->Border > 0)
return FX_FALLBACK_TEXTURE_BORDER;
}
if (fxMesa->type < GR_SSTTYPE_Voodoo2)
if (ctx->Texture.Unit[1].EnvMode == GL_BLEND)
return FX_FALLBACK_TEXTURE_ENV;
- if (ctx->Texture.Unit[1]._Current->Image[0]->Border > 0)
+ if (ctx->Texture.Unit[1]._Current->Image[0][0]->Border > 0)
return FX_FALLBACK_TEXTURE_BORDER;
}
fprintf(stderr, "\tName: %d\n", ti->tObj->Name);
fprintf(stderr, "\tBaseLevel: %d\n", ti->tObj->BaseLevel);
fprintf(stderr, "\tSize: %d x %d\n",
- ti->tObj->Image[ti->tObj->BaseLevel]->Width,
- ti->tObj->Image[ti->tObj->BaseLevel]->Height);
+ ti->tObj->Image[0][ti->tObj->BaseLevel]->Width,
+ ti->tObj->Image[0][ti->tObj->BaseLevel]->Height);
}
else
fprintf(stderr, "\tName: UNNAMED\n");
ti->tObj = tObj;
minl = ti->minLevel = tObj->BaseLevel;
- maxl = ti->maxLevel = MIN2(tObj->MaxLevel, tObj->Image[0]->MaxLog2);
+ maxl = ti->maxLevel = MIN2(tObj->MaxLevel, tObj->Image[0][0]->MaxLog2);
#if 1||FX_RESCALE_BIG_TEXURES
{
*/
if ((tObj->MinFilter == GL_NEAREST) || (tObj->MinFilter == GL_LINEAR)) {
/* no mipmaps! need to rescale */
- struct gl_texture_image *texImage = tObj->Image[minl];
+ struct gl_texture_image *texImage = tObj->Image[0][minl];
tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
GLint texelBytes = texImage->TexFormat->TexelBytes;
GLvoid *texImage_Data = texImage->Data;
MESA_PBUFFER_FREE(texImage_Data);
mml->width = _w;
mml->height = _h;
- maxl = ti->maxLevel = tObj->Image[0]->MaxLog2 = minl + fxMesa->textureMaxLod;
+ maxl = ti->maxLevel = tObj->Image[0][0]->MaxLog2 = minl + fxMesa->textureMaxLod;
} else {
/* skip a certain number of LODs */
minl += maxl - fxMesa->textureMaxLod;
}
#endif
- fxTexGetInfo(tObj->Image[minl]->Width, tObj->Image[minl]->Height,
+ fxTexGetInfo(tObj->Image[0][minl]->Width, tObj->Image[0][minl]->Height,
&(FX_largeLodLog2(ti->info)), &(FX_aspectRatioLog2(ti->info)),
&(ti->sScale), &(ti->tScale),
NULL, NULL);
if ((tObj->MinFilter != GL_NEAREST) && (tObj->MinFilter != GL_LINEAR))
- fxTexGetInfo(tObj->Image[maxl]->Width, tObj->Image[maxl]->Height,
+ fxTexGetInfo(tObj->Image[0][maxl]->Width, tObj->Image[0][maxl]->Height,
&(FX_smallLodLog2(ti->info)), NULL,
NULL, NULL, NULL, NULL);
else
FX_smallLodLog2(ti->info) = FX_largeLodLog2(ti->info);
- ti->baseLevelInternalFormat = tObj->Image[minl]->Format;
+ ti->baseLevelInternalFormat = tObj->Image[0][minl]->Format;
ti->validated = GL_TRUE;
for (i = FX_largeLodValue(ti->info), l = ti->minLevel;
i <= FX_smallLodValue(ti->info); i++, l++) {
- struct gl_texture_image *texImage = tObj->Image[l];
+ struct gl_texture_image *texImage = tObj->Image[0][l];
grTexDownloadMipMapLevel(where,
ti->tm[where]->startAddr,
FX_valueToLod(i),
for (i = FX_largeLodValue(ti->info), l = ti->minLevel;
i <= FX_smallLodValue(ti->info); i++, l++) {
- struct gl_texture_image *texImage = tObj->Image[l];
+ struct gl_texture_image *texImage = tObj->Image[0][l];
grTexDownloadMipMapLevel(GR_TMU0,
ti->tm[FX_TMU0]->startAddr,
for (i = FX_largeLodValue(ti->info), l = ti->minLevel;
i <= FX_smallLodValue(ti->info); i++, l++) {
- struct gl_texture_image *texImage = tObj->Image[l];
+ struct gl_texture_image *texImage = tObj->Image[0][l];
grTexDownloadMipMapLevel(GR_TMU0,
ti->tm[FX_TMU0]->startAddr,
FX_valueToLod(i),
tfxTexInfo *ti = fxTMGetTexInfo(tObj);
GrLOD_t lodlevel;
GLint tmu;
- struct gl_texture_image *texImage = tObj->Image[level];
+ struct gl_texture_image *texImage = tObj->Image[0][level];
tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
if (TDFX_DEBUG & VERBOSE_TEXTURE) {
GrLOD_t lodlevel;
unsigned short *data;
GLint tmu;
- struct gl_texture_image *texImage = tObj->Image[level];
+ struct gl_texture_image *texImage = tObj->Image[0][level];
tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
assert(mml);
fxTMMoveOutTM(fxMesa, tObj);
for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
- struct gl_texture_image *texImage = tObj->Image[i];
+ struct gl_texture_image *texImage = tObj->Image[0][i];
if (texImage) {
if (texImage->DriverData) {
FREE(texImage->DriverData);
/*@}*/
};
+#define FACE_POS_X 0
+#define FACE_NEG_X 1
+#define FACE_POS_Y 2
+#define FACE_NEG_Y 3
+#define FACE_POS_Z 4
+#define FACE_NEG_Z 5
+#define MAX_FACES 6
/**
* Texture object record
GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */
GLboolean _IsPowerOfTwo; /**< Are all image dimensions powers of two? */
- struct gl_texture_image *Image[MAX_TEXTURE_LEVELS];
-
- /**
- * \name Texture cube faces
- *
- * Image[] is alias for *PosX[MAX_TEXTURE_LEVELS];
- */
- /*@{*/
- struct gl_texture_image *NegX[MAX_TEXTURE_LEVELS];
- struct gl_texture_image *PosY[MAX_TEXTURE_LEVELS];
- struct gl_texture_image *NegY[MAX_TEXTURE_LEVELS];
- struct gl_texture_image *PosZ[MAX_TEXTURE_LEVELS];
- struct gl_texture_image *NegZ[MAX_TEXTURE_LEVELS];
- /*@}*/
+ struct gl_texture_image *Image[MAX_FACES][MAX_TEXTURE_LEVELS];
/** GL_EXT_paletted_texture */
struct gl_color_table Palette;
case GL_TEXTURE_1D:
case GL_TEXTURE_2D:
case GL_TEXTURE_3D:
- tObj->Image[level] = texImage;
+ tObj->Image[0][level] = texImage;
return;
case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
- tObj->Image[level] = texImage;
- return;
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
- tObj->NegX[level] = texImage;
- return;
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
- tObj->PosY[level] = texImage;
- return;
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
- tObj->NegY[level] = texImage;
- return;
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
- tObj->PosZ[level] = texImage;
- return;
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
- tObj->NegZ[level] = texImage;
- return;
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: {
+ GLuint face = ((GLuint) target -
+ (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X);
+ tObj->Image[face][level] = texImage;
+ break;
+ }
case GL_TEXTURE_RECTANGLE_NV:
ASSERT(level == 0);
- tObj->Image[level] = texImage;
+ tObj->Image[0][level] = texImage;
return;
default:
_mesa_problem(NULL, "bad target in _mesa_set_tex_image()");
ASSERT(level < MAX_TEXTURE_LEVELS);
switch (target) {
case GL_TEXTURE_1D:
- return texUnit->Current1D->Image[level];
+ return texUnit->Current1D->Image[0][level];
case GL_PROXY_TEXTURE_1D:
- return ctx->Texture.Proxy1D->Image[level];
+ return ctx->Texture.Proxy1D->Image[0][level];
case GL_TEXTURE_2D:
- return texUnit->Current2D->Image[level];
+ return texUnit->Current2D->Image[0][level];
case GL_PROXY_TEXTURE_2D:
- return ctx->Texture.Proxy2D->Image[level];
+ return ctx->Texture.Proxy2D->Image[0][level];
case GL_TEXTURE_3D:
- return texUnit->Current3D->Image[level];
+ return texUnit->Current3D->Image[0][level];
case GL_PROXY_TEXTURE_3D:
- return ctx->Texture.Proxy3D->Image[level];
+ return ctx->Texture.Proxy3D->Image[0][level];
case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- return texUnit->CurrentCubeMap->Image[level];
- else
- return NULL;
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- return texUnit->CurrentCubeMap->NegX[level];
- else
- return NULL;
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- return texUnit->CurrentCubeMap->PosY[level];
- else
- return NULL;
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- return texUnit->CurrentCubeMap->NegY[level];
- else
- return NULL;
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- return texUnit->CurrentCubeMap->PosZ[level];
- else
- return NULL;
- case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
- if (ctx->Extensions.ARB_texture_cube_map)
- return texUnit->CurrentCubeMap->NegZ[level];
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
+ if (ctx->Extensions.ARB_texture_cube_map) {
+ GLuint face = ((GLuint) target -
+ (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X);
+ return texUnit->CurrentCubeMap->Image[face][level];
+ }
else
return NULL;
case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
if (ctx->Extensions.ARB_texture_cube_map)
- return ctx->Texture.ProxyCubeMap->Image[level];
+ return ctx->Texture.ProxyCubeMap->Image[0][level];
else
return NULL;
case GL_TEXTURE_RECTANGLE_NV:
if (ctx->Extensions.NV_texture_rectangle) {
ASSERT(level == 0);
- return texUnit->CurrentRect->Image[level];
+ return texUnit->CurrentRect->Image[0][level];
}
else {
return NULL;
case GL_PROXY_TEXTURE_RECTANGLE_NV:
if (ctx->Extensions.NV_texture_rectangle) {
ASSERT(level == 0);
- return ctx->Texture.ProxyRect->Image[level];
+ return ctx->Texture.ProxyRect->Image[0][level];
}
else {
return NULL;
case GL_PROXY_TEXTURE_1D:
if (level >= ctx->Const.MaxTextureLevels)
return NULL;
- texImage = ctx->Texture.Proxy1D->Image[level];
+ texImage = ctx->Texture.Proxy1D->Image[0][level];
if (!texImage) {
texImage = ctx->Driver.NewTextureImage(ctx);
if (!texImage) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation");
return NULL;
}
- ctx->Texture.Proxy1D->Image[level] = texImage;
+ ctx->Texture.Proxy1D->Image[0][level] = texImage;
}
return texImage;
case GL_PROXY_TEXTURE_2D:
if (level >= ctx->Const.MaxTextureLevels)
return NULL;
- texImage = ctx->Texture.Proxy2D->Image[level];
+ texImage = ctx->Texture.Proxy2D->Image[0][level];
if (!texImage) {
texImage = ctx->Driver.NewTextureImage(ctx);
if (!texImage) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation");
return NULL;
}
- ctx->Texture.Proxy2D->Image[level] = texImage;
+ ctx->Texture.Proxy2D->Image[0][level] = texImage;
}
return texImage;
case GL_PROXY_TEXTURE_3D:
if (level >= ctx->Const.Max3DTextureLevels)
return NULL;
- texImage = ctx->Texture.Proxy3D->Image[level];
+ texImage = ctx->Texture.Proxy3D->Image[0][level];
if (!texImage) {
texImage = ctx->Driver.NewTextureImage(ctx);
if (!texImage) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation");
return NULL;
}
- ctx->Texture.Proxy3D->Image[level] = texImage;
+ ctx->Texture.Proxy3D->Image[0][level] = texImage;
}
return texImage;
case GL_PROXY_TEXTURE_CUBE_MAP:
if (level >= ctx->Const.MaxCubeTextureLevels)
return NULL;
- texImage = ctx->Texture.ProxyCubeMap->Image[level];
+ texImage = ctx->Texture.ProxyCubeMap->Image[0][level];
if (!texImage) {
texImage = ctx->Driver.NewTextureImage(ctx);
if (!texImage) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation");
return NULL;
}
- ctx->Texture.ProxyCubeMap->Image[level] = texImage;
+ ctx->Texture.ProxyCubeMap->Image[0][level] = texImage;
}
return texImage;
case GL_PROXY_TEXTURE_RECTANGLE_NV:
if (level > 0)
return NULL;
- texImage = ctx->Texture.ProxyRect->Image[level];
+ texImage = ctx->Texture.ProxyRect->Image[0][level];
if (!texImage) {
texImage = ctx->Driver.NewTextureImage(ctx);
if (!texImage) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "proxy texture allocation");
return NULL;
}
- ctx->Texture.ProxyRect->Image[level] = texImage;
+ ctx->Texture.ProxyRect->Image[0][level] = texImage;
}
return texImage;
default:
1, border)) {
/* when error, clear all proxy texture image parameters */
if (texImage)
- clear_teximage_fields(ctx->Texture.Proxy2D->Image[level]);
+ clear_teximage_fields(ctx->Texture.Proxy2D->Image[0][level]);
}
else {
/* no error, set the tex image parameters */
void
_mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj )
{
- GLuint i;
+ GLuint i, face;
(void) ctx;
_mesa_free_colortable_data(&texObj->Palette);
/* free the texture images */
- for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
- if (texObj->Image[i]) {
- _mesa_delete_texture_image( texObj->Image[i] );
+ for (face = 0; face < 6; face++) {
+ for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
+ if (texObj->Image[face][i]) {
+ _mesa_delete_texture_image( texObj->Image[face][i] );
+ }
}
}
t->_IsPowerOfTwo = GL_TRUE; /* may be set FALSE below */
/* Always need the base level image */
- if (!t->Image[baseLevel]) {
+ if (!t->Image[0][baseLevel]) {
char s[100];
sprintf(s, "obj %p (%d) Image[baseLevel=%d] == NULL",
(void *) t, t->Name, baseLevel);
}
/* Check width/height/depth for zero */
- if (t->Image[baseLevel]->Width == 0 ||
- t->Image[baseLevel]->Height == 0 ||
- t->Image[baseLevel]->Depth == 0) {
+ if (t->Image[0][baseLevel]->Width == 0 ||
+ t->Image[0][baseLevel]->Height == 0 ||
+ t->Image[0][baseLevel]->Depth == 0) {
incomplete(t, "texture width = 0");
t->Complete = GL_FALSE;
return;
/* Compute _MaxLevel */
if (t->Target == GL_TEXTURE_1D) {
- maxLog2 = t->Image[baseLevel]->WidthLog2;
+ maxLog2 = t->Image[0][baseLevel]->WidthLog2;
maxLevels = ctx->Const.MaxTextureLevels;
}
else if (t->Target == GL_TEXTURE_2D) {
- maxLog2 = MAX2(t->Image[baseLevel]->WidthLog2,
- t->Image[baseLevel]->HeightLog2);
+ maxLog2 = MAX2(t->Image[0][baseLevel]->WidthLog2,
+ t->Image[0][baseLevel]->HeightLog2);
maxLevels = ctx->Const.MaxTextureLevels;
}
else if (t->Target == GL_TEXTURE_3D) {
- GLint max = MAX2(t->Image[baseLevel]->WidthLog2,
- t->Image[baseLevel]->HeightLog2);
- maxLog2 = MAX2(max, (GLint)(t->Image[baseLevel]->DepthLog2));
+ GLint max = MAX2(t->Image[0][baseLevel]->WidthLog2,
+ t->Image[0][baseLevel]->HeightLog2);
+ maxLog2 = MAX2(max, (GLint)(t->Image[0][baseLevel]->DepthLog2));
maxLevels = ctx->Const.Max3DTextureLevels;
}
else if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) {
- maxLog2 = MAX2(t->Image[baseLevel]->WidthLog2,
- t->Image[baseLevel]->HeightLog2);
+ maxLog2 = MAX2(t->Image[0][baseLevel]->WidthLog2,
+ t->Image[0][baseLevel]->HeightLog2);
maxLevels = ctx->Const.MaxCubeTextureLevels;
}
else if (t->Target == GL_TEXTURE_RECTANGLE_NV) {
if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) {
/* make sure that all six cube map level 0 images are the same size */
- const GLuint w = t->Image[baseLevel]->Width2;
- const GLuint h = t->Image[baseLevel]->Height2;
- if (!t->NegX[baseLevel] ||
- t->NegX[baseLevel]->Width2 != w ||
- t->NegX[baseLevel]->Height2 != h ||
- !t->PosY[baseLevel] ||
- t->PosY[baseLevel]->Width2 != w ||
- t->PosY[baseLevel]->Height2 != h ||
- !t->NegY[baseLevel] ||
- t->NegY[baseLevel]->Width2 != w ||
- t->NegY[baseLevel]->Height2 != h ||
- !t->PosZ[baseLevel] ||
- t->PosZ[baseLevel]->Width2 != w ||
- t->PosZ[baseLevel]->Height2 != h ||
- !t->NegZ[baseLevel] ||
- t->NegZ[baseLevel]->Width2 != w ||
- t->NegZ[baseLevel]->Height2 != h) {
- t->Complete = GL_FALSE;
- incomplete(t, "Non-quare cubemap image");
- return;
+ const GLuint w = t->Image[0][baseLevel]->Width2;
+ const GLuint h = t->Image[0][baseLevel]->Height2;
+ GLuint face;
+ for (face = 1; face < 6; face++) {
+ if (t->Image[face][baseLevel] == NULL ||
+ t->Image[face][baseLevel]->Width2 != w ||
+ t->Image[face][baseLevel]->Height2 != h) {
+ t->Complete = GL_FALSE;
+ incomplete(t, "Non-quare cubemap image");
+ return;
+ }
}
}
/* check for non power of two */
- if (!t->Image[baseLevel]->_IsPowerOfTwo) {
+ if (!t->Image[0][baseLevel]->_IsPowerOfTwo) {
t->_IsPowerOfTwo = GL_FALSE;
}
/* Test dimension-independent attributes */
for (i = minLevel; i <= maxLevel; i++) {
- if (t->Image[i]) {
- if (t->Image[i]->TexFormat != t->Image[baseLevel]->TexFormat) {
+ if (t->Image[0][i]) {
+ if (t->Image[0][i]->TexFormat != t->Image[0][baseLevel]->TexFormat) {
t->Complete = GL_FALSE;
incomplete(t, "Format[i] != Format[baseLevel]");
return;
}
- if (t->Image[i]->Border != t->Image[baseLevel]->Border) {
+ if (t->Image[0][i]->Border != t->Image[0][baseLevel]->Border) {
t->Complete = GL_FALSE;
incomplete(t, "Border[i] != Border[baseLevel]");
return;
/* Test things which depend on number of texture image dimensions */
if (t->Target == GL_TEXTURE_1D) {
/* Test 1-D mipmaps */
- GLuint width = t->Image[baseLevel]->Width2;
+ GLuint width = t->Image[0][baseLevel]->Width2;
for (i = baseLevel + 1; i < maxLevels; i++) {
if (width > 1) {
width /= 2;
}
if (i >= minLevel && i <= maxLevel) {
- if (!t->Image[i]) {
+ if (!t->Image[0][i]) {
t->Complete = GL_FALSE;
- incomplete(t, "1D Image[i] == NULL");
+ incomplete(t, "1D Image[0][i] == NULL");
return;
}
- if (t->Image[i]->Width2 != width ) {
+ if (t->Image[0][i]->Width2 != width ) {
t->Complete = GL_FALSE;
- incomplete(t, "1D Image[i] bad width");
+ incomplete(t, "1D Image[0][i] bad width");
return;
}
}
}
else if (t->Target == GL_TEXTURE_2D) {
/* Test 2-D mipmaps */
- GLuint width = t->Image[baseLevel]->Width2;
- GLuint height = t->Image[baseLevel]->Height2;
+ GLuint width = t->Image[0][baseLevel]->Width2;
+ GLuint height = t->Image[0][baseLevel]->Height2;
for (i = baseLevel + 1; i < maxLevels; i++) {
if (width > 1) {
width /= 2;
height /= 2;
}
if (i >= minLevel && i <= maxLevel) {
- if (!t->Image[i]) {
+ if (!t->Image[0][i]) {
t->Complete = GL_FALSE;
- incomplete(t, "2D Image[i] == NULL");
+ incomplete(t, "2D Image[0][i] == NULL");
return;
}
- if (t->Image[i]->Width2 != width) {
+ if (t->Image[0][i]->Width2 != width) {
t->Complete = GL_FALSE;
- incomplete(t, "2D Image[i] bad width");
+ incomplete(t, "2D Image[0][i] bad width");
return;
}
- if (t->Image[i]->Height2 != height) {
+ if (t->Image[0][i]->Height2 != height) {
t->Complete = GL_FALSE;
- incomplete(t, "2D Image[i] bad height");
+ incomplete(t, "2D Image[0][i] bad height");
return;
}
if (width==1 && height==1) {
}
else if (t->Target == GL_TEXTURE_3D) {
/* Test 3-D mipmaps */
- GLuint width = t->Image[baseLevel]->Width2;
- GLuint height = t->Image[baseLevel]->Height2;
- GLuint depth = t->Image[baseLevel]->Depth2;
+ GLuint width = t->Image[0][baseLevel]->Width2;
+ GLuint height = t->Image[0][baseLevel]->Height2;
+ GLuint depth = t->Image[0][baseLevel]->Depth2;
for (i = baseLevel + 1; i < maxLevels; i++) {
if (width > 1) {
width /= 2;
depth /= 2;
}
if (i >= minLevel && i <= maxLevel) {
- if (!t->Image[i]) {
- incomplete(t, "3D Image[i] == NULL");
+ if (!t->Image[0][i]) {
+ incomplete(t, "3D Image[0][i] == NULL");
t->Complete = GL_FALSE;
return;
}
- if (t->Image[i]->Format == GL_DEPTH_COMPONENT) {
+ if (t->Image[0][i]->Format == GL_DEPTH_COMPONENT) {
t->Complete = GL_FALSE;
incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex");
return;
}
- if (t->Image[i]->Width2 != width) {
+ if (t->Image[0][i]->Width2 != width) {
t->Complete = GL_FALSE;
- incomplete(t, "3D Image[i] bad width");
+ incomplete(t, "3D Image[0][i] bad width");
return;
}
- if (t->Image[i]->Height2 != height) {
+ if (t->Image[0][i]->Height2 != height) {
t->Complete = GL_FALSE;
- incomplete(t, "3D Image[i] bad height");
+ incomplete(t, "3D Image[0][i] bad height");
return;
}
- if (t->Image[i]->Depth2 != depth) {
+ if (t->Image[0][i]->Depth2 != depth) {
t->Complete = GL_FALSE;
- incomplete(t, "3D Image[i] bad depth");
+ incomplete(t, "3D Image[0][i] bad depth");
return;
}
}
}
else if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) {
/* make sure 6 cube faces are consistant */
- GLuint width = t->Image[baseLevel]->Width2;
- GLuint height = t->Image[baseLevel]->Height2;
+ GLuint width = t->Image[0][baseLevel]->Width2;
+ GLuint height = t->Image[0][baseLevel]->Height2;
for (i = baseLevel + 1; i < maxLevels; i++) {
if (width > 1) {
width /= 2;
height /= 2;
}
if (i >= minLevel && i <= maxLevel) {
- /* check that we have images defined */
- if (!t->Image[i] || !t->NegX[i] ||
- !t->PosY[i] || !t->NegY[i] ||
- !t->PosZ[i] || !t->NegZ[i]) {
- t->Complete = GL_FALSE;
- incomplete(t, "CubeMap Image[i] == NULL");
- return;
- }
- /* Don't support GL_DEPTH_COMPONENT for cube maps */
- if (t->Image[i]->Format == GL_DEPTH_COMPONENT) {
- t->Complete = GL_FALSE;
- incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex");
- return;
- }
- /* check that all six images have same size */
- if (t->NegX[i]->Width2!=width || t->NegX[i]->Height2!=height ||
- t->PosY[i]->Width2!=width || t->PosY[i]->Height2!=height ||
- t->NegY[i]->Width2!=width || t->NegY[i]->Height2!=height ||
- t->PosZ[i]->Width2!=width || t->PosZ[i]->Height2!=height ||
- t->NegZ[i]->Width2!=width || t->NegZ[i]->Height2!=height) {
- t->Complete = GL_FALSE;
- incomplete(t, "CubeMap Image[i] bad size");
- return;
- }
- }
- if (width == 1 && height == 1) {
- return; /* found smallest needed mipmap, all done! */
+ GLuint face;
+ for (face = 0; face < 6; face++) {
+ /* check that we have images defined */
+ if (!t->Image[face][i]) {
+ t->Complete = GL_FALSE;
+ incomplete(t, "CubeMap Image[n][i] == NULL");
+ return;
+ }
+ /* Don't support GL_DEPTH_COMPONENT for cube maps */
+ if (t->Image[face][i]->Format == GL_DEPTH_COMPONENT) {
+ t->Complete = GL_FALSE;
+ incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex");
+ return;
+ }
+ /* check that all six images have same size */
+ if (t->Image[face][i]->Width2!=width ||
+ t->Image[face][i]->Height2!=height) {
+ t->Complete = GL_FALSE;
+ incomplete(t, "CubeMap Image[n][i] bad size");
+ return;
+ }
+ }
+ }
+ if (width == 1 && height == 1) {
+ return; /* found smallest needed mipmap, all done! */
}
}
}
GLint level, maxLevels;
ASSERT(texObj);
- srcImage = texObj->Image[texObj->BaseLevel];
+ srcImage = texObj->Image[0][texObj->BaseLevel];
ASSERT(srcImage);
maxLevels = _mesa_max_texture_levels(ctx, texObj->Target);
#ifdef DO_TEX
{
const struct gl_texture_object *obj = ctx->Texture.Unit[0]._Current;
- const struct gl_texture_image *texImage = obj->Image[obj->BaseLevel];
+ const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel];
const GLfloat invW0 = v0->win[3];
const GLfloat invW1 = v1->win[3];
const GLfloat s0 = v0->texcoord[0][0] * invW0;
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
if (ctx->Texture.Unit[u]._ReallyEnabled) {
const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current;
- const struct gl_texture_image *texImage = obj->Image[obj->BaseLevel];
+ const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel];
const GLfloat invW0 = v0->win[3];
const GLfloat invW1 = v1->win[3];
const GLfloat s0 = v0->texcoord[u][0] * invW0;
#ifdef DO_TEX
{
const struct gl_texture_object *obj = ctx->Texture.Unit[0]._Current;
- const struct gl_texture_image *texImage = obj->Image[obj->BaseLevel];
+ const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel];
const GLfloat invW0 = v0->win[3];
const GLfloat invW1 = v1->win[3];
const GLfloat invW2 = v2->win[3];
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
if (ctx->Texture.Unit[u]._ReallyEnabled) {
const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current;
- const struct gl_texture_image *texImage = obj->Image[obj->BaseLevel];
+ const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel];
const GLfloat invW0 = v0->win[3];
const GLfloat invW1 = v1->win[3];
const GLfloat invW2 = v2->win[3];
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current;
- const struct gl_texture_image *texImg = texObj->Image[texObj->BaseLevel];
+ const struct gl_texture_image *texImg = texObj->Image[0][texObj->BaseLevel];
const GLfloat texW = (GLfloat) texImg->WidthScale;
const GLfloat texH = (GLfloat) texImg->HeightScale;
GLchan rgba[4];
GLfloat texW, texH;
GLboolean needLambda;
if (obj) {
- const struct gl_texture_image *img = obj->Image[obj->BaseLevel];
+ const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
needLambda = (obj->MinFilter != obj->MagFilter)
|| ctx->FragmentProgram.Enabled;
texW = img->WidthScale;
GLfloat texW, texH;
GLboolean needLambda;
if (obj) {
- const struct gl_texture_image *img = obj->Image[obj->BaseLevel];
+ const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
needLambda = (obj->MinFilter != obj->MagFilter)
|| ctx->FragmentProgram.Enabled;
texW = (GLfloat) img->WidthScale;
for (i = 0; i < n; i++) {
GLint level;
COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
- sample_1d_nearest(ctx, tObj, tObj->Image[level], texcoord[i], rgba[i]);
+ sample_1d_nearest(ctx, tObj, tObj->Image[0][level], texcoord[i], rgba[i]);
}
}
for (i = 0; i < n; i++) {
GLint level;
COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
- sample_1d_linear(ctx, tObj, tObj->Image[level], texcoord[i], rgba[i]);
+ sample_1d_linear(ctx, tObj, tObj->Image[0][level], texcoord[i], rgba[i]);
}
}
GLint level;
COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
if (level >= tObj->_MaxLevel) {
- sample_1d_nearest(ctx, tObj, tObj->Image[tObj->_MaxLevel],
+ sample_1d_nearest(ctx, tObj, tObj->Image[0][tObj->_MaxLevel],
texcoord[i], rgba[i]);
}
else {
GLchan t0[4], t1[4];
const GLfloat f = FRAC(lambda[i]);
- sample_1d_nearest(ctx, tObj, tObj->Image[level ], texcoord[i], t0);
- sample_1d_nearest(ctx, tObj, tObj->Image[level+1], texcoord[i], t1);
+ sample_1d_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0);
+ sample_1d_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1);
rgba[i][RCOMP] = CHAN_CAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
rgba[i][GCOMP] = CHAN_CAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
rgba[i][BCOMP] = CHAN_CAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
GLint level;
COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
if (level >= tObj->_MaxLevel) {
- sample_1d_linear(ctx, tObj, tObj->Image[tObj->_MaxLevel],
+ sample_1d_linear(ctx, tObj, tObj->Image[0][tObj->_MaxLevel],
texcoord[i], rgba[i]);
}
else {
GLchan t0[4], t1[4];
const GLfloat f = FRAC(lambda[i]);
- sample_1d_linear(ctx, tObj, tObj->Image[level ], texcoord[i], t0);
- sample_1d_linear(ctx, tObj, tObj->Image[level+1], texcoord[i], t1);
+ sample_1d_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0);
+ sample_1d_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1);
rgba[i][RCOMP] = CHAN_CAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
rgba[i][GCOMP] = CHAN_CAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
rgba[i][BCOMP] = CHAN_CAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
GLchan rgba[][4] )
{
GLuint i;
- struct gl_texture_image *image = tObj->Image[tObj->BaseLevel];
+ struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
(void) lambda;
for (i=0;i<n;i++) {
sample_1d_nearest(ctx, tObj, image, texcoords[i], rgba[i]);
GLchan rgba[][4] )
{
GLuint i;
- struct gl_texture_image *image = tObj->Image[tObj->BaseLevel];
+ struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
(void) lambda;
for (i=0;i<n;i++) {
sample_1d_linear(ctx, tObj, image, texcoords[i], rgba[i]);
switch (tObj->MinFilter) {
case GL_NEAREST:
for (i = minStart; i < minEnd; i++)
- sample_1d_nearest(ctx, tObj, tObj->Image[tObj->BaseLevel],
+ sample_1d_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel],
texcoords[i], rgba[i]);
break;
case GL_LINEAR:
for (i = minStart; i < minEnd; i++)
- sample_1d_linear(ctx, tObj, tObj->Image[tObj->BaseLevel],
+ sample_1d_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel],
texcoords[i], rgba[i]);
break;
case GL_NEAREST_MIPMAP_NEAREST:
switch (tObj->MagFilter) {
case GL_NEAREST:
for (i = magStart; i < magEnd; i++)
- sample_1d_nearest(ctx, tObj, tObj->Image[tObj->BaseLevel],
+ sample_1d_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel],
texcoords[i], rgba[i]);
break;
case GL_LINEAR:
for (i = magStart; i < magEnd; i++)
- sample_1d_linear(ctx, tObj, tObj->Image[tObj->BaseLevel],
+ sample_1d_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel],
texcoords[i], rgba[i]);
break;
default:
for (i = 0; i < n; i++) {
GLint level;
COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
- sample_2d_nearest(ctx, tObj, tObj->Image[level], texcoord[i], rgba[i]);
+ sample_2d_nearest(ctx, tObj, tObj->Image[0][level], texcoord[i], rgba[i]);
}
}
for (i = 0; i < n; i++) {
GLint level;
COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
- sample_2d_linear(ctx, tObj, tObj->Image[level], texcoord[i], rgba[i]);
+ sample_2d_linear(ctx, tObj, tObj->Image[0][level], texcoord[i], rgba[i]);
}
}
GLint level;
COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
if (level >= tObj->_MaxLevel) {
- sample_2d_nearest(ctx, tObj, tObj->Image[tObj->_MaxLevel],
+ sample_2d_nearest(ctx, tObj, tObj->Image[0][tObj->_MaxLevel],
texcoord[i], rgba[i]);
}
else {
GLchan t0[4], t1[4]; /* texels */
const GLfloat f = FRAC(lambda[i]);
- sample_2d_nearest(ctx, tObj, tObj->Image[level ], texcoord[i], t0);
- sample_2d_nearest(ctx, tObj, tObj->Image[level+1], texcoord[i], t1);
+ sample_2d_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0);
+ sample_2d_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1);
rgba[i][RCOMP] = CHAN_CAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
rgba[i][GCOMP] = CHAN_CAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
rgba[i][BCOMP] = CHAN_CAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
GLint level;
COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
if (level >= tObj->_MaxLevel) {
- sample_2d_linear(ctx, tObj, tObj->Image[tObj->_MaxLevel],
+ sample_2d_linear(ctx, tObj, tObj->Image[0][tObj->_MaxLevel],
texcoord[i], rgba[i]);
}
else {
GLchan t0[4], t1[4]; /* texels */
const GLfloat f = FRAC(lambda[i]);
- sample_2d_linear(ctx, tObj, tObj->Image[level ], texcoord[i], t0);
- sample_2d_linear(ctx, tObj, tObj->Image[level+1], texcoord[i], t1);
+ sample_2d_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0);
+ sample_2d_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1);
rgba[i][RCOMP] = CHAN_CAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
rgba[i][GCOMP] = CHAN_CAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
rgba[i][BCOMP] = CHAN_CAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
GLint level;
COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
if (level >= tObj->_MaxLevel) {
- sample_2d_linear_repeat(ctx, tObj, tObj->Image[tObj->_MaxLevel],
+ sample_2d_linear_repeat(ctx, tObj, tObj->Image[0][tObj->_MaxLevel],
texcoord[i], rgba[i]);
}
else {
GLchan t0[4], t1[4]; /* texels */
const GLfloat f = FRAC(lambda[i]);
- sample_2d_linear_repeat(ctx, tObj, tObj->Image[level ], texcoord[i], t0);
- sample_2d_linear_repeat(ctx, tObj, tObj->Image[level+1], texcoord[i], t1);
+ sample_2d_linear_repeat(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0);
+ sample_2d_linear_repeat(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1);
rgba[i][RCOMP] = CHAN_CAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
rgba[i][GCOMP] = CHAN_CAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
rgba[i][BCOMP] = CHAN_CAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
const GLfloat lambda[], GLchan rgba[][4] )
{
GLuint i;
- struct gl_texture_image *image = tObj->Image[tObj->BaseLevel];
+ struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
(void) lambda;
for (i=0;i<n;i++) {
sample_2d_nearest(ctx, tObj, image, texcoords[i], rgba[i]);
const GLfloat lambda[], GLchan rgba[][4] )
{
GLuint i;
- struct gl_texture_image *image = tObj->Image[tObj->BaseLevel];
+ struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
(void) lambda;
for (i=0;i<n;i++) {
sample_2d_linear(ctx, tObj, image, texcoords[i], rgba[i]);
GLuint n, const GLfloat texcoords[][4],
const GLfloat lambda[], GLchan rgba[][4] )
{
- const struct gl_texture_image *img = tObj->Image[tObj->BaseLevel];
+ const struct gl_texture_image *img = tObj->Image[0][tObj->BaseLevel];
const GLfloat width = (GLfloat) img->Width;
const GLfloat height = (GLfloat) img->Height;
const GLint colMask = img->Width - 1;
GLuint n, const GLfloat texcoords[][4],
const GLfloat lambda[], GLchan rgba[][4] )
{
- const struct gl_texture_image *img = tObj->Image[tObj->BaseLevel];
+ const struct gl_texture_image *img = tObj->Image[0][tObj->BaseLevel];
const GLfloat width = (GLfloat) img->Width;
const GLfloat height = (GLfloat) img->Height;
const GLint colMask = img->Width - 1;
GLuint n, const GLfloat texcoords[][4],
const GLfloat lambda[], GLchan rgba[][4] )
{
- const struct gl_texture_image *tImg = tObj->Image[tObj->BaseLevel];
+ const struct gl_texture_image *tImg = tObj->Image[0][tObj->BaseLevel];
GLuint minStart, minEnd; /* texels with minification */
GLuint magStart, magEnd; /* texels with magnification */
for (i = 0; i < n; i++) {
GLint level;
COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
- sample_3d_nearest(ctx, tObj, tObj->Image[level], texcoord[i], rgba[i]);
+ sample_3d_nearest(ctx, tObj, tObj->Image[0][level], texcoord[i], rgba[i]);
}
}
for (i = 0; i < n; i++) {
GLint level;
COMPUTE_NEAREST_MIPMAP_LEVEL(tObj, lambda[i], level);
- sample_3d_linear(ctx, tObj, tObj->Image[level], texcoord[i], rgba[i]);
+ sample_3d_linear(ctx, tObj, tObj->Image[0][level], texcoord[i], rgba[i]);
}
}
GLint level;
COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
if (level >= tObj->_MaxLevel) {
- sample_3d_nearest(ctx, tObj, tObj->Image[tObj->_MaxLevel],
+ sample_3d_nearest(ctx, tObj, tObj->Image[0][tObj->_MaxLevel],
texcoord[i], rgba[i]);
}
else {
GLchan t0[4], t1[4]; /* texels */
const GLfloat f = FRAC(lambda[i]);
- sample_3d_nearest(ctx, tObj, tObj->Image[level ], texcoord[i], t0);
- sample_3d_nearest(ctx, tObj, tObj->Image[level+1], texcoord[i], t1);
+ sample_3d_nearest(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0);
+ sample_3d_nearest(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1);
rgba[i][RCOMP] = CHAN_CAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
rgba[i][GCOMP] = CHAN_CAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
rgba[i][BCOMP] = CHAN_CAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
GLint level;
COMPUTE_LINEAR_MIPMAP_LEVEL(tObj, lambda[i], level);
if (level >= tObj->_MaxLevel) {
- sample_3d_linear(ctx, tObj, tObj->Image[tObj->_MaxLevel],
+ sample_3d_linear(ctx, tObj, tObj->Image[0][tObj->_MaxLevel],
texcoord[i], rgba[i]);
}
else {
GLchan t0[4], t1[4]; /* texels */
const GLfloat f = FRAC(lambda[i]);
- sample_3d_linear(ctx, tObj, tObj->Image[level ], texcoord[i], t0);
- sample_3d_linear(ctx, tObj, tObj->Image[level+1], texcoord[i], t1);
+ sample_3d_linear(ctx, tObj, tObj->Image[0][level ], texcoord[i], t0);
+ sample_3d_linear(ctx, tObj, tObj->Image[0][level+1], texcoord[i], t1);
rgba[i][RCOMP] = CHAN_CAST ((1.0F-f) * t0[RCOMP] + f * t1[RCOMP]);
rgba[i][GCOMP] = CHAN_CAST ((1.0F-f) * t0[GCOMP] + f * t1[GCOMP]);
rgba[i][BCOMP] = CHAN_CAST ((1.0F-f) * t0[BCOMP] + f * t1[BCOMP]);
GLchan rgba[][4])
{
GLuint i;
- struct gl_texture_image *image = tObj->Image[tObj->BaseLevel];
+ struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
(void) lambda;
for (i=0;i<n;i++) {
sample_3d_nearest(ctx, tObj, image, texcoords[i], rgba[i]);
const GLfloat lambda[], GLchan rgba[][4] )
{
GLuint i;
- struct gl_texture_image *image = tObj->Image[tObj->BaseLevel];
+ struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
(void) lambda;
for (i=0;i<n;i++) {
sample_3d_linear(ctx, tObj, image, texcoords[i], rgba[i]);
switch (tObj->MinFilter) {
case GL_NEAREST:
for (i = minStart; i < minEnd; i++)
- sample_3d_nearest(ctx, tObj, tObj->Image[tObj->BaseLevel],
+ sample_3d_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel],
texcoords[i], rgba[i]);
break;
case GL_LINEAR:
for (i = minStart; i < minEnd; i++)
- sample_3d_linear(ctx, tObj, tObj->Image[tObj->BaseLevel],
+ sample_3d_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel],
texcoords[i], rgba[i]);
break;
case GL_NEAREST_MIPMAP_NEAREST:
switch (tObj->MagFilter) {
case GL_NEAREST:
for (i = magStart; i < magEnd; i++)
- sample_3d_nearest(ctx, tObj, tObj->Image[tObj->BaseLevel],
+ sample_3d_nearest(ctx, tObj, tObj->Image[0][tObj->BaseLevel],
texcoords[i], rgba[i]);
break;
case GL_LINEAR:
for (i = magStart; i < magEnd; i++)
- sample_3d_linear(ctx, tObj, tObj->Image[tObj->BaseLevel],
+ sample_3d_linear(ctx, tObj, tObj->Image[0][tObj->BaseLevel],
texcoords[i], rgba[i]);
break;
default:
if (arx > ary && arx > arz) {
if (rx >= 0.0F) {
- imgArray = (const struct gl_texture_image **) texObj->Image;
+ imgArray = (const struct gl_texture_image **) texObj->Image[FACE_POS_X];
sc = -rz;
tc = -ry;
ma = arx;
}
else {
- imgArray = (const struct gl_texture_image **) texObj->NegX;
+ imgArray = (const struct gl_texture_image **) texObj->Image[FACE_NEG_X];
sc = rz;
tc = -ry;
ma = arx;
}
else if (ary > arx && ary > arz) {
if (ry >= 0.0F) {
- imgArray = (const struct gl_texture_image **) texObj->PosY;
+ imgArray = (const struct gl_texture_image **) texObj->Image[FACE_POS_Y];
sc = rx;
tc = rz;
ma = ary;
}
else {
- imgArray = (const struct gl_texture_image **) texObj->NegY;
+ imgArray = (const struct gl_texture_image **) texObj->Image[FACE_NEG_Y];
sc = rx;
tc = -rz;
ma = ary;
}
else {
if (rz > 0.0F) {
- imgArray = (const struct gl_texture_image **) texObj->PosZ;
+ imgArray = (const struct gl_texture_image **) texObj->Image[FACE_POS_Z];
sc = rx;
tc = -ry;
ma = arz;
}
else {
- imgArray = (const struct gl_texture_image **) texObj->NegZ;
+ imgArray = (const struct gl_texture_image **) texObj->Image[FACE_NEG_Z];
sc = -rx;
tc = -ry;
ma = arz;
const GLfloat texcoords[][4], const GLfloat lambda[],
GLchan rgba[][4])
{
- const struct gl_texture_image *img = tObj->Image[0];
+ const struct gl_texture_image *img = tObj->Image[0][0];
const GLfloat width = (GLfloat) img->Width;
const GLfloat height = (GLfloat) img->Height;
const GLint width_minus_1 = img->Width - 1;
const GLfloat texcoords[][4],
const GLfloat lambda[], GLchan rgba[][4])
{
- const struct gl_texture_image *img = tObj->Image[0];
+ const struct gl_texture_image *img = tObj->Image[0][0];
const GLfloat width = (GLfloat) img->Width;
const GLfloat height = (GLfloat) img->Height;
const GLint width_minus_1 = img->Width - 1;
GLchan texel[][4] )
{
const GLint baseLevel = tObj->BaseLevel;
- const struct gl_texture_image *texImage = tObj->Image[baseLevel];
+ const struct gl_texture_image *texImage = tObj->Image[0][baseLevel];
const GLuint width = texImage->Width;
const GLuint height = texImage->Height;
GLchan ambient;
(void) unit;
- ASSERT(tObj->Image[tObj->BaseLevel]->Format == GL_DEPTH_COMPONENT);
+ ASSERT(tObj->Image[0][tObj->BaseLevel]->Format == GL_DEPTH_COMPONENT);
ASSERT(tObj->Target == GL_TEXTURE_1D ||
tObj->Target == GL_TEXTURE_2D ||
tObj->Target == GL_TEXTURE_RECTANGLE_NV);
{
const struct gl_texture_object *texObj = texUnit->_Current;
const GLint baseLevel = texObj->BaseLevel;
- const struct gl_texture_image *texImage = texObj->Image[baseLevel];
+ const struct gl_texture_image *texImage = texObj->Image[0][baseLevel];
const GLuint width = texImage->Width;
const GLuint height = texImage->Height;
GLchan ambient;
const struct gl_texture_object *t )
{
const GLboolean needLambda = (GLboolean) (t->MinFilter != t->MagFilter);
- const GLenum format = t->Image[t->BaseLevel]->Format;
+ const GLenum format = t->Image[0][t->BaseLevel]->Format;
if (!t->Complete) {
return &null_sample_func;
if (t->WrapS == GL_REPEAT &&
t->WrapT == GL_REPEAT &&
t->_IsPowerOfTwo &&
- t->Image[baseLevel]->Border == 0 &&
- t->Image[baseLevel]->TexFormat->MesaFormat == MESA_FORMAT_RGB) {
+ t->Image[0][baseLevel]->Border == 0 &&
+ t->Image[0][baseLevel]->TexFormat->MesaFormat == MESA_FORMAT_RGB) {
return &opt_sample_rgb_2d;
}
else if (t->WrapS == GL_REPEAT &&
t->WrapT == GL_REPEAT &&
t->_IsPowerOfTwo &&
- t->Image[baseLevel]->Border == 0 &&
- t->Image[baseLevel]->TexFormat->MesaFormat == MESA_FORMAT_RGBA) {
+ t->Image[0][baseLevel]->Border == 0 &&
+ t->Image[0][baseLevel]->TexFormat->MesaFormat == MESA_FORMAT_RGBA) {
return &opt_sample_rgba_2d;
}
else {
ASSERT(texUnit->_Current);
baseLevel = texUnit->_Current->BaseLevel;
- ASSERT(texUnit->_Current->Image[baseLevel]);
+ ASSERT(texUnit->_Current->Image[0][baseLevel]);
- format = texUnit->_Current->Image[baseLevel]->Format;
+ format = texUnit->_Current->Image[0][baseLevel]->Format;
if (format == GL_COLOR_INDEX || format == GL_YCBCR_MESA) {
format = GL_RGBA; /* a bit of a hack */
SWcontext *swrast = SWRAST_CONTEXT(ctx); \
struct gl_texture_object *obj = ctx->Texture.Unit[0].Current2D; \
const GLint b = obj->BaseLevel; \
- const GLfloat twidth = (GLfloat) obj->Image[b]->Width; \
- const GLfloat theight = (GLfloat) obj->Image[b]->Height; \
- const GLint twidth_log2 = obj->Image[b]->WidthLog2; \
- const GLchan *texture = (const GLchan *) obj->Image[b]->Data; \
- const GLint smask = obj->Image[b]->Width - 1; \
- const GLint tmask = obj->Image[b]->Height - 1; \
+ const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \
+ const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \
+ const GLint twidth_log2 = obj->Image[0][b]->WidthLog2; \
+ const GLchan *texture = (const GLchan *) obj->Image[0][b]->Data; \
+ const GLint smask = obj->Image[0][b]->Width - 1; \
+ const GLint tmask = obj->Image[0][b]->Height - 1; \
if (!texture) { \
/* this shouldn't happen */ \
return; \
SWcontext *swrast = SWRAST_CONTEXT(ctx); \
struct gl_texture_object *obj = ctx->Texture.Unit[0].Current2D; \
const GLint b = obj->BaseLevel; \
- const GLfloat twidth = (GLfloat) obj->Image[b]->Width; \
- const GLfloat theight = (GLfloat) obj->Image[b]->Height; \
- const GLint twidth_log2 = obj->Image[b]->WidthLog2; \
- const GLchan *texture = (const GLchan *) obj->Image[b]->Data; \
- const GLint smask = obj->Image[b]->Width - 1; \
- const GLint tmask = obj->Image[b]->Height - 1; \
+ const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \
+ const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \
+ const GLint twidth_log2 = obj->Image[0][b]->WidthLog2; \
+ const GLchan *texture = (const GLchan *) obj->Image[0][b]->Data; \
+ const GLint smask = obj->Image[0][b]->Width - 1; \
+ const GLint tmask = obj->Image[0][b]->Height - 1; \
if (!texture) { \
/* this shouldn't happen */ \
return; \
struct gl_texture_unit *unit = ctx->Texture.Unit+0; \
struct gl_texture_object *obj = unit->Current2D; \
const GLint b = obj->BaseLevel; \
- const GLfloat twidth = (GLfloat) obj->Image[b]->Width; \
- const GLfloat theight = (GLfloat) obj->Image[b]->Height; \
- info.texture = (const GLchan *) obj->Image[b]->Data; \
- info.twidth_log2 = obj->Image[b]->WidthLog2; \
- info.smask = obj->Image[b]->Width - 1; \
- info.tmask = obj->Image[b]->Height - 1; \
- info.format = obj->Image[b]->Format; \
+ const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \
+ const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \
+ info.texture = (const GLchan *) obj->Image[0][b]->Data; \
+ info.twidth_log2 = obj->Image[0][b]->WidthLog2; \
+ info.smask = obj->Image[0][b]->Width - 1; \
+ info.tmask = obj->Image[0][b]->Height - 1; \
+ info.format = obj->Image[0][b]->Format; \
info.filter = obj->MinFilter; \
info.envmode = unit->EnvMode; \
span.arrayMask |= SPAN_RGBA; \
case GL_ALPHA: \
case GL_LUMINANCE: \
case GL_INTENSITY: \
- info.tbytesline = obj->Image[b]->Width; \
+ info.tbytesline = obj->Image[0][b]->Width; \
break; \
case GL_LUMINANCE_ALPHA: \
- info.tbytesline = obj->Image[b]->Width * 2; \
+ info.tbytesline = obj->Image[0][b]->Width * 2; \
break; \
case GL_RGB: \
- info.tbytesline = obj->Image[b]->Width * 3; \
+ info.tbytesline = obj->Image[0][b]->Width * 3; \
break; \
case GL_RGBA: \
- info.tbytesline = obj->Image[b]->Width * 4; \
+ info.tbytesline = obj->Image[0][b]->Width * 4; \
break; \
default: \
_mesa_problem(NULL, "Bad texture format in affine_texture_triangle");\
return; \
} \
- info.tsize = obj->Image[b]->Height * info.tbytesline;
+ info.tsize = obj->Image[0][b]->Height * info.tbytesline;
#define RENDER_SPAN( span ) affine_span(ctx, &span, &info);
const struct gl_texture_unit *unit = ctx->Texture.Unit+0; \
const struct gl_texture_object *obj = unit->Current2D; \
const GLint b = obj->BaseLevel; \
- info.texture = (const GLchan *) obj->Image[b]->Data; \
- info.twidth_log2 = obj->Image[b]->WidthLog2; \
- info.smask = obj->Image[b]->Width - 1; \
- info.tmask = obj->Image[b]->Height - 1; \
- info.format = obj->Image[b]->Format; \
+ info.texture = (const GLchan *) obj->Image[0][b]->Data; \
+ info.twidth_log2 = obj->Image[0][b]->WidthLog2; \
+ info.smask = obj->Image[0][b]->Width - 1; \
+ info.tmask = obj->Image[0][b]->Height - 1; \
+ info.format = obj->Image[0][b]->Format; \
info.filter = obj->MinFilter; \
info.envmode = unit->EnvMode; \
\
case GL_ALPHA: \
case GL_LUMINANCE: \
case GL_INTENSITY: \
- info.tbytesline = obj->Image[b]->Width; \
+ info.tbytesline = obj->Image[0][b]->Width; \
break; \
case GL_LUMINANCE_ALPHA: \
- info.tbytesline = obj->Image[b]->Width * 2; \
+ info.tbytesline = obj->Image[0][b]->Width * 2; \
break; \
case GL_RGB: \
- info.tbytesline = obj->Image[b]->Width * 3; \
+ info.tbytesline = obj->Image[0][b]->Width * 3; \
break; \
case GL_RGBA: \
- info.tbytesline = obj->Image[b]->Width * 4; \
+ info.tbytesline = obj->Image[0][b]->Width * 4; \
break; \
default: \
_mesa_problem(NULL, "Bad texture format in persp_textured_triangle");\
return; \
} \
- info.tsize = obj->Image[b]->Height * info.tbytesline;
+ info.tsize = obj->Image[0][b]->Height * info.tbytesline;
#define RENDER_SPAN( span ) \
span.interpMask &= ~SPAN_RGBA; \
GLenum minFilter, magFilter, envMode;
GLint format;
texObj2D = ctx->Texture.Unit[0].Current2D;
- texImg = texObj2D ? texObj2D->Image[texObj2D->BaseLevel] : NULL;
+ texImg = texObj2D ? texObj2D->Image[0][texObj2D->BaseLevel] : NULL;
format = texImg ? texImg->TexFormat->MesaFormat : -1;
minFilter = texObj2D ? texObj2D->MinFilter : (GLenum) 0;
magFilter = texObj2D ? texObj2D->MagFilter : (GLenum) 0;