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

Iago Toral itoral at igalia.com
Wed Nov 19 23:24:30 PST 2014


Hi Jason,

we discussed this some weeks ago actually, the detailed explanation is
here:
https://bugs.freedesktop.org/show_bug.cgi?id=84566#c5

the short answer is that this is necessary because there is a normalized
parameter to _mesa_swizzle_and_convert, and when we deal with float
types we want to set this to true.

Iago

On Wed, 2014-11-19 at 11:31 -0800, Jason Ekstrand wrote:
> 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
> 
> 




More information about the mesa-dev mailing list