Mesa (7.9): r300g: add a default channel ordering of texture border for unhandled formats

Marek Olšák mareko at kemper.freedesktop.org
Thu Dec 2 00:58:19 UTC 2010


Module: Mesa
Branch: 7.9
Commit: 44ba61c518e4fb8eececd55002be7a36964e2d0c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=44ba61c518e4fb8eececd55002be7a36964e2d0c

Author: Marek Olšák <maraeo at gmail.com>
Date:   Wed Dec  1 23:38:36 2010 +0100

r300g: add a default channel ordering of texture border for unhandled formats

It should fix the texture border for compressed textures.
Broken since 8449a4772a73f613d9425b691cffba6a261df813.
(cherry picked from commit 676c3f08bd13564c088ae85c3538ee0ee3c52599)

Conflicts:

	src/gallium/drivers/r300/r300_state_derived.c

---

 src/gallium/drivers/r300/r300_state_derived.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c
index 04e0456..253342c 100644
--- a/src/gallium/drivers/r300/r300_state_derived.c
+++ b/src/gallium/drivers/r300/r300_state_derived.c
@@ -606,17 +606,18 @@ static uint32_t r300_get_border_color(enum pipe_format format,
             }
             break;
 
-        case 8:
-            r = ((float_to_ubyte(border_swizzled[0]) & 0xff) << 0) |
+        case 16:
+            r = ((float_to_ubyte(border_swizzled[2]) & 0xff) << 0) |
                 ((float_to_ubyte(border_swizzled[1]) & 0xff) << 8) |
-                ((float_to_ubyte(border_swizzled[2]) & 0xff) << 16) |
+                ((float_to_ubyte(border_swizzled[0]) & 0xff) << 16) |
                 ((float_to_ubyte(border_swizzled[3]) & 0xff) << 24);
             break;
 
-        case 16:
-            r = ((float_to_ubyte(border_swizzled[2]) & 0xff) << 0) |
+        case 8:
+        default:
+            r = ((float_to_ubyte(border_swizzled[0]) & 0xff) << 0) |
                 ((float_to_ubyte(border_swizzled[1]) & 0xff) << 8) |
-                ((float_to_ubyte(border_swizzled[0]) & 0xff) << 16) |
+                ((float_to_ubyte(border_swizzled[2]) & 0xff) << 16) |
                 ((float_to_ubyte(border_swizzled[3]) & 0xff) << 24);
             break;
     }




More information about the mesa-commit mailing list