Mesa (master): mesa: Fix _mesa_format_convert fallback path when src is not an array format

Iago Toral Quiroga itoral at kemper.freedesktop.org
Wed Feb 4 07:09:40 UTC 2015


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

Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Mon Feb  2 13:59:27 2015 +0100

mesa: Fix _mesa_format_convert fallback path when src is not an array format

When a rebase swizzle is provided and we call _mesa_swizzle_and_convert
after unpacking the source format we were always passing normalized=false.
We should pass true or false depending on the formats involved in the
conversion for the byte and float paths (the integer path cannot ever be
normalized).

Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>
Tested-by: Mark Janes <mark.a.janes at intel.com>

---

 src/mesa/main/format_utils.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c
index 4b44bef..00061de 100644
--- a/src/mesa/main/format_utils.c
+++ b/src/mesa/main/format_utils.c
@@ -499,7 +499,7 @@ _mesa_format_convert(void *void_dst, uint32_t dst_format, size_t dst_stride,
                                          MESA_ARRAY_FORMAT_TYPE_FLOAT, 4,
                                          tmp_float + row * width,
                                          MESA_ARRAY_FORMAT_TYPE_FLOAT, 4,
-                                         rebase_swizzle, false, width);
+                                         rebase_swizzle, normalized, width);
             src += src_stride;
          }
       }
@@ -543,7 +543,7 @@ _mesa_format_convert(void *void_dst, uint32_t dst_format, size_t dst_stride,
                                          MESA_ARRAY_FORMAT_TYPE_UBYTE, 4,
                                          tmp_ubyte + row * width,
                                          MESA_ARRAY_FORMAT_TYPE_UBYTE, 4,
-                                         rebase_swizzle, false, width);
+                                         rebase_swizzle, normalized, width);
             src += src_stride;
          }
       }




More information about the mesa-commit mailing list