[Mesa-dev] [PATCH] mesa: fix SRGB alpha channel value in pack_float_R8G8B8X8_SRGB

Jason Ekstrand jason at jlekstrand.net
Tue Sep 16 20:03:44 PDT 2014


Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>
On Sep 16, 2014 6:57 PM, "Dave Airlie" <airlied at gmail.com> wrote:

> From: Dave Airlie <airlied at redhat.com>
>
> Jason pointed out the bug on review adding new formats,
> but the existing format also appears to have the bug, so
> use 255 as the max, these are SRGB no SNORM.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/mesa/main/format_pack.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/format_pack.c b/src/mesa/main/format_pack.c
> index 6cbf859..6bf174a 100644
> --- a/src/mesa/main/format_pack.c
> +++ b/src/mesa/main/format_pack.c
> @@ -1713,7 +1713,7 @@ pack_float_R8G8B8X8_SRGB(const GLfloat src[4], void
> *dst)
>     GLubyte r = util_format_linear_float_to_srgb_8unorm(src[RCOMP]);
>     GLubyte g = util_format_linear_float_to_srgb_8unorm(src[GCOMP]);
>     GLubyte b = util_format_linear_float_to_srgb_8unorm(src[BCOMP]);
> -   *d = PACK_COLOR_8888(127, b, g, r);
> +   *d = PACK_COLOR_8888(255, b, g, r);
>  }
>
>
> --
> 1.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140916/c4e40347/attachment.html>


More information about the mesa-dev mailing list