diff options
author | Brian Paul <[email protected]> | 2012-06-05 16:32:23 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-06-06 07:56:00 -0600 |
commit | e8fdd0e0d5286f4a9c763ffde44decec51124ebc (patch) | |
tree | cb07e2c420c728b9b395f6199a216ddb2e874e78 /src/mesa/main | |
parent | cd9ab2584f5e2a5eb0e96a948e6aedc9a33c886d (diff) |
mesa: consolidate internal glCompressedTexImage1/2/3D code
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/dd.h | 39 | ||||
-rw-r--r-- | src/mesa/main/teximage.c | 29 | ||||
-rw-r--r-- | src/mesa/main/texstore.c | 62 | ||||
-rw-r--r-- | src/mesa/main/texstore.h | 26 |
4 files changed, 31 insertions, 125 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index f66e754baea..07106ac3684 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -269,37 +269,14 @@ struct dd_function_table { /*@{*/ /** - * Called by glCompressedTexImage1D(). - * The parameters are the same as for glCompressedTexImage1D(), plus a - * pointer to the destination texure image. - */ - void (*CompressedTexImage1D)(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint internalFormat, - GLsizei width, GLint border, - GLsizei imageSize, const GLvoid *data); - /** - * Called by glCompressedTexImage2D(). - * - * \sa dd_function_table::CompressedTexImage1D. - */ - void (*CompressedTexImage2D)(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint internalFormat, - GLsizei width, GLsizei height, GLint border, - GLsizei imageSize, const GLvoid *data); - - /** - * Called by glCompressedTexImage3D(). - * - * \sa dd_function_table::CompressedTexImage3D. - */ - void (*CompressedTexImage3D)(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint internalFormat, - GLsizei width, GLsizei height, GLsizei depth, - GLint border, - GLsizei imageSize, const GLvoid *data); + * Called by glCompressedTexImage[123]D(). + */ + void (*CompressedTexImage)(struct gl_context *ctx, GLuint dims, + struct gl_texture_image *texImage, + GLint internalFormat, + GLsizei width, GLsizei height, GLsizei depth, + GLint border, + GLsizei imageSize, const GLvoid *data); /** * Called by glCompressedTexSubImage1D(). diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index ce42246317f..290a4e454dc 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -3541,31 +3541,10 @@ compressedteximage(struct gl_context *ctx, GLuint dims, width, height, depth, border, internalFormat, texFormat); - switch (dims) { - case 1: - ASSERT(ctx->Driver.CompressedTexImage1D); - ctx->Driver.CompressedTexImage1D(ctx, texImage, - internalFormat, - width, - border, imageSize, data); - break; - case 2: - ASSERT(ctx->Driver.CompressedTexImage2D); - ctx->Driver.CompressedTexImage2D(ctx, texImage, - internalFormat, - width, height, - border, imageSize, data); - break; - case 3: - ASSERT(ctx->Driver.CompressedTexImage3D); - ctx->Driver.CompressedTexImage3D(ctx, texImage, - internalFormat, - width, height, depth, - border, imageSize, data); - break; - default: - _mesa_problem(ctx, "bad dims in compressedteximage"); - } + ctx->Driver.CompressedTexImage(ctx, dims, texImage, + internalFormat, + width, height, depth, + border, imageSize, data); check_gen_mipmap(ctx, target, texObj, level); diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index ce8f36bfc2f..37ba082a475 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -4309,36 +4309,23 @@ _mesa_store_texsubimage(struct gl_context *ctx, GLuint dims, } -/* - * Fallback for Driver.CompressedTexImage1D() - */ -void -_mesa_store_compressed_teximage1d(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint internalFormat, - GLint width, GLint border, - GLsizei imageSize, const GLvoid *data) -{ - /* no compressed 1D image formats at this time */ - (void) ctx; - (void) internalFormat; - (void) width; (void) border; - (void) imageSize; (void) data; - (void) texImage; -} - - - /** - * Fallback for Driver.CompressedTexImage2D() + * Fallback for Driver.CompressedTexImage() */ void -_mesa_store_compressed_teximage2d(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint internalFormat, - GLint width, GLint height, GLint border, - GLsizei imageSize, const GLvoid *data) +_mesa_store_compressed_teximage(struct gl_context *ctx, GLuint dims, + struct gl_texture_image *texImage, + GLint internalFormat, + GLint width, GLint height, GLint depth, + GLint border, + GLsizei imageSize, const GLvoid *data) { + /* only 2D compressed images are supported at this time */ + if (dims != 2) { + _mesa_problem(ctx, "Unexpected glCompressedTexImage1D/3D call"); + return; + } + /* This is pretty simple, because unlike the general texstore path we don't * have to worry about the usual image unpacking or image transfer * operations. @@ -4363,29 +4350,6 @@ _mesa_store_compressed_teximage2d(struct gl_context *ctx, } - -/* - * Fallback for Driver.CompressedTexImage3D() - */ -void -_mesa_store_compressed_teximage3d(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint internalFormat, - GLint width, GLint height, GLint depth, - GLint border, - GLsizei imageSize, const GLvoid *data) -{ - /* this space intentionally left blank */ - (void) ctx; - (void) internalFormat; - (void) width; (void) height; (void) depth; - (void) border; - (void) imageSize; (void) data; - (void) texImage; -} - - - /** * Fallback for Driver.CompressedTexSubImage1D() */ diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index e6eb2fb4811..68dc4b47960 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -109,26 +109,12 @@ _mesa_store_texsubimage(struct gl_context *ctx, GLuint dims, extern void -_mesa_store_compressed_teximage1d(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint internalFormat, - GLint width, GLint border, - GLsizei imageSize, const GLvoid *data); - -extern void -_mesa_store_compressed_teximage2d(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint internalFormat, - GLint width, GLint height, GLint border, - GLsizei imageSize, const GLvoid *data); - -extern void -_mesa_store_compressed_teximage3d(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint internalFormat, - GLint width, GLint height, GLint depth, - GLint border, - GLsizei imageSize, const GLvoid *data); +_mesa_store_compressed_teximage(struct gl_context *ctx, GLuint dims, + struct gl_texture_image *texImage, + GLint internalFormat, + GLint width, GLint height, GLint depth, + GLint border, + GLsizei imageSize, const GLvoid *data); extern void |