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 | ec19bdd16c3d4070af69fd865042babe0a627595 (patch) | |
tree | d39293036df9b454e8c1d13350dbe7530924868c /src/mesa/main/texstore.c | |
parent | e8fdd0e0d5286f4a9c763ffde44decec51124ebc (diff) |
mesa: consolidate internal glCompressedTexSubImage1/2/3D code
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r-- | src/mesa/main/texstore.c | 69 |
1 files changed, 17 insertions, 52 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 37ba082a475..1ced8aac98d 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -4342,43 +4342,24 @@ _mesa_store_compressed_teximage(struct gl_context *ctx, GLuint dims, return; } - _mesa_store_compressed_texsubimage2d(ctx, texImage, - 0, 0, - width, height, - texImage->TexFormat, - imageSize, data); + _mesa_store_compressed_texsubimage(ctx, dims, texImage, + 0, 0, 0, + width, height, depth, + texImage->TexFormat, + imageSize, data); } /** - * Fallback for Driver.CompressedTexSubImage1D() + * Fallback for Driver.CompressedTexSubImage() */ void -_mesa_store_compressed_texsubimage1d(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint xoffset, GLsizei width, - GLenum format, - GLsizei imageSize, const GLvoid *data) -{ - /* there are no compressed 1D texture formats yet */ - (void) ctx; - (void) xoffset; (void) width; - (void) format; - (void) imageSize; (void) data; - (void) texImage; -} - - -/** - * Fallback for Driver.CompressedTexSubImage2D() - */ -void -_mesa_store_compressed_texsubimage2d(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, - GLsizei imageSize, const GLvoid *data) +_mesa_store_compressed_texsubimage(struct gl_context *ctx, GLuint dims, + struct gl_texture_image *texImage, + GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, + GLsizei imageSize, const GLvoid *data) { GLint bytesPerRow, dstRowStride, srcRowStride; GLint i, rows; @@ -4387,6 +4368,11 @@ _mesa_store_compressed_texsubimage2d(struct gl_context *ctx, const gl_format texFormat = texImage->TexFormat; GLuint bw, bh; + if (dims != 2) { + _mesa_problem(ctx, "Unexpected 1D/3D compressed texsubimage call"); + return; + } + _mesa_get_format_block_size(texFormat, &bw, &bh); /* these should have been caught sooner */ @@ -4430,24 +4416,3 @@ _mesa_store_compressed_texsubimage2d(struct gl_context *ctx, _mesa_unmap_teximage_pbo(ctx, &ctx->Unpack); } - - -/** - * Fallback for Driver.CompressedTexSubImage3D() - */ -void -_mesa_store_compressed_texsubimage3d(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, - GLsizei imageSize, const GLvoid *data) -{ - /* there are no compressed 3D texture formats yet */ - (void) ctx; - (void) xoffset; (void) yoffset; (void) zoffset; - (void) width; (void) height; (void) depth; - (void) format; - (void) imageSize; (void) data; - (void) texImage; -} |