From: Dave Airlie Date: Sun, 27 Feb 2011 07:00:50 +0000 (+1000) Subject: r300g: force swizzles for RGTC X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0495425dc3d9f1c12e30df3f8f7f450687d13d6b;p=mesa.git r300g: force swizzles for RGTC still can't get signed to work --- 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. */