From: Marek Olšák Date: Sun, 17 Jan 2010 13:54:35 +0000 (+0100) Subject: r300g: fix vertex data swizzle X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d3d41cbc3504536c2d2dfa2faaae86b2ae5eb670;p=mesa.git r300g: fix vertex data swizzle --- 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++) {