else {
/* Allocate regular memory and store the image there temporarily. */
if (_mesa_is_format_compressed(texImage->TexFormat)) {
- sizeInBytes = ctx->Driver.CompressedTextureSize(ctx,
- texImage->Width,
- texImage->Height,
- texImage->Depth,
- texImage->TexFormat);
+ sizeInBytes = _mesa_format_image_size(texImage->TexFormat,
+ texImage->Width,
+ texImage->Height,
+ texImage->Depth);
dstRowStride =
_mesa_compressed_row_stride(texImage->TexFormat, width);
assert(dims != 3);
} else {
int size;
if (_mesa_is_format_compressed(texImage->TexFormat)) {
- size = ctx->Driver.CompressedTextureSize(ctx,
- texImage->Width,
- texImage->Height,
- texImage->Depth,
- texImage->TexFormat);
-
+ size = _mesa_format_image_size(texImage->TexFormat,
+ texImage->Width,
+ texImage->Height,
+ texImage->Depth);
} else {
size = texImage->Width * texImage->Height * texImage->Depth * _mesa_get_format_bytes(texImage->TexFormat);
}
texelBytes = _mesa_get_format_bytes(texImage->TexFormat);
if (_mesa_is_format_compressed(texImage->TexFormat)) {
- GLuint compressedSize = ctx->Driver.CompressedTextureSize(ctx,
- mml->width,
- mml->height,
- 1,
- mesaFormat);
+ GLuint compressedSize = _mesa_format_image_size(mesaFormat, mml->width,
+ mml->height, 1);
dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, mml->width);
texImage->Data = _mesa_alloc_texmemory(compressedSize);
} else {
/* allocate new storage for texture image, if needed */
if (!texImage->Data) {
- compressedSize = ctx->Driver.CompressedTextureSize(ctx,
- mml->width,
- mml->height,
- 1,
- mesaFormat);
+ compressedSize = _mesa_format_image_size(mesaFormat, mml->width,
+ mml->height, 1);
texImage->Data = _mesa_alloc_texmemory(compressedSize);
if (!texImage->Data) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
struct via_texture_object *viaObj = (struct via_texture_object *)texObj;
struct via_texture_image *viaImage = (struct via_texture_image *)texImage;
int heaps[3], nheaps, i;
- GLuint compressedSize;
if (!is_empty_list(&vmesa->freed_tex_buffers)) {
viaCheckBreadcrumb(vmesa, 0);
texelBytes = _mesa_get_format_bytes(texImage->TexFormat);
- if (texelBytes == 0) {
- /* compressed format */
- compressedSize =
- ctx->Driver.CompressedTextureSize(ctx, texImage->Width,
- texImage->Height, texImage->Depth,
- texImage->TexFormat);
- }
-
/* Minimum pitch of 32 bytes */
if (postConvWidth * texelBytes < 32) {
postConvWidth = 32 / texelBytes;
/* allocate memory */
if (_mesa_is_format_compressed(texImage->TexFormat))
- sizeInBytes = compressedSize;
+ sizeInBytes = _mesa_format_image_size(texImage->TexFormat,
+ texImage->Width,
+ texImage->Height,
+ texImage->Depth);
else
sizeInBytes = postConvWidth * postConvHeight * texelBytes;
* Setup src and dest data pointers.
*/
if (_mesa_is_format_compressed(dstImage->TexFormat)) {
- GLuint dstCompressedSize
- = ctx->Driver.CompressedTextureSize(ctx, dstImage->Width,
- dstImage->Height,
- dstImage->Depth,
- dstImage->TexFormat);
+ GLuint dstCompressedSize =
+ _mesa_format_image_size(dstImage->TexFormat, dstImage->Width,
+ dstImage->Height, dstImage->Depth);
ASSERT(dstCompressedSize > 0);
dstImage->Data = _mesa_alloc_texmemory(dstCompressedSize);
else {
/* Allocate regular memory and store the image there temporarily. */
if (_mesa_is_format_compressed(texImage->TexFormat)) {
- sizeInBytes = ctx->Driver.CompressedTextureSize(ctx,
- texImage->Width,
- texImage->Height,
- texImage->Depth,
- texImage->TexFormat);
+ sizeInBytes = _mesa_format_image_size(texImage->TexFormat,
+ texImage->Width,
+ texImage->Height,
+ texImage->Depth);
dstRowStride =
_mesa_compressed_row_stride(texImage->TexFormat, width);
assert(dims != 3);