[Mesa-dev] [PATCH 2/2] mesa: handle SwapBytes in compressed texture get code.

Brian Paul brianp at vmware.com
Tue Sep 1 07:32:59 PDT 2015


On 08/31/2015 10:50 PM, Dave Airlie wrote:
> This case just wasn't handled, so add support for it.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>   src/mesa/main/texgetimage.c | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
> index 0c23687..52ed1ef 100644
> --- a/src/mesa/main/texgetimage.c
> +++ b/src/mesa/main/texgetimage.c
> @@ -361,6 +361,13 @@ get_tex_rgba_compressed(struct gl_context *ctx, GLuint dimensions,
>                              tempSlice, RGBA32_FLOAT, srcStride,
>                              width, height,
>                              needsRebase ? rebaseSwizzle : NULL);
> +
> +      /* Handle byte swapping if required */
> +      if (ctx->Pack.SwapBytes) {
> +         _mesa_swap_bytes_2d_image(format, type, &ctx->Pack,
> +                                   width, height, dest, NULL);

Per my comment on the first patch, could we just pass dest for both the 
src and dst parameters?  If so, it would probably be good to put a 
comment before the function call saying it's intentional, to avoid 
reader confusion.

Looks OK otherwise.

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

> +      }
> +
>         tempSlice += 4 * width * height;
>      }
>
>



More information about the mesa-dev mailing list