<div dir="ltr"><div>Ok, so I actually applied the patch and benchmarked it.  It seems to have improved performance in a lot of cases that were mysteriously slow!  It looks like breaking it up freed up GCC to optimize the inside better.<br><br></div>--Jason<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 12, 2014 at 2:48 PM, Jason Ekstrand <span dir="ltr"><<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>One comment below.  Otherwise, both of these look good to me.<br><br></div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com" target="_blank">jason.ekstrand@intel.com</a>><br><br></div>I haven't applied it and benchmarked it myself, but I don't see anything that would hurt performance.<br></div>--Jason<br><div><div><div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Fri, Sep 12, 2014 at 9:17 AM, Brian Paul <span dir="ltr"><<a href="mailto:brianp@vmware.com" target="_blank">brianp@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This reduces gcc -O3 compile time to 1/4 of what it was on my system.<br>
Reduces MSVC release build time too.<br>
---<br>
 src/mesa/main/format_utils.c | 1030 ++++++++++++++++++++++--------------------<br>
 1 file changed, 550 insertions(+), 480 deletions(-)<br>
<br>
diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c<br>
index 240e3bc..29d779a 100644<br>
--- a/src/mesa/main/format_utils.c<br>
+++ b/src/mesa/main/format_utils.c<br>
@@ -352,9 +352,14 @@ swizzle_convert_try_memcpy(void *dst, GLenum dst_type, int num_dst_channels,<br>
  */<br>
 #define SWIZZLE_CONVERT(DST_TYPE, SRC_TYPE, CONV)                 \<br>
    do {                                                           \<br>
+      const uint8_t swizzle_x = swizzle[0];                       \<br>
+      const uint8_t swizzle_y = swizzle[1];                       \<br>
+      const uint8_t swizzle_z = swizzle[2];                       \<br>
+      const uint8_t swizzle_w = swizzle[3];                       \<br></blockquote><div><br></div></span><div>Is there a reason you got rid of the "register" qualifiers?  I'm not 100% sure they were needed in the first place, but I was wondering if you had a reason.<br></div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
       const SRC_TYPE *typed_src = void_src;                       \<br>
       DST_TYPE *typed_dst = void_dst;                             \<br>
       DST_TYPE tmp[7];                                            \<br>
+      int s, j;                                                   \<br>
       tmp[4] = 0;                                                 \<br>
       tmp[5] = one;                                               \<br>
       switch (num_dst_channels) {                                 \<br>
@@ -423,7 +428,527 @@ swizzle_convert_try_memcpy(void *dst, GLenum dst_type, int num_dst_channels,<br>
          }                                                        \<br>
          break;                                                   \<br>
       }                                                           \<br>
-   } while (0);<br>
+   } while (0)<br>
+<br>
+<br>
+static void<br>
+convert_float(void *void_dst, int num_dst_channels,<br>
+              const void *void_src, GLenum src_type, int num_src_channels,<br>
+              const uint8_t swizzle[4], bool normalized, int count)<br>
+{<br>
+   const float one = 1.0f;<br>
+<br>
+   switch (src_type) {<br>
+   case GL_FLOAT:<br>
+      SWIZZLE_CONVERT(float, float, src);<br>
+      break;<br>
+   case GL_HALF_FLOAT:<br>
+      SWIZZLE_CONVERT(float, uint16_t, _mesa_half_to_float(src));<br>
+      break;<br>
+   case GL_UNSIGNED_BYTE:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(float, uint8_t, unorm_to_float(src, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(float, uint8_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_BYTE:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(float, int8_t, snorm_to_float(src, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(float, int8_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_SHORT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(float, uint16_t, unorm_to_float(src, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(float, uint16_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_SHORT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(float, int16_t, snorm_to_float(src, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(float, int16_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_INT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(float, uint32_t, unorm_to_float(src, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(float, uint32_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_INT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(float, int32_t, snorm_to_float(src, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(float, int32_t, src);<br>
+      }<br>
+      break;<br>
+   default:<br>
+      assert(!"Invalid channel type combination");<br>
+   }<br>
+}<br>
+<br>
+<br>
+static void<br>
+convert_half_float(void *void_dst, int num_dst_channels,<br>
+                   const void *void_src, GLenum src_type, int num_src_channels,<br>
+                   const uint8_t swizzle[4], bool normalized, int count)<br>
+{<br>
+   const uint16_t one = _mesa_float_to_half(1.0f);<br>
+<br>
+   switch (src_type) {<br>
+   case GL_FLOAT:<br>
+      SWIZZLE_CONVERT(uint16_t, float, _mesa_float_to_half(src));<br>
+      break;<br>
+   case GL_HALF_FLOAT:<br>
+      SWIZZLE_CONVERT(uint16_t, uint16_t, src);<br>
+      break;<br>
+   case GL_UNSIGNED_BYTE:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint16_t, uint8_t, unorm_to_half(src, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint16_t, uint8_t, _mesa_float_to_half(src));<br>
+      }<br>
+      break;<br>
+   case GL_BYTE:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint16_t, int8_t, snorm_to_half(src, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint16_t, int8_t, _mesa_float_to_half(src));<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_SHORT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint16_t, uint16_t, unorm_to_half(src, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint16_t, uint16_t, _mesa_float_to_half(src));<br>
+      }<br>
+      break;<br>
+   case GL_SHORT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint16_t, int16_t, snorm_to_half(src, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint16_t, int16_t, _mesa_float_to_half(src));<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_INT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint16_t, uint32_t, unorm_to_half(src, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint16_t, uint32_t, _mesa_float_to_half(src));<br>
+      }<br>
+      break;<br>
+   case GL_INT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint16_t, int32_t, snorm_to_half(src, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint16_t, int32_t, _mesa_float_to_half(src));<br>
+      }<br>
+      break;<br>
+   default:<br>
+      assert(!"Invalid channel type combination");<br>
+   }<br>
+}<br>
+<br>
+<br>
+static void<br>
+convert_ubyte(void *void_dst, int num_dst_channels,<br>
+              const void *void_src, GLenum src_type, int num_src_channels,<br>
+              const uint8_t swizzle[4], bool normalized, int count)<br>
+{<br>
+   const uint8_t one = normalized ? UINT8_MAX : 1;<br>
+<br>
+   switch (src_type) {<br>
+   case GL_FLOAT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint8_t, float, float_to_unorm(src, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint8_t, float, (src < 0) ? 0 : src);<br>
+      }<br>
+      break;<br>
+   case GL_HALF_FLOAT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_unorm(src, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_uint(src));<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_BYTE:<br>
+      SWIZZLE_CONVERT(uint8_t, uint8_t, src);<br>
+      break;<br>
+   case GL_BYTE:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint8_t, int8_t, snorm_to_unorm(src, 8, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint8_t, int8_t, (src < 0) ? 0 : src);<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_SHORT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint8_t, uint16_t, unorm_to_unorm(src, 16, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint8_t, uint16_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_SHORT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint8_t, int16_t, snorm_to_unorm(src, 16, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint8_t, int16_t, (src < 0) ? 0 : src);<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_INT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint8_t, uint32_t, unorm_to_unorm(src, 32, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint8_t, uint32_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_INT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint8_t, int32_t, snorm_to_unorm(src, 32, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint8_t, int32_t, (src < 0) ? 0 : src);<br>
+      }<br>
+      break;<br>
+   default:<br>
+      assert(!"Invalid channel type combination");<br>
+   }<br>
+}<br>
+<br>
+<br>
+static void<br>
+convert_byte(void *void_dst, int num_dst_channels,<br>
+             const void *void_src, GLenum src_type, int num_src_channels,<br>
+             const uint8_t swizzle[4], bool normalized, int count)<br>
+{<br>
+   const int8_t one = normalized ? INT8_MAX : 1;<br>
+<br>
+   switch (src_type) {<br>
+   case GL_FLOAT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint8_t, float, float_to_snorm(src, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint8_t, float, src);<br>
+      }<br>
+      break;<br>
+   case GL_HALF_FLOAT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_snorm(src, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint8_t, uint16_t, _mesa_half_to_float(src));<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_BYTE:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(int8_t, uint8_t, unorm_to_snorm(src, 8, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(int8_t, uint8_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_BYTE:<br>
+      SWIZZLE_CONVERT(int8_t, int8_t, src);<br>
+      break;<br>
+   case GL_UNSIGNED_SHORT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(int8_t, uint16_t, unorm_to_snorm(src, 16, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(int8_t, uint16_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_SHORT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(int8_t, int16_t, snorm_to_snorm(src, 16, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(int8_t, int16_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_INT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(int8_t, uint32_t, unorm_to_snorm(src, 32, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(int8_t, uint32_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_INT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(int8_t, int32_t, snorm_to_snorm(src, 32, 8));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(int8_t, int32_t, src);<br>
+      }<br>
+      break;<br>
+   default:<br>
+      assert(!"Invalid channel type combination");<br>
+   }<br>
+}<br>
+<br>
+<br>
+static void<br>
+convert_ushort(void *void_dst, int num_dst_channels,<br>
+               const void *void_src, GLenum src_type, int num_src_channels,<br>
+               const uint8_t swizzle[4], bool normalized, int count)<br>
+{<br>
+   const uint16_t one = normalized ? UINT16_MAX : 1;<br>
+<br>
+   switch (src_type) {<br>
+   case GL_FLOAT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint16_t, float, float_to_unorm(src, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint16_t, float, (src < 0) ? 0 : src);<br>
+      }<br>
+      break;<br>
+   case GL_HALF_FLOAT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_unorm(src, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_uint(src));<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_BYTE:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint16_t, uint8_t, unorm_to_unorm(src, 8, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint16_t, uint8_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_BYTE:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint16_t, int8_t, snorm_to_unorm(src, 8, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint16_t, int8_t, (src < 0) ? 0 : src);<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_SHORT:<br>
+      SWIZZLE_CONVERT(uint16_t, uint16_t, src);<br>
+      break;<br>
+   case GL_SHORT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint16_t, int16_t, snorm_to_unorm(src, 16, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint16_t, int16_t, (src < 0) ? 0 : src);<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_INT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint16_t, uint32_t, unorm_to_unorm(src, 32, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint16_t, uint32_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_INT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint16_t, int32_t, snorm_to_unorm(src, 32, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint16_t, int32_t, (src < 0) ? 0 : src);<br>
+      }<br>
+      break;<br>
+   default:<br>
+      assert(!"Invalid channel type combination");<br>
+   }<br>
+}<br>
+<br>
+<br>
+static void<br>
+convert_short(void *void_dst, int num_dst_channels,<br>
+              const void *void_src, GLenum src_type, int num_src_channels,<br>
+              const uint8_t swizzle[4], bool normalized, int count)<br>
+{<br>
+   const int16_t one = normalized ? INT16_MAX : 1;<br>
+<br>
+   switch (src_type) {<br>
+   case GL_FLOAT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint16_t, float, float_to_snorm(src, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint16_t, float, src);<br>
+      }<br>
+      break;<br>
+   case GL_HALF_FLOAT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_snorm(src, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint16_t, uint16_t, _mesa_half_to_float(src));<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_BYTE:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(int16_t, uint8_t, unorm_to_snorm(src, 8, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(int16_t, uint8_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_BYTE:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(int16_t, int8_t, snorm_to_snorm(src, 8, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(int16_t, int8_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_SHORT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(int16_t, uint16_t, unorm_to_snorm(src, 16, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(int16_t, uint16_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_SHORT:<br>
+      SWIZZLE_CONVERT(int16_t, int16_t, src);<br>
+      break;<br>
+   case GL_UNSIGNED_INT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(int16_t, uint32_t, unorm_to_snorm(src, 32, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(int16_t, uint32_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_INT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(int16_t, int32_t, snorm_to_snorm(src, 32, 16));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(int16_t, int32_t, src);<br>
+      }<br>
+      break;<br>
+   default:<br>
+      assert(!"Invalid channel type combination");<br>
+   }<br>
+}<br>
+<br>
+static void<br>
+convert_uint(void *void_dst, int num_dst_channels,<br>
+             const void *void_src, GLenum src_type, int num_src_channels,<br>
+             const uint8_t swizzle[4], bool normalized, int count)<br>
+{<br>
+   const uint32_t one = normalized ? UINT32_MAX : 1;<br>
+<br>
+   switch (src_type) {<br>
+   case GL_FLOAT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint32_t, float, float_to_unorm(src, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint32_t, float, (src < 0) ? 0 : src);<br>
+      }<br>
+      break;<br>
+   case GL_HALF_FLOAT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_unorm(src, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_uint(src));<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_BYTE:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint32_t, uint8_t, unorm_to_unorm(src, 8, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint32_t, uint8_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_BYTE:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint32_t, int8_t, snorm_to_unorm(src, 8, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint32_t, int8_t, (src < 0) ? 0 : src);<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_SHORT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint32_t, uint16_t, unorm_to_unorm(src, 16, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint32_t, uint16_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_SHORT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint32_t, int16_t, snorm_to_unorm(src, 16, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint32_t, int16_t, (src < 0) ? 0 : src);<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_INT:<br>
+      SWIZZLE_CONVERT(uint32_t, uint32_t, src);<br>
+      break;<br>
+   case GL_INT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint32_t, int32_t, snorm_to_unorm(src, 32, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint32_t, int32_t, (src < 0) ? 0 : src);<br>
+      }<br>
+      break;<br>
+   default:<br>
+      assert(!"Invalid channel type combination");<br>
+   }<br>
+}<br>
+<br>
+<br>
+static void<br>
+convert_int(void *void_dst, int num_dst_channels,<br>
+            const void *void_src, GLenum src_type, int num_src_channels,<br>
+            const uint8_t swizzle[4], bool normalized, int count)<br>
+{<br>
+   const int32_t one = normalized ? INT32_MAX : 12;<br>
+<br>
+   switch (src_type) {<br>
+   case GL_FLOAT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint32_t, float, float_to_snorm(src, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint32_t, float, src);<br>
+      }<br>
+      break;<br>
+   case GL_HALF_FLOAT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_snorm(src, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(uint32_t, uint16_t, _mesa_half_to_float(src));<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_BYTE:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(int32_t, uint8_t, unorm_to_snorm(src, 8, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(int32_t, uint8_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_BYTE:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(int32_t, int8_t, snorm_to_snorm(src, 8, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(int32_t, int8_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_SHORT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(int32_t, uint16_t, unorm_to_snorm(src, 16, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(int32_t, uint16_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_SHORT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(int32_t, int16_t, snorm_to_snorm(src, 16, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(int32_t, int16_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_UNSIGNED_INT:<br>
+      if (normalized) {<br>
+         SWIZZLE_CONVERT(int32_t, uint32_t, unorm_to_snorm(src, 32, 32));<br>
+      } else {<br>
+         SWIZZLE_CONVERT(int32_t, uint32_t, src);<br>
+      }<br>
+      break;<br>
+   case GL_INT:<br>
+      SWIZZLE_CONVERT(int32_t, int32_t, src);<br>
+      break;<br>
+   default:<br>
+      assert(!"Invalid channel type combination");<br>
+   }<br>
+}<br>
+<br>
<br>
 /**<br>
  * Convert between array-based color formats.<br>
@@ -478,499 +1003,44 @@ _mesa_swizzle_and_convert(void *void_dst, GLenum dst_type, int num_dst_channels,<br>
                           const void *void_src, GLenum src_type, int num_src_channels,<br>
                           const uint8_t swizzle[4], bool normalized, int count)<br>
 {<br>
-   int s, j;<br>
-   register uint8_t swizzle_x, swizzle_y, swizzle_z, swizzle_w;<br>
-<br>
    if (swizzle_convert_try_memcpy(void_dst, dst_type, num_dst_channels,<br>
                                   void_src, src_type, num_src_channels,<br>
                                   swizzle, normalized, count))<br>
       return;<br>
<br>
-   swizzle_x = swizzle[0];<br>
-   swizzle_y = swizzle[1];<br>
-   swizzle_z = swizzle[2];<br>
-   swizzle_w = swizzle[3];<br>
-<br>
    switch (dst_type) {<br>
    case GL_FLOAT:<br>
-   {<br>
-      const float one = 1.0f;<br>
-      switch (src_type) {<br>
-      case GL_FLOAT:<br>
-         SWIZZLE_CONVERT(float, float, src)<br>
-         break;<br>
-      case GL_HALF_FLOAT:<br>
-         SWIZZLE_CONVERT(float, uint16_t, _mesa_half_to_float(src))<br>
-         break;<br>
-      case GL_UNSIGNED_BYTE:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(float, uint8_t, unorm_to_float(src, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(float, uint8_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_BYTE:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(float, int8_t, snorm_to_float(src, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(float, int8_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_SHORT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(float, uint16_t, unorm_to_float(src, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(float, uint16_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_SHORT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(float, int16_t, snorm_to_float(src, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(float, int16_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_INT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(float, uint32_t, unorm_to_float(src, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(float, uint32_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_INT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(float, int32_t, snorm_to_float(src, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(float, int32_t, src)<br>
-         }<br>
-         break;<br>
-      default:<br>
-         assert(!"Invalid channel type combination");<br>
-      }<br>
-   }<br>
-   break;<br>
+      convert_float(void_dst, num_dst_channels, void_src, src_type,<br>
+                    num_src_channels, swizzle, normalized, count);<br>
+      break;<br>
    case GL_HALF_FLOAT:<br>
-   {<br>
-      const uint16_t one = _mesa_float_to_half(1.0f);<br>
-      switch (src_type) {<br>
-      case GL_FLOAT:<br>
-         SWIZZLE_CONVERT(uint16_t, float, _mesa_float_to_half(src))<br>
-         break;<br>
-      case GL_HALF_FLOAT:<br>
-         SWIZZLE_CONVERT(uint16_t, uint16_t, src)<br>
-         break;<br>
-      case GL_UNSIGNED_BYTE:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint16_t, uint8_t, unorm_to_half(src, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint16_t, uint8_t, _mesa_float_to_half(src))<br>
-         }<br>
-         break;<br>
-      case GL_BYTE:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint16_t, int8_t, snorm_to_half(src, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint16_t, int8_t, _mesa_float_to_half(src))<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_SHORT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint16_t, uint16_t, unorm_to_half(src, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint16_t, uint16_t, _mesa_float_to_half(src))<br>
-         }<br>
-         break;<br>
-      case GL_SHORT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint16_t, int16_t, snorm_to_half(src, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint16_t, int16_t, _mesa_float_to_half(src))<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_INT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint16_t, uint32_t, unorm_to_half(src, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint16_t, uint32_t, _mesa_float_to_half(src))<br>
-         }<br>
-         break;<br>
-      case GL_INT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint16_t, int32_t, snorm_to_half(src, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint16_t, int32_t, _mesa_float_to_half(src))<br>
-         }<br>
-         break;<br>
-      default:<br>
-         assert(!"Invalid channel type combination");<br>
-      }<br>
-   }<br>
-   break;<br>
+      convert_half_float(void_dst, num_dst_channels, void_src, src_type,<br>
+                    num_src_channels, swizzle, normalized, count);<br>
+      break;<br>
    case GL_UNSIGNED_BYTE:<br>
-   {<br>
-      const uint8_t one = normalized ? UINT8_MAX : 1;<br>
-      switch (src_type) {<br>
-      case GL_FLOAT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint8_t, float, float_to_unorm(src, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint8_t, float, (src < 0) ? 0 : src)<br>
-         }<br>
-         break;<br>
-      case GL_HALF_FLOAT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_unorm(src, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_uint(src))<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_BYTE:<br>
-         SWIZZLE_CONVERT(uint8_t, uint8_t, src)<br>
-         break;<br>
-      case GL_BYTE:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint8_t, int8_t, snorm_to_unorm(src, 8, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint8_t, int8_t, (src < 0) ? 0 : src)<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_SHORT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint8_t, uint16_t, unorm_to_unorm(src, 16, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint8_t, uint16_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_SHORT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint8_t, int16_t, snorm_to_unorm(src, 16, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint8_t, int16_t, (src < 0) ? 0 : src)<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_INT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint8_t, uint32_t, unorm_to_unorm(src, 32, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint8_t, uint32_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_INT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint8_t, int32_t, snorm_to_unorm(src, 32, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint8_t, int32_t, (src < 0) ? 0 : src)<br>
-         }<br>
-         break;<br>
-      default:<br>
-         assert(!"Invalid channel type combination");<br>
-      }<br>
-   }<br>
-   break;<br>
+      convert_ubyte(void_dst, num_dst_channels, void_src, src_type,<br>
+                    num_src_channels, swizzle, normalized, count);<br>
+      break;<br>
    case GL_BYTE:<br>
-   {<br>
-      const int8_t one = normalized ? INT8_MAX : 1;<br>
-      switch (src_type) {<br>
-      case GL_FLOAT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint8_t, float, float_to_snorm(src, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint8_t, float, src)<br>
-         }<br>
-         break;<br>
-      case GL_HALF_FLOAT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_snorm(src, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint8_t, uint16_t, _mesa_half_to_float(src))<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_BYTE:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(int8_t, uint8_t, unorm_to_snorm(src, 8, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(int8_t, uint8_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_BYTE:<br>
-         SWIZZLE_CONVERT(int8_t, int8_t, src)<br>
-         break;<br>
-      case GL_UNSIGNED_SHORT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(int8_t, uint16_t, unorm_to_snorm(src, 16, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(int8_t, uint16_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_SHORT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(int8_t, int16_t, snorm_to_snorm(src, 16, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(int8_t, int16_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_INT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(int8_t, uint32_t, unorm_to_snorm(src, 32, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(int8_t, uint32_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_INT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(int8_t, int32_t, snorm_to_snorm(src, 32, 8))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(int8_t, int32_t, src)<br>
-         }<br>
-         break;<br>
-      default:<br>
-         assert(!"Invalid channel type combination");<br>
-      }<br>
-   }<br>
-   break;<br>
+      convert_byte(void_dst, num_dst_channels, void_src, src_type,<br>
+                   num_src_channels, swizzle, normalized, count);<br>
+      break;<br>
    case GL_UNSIGNED_SHORT:<br>
-   {<br>
-      const uint16_t one = normalized ? UINT16_MAX : 1;<br>
-      switch (src_type) {<br>
-      case GL_FLOAT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint16_t, float, float_to_unorm(src, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint16_t, float, (src < 0) ? 0 : src)<br>
-         }<br>
-         break;<br>
-      case GL_HALF_FLOAT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_unorm(src, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_uint(src))<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_BYTE:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint16_t, uint8_t, unorm_to_unorm(src, 8, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint16_t, uint8_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_BYTE:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint16_t, int8_t, snorm_to_unorm(src, 8, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint16_t, int8_t, (src < 0) ? 0 : src)<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_SHORT:<br>
-         SWIZZLE_CONVERT(uint16_t, uint16_t, src)<br>
-         break;<br>
-      case GL_SHORT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint16_t, int16_t, snorm_to_unorm(src, 16, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint16_t, int16_t, (src < 0) ? 0 : src)<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_INT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint16_t, uint32_t, unorm_to_unorm(src, 32, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint16_t, uint32_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_INT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint16_t, int32_t, snorm_to_unorm(src, 32, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint16_t, int32_t, (src < 0) ? 0 : src)<br>
-         }<br>
-         break;<br>
-      default:<br>
-         assert(!"Invalid channel type combination");<br>
-      }<br>
-   }<br>
-   break;<br>
+      convert_ushort(void_dst, num_dst_channels, void_src, src_type,<br>
+                     num_src_channels, swizzle, normalized, count);<br>
+      break;<br>
    case GL_SHORT:<br>
-   {<br>
-      const int16_t one = normalized ? INT16_MAX : 1;<br>
-      switch (src_type) {<br>
-      case GL_FLOAT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint16_t, float, float_to_snorm(src, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint16_t, float, src)<br>
-         }<br>
-         break;<br>
-      case GL_HALF_FLOAT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_snorm(src, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint16_t, uint16_t, _mesa_half_to_float(src))<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_BYTE:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(int16_t, uint8_t, unorm_to_snorm(src, 8, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(int16_t, uint8_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_BYTE:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(int16_t, int8_t, snorm_to_snorm(src, 8, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(int16_t, int8_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_SHORT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(int16_t, uint16_t, unorm_to_snorm(src, 16, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(int16_t, uint16_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_SHORT:<br>
-         SWIZZLE_CONVERT(int16_t, int16_t, src)<br>
-         break;<br>
-      case GL_UNSIGNED_INT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(int16_t, uint32_t, unorm_to_snorm(src, 32, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(int16_t, uint32_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_INT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(int16_t, int32_t, snorm_to_snorm(src, 32, 16))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(int16_t, int32_t, src)<br>
-         }<br>
-         break;<br>
-      default:<br>
-         assert(!"Invalid channel type combination");<br>
-      }<br>
-   }<br>
-   break;<br>
+      convert_short(void_dst, num_dst_channels, void_src, src_type,<br>
+                    num_src_channels, swizzle, normalized, count);<br>
+      break;<br>
    case GL_UNSIGNED_INT:<br>
-   {<br>
-      const uint32_t one = normalized ? UINT32_MAX : 1;<br>
-      switch (src_type) { case GL_FLOAT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint32_t, float, float_to_unorm(src, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint32_t, float, (src < 0) ? 0 : src)<br>
-         }<br>
-         break;<br>
-      case GL_HALF_FLOAT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_unorm(src, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_uint(src))<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_BYTE:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint32_t, uint8_t, unorm_to_unorm(src, 8, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint32_t, uint8_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_BYTE:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint32_t, int8_t, snorm_to_unorm(src, 8, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint32_t, int8_t, (src < 0) ? 0 : src)<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_SHORT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint32_t, uint16_t, unorm_to_unorm(src, 16, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint32_t, uint16_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_SHORT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint32_t, int16_t, snorm_to_unorm(src, 16, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint32_t, int16_t, (src < 0) ? 0 : src)<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_INT:<br>
-         SWIZZLE_CONVERT(uint32_t, uint32_t, src)<br>
-         break;<br>
-      case GL_INT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint32_t, int32_t, snorm_to_unorm(src, 32, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint32_t, int32_t, (src < 0) ? 0 : src)<br>
-         }<br>
-         break;<br>
-      default:<br>
-         assert(!"Invalid channel type combination");<br>
-      }<br>
-   }<br>
-   break;<br>
+      convert_uint(void_dst, num_dst_channels, void_src, src_type,<br>
+                   num_src_channels, swizzle, normalized, count);<br>
+      break;<br>
    case GL_INT:<br>
-   {<br>
-      const int32_t one = normalized ? INT32_MAX : 1;<br>
-      switch (src_type) {<br>
-      case GL_FLOAT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint32_t, float, float_to_snorm(src, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint32_t, float, src)<br>
-         }<br>
-         break;<br>
-      case GL_HALF_FLOAT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_snorm(src, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(uint32_t, uint16_t, _mesa_half_to_float(src))<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_BYTE:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(int32_t, uint8_t, unorm_to_snorm(src, 8, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(int32_t, uint8_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_BYTE:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(int32_t, int8_t, snorm_to_snorm(src, 8, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(int32_t, int8_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_SHORT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(int32_t, uint16_t, unorm_to_snorm(src, 16, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(int32_t, uint16_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_SHORT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(int32_t, int16_t, snorm_to_snorm(src, 16, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(int32_t, int16_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_UNSIGNED_INT:<br>
-         if (normalized) {<br>
-            SWIZZLE_CONVERT(int32_t, uint32_t, unorm_to_snorm(src, 32, 32))<br>
-         } else {<br>
-            SWIZZLE_CONVERT(int32_t, uint32_t, src)<br>
-         }<br>
-         break;<br>
-      case GL_INT:<br>
-         SWIZZLE_CONVERT(int32_t, int32_t, src)<br>
-         break;<br>
-      default:<br>
-         assert(!"Invalid channel type combination");<br>
-      }<br>
-   }<br>
-   break;<br>
+      convert_int(void_dst, num_dst_channels, void_src, src_type,<br>
+                  num_src_channels, swizzle, normalized, count);<br>
+      break;<br>
    default:<br>
       assert(!"Invalid channel type");<br>
    }<br>
<span><font color="#888888">--<br>
1.7.10.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div></div></div><br></div></div></div></div></div></div></div></div>
</blockquote></div><br></div>