aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2011-02-27 17:00:50 +1000
committerDave Airlie <[email protected]>2011-02-28 13:21:44 +1000
commit0495425dc3d9f1c12e30df3f8f7f450687d13d6b (patch)
treebac44f9ae08d20e6ff85e32932576f3eeded0af9
parent96bbc627f369c0100b950f81531b1fe9ef586c34 (diff)
r300g: force swizzles for RGTC
still can't get signed to work
-rw-r--r--src/gallium/drivers/r300/r300_texture.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index 2db5ab9a287..b97c45ac198 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -217,10 +217,15 @@ uint32_t r300_translate_texformat(enum pipe_format format,
case PIPE_FORMAT_RGTC1_SNORM:
result |= sign_bit[0];
case PIPE_FORMAT_RGTC1_UNORM:
+ result &= ~(0xfff << 9); /* mask off swizzle */
+ result |= R300_TX_FORMAT_Y << R300_TX_FORMAT_R_SHIFT;
return R500_TX_FORMAT_ATI1N | result;
case PIPE_FORMAT_RGTC2_SNORM:
result |= sign_bit[0] | sign_bit[1];
case PIPE_FORMAT_RGTC2_UNORM:
+ result &= ~(0xfff << 9); /* mask off swizzle */
+ result |= R300_TX_FORMAT_Y << R300_TX_FORMAT_R_SHIFT |
+ R300_TX_FORMAT_X << R300_TX_FORMAT_G_SHIFT;
return R400_TX_FORMAT_ATI2N | result;
default:
return ~0; /* Unsupported/unknown. */