summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-06-16 22:54:26 +0200
committerMarek Olšák <[email protected]>2017-06-19 20:15:36 +0200
commit0f827b51c0b7e6120df1fedadf34b578b5bcff53 (patch)
treede52c6d7f25e203d71aac82399e5dcd3d8941671 /src
parent8a264dd8299b50b8b705b717a172b728da8bb1d9 (diff)
radeonsi/gfx9: fix TC-compatible stencil compression
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/common/gfx9d.h4
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/amd/common/gfx9d.h b/src/amd/common/gfx9d.h
index 787d0a94dfb..8c616451849 100644
--- a/src/amd/common/gfx9d.h
+++ b/src/amd/common/gfx9d.h
@@ -1345,8 +1345,8 @@
#define V_008F14_IMG_DATA_FORMAT_RESERVED_56 0x38
#define V_008F14_IMG_DATA_FORMAT_4_4 0x39
#define V_008F14_IMG_DATA_FORMAT_6_5_5 0x3A
-#define V_008F14_IMG_DATA_S8_16 0x3B
-#define V_008F14_IMG_DATA_S8_32 0x3C
+#define V_008F14_IMG_DATA_FORMAT_S8_16 0x3B
+#define V_008F14_IMG_DATA_FORMAT_S8_32 0x3C
#define V_008F14_IMG_DATA_FORMAT_8_AS_32 0x3D
#define V_008F14_IMG_DATA_FORMAT_8_AS_32_32 0x3E
#define V_008F14_IMG_DATA_FORMAT_32_AS_32_32_32_32 0x3F
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 1cd1f9190e0..831c6b8ea32 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -3227,6 +3227,12 @@ si_make_texture_descriptor(struct si_screen *screen,
data_format = V_008F14_IMG_DATA_FORMAT_24_8;
}
+ /* S8 with Z32 HTILE needs a special format. */
+ if (screen->b.chip_class >= GFX9 &&
+ pipe_format == PIPE_FORMAT_S8_UINT &&
+ tex->tc_compatible_htile)
+ data_format = V_008F14_IMG_DATA_FORMAT_S8_32;
+
if (!sampler &&
(res->target == PIPE_TEXTURE_CUBE ||
res->target == PIPE_TEXTURE_CUBE_ARRAY ||