diff options
author | Dave Airlie <[email protected]> | 2011-12-30 20:29:08 +0000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2011-12-30 20:31:34 +0000 |
commit | 0c6ee788f225e978dab3c78e18b1cf26e37edfbd (patch) | |
tree | 6c76120bfe026a1e8d0cc3fc7c4a2e497a3ec300 | |
parent | 141d961d847111b2596f9c3094d5ebf1639c8c24 (diff) |
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 <[email protected]>
-rw-r--r-- | src/gallium/auxiliary/util/u_format_rgtc.c | 11 |
1 files changed, 10 insertions, 1 deletions
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; |