u_format: fix latc fetches.
authorDave Airlie <airlied@gmail.com>
Fri, 30 Dec 2011 21:17:07 +0000 (21:17 +0000)
committerDave Airlie <airlied@gmail.com>
Fri, 30 Dec 2011 21:20:18 +0000 (21:20 +0000)
This fixes the latc fetches for llvmpipe, fixes
fbo-generatemipmap-formats GL_ARB_texture_compression
fbo-generatemipmap-formats GL_ATI_texture_compression_3dc
fbo-generatemipmap-formats GL_EXT_texture_compression_latc

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
src/gallium/auxiliary/util/u_format_latc.c

index 113a793e2cd3b8aa3b47cce32feacddb6fed13ef..20feb241ee011a4cfc1db2bb88f4abfb29939bea 100644 (file)
@@ -47,6 +47,9 @@ util_format_latc1_unorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsi
    (void) u_format_signed_encode_rgtc_ubyte;
 
    u_format_unsigned_fetch_texel_rgtc(0, src, i, j, dst, 1);
+   dst[1] = dst[0];
+   dst[2] = dst[0];
+   dst[3] = 255;
 }
 
 void
@@ -173,7 +176,9 @@ void
 util_format_latc2_unorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
 {
    u_format_unsigned_fetch_texel_rgtc(0, src, i, j, dst, 2);
-   u_format_unsigned_fetch_texel_rgtc(0, src + 8, i, j, dst + 1, 2);
+   dst[1] = dst[0];
+   dst[2] = dst[0];
+   u_format_unsigned_fetch_texel_rgtc(0, src + 8, i, j, dst + 3, 2);
 }
 
 void