diff options
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r-- | src/mesa/main/texstore.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 8af23ae07c2..a2bd8989694 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -2207,7 +2207,7 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, sizeInBytes = texImage->CompressedSize; else sizeInBytes = postConvWidth * texImage->TexFormat->TexelBytes; - texImage->Data = _mesa_malloc(sizeInBytes); + texImage->Data = _mesa_alloc_texmemory(sizeInBytes); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); return; @@ -2295,7 +2295,7 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, sizeInBytes = texImage->CompressedSize; else sizeInBytes = postConvWidth * postConvHeight * texelBytes; - texImage->Data = _mesa_malloc(sizeInBytes); + texImage->Data = _mesa_alloc_texmemory(sizeInBytes); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); return; @@ -2375,7 +2375,7 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, sizeInBytes = texImage->CompressedSize; else sizeInBytes = width * height * depth * texelBytes; - texImage->Data = _mesa_malloc(sizeInBytes); + texImage->Data = _mesa_alloc_texmemory(sizeInBytes); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); return; @@ -2633,7 +2633,7 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, texImage->FetchTexelf = texImage->TexFormat->FetchTexel2Df; /* allocate storage */ - texImage->Data = _mesa_malloc(imageSize); + texImage->Data = _mesa_alloc_texmemory(imageSize); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2DARB"); return; @@ -3674,7 +3674,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, /* Free old image data */ if (dstImage->Data) - _mesa_free(dstImage->Data); + ctx->Driver.FreeTexImageData(ctx, dstImage); /* initialize new image */ _mesa_init_teximage_fields(ctx, target, dstImage, dstWidth, dstHeight, @@ -3692,7 +3692,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, */ if (dstImage->IsCompressed) { ASSERT(dstImage->CompressedSize > 0); /* set by init_teximage_fields*/ - dstImage->Data = _mesa_malloc(dstImage->CompressedSize); + dstImage->Data = _mesa_alloc_texmemory(dstImage->CompressedSize); if (!dstImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps"); return; @@ -3704,8 +3704,8 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, else { bytesPerTexel = srcImage->TexFormat->TexelBytes; ASSERT(dstWidth * dstHeight * dstDepth * bytesPerTexel > 0); - dstImage->Data = _mesa_malloc(dstWidth * dstHeight * dstDepth - * bytesPerTexel); + dstImage->Data = _mesa_alloc_texmemory(dstWidth * dstHeight + * dstDepth * bytesPerTexel); if (!dstImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps"); return; |