_mesa_set_fetch_functions(texImage, dims);
- if (texImage->TexFormat->TexelBytes == 0) {
- /* must be a compressed format */
+ if (_mesa_is_format_compressed(texImage->TexFormat->MesaFormat)) {
texelBytes = 0;
texImage->IsCompressed = GL_TRUE;
texImage->CompressedSize =
texImage->Height, texImage->Depth,
texImage->TexFormat->MesaFormat);
} else {
- texelBytes = texImage->TexFormat->TexelBytes;
+ texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat);
/* Minimum pitch of 32 bytes */
if (postConvWidth * texelBytes < 32) {
assert(dims != 3);
}
else {
- dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes;
+ dstRowStride = texImage->RowStride * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat);
}
}
* directly used by the hardware for texturing.
*/
- texelBytes = texImage->TexFormat->TexelBytes;
+ texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat);
length = texImage->Width * texImage->Height * texelBytes;
if ( t->base.heap->heapId == MGA_CARD_HEAP ) {
unsigned tex_offset = 0;
if (!texImage->IsCompressed &&
!mt->compressed &&
- texImage->TexFormat->TexelBytes != mt->bpp)
+ _mesa_get_format_bytes(texImage->TexFormat->MesaFormat) != mt->bpp)
return GL_FALSE;
lvl = &mt->levels[level - mt->firstLevel];
texImage->TexFormat = radeonChooseTextureFormat(ctx, internalFormat, format, type, 0);
_mesa_set_fetch_functions(texImage, dims);
- if (texImage->TexFormat->TexelBytes == 0) {
+ if (_mesa_is_format_compressed(texImage->TexFormat->MesaFormat)) {
texelBytes = 0;
texImage->IsCompressed = GL_TRUE;
texImage->CompressedSize =
texImage->IsCompressed = GL_FALSE;
texImage->CompressedSize = 0;
- texelBytes = texImage->TexFormat->TexelBytes;
+ texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat);
/* Minimum pitch of 32 bytes */
if (postConvWidth * texelBytes < 32) {
postConvWidth = 32 / texelBytes;
if (texImage->IsCompressed) {
size = texImage->CompressedSize;
} else {
- size = texImage->Width * texImage->Height * texImage->Depth * texImage->TexFormat->TexelBytes;
+ size = texImage->Width * texImage->Height * texImage->Depth * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat);
}
texImage->Data = _mesa_alloc_texmemory(size);
}
radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel];
dstRowStride = lvl->rowstride;
} else {
- dstRowStride = texImage->Width * texImage->TexFormat->TexelBytes;
+ dstRowStride = texImage->Width * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat);
}
if (dims == 3) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
for (i = 0; i < depth; ++i) {
- dstImageOffsets[i] = dstRowStride/texImage->TexFormat->TexelBytes * height * i;
+ dstImageOffsets[i] = dstRowStride/_mesa_get_format_bytes(texImage->TexFormat->MesaFormat) * height * i;
}
} else {
dstImageOffsets = texImage->ImageOffsets;
radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel];
dstRowStride = lvl->rowstride;
} else {
- dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes;
+ dstRowStride = texImage->RowStride * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat);
}
if (compressed) {
/* Upload the texture */
WaitEngIdle(smesa);
- texelBytes = texImage->TexFormat->TexelBytes;
+ texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat);
copySize = width * texelBytes;
src = (char *)texImage->Data + xoffset * texelBytes;
/* Upload the texture */
WaitEngIdle(smesa);
- texelBytes = texImage->TexFormat->TexelBytes;
+ texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat);
copySize = width * texelBytes;
src = (char *)texImage->Data + (xoffset + yoffset * texImage->Width) *
mml->glideFormat = fxGlideFormat(mesaFormat);
ti->info.format = mml->glideFormat;
texImage->FetchTexelc = fxFetchFunction(mesaFormat);
- texelBytes = texImage->TexFormat->TexelBytes;
+ texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat);
if (texImage->IsCompressed) {
texImage->CompressedSize = _mesa_compressed_texture_size(ctx,
assert(texImage->Data); /* must have an existing texture image! */
assert(texImage->_BaseFormat);
- texelBytes = texImage->TexFormat->TexelBytes;
+ texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat);
if (texImage->IsCompressed) {
dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, mml->width);
} else {