[Mesa-dev] [PATCH 02/29] mesa: Set normalized=true for float array formats.

Jason Ekstrand jason at jlekstrand.net
Wed Nov 19 11:31:24 PST 2014


I'm not sure what I think about this.  Does it make a functional change
other than consistancy?
--Jason

On Tue, Nov 18, 2014 at 1:23 AM, Iago Toral Quiroga <itoral at igalia.com>
wrote:

> In order to check if a format is normalized Mesa does something like this:
> normalized = !_mesa_is_enum_format_integer(srcFormat);
>
> So all float types will set normalized to true. Since our mesa_array_format
> includes a normalized flag for each type we want to make it consistent with
> this.
> ---
>  src/mesa/main/format_info.py | 3 ++-
>  src/mesa/main/format_utils.c | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/main/format_info.py b/src/mesa/main/format_info.py
> index 315767d..d4bc276 100644
> --- a/src/mesa/main/format_info.py
> +++ b/src/mesa/main/format_info.py
> @@ -220,9 +220,10 @@ for fmat in formats:
>     print '      {{ {0} }},'.format(', '.join(map(str, fmat.swizzle)))
>     if fmat.is_array() and fmat.colorspace in ('rgb', 'srgb'):
>        chan = fmat.array_element()
> +      norm = chan.norm or chan.type == parser.FLOAT
>        print '      {{{{ {0} }}}},'.format(', '.join([
>           get_array_format_datatype(chan),
> -         str(int(chan.norm)),
> +         str(int(norm)),
>           str(len(fmat.channels)),
>           str(fmat.swizzle[0]),
>           str(fmat.swizzle[1]),
> diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c
> index c3815cb..1d65f2b 100644
> --- a/src/mesa/main/format_utils.c
> +++ b/src/mesa/main/format_utils.c
> @@ -30,7 +30,7 @@
>
>  mesa_array_format RGBA8888_FLOAT = {{
>     MESA_ARRAY_FORMAT_TYPE_FLOAT,
> -   0,
> +   1,
>     4,
>     0, 1, 2, 3,
>     0, 1
> --
> 1.9.1
>
> _______________________________________________
> 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/20141119/c58d29d6/attachment.html>


More information about the mesa-dev mailing list