summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorGlenn Kennard <[email protected]>2014-08-13 13:02:53 +0200
committerMarek Olšák <[email protected]>2014-08-15 01:55:13 +0200
commitf23ee74791853137caabede52204167e938fdeeb (patch)
tree3d9e81fa8211b11dea12eada8bc37374f7b74edc /src/gallium/drivers
parent221d9c3e9c043d96dcd0df9f996cb15daaeffe47 (diff)
r600g: Implement BPTC texture support
Requires Evergreen/Cayman Signed-off-by: Glenn Kennard <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/r600/r600_state_common.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index 64a027797d1..d29e137d511 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -1971,6 +1971,30 @@ uint32_t r600_translate_texformat(struct pipe_screen *screen,
}
}
+ if (desc->layout == UTIL_FORMAT_LAYOUT_BPTC) {
+ if (!enable_s3tc)
+ goto out_unknown;
+
+ if (rscreen->b.chip_class < EVERGREEN)
+ goto out_unknown;
+
+ switch (format) {
+ case PIPE_FORMAT_BPTC_RGBA_UNORM:
+ case PIPE_FORMAT_BPTC_SRGBA:
+ result = FMT_BC7;
+ is_srgb_valid = TRUE;
+ goto out_word4;
+ case PIPE_FORMAT_BPTC_RGB_FLOAT:
+ word4 |= sign_bit[0] | sign_bit[1] | sign_bit[2];
+ /* fall through */
+ case PIPE_FORMAT_BPTC_RGB_UFLOAT:
+ result = FMT_BC6;
+ goto out_word4;
+ default:
+ goto out_unknown;
+ }
+ }
+
if (desc->layout == UTIL_FORMAT_LAYOUT_SUBSAMPLED) {
switch (format) {
case PIPE_FORMAT_R8G8_B8G8_UNORM: