[Mesa-dev] [PATCH 1/2] mesa: Fix glCompressedTexSubImage (and non-Sub) for height == 2 or 1.

Brian Paul brianp at vmware.com
Fri Dec 2 06:15:46 PST 2011


On 12/01/2011 09:30 PM, Eric Anholt wrote:
> Generally this code works with width and height aligned to compressed
> blocks, but but at the 2x2 and 1x1 levels of a square texture (or
> height<  bh in general), we were skipping uploading our single row of
> blocks.
>
> Fixes piglit compressedteximage GL_COMPRESSED_RGBA_S3TC_DXT5_EXT.
> ---
>   src/mesa/main/texstore.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
> index ef43ed9..78b64ce 100644
> --- a/src/mesa/main/texstore.c
> +++ b/src/mesa/main/texstore.c
> @@ -5138,7 +5138,7 @@ _mesa_store_compressed_texsubimage2d(struct gl_context *ctx, GLenum target,
>
>      if (dstMap) {
>         bytesPerRow = srcRowStride;  /* bytes per row of blocks */
> -      rows = height / bh;  /* rows in blocks */
> +      rows = (height + bh - 1) / bh;  /* rows in blocks */
>
>         /* copy rows of blocks */
>         for (i = 0; i<  rows; i++) {


Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the mesa-dev mailing list