radeonsi/gfx9: fix TC-compatible stencil compression
authorMarek Olšák <marek.olsak@amd.com>
Fri, 16 Jun 2017 20:54:26 +0000 (22:54 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 19 Jun 2017 18:15:36 +0000 (20:15 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/amd/common/gfx9d.h
src/gallium/drivers/radeonsi/si_state.c

index 787d0a94dfb5469c110a8d8a6afbbe68b7a6ee82..8c616451849a5290f6c0729ec3949d743a4b8e03 100644 (file)
 #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
index 1cd1f9190e0287945967c0362fb3bb728944daf9..831c6b8ea32648fde540b1cab919c4a789ce0b14 100644 (file)
@@ -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 ||