From 0c6ee788f225e978dab3c78e18b1cf26e37edfbd Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 30 Dec 2011 20:29:08 +0000 Subject: [PATCH] u_format/rgtc: fix alpha values in returned texels. This fixes fbo-generatemipmap-formats GL_EXT_texture_compression_rgtc on llvmpipe. Signed-off-by: Dave Airlie --- src/gallium/auxiliary/util/u_format_rgtc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/util/u_format_rgtc.c b/src/gallium/auxiliary/util/u_format_rgtc.c index 2371bab1e69..ff04e37b59d 100644 --- a/src/gallium/auxiliary/util/u_format_rgtc.c +++ b/src/gallium/auxiliary/util/u_format_rgtc.c @@ -42,6 +42,9 @@ void util_format_rgtc1_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, 1); + dst[1] = 0; + dst[2] = 0; + dst[3] = 255; } void @@ -58,6 +61,9 @@ util_format_rgtc1_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride for(i = 0; i < bw; ++i) { uint8_t *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*comps; u_format_unsigned_fetch_texel_rgtc(0, src, i, j, dst, 1); + dst[1] = 0; + dst[2] = 0; + dst[3] = 255; } } src += block_size; @@ -229,6 +235,8 @@ util_format_rgtc2_unorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsi { 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[2] = 0; + dst[3] = 255; } void @@ -246,7 +254,8 @@ util_format_rgtc2_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride uint8_t *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*comps; 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[2] = 0; + dst[3] = 255; } } src += block_size; -- 2.30.2