summaryrefslogtreecommitdiff
path: root/src/mesa/main/texstore.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-04-01 16:41:50 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-04-01 16:41:50 +0000
commita3f137094cd965d27e1b088499dd609b81a91906 (patch)
tree76d361c0998c5fbe55ce7d665ac8f1d2ca6e2e0f /src/mesa/main/texstore.c
parent926c34f89453c9b0455910bbdbe20b52d909d962 (diff)
New device driver hooks for texture object and texture image creation to
allow drivers to implement C++-like inheritance via containment. Lots of assorted clean-ups related to texture objects.
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r--src/mesa/main/texstore.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 117696896e..08e625bc0d 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -1,4 +1,4 @@
-/* $Id: texstore.c,v 1.54 2003/03/04 19:16:23 brianp Exp $ */
+/* $Id: texstore.c,v 1.55 2003/04/01 16:41:55 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -482,6 +482,7 @@ _mesa_transfer_teximage(GLcontext *ctx, GLuint dimensions,
baseInternalFormat == GL_ALPHA ||
baseInternalFormat == GL_RGB ||
baseInternalFormat == GL_RGBA ||
+ baseInternalFormat == GL_COLOR_INDEX ||
baseInternalFormat == GL_DEPTH_COMPONENT);
if (transferOps & IMAGE_CONVOLUTION_BIT) {
@@ -1274,16 +1275,12 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
GLint internalFormat, GLenum format, GLenum type,
GLint width, GLint height, GLint depth, GLint border)
{
- struct gl_texture_unit *texUnit;
- struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
(void) format;
(void) type;
- texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
- texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
+ texImage = _mesa_get_proxy_tex_image(ctx, target, level);
/* We always pass.
* The core Mesa code will have already tested the image size, etc.
@@ -2011,14 +2008,10 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
}
/* get dest gl_texture_image */
- dstImage = _mesa_select_tex_image(ctx, texUnit, target, level+1);
+ dstImage = _mesa_get_tex_image(ctx, texUnit, target, level + 1);
if (!dstImage) {
- dstImage = _mesa_alloc_texture_image();
- if (!dstImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
- return;
- }
- _mesa_set_tex_image(texObj, target, level + 1, dstImage);
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
+ return;
}
/* Free old image data */