summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-01-17 14:54:35 +0100
committerCorbin Simpson <[email protected]>2010-01-18 02:35:08 -0800
commitd3d41cbc3504536c2d2dfa2faaae86b2ae5eb670 (patch)
treea3f847cf796b549effc228188027822ec1d591d6 /src/gallium
parentcd553ec8be14eea7db2d21b9f26ea6e72474a471 (diff)
r300g: fix vertex data swizzle
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/r300/r300_state_inlines.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h
index a9ee0a26f14..e2180b33b77 100644
--- a/src/gallium/drivers/r300/r300_state_inlines.h
+++ b/src/gallium/drivers/r300/r300_state_inlines.h
@@ -551,7 +551,11 @@ r300_translate_vertex_data_swizzle(enum pipe_format format) {
/* Swizzles for 8bits formats are in the reversed order, not sure why. */
if (desc->channel[0].size == 8) {
for (i = 0; i < 4; i++) {
- swizzle[i] = 3 - desc->swizzle[i];
+ if (desc->swizzle[i] <= 3) {
+ swizzle[i] = 3 - desc->swizzle[i];
+ } else {
+ swizzle[i] = desc->swizzle[i];
+ }
}
} else {
for (i = 0; i < 4; i++) {