summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Dösinger <stefandoesinger@gmx.at>2015-03-09 16:15:13 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2015-03-11 18:14:25 +0000
commit578ac079c77abbe9c972bb95ddb57abea7eeec99 (patch)
treeee0e61a307865c6f5a12ddcc4093837591dc52d2
parent0ea3c150cfc273e66626c8dc0958269c68d9e739 (diff)
r300g: Fix the ATI1N swizzle (RGTC1 and LATC1)
This fixes the GL_COMPRESSED_RED_RGTC1 part of piglit's rgtc-teximage-01 test as well as the precision part of Wine's 3dc format test (fd.o bug 89156). The Z component seems to contain a lower precision version of the result, probably a temporary value from the decompression computation. The Y and W component contain different data that depends on the input values as well, but I could not make sense of them (Not that I tried very hard). GL_COMPRESSED_SIGNED_RED_RGTC1 still seems to have precision problems in piglit, and both formats are affected by a compiler bug if they're sampled by the shader with a swizzle other than .xyzw. Wine uses .xxxx, which returns random garbage. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89156 Signed-off-by: Marek Olšák <marek.olsak@amd.com> Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org> (cherry picked from commit f710b99071fe4e3c2ee88cdcb6bb5c10298e014e)
-rw-r--r--src/gallium/drivers/r300/r300_texture.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index ffe8c004525..340b8fc076e 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -176,7 +176,9 @@ uint32_t r300_translate_texformat(enum pipe_format format,
format != PIPE_FORMAT_RGTC2_UNORM &&
format != PIPE_FORMAT_RGTC2_SNORM &&
format != PIPE_FORMAT_LATC2_UNORM &&
- format != PIPE_FORMAT_LATC2_SNORM) {
+ format != PIPE_FORMAT_LATC2_SNORM &&
+ format != PIPE_FORMAT_RGTC1_UNORM &&
+ format != PIPE_FORMAT_LATC1_UNORM) {
result |= r300_get_swizzle_combined(desc->swizzle, swizzle_view,
TRUE);
} else {