diff options
author | Gareth Hughes <[email protected]> | 2001-03-28 20:40:51 +0000 |
---|---|---|
committer | Gareth Hughes <[email protected]> | 2001-03-28 20:40:51 +0000 |
commit | 38f28665bf9fb5b2464738ca5074848ec2777ae1 (patch) | |
tree | d7df29f52814f6cd466b3ad9c3252c744ee5071c /src/mesa/main/texstore.c | |
parent | 53933fe9dbfae168dce0688b406810462a6d577b (diff) |
More texture format updates. Drivers now need only plug an appropriate
format into texImage->TexFormat, the rest is handled by core Mesa.
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r-- | src/mesa/main/texstore.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index c1d9dfc4bc8..0647b2c7d55 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1,4 +1,4 @@ -/* $Id: texstore.c,v 1.20 2001/03/27 20:26:10 brianp Exp $ */ +/* $Id: texstore.c,v 1.21 2001/03/28 20:40:51 gareth Exp $ */ /* * Mesa 3-D graphics library @@ -406,7 +406,6 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, /* setup the teximage struct's fields */ _mesa_init_tex_format( ctx, internalFormat, texImage ); - texImage->FetchTexel = texImage->TexFormat->FetchTexel1D; texelBytes = texImage->TexFormat->TexelBytes; @@ -450,7 +449,6 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, /* setup the teximage struct's fields */ _mesa_init_tex_format( ctx, internalFormat, texImage ); - texImage->FetchTexel = texImage->TexFormat->FetchTexel2D; texelBytes = texImage->TexFormat->TexelBytes; @@ -490,7 +488,6 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, /* setup the teximage struct's fields */ _mesa_init_tex_format( ctx, internalFormat, texImage ); - texImage->FetchTexel = texImage->TexFormat->FetchTexel3D; texelBytes = texImage->TexFormat->TexelBytes; @@ -542,12 +539,10 @@ _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - const GLint components = components_in_intformat(texImage->IntFormat); - const GLint compSize = _mesa_sizeof_type(texImage->Type); _mesa_transfer_teximage(ctx, 2, texImage->Format, texImage->Data, width, height, 1, /* src size */ xoffset, yoffset, 0, /* dest offsets */ - texImage->Width * components * compSize, + texImage->Width * texImage->TexFormat->TexelBytes, 0, /* dstImageStride */ format, type, pixels, packing); } @@ -565,14 +560,12 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - const GLint components = components_in_intformat(texImage->IntFormat); - const GLint compSize = _mesa_sizeof_type(texImage->Type); + const GLint texelBytes = texImage->TexFormat->TexelBytes; _mesa_transfer_teximage(ctx, 3, texImage->Format, texImage->Data, width, height, depth, /* src size */ xoffset, yoffset, xoffset, /* dest offsets */ - texImage->Width * components * compSize, - texImage->Width * texImage->Height * components - * compSize, + texImage->Width * texelBytes, + texImage->Width * texImage->Height * texelBytes, format, type, pixels, packing); } @@ -648,7 +641,6 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; - const struct gl_texture_format *texFormat; (void) format; (void) type; @@ -665,9 +657,5 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, /* setup the teximage struct's fields */ _mesa_init_tex_format( ctx, internalFormat, texImage ); - texFormat = texImage->TexFormat; - texImage->Format = texFormat->BaseFormat; - texImage->Type = texFormat->BaseType; - return GL_TRUE; } |