diff options
-rw-r--r-- | src/gallium/drivers/r300/r300_state_inlines.h | 6 |
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++) { |