diff options
author | Brian Paul <brianp@vmware.com> | 2014-08-15 15:21:01 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2014-08-16 06:48:44 -0600 |
commit | 9b4c6da7f08f3e1ae5df2d51e2b1dcf316d19288 (patch) | |
tree | 6332c99b5183aa09e9bdeaf2cee1c49851046ac5 /src/mesa/main/texstore.c | |
parent | 1e594d4f5c03ff9a59ab9a692ef94d122b491211 (diff) |
mesa: minor improvements to _mesa_compute_compressed_pixelstore()
Replace the gl_texture_image parameter with mesa_format since we only
used the image's format.
Add some comments.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r-- | src/mesa/main/texstore.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index f2eb0def233..d2aba8ba1e3 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -2191,14 +2191,23 @@ _mesa_store_compressed_teximage(struct gl_context *ctx, GLuint dims, } +/** + * Compute compressed_pixelstore parameters for copying compressed + * texture data. + * \param dims number of texture image dimensions: 1, 2 or 3 + * \param texFormat the compressed texture format + * \param width, height, depth size of image to copy + * \param packing pixelstore parameters describing user-space image packing + * \param store returns the compressed_pixelstore parameters + */ void -_mesa_compute_compressed_pixelstore(GLuint dims, struct gl_texture_image *texImage, - GLsizei width, GLsizei height, GLsizei depth, - const struct gl_pixelstore_attrib *packing, - struct compressed_pixelstore *store) +_mesa_compute_compressed_pixelstore(GLuint dims, mesa_format texFormat, + GLsizei width, GLsizei height, + GLsizei depth, + const struct gl_pixelstore_attrib *packing, + struct compressed_pixelstore *store) { GLuint bw, bh; - const mesa_format texFormat = texImage->TexFormat; _mesa_get_format_block_size(texFormat, &bw, &bh); @@ -2268,8 +2277,9 @@ _mesa_store_compressed_texsubimage(struct gl_context *ctx, GLuint dims, return; } - _mesa_compute_compressed_pixelstore(dims, texImage, width, height, depth, - &ctx->Unpack, &store); + _mesa_compute_compressed_pixelstore(dims, texImage->TexFormat, + width, height, depth, + &ctx->Unpack, &store); /* get pointer to src pixels (may be in a pbo which we'll map here) */ data = _mesa_validate_pbo_compressed_teximage(ctx, dims, imageSize, data, |