Mesa (master): util: Fix unity value for swizzle 1.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Tue Dec 15 13:40:41 UTC 2009


Module: Mesa
Branch: master
Commit: 079b1cf4cf32a2bdc5f13c2aa1e211c4c7dc6775
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=079b1cf4cf32a2bdc5f13c2aa1e211c4c7dc6775

Author: José Fonseca <jfonseca at vmware.com>
Date:   Tue Dec 15 13:40:13 2009 +0000

util: Fix unity value for swizzle 1.

It should be 255 for ubytes, and not 1.

Thanks Michal for spotting this.

---

 src/gallium/auxiliary/util/u_format_access.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_format_access.py b/src/gallium/auxiliary/util/u_format_access.py
index eeb1a96..0b05ddb 100644
--- a/src/gallium/auxiliary/util/u_format_access.py
+++ b/src/gallium/auxiliary/util/u_format_access.py
@@ -325,14 +325,14 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix):
             elif swizzle == SWIZZLE_0:
                 value = '0'
             elif swizzle == SWIZZLE_1:
-                value = '1'
+                value = get_one(dst_type)
             else:
                 assert False
         elif format.colorspace == 'zs':
             if i < 3:
                 value = 'z'
             else:
-                value = '1'
+                value = get_one(dst_type)
         else:
             assert False
         print '         *dst_pixel++ = %s; /* %s */' % (value, 'rgba'[i])




More information about the mesa-commit mailing list