Bug #5754: Allocate texture memory correctly. (Richard Drummond)
authorAdam Jackson <ajax@freedesktop.org>
Mon, 3 Apr 2006 21:28:07 +0000 (21:28 +0000)
committerAdam Jackson <ajax@freedesktop.org>
Mon, 3 Apr 2006 21:28:07 +0000 (21:28 +0000)
src/mesa/drivers/dri/tdfx/tdfx_tex.c

index f293c3f2f826e9a8a443c90cc8d4de4e80487021..fe40953a1b3bbc2423f206ffeb3358f5795b1b78 100644 (file)
@@ -1357,10 +1357,11 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level,
                                                                1,
                                                                internalFormat);
        dstRowStride = _mesa_compressed_row_stride(internalFormat, mml->width);
-       texImage->Data = _mesa_malloc(texImage->CompressedSize);
+       texImage->Data = _mesa_alloc_texmemory(texImage->CompressedSize);
     } else {
        dstRowStride = mml->width * texelBytes;
-       texImage->Data = _mesa_malloc(mml->width * mml->height * texelBytes);
+       texImage->Data = _mesa_alloc_texmemory(mml->width * mml->height *
+                                             texelBytes);
     }
     if (!texImage->Data) {
        _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
@@ -1663,7 +1664,7 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target,
                                                                 mml->height,
                                                                 1,
                                                                 internalFormat);
-       texImage->Data = _mesa_malloc(texImage->CompressedSize);
+       texImage->Data = _mesa_alloc_texmemory(texImage->CompressedSize);
        if (!texImage->Data) {
           _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
           return;