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

Iago Toral Quiroga itoral at igalia.com
Mon Dec 1 03:04:55 PST 2014


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 4db5269..5139511 100644
--- a/src/mesa/main/format_utils.c
+++ b/src/mesa/main/format_utils.c
@@ -29,7 +29,7 @@
 
 mesa_array_format RGBA8888_FLOAT = {{
    MESA_ARRAY_FORMAT_TYPE_FLOAT,
-   0,
+   1,
    4,
    0, 1, 2, 3,
    0, 1
-- 
1.9.1



More information about the mesa-dev mailing list