[Mesa-dev] [PATCH 7/8] MAYBEREVERT: Fill X components with 1

Jason Ekstrand jason at jlekstrand.net
Sat Aug 23 15:23:17 PDT 2014


I'm not 100% sure if I like this one.  If used, it'll be squashed in with
the previous patch.
---
 src/mesa/main/format_pack.c.mako | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/format_pack.c.mako b/src/mesa/main/format_pack.c.mako
index 13a20c1..45caafc 100644
--- a/src/mesa/main/format_pack.c.mako
+++ b/src/mesa/main/format_pack.c.mako
@@ -117,9 +117,10 @@ pack_ubyte_${f.short_name()}(const GLubyte src[4], void *dst)
       ${format_datatype(f)} d = 0;
       %for (i, c) in enumerate(f.channels):
          %if c.type == 'x':
-            <% continue %>
+            d |= PACK(MAX_INT(${c.size}), ${c.shift}, ${c.size});
+         %else:
+            d |= PACK(${c.name}, ${c.shift}, ${c.size});
          %endif
-         d |= PACK(${c.name}, ${c.shift}, ${c.size});
       %endfor
       (*(${format_datatype(f)} *)dst) = d;
    %else:
@@ -204,9 +205,10 @@ pack_float_${f.short_name()}(const GLfloat src[4], void *dst)
       ${format_datatype(f)} d = 0;
       %for (i, c) in enumerate(f.channels):
          %if c.type == 'x':
-            <% continue %>
+            d |= PACK(MAX_INT(${c.size}), ${c.shift}, ${c.size});
+         %else:
+            d |= PACK(${c.name}, ${c.shift}, ${c.size});
          %endif
-         d |= PACK(${c.name}, ${c.shift}, ${c.size});
       %endfor
       (*(${format_datatype(f)} *)dst) = d;
    %else:
-- 
2.1.0



More information about the mesa-dev mailing list