[Mesa-dev] [PATCH] meta: fix GetTexImage() for compressed luminance, l/a, intensity formats

Eric Anholt eric at anholt.net
Fri Sep 30 10:58:51 PDT 2011


On Thu, 29 Sep 2011 20:22:28 -0600, Brian Paul <brian.e.paul at gmail.com> wrote:
> From: Brian Paul <brianp at vmware.com>
> 
> The GL spec says that luminance values are returned as (l, 0, 0, 1),
> L/A values as (l, 0, 0, a) and intensity values as (i, 0, 0, 1).
> Use the pixel transfer scale controls to implement that.
> This fixes a few failures in the new piglit getteximage-formats
> test when getting a compressed L or L/A image.
> ---
>  src/mesa/drivers/common/meta.c |   24 ++++++++++++++++++++++--
>  src/mesa/main/pixel.c          |    2 +-
>  src/mesa/main/pixel.h          |    9 +++++++++
>  3 files changed, 32 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
> index 0291368..148097a 100644
> --- a/src/mesa/drivers/common/meta.c
> +++ b/src/mesa/drivers/common/meta.c
> @@ -49,6 +49,7 @@
>  #include "main/macros.h"
>  #include "main/matrix.h"
>  #include "main/mipmap.h"
> +#include "main/pixel.h"
>  #include "main/pbo.h"
>  #include "main/polygon.h"
>  #include "main/readpix.h"
> @@ -3235,8 +3236,27 @@ decompress_texture_image(struct gl_context *ctx,
>     }
>  
>     /* read pixels from renderbuffer */
> -   ctx->Pack.RowLength = destRowLength;
> -   _mesa_ReadPixels(0, 0, width, height, destFormat, destType, dest);
> +   {
> +      GLenum baseTexFormat = _mesa_base_tex_format(ctx, texImage->InternalFormat);

(aka texImage->_BaseFormat)

Looks fine.  I'm not really into the indenting of blocks like this for
non-control-flow, but no substantive complaints.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110930/69d46457/attachment.pgp>


More information about the mesa-dev mailing list