Mesa (master): r300g: reorder parts of translate_texformat

Marek Olšák mareko at kemper.freedesktop.org
Tue Mar 1 04:25:47 UTC 2011


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Tue Mar  1 05:14:27 2011 +0100

r300g: reorder parts of translate_texformat

---

 src/gallium/drivers/r300/r300_texture.c |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index 831b06b..6ed3125 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -205,20 +205,6 @@ uint32_t r300_translate_texformat(enum pipe_format format,
         }
     }
 
-    /* Add sign. */
-    for (i = 0; i < desc->nr_channels; i++) {
-        if (desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED) {
-            result |= sign_bit[i];
-        }
-    }
-
-    /* This is truly a special format.
-     * It stores R8G8 and B is computed using sqrt(1 - R^2 - G^2)
-     * in the sampler unit. Also known as D3DFMT_CxV8U8. */
-    if (format == PIPE_FORMAT_R8G8Bx_SNORM) {
-        return R300_TX_FORMAT_CxV8U8 | result;
-    }
-
     /* RGTC formats. */
     if (desc->layout == UTIL_FORMAT_LAYOUT_RGTC) {
         switch (format) {
@@ -235,6 +221,20 @@ uint32_t r300_translate_texformat(enum pipe_format format,
         }
     }
 
+    /* This is truly a special format.
+     * It stores R8G8 and B is computed using sqrt(1 - R^2 - G^2)
+     * in the sampler unit. Also known as D3DFMT_CxV8U8. */
+    if (format == PIPE_FORMAT_R8G8Bx_SNORM) {
+        return R300_TX_FORMAT_CxV8U8 | result;
+    }
+
+    /* Add sign. */
+    for (i = 0; i < desc->nr_channels; i++) {
+        if (desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED) {
+            result |= sign_bit[i];
+        }
+    }
+
     /* See whether the components are of the same size. */
     for (i = 1; i < desc->nr_channels; i++) {
         uniform = uniform && desc->channel[0].size == desc->channel[i].size;




More information about the mesa-commit mailing list