[Mesa-dev] [PATCH 064/140] amd: add texture format definitions for GFX9

Marek Olšák maraeo at gmail.com
Mon Mar 20 22:43:14 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

the DATA_FORMAT and NUM_FORMAT fields are the same, but some of the enums
differ, thus add GFX6 and GFX9 suffixes, so that the IB parser can show
enums for both.
---
 src/amd/common/gfx9d.h                  | 137 ++++++++++++++++++++++++++++++--
 src/amd/common/sid.h                    |  24 +++---
 src/gallium/drivers/radeonsi/si_state.c |   8 +-
 3 files changed, 147 insertions(+), 22 deletions(-)

diff --git a/src/amd/common/gfx9d.h b/src/amd/common/gfx9d.h
index 702508b..b8ff825 100644
--- a/src/amd/common/gfx9d.h
+++ b/src/amd/common/gfx9d.h
@@ -1276,26 +1276,147 @@
 #define   S_030F14_COUNT_HI(x)                                        (((unsigned)(x) & 0x7FFFFFFF) << 0)
 #define   G_030F14_COUNT_HI(x)                                        (((x) >> 0) & 0x7FFFFFFF)
 #define   C_030F14_COUNT_HI                                           0x80000000
 #define R_008F14_SQ_IMG_RSRC_WORD1                                      0x008F14
 #define   S_008F14_BASE_ADDRESS_HI(x)                                 (((unsigned)(x) & 0xFF) << 0)
 #define   G_008F14_BASE_ADDRESS_HI(x)                                 (((x) >> 0) & 0xFF)
 #define   C_008F14_BASE_ADDRESS_HI                                    0xFFFFFF00
 #define   S_008F14_MIN_LOD(x)                                         (((unsigned)(x) & 0xFFF) << 8)
 #define   G_008F14_MIN_LOD(x)                                         (((x) >> 8) & 0xFFF)
 #define   C_008F14_MIN_LOD                                            0xFFF000FF
-#define   S_008F14_DATA_FORMAT(x)                                     (((unsigned)(x) & 0x3F) << 20)
-#define   G_008F14_DATA_FORMAT(x)                                     (((x) >> 20) & 0x3F)
-#define   C_008F14_DATA_FORMAT                                        0xFC0FFFFF
-#define   S_008F14_NUM_FORMAT(x)                                      (((unsigned)(x) & 0x0F) << 26)
-#define   G_008F14_NUM_FORMAT(x)                                      (((x) >> 26) & 0x0F)
-#define   C_008F14_NUM_FORMAT                                         0xC3FFFFFF
+#define   S_008F14_DATA_FORMAT_GFX9(x)                                (((unsigned)(x) & 0x3F) << 20)
+#define   G_008F14_DATA_FORMAT_GFX9(x)                                (((x) >> 20) & 0x3F)
+#define   C_008F14_DATA_FORMAT_GFX9                                   0xFC0FFFFF
+#define     V_008F14_IMG_DATA_FORMAT_INVALID                        0x00
+#define     V_008F14_IMG_DATA_FORMAT_8                              0x01
+#define     V_008F14_IMG_DATA_FORMAT_16                             0x02
+#define     V_008F14_IMG_DATA_FORMAT_8_8                            0x03
+#define     V_008F14_IMG_DATA_FORMAT_32                             0x04
+#define     V_008F14_IMG_DATA_FORMAT_16_16                          0x05
+#define     V_008F14_IMG_DATA_FORMAT_10_11_11                       0x06
+#define     V_008F14_IMG_DATA_FORMAT_11_11_10                       0x07
+#define     V_008F14_IMG_DATA_FORMAT_10_10_10_2                     0x08
+#define     V_008F14_IMG_DATA_FORMAT_2_10_10_10                     0x09
+#define     V_008F14_IMG_DATA_FORMAT_8_8_8_8                        0x0A
+#define     V_008F14_IMG_DATA_FORMAT_32_32                          0x0B
+#define     V_008F14_IMG_DATA_FORMAT_16_16_16_16                    0x0C
+#define     V_008F14_IMG_DATA_FORMAT_32_32_32                       0x0D
+#define     V_008F14_IMG_DATA_FORMAT_32_32_32_32                    0x0E
+#define     V_008F14_IMG_DATA_FORMAT_RESERVED_15                    0x0F
+#define     V_008F14_IMG_DATA_FORMAT_5_6_5                          0x10
+#define     V_008F14_IMG_DATA_FORMAT_1_5_5_5                        0x11
+#define     V_008F14_IMG_DATA_FORMAT_5_5_5_1                        0x12
+#define     V_008F14_IMG_DATA_FORMAT_4_4_4_4                        0x13
+#define     V_008F14_IMG_DATA_FORMAT_8_24                           0x14
+#define     V_008F14_IMG_DATA_FORMAT_24_8                           0x15
+#define     V_008F14_IMG_DATA_FORMAT_X24_8_32                       0x16
+#define     V_008F14_IMG_DATA_FORMAT_8_AS_8_8_8_8                   0x17
+#define     V_008F14_IMG_DATA_FORMAT_ETC2_RGB                       0x18
+#define     V_008F14_IMG_DATA_FORMAT_ETC2_RGBA                      0x19
+#define     V_008F14_IMG_DATA_FORMAT_ETC2_R                         0x1A
+#define     V_008F14_IMG_DATA_FORMAT_ETC2_RG                        0x1B
+#define     V_008F14_IMG_DATA_FORMAT_ETC2_RGBA1                     0x1C
+#define     V_008F14_IMG_DATA_FORMAT_RESERVED_29                    0x1D
+#define     V_008F14_IMG_DATA_FORMAT_RESERVED_30                    0x1E
+#define     V_008F14_IMG_DATA_FORMAT_6E4                            0x1F
+#define     V_008F14_IMG_DATA_FORMAT_GB_GR                          0x20
+#define     V_008F14_IMG_DATA_FORMAT_BG_RG                          0x21
+#define     V_008F14_IMG_DATA_FORMAT_5_9_9_9                        0x22
+#define     V_008F14_IMG_DATA_FORMAT_BC1                            0x23
+#define     V_008F14_IMG_DATA_FORMAT_BC2                            0x24
+#define     V_008F14_IMG_DATA_FORMAT_BC3                            0x25
+#define     V_008F14_IMG_DATA_FORMAT_BC4                            0x26
+#define     V_008F14_IMG_DATA_FORMAT_BC5                            0x27
+#define     V_008F14_IMG_DATA_FORMAT_BC6                            0x28
+#define     V_008F14_IMG_DATA_FORMAT_BC7                            0x29
+#define     V_008F14_IMG_DATA_FORMAT_16_AS_32_32                    0x2A
+#define     V_008F14_IMG_DATA_FORMAT_16_AS_16_16_16_16_GFX9         0x2B
+#define     V_008F14_IMG_DATA_FORMAT_16_AS_32_32_32_32_GFX9         0x2C
+#define     V_008F14_IMG_DATA_FORMAT_FMASK                          0x2D /* NUM_FORMAT selects the format */
+#define     V_008F14_IMG_DATA_FORMAT_ASTC_2D_LDR                    0x2E /* NUM_FORMAT selects the block size */
+#define     V_008F14_IMG_DATA_FORMAT_ASTC_2D_HDR                    0x2F /* ditto */
+#define     V_008F14_IMG_DATA_FORMAT_ASTC_2D_LDR_SRGB               0x30 /* ditto */
+#define     V_008F14_IMG_DATA_FORMAT_ASTC_3D_LDR                    0x31 /* ditto */
+#define     V_008F14_IMG_DATA_FORMAT_ASTC_3D_HDR                    0x32 /* ditto */
+#define     V_008F14_IMG_DATA_FORMAT_ASTC_3D_LDR_SRGB               0x33 /* ditto */
+#define     V_008F14_IMG_DATA_FORMAT_N_IN_16                        0x34
+#define     V_008F14_IMG_DATA_FORMAT_N_IN_16_16                     0x35
+#define     V_008F14_IMG_DATA_FORMAT_N_IN_16_16_16_16               0x36
+#define     V_008F14_IMG_DATA_FORMAT_N_IN_16_AS_16_16_16_16         0x37
+#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_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
+#define   S_008F14_NUM_FORMAT_GFX9(x)                                 (((unsigned)(x) & 0x0F) << 26)
+#define   G_008F14_NUM_FORMAT_GFX9(x)                                 (((x) >> 26) & 0x0F)
+#define   C_008F14_NUM_FORMAT_GFX9                                    0xC3FFFFFF
+#define     V_008F14_IMG_NUM_FORMAT_UNORM                           0x00
+#define     V_008F14_IMG_NUM_FORMAT_SNORM                           0x01
+#define     V_008F14_IMG_NUM_FORMAT_USCALED                         0x02
+#define     V_008F14_IMG_NUM_FORMAT_SSCALED                         0x03
+#define     V_008F14_IMG_NUM_FORMAT_UINT                            0x04
+#define     V_008F14_IMG_NUM_FORMAT_SINT                            0x05
+#define     V_008F14_IMG_NUM_FORMAT_RESERVED_6                      0x06
+#define     V_008F14_IMG_NUM_FORMAT_FLOAT                           0x07
+#define     V_008F14_IMG_NUM_FORMAT_METADATA                        0x08
+#define     V_008F14_IMG_NUM_FORMAT_SRGB                            0x09
+#define     V_008F14_IMG_NUM_FORMAT_UNORM_UINT                      0x0A
+#define   S_008F14_NUM_FORMAT_FMASK(x)                                (((unsigned)(x) & 0x0F) << 26)
+#define   G_008F14_NUM_FORMAT_FMASK(x)                                (((x) >> 26) & 0x0F)
+#define   C_008F14_NUM_FORMAT_FMASK                                   0xC3FFFFFF
+#define     V_008F14_IMG_FMASK_8_2_1                                0x00
+#define     V_008F14_IMG_FMASK_8_4_1                                0x01
+#define     V_008F14_IMG_FMASK_8_8_1                                0x02
+#define     V_008F14_IMG_FMASK_8_2_2                                0x03
+#define     V_008F14_IMG_FMASK_8_4_2                                0x04
+#define     V_008F14_IMG_FMASK_8_4_4                                0x05
+#define     V_008F14_IMG_FMASK_16_16_1                              0x06
+#define     V_008F14_IMG_FMASK_16_8_2                               0x07
+#define     V_008F14_IMG_FMASK_32_16_2                              0x08
+#define     V_008F14_IMG_FMASK_32_8_4                               0x09
+#define     V_008F14_IMG_FMASK_32_8_8                               0x0A
+#define     V_008F14_IMG_FMASK_64_16_4                              0x0B
+#define     V_008F14_IMG_FMASK_64_16_8                              0x0C
+#define   S_008F14_NUM_FORMAT_ASTC_2D(x)                              (((unsigned)(x) & 0x0F) << 26)
+#define   G_008F14_NUM_FORMAT_ASTC_2D(x)                              (((x) >> 26) & 0x0F)
+#define   C_008F14_NUM_FORMAT_ASTC_2D                               0xC3FFFFFF
+#define     V_008F14_IMG_ASTC_2D_4x4                                0x00
+#define     V_008F14_IMG_ASTC_2D_5x4                                0x01
+#define     V_008F14_IMG_ASTC_2D_5x5                                0x02
+#define     V_008F14_IMG_ASTC_2D_6x5                                0x03
+#define     V_008F14_IMG_ASTC_2D_6x6                                0x04
+#define     V_008F14_IMG_ASTC_2D_8x5                                0x05
+#define     V_008F14_IMG_ASTC_2D_8x6                                0x06
+#define     V_008F14_IMG_ASTC_2D_8x8                                0x07
+#define     V_008F14_IMG_ASTC_2D_10x5                               0x08
+#define     V_008F14_IMG_ASTC_2D_10x6                               0x09
+#define     V_008F14_IMG_ASTC_2D_10x8                               0x0A
+#define     V_008F14_IMG_ASTC_2D_10x10                              0x0B
+#define     V_008F14_IMG_ASTC_2D_12x10                              0x0C
+#define     V_008F14_IMG_ASTC_2D_12x12                              0x0D
+#define   S_008F14_NUM_FORMAT_ASTC_3D(x)                              (((unsigned)(x) & 0x0F) << 26)
+#define   G_008F14_NUM_FORMAT_ASTC_3D(x)                              (((x) >> 26) & 0x0F)
+#define   C_008F14_NUM_FORMAT_ASTC_3D                               0xC3FFFFFF
+#define     V_008F14_IMG_ASTC_3D_3x3x3                              0x00
+#define     V_008F14_IMG_ASTC_3D_4x3x3                              0x01
+#define     V_008F14_IMG_ASTC_3D_4x4x3                              0x02
+#define     V_008F14_IMG_ASTC_3D_4x4x4                              0x03
+#define     V_008F14_IMG_ASTC_3D_5x4x4                              0x04
+#define     V_008F14_IMG_ASTC_3D_5x5x4                              0x05
+#define     V_008F14_IMG_ASTC_3D_5x5x5                              0x06
+#define     V_008F14_IMG_ASTC_3D_6x5x5                              0x07
+#define     V_008F14_IMG_ASTC_3D_6x6x5                              0x08
+#define     V_008F14_IMG_ASTC_3D_6x6x6                              0x09
 #define   S_008F14_NV(x)                                              (((unsigned)(x) & 0x1) << 30)
 #define   G_008F14_NV(x)                                              (((x) >> 30) & 0x1)
 #define   C_008F14_NV                                                 0xBFFFFFFF
 #define   S_008F14_META_DIRECT(x)                                     (((unsigned)(x) & 0x1) << 31)
 #define   G_008F14_META_DIRECT(x)                                     (((x) >> 31) & 0x1)
 #define   C_008F14_META_DIRECT                                        0x7FFFFFFF
 #define R_030F18_DB_OCCLUSION_COUNT3_LOW                                0x030F18
 #define R_008F18_SQ_IMG_RSRC_WORD2                                      0x008F18
 #define   S_008F18_WIDTH(x)                                           (((unsigned)(x) & 0x3FFF) << 0)
 #define   G_008F18_WIDTH(x)                                           (((x) >> 0) & 0x3FFF)
@@ -7119,20 +7240,24 @@
 #define   C_028C74_FORCE_DST_ALPHA_1                                  0xFFFDFFFF
 #define   S_028C74_COLOR_SW_MODE(x)                                   (((unsigned)(x) & 0x1F) << 18)
 #define   G_028C74_COLOR_SW_MODE(x)                                   (((x) >> 18) & 0x1F)
 #define   C_028C74_COLOR_SW_MODE                                      0xFF83FFFF
 #define   S_028C74_FMASK_SW_MODE(x)                                   (((unsigned)(x) & 0x1F) << 23)
 #define   G_028C74_FMASK_SW_MODE(x)                                   (((x) >> 23) & 0x1F)
 #define   C_028C74_FMASK_SW_MODE                                      0xF07FFFFF
 #define   S_028C74_RESOURCE_TYPE(x)                                   (((unsigned)(x) & 0x03) << 28)
 #define   G_028C74_RESOURCE_TYPE(x)                                   (((x) >> 28) & 0x03)
 #define   C_028C74_RESOURCE_TYPE                                      0xCFFFFFFF
+#define     V_028C74_1D                                             0
+#define     V_028C74_2D                                             1
+#define     V_028C74_3D                                             2
+#define     V_028C74_RESERVED                                       3
 #define   S_028C74_RB_ALIGNED(x)                                      (((unsigned)(x) & 0x1) << 30)
 #define   G_028C74_RB_ALIGNED(x)                                      (((x) >> 30) & 0x1)
 #define   C_028C74_RB_ALIGNED                                         0xBFFFFFFF
 #define   S_028C74_PIPE_ALIGNED(x)                                    (((unsigned)(x) & 0x1) << 31)
 #define   G_028C74_PIPE_ALIGNED(x)                                    (((x) >> 31) & 0x1)
 #define   C_028C74_PIPE_ALIGNED                                       0x7FFFFFFF
 #define R_028C78_CB_COLOR0_DCC_CONTROL                                  0x028C78
 #define   S_028C78_OVERWRITE_COMBINER_DISABLE(x)                      (((unsigned)(x) & 0x1) << 0)
 #define   G_028C78_OVERWRITE_COMBINER_DISABLE(x)                      (((x) >> 0) & 0x1)
 #define   C_028C78_OVERWRITE_COMBINER_DISABLE                         0xFFFFFFFE
diff --git a/src/amd/common/sid.h b/src/amd/common/sid.h
index 9145624..61e1406 100644
--- a/src/amd/common/sid.h
+++ b/src/amd/common/sid.h
@@ -2057,23 +2057,23 @@
 #define   S_030F14_COUNT_HI(x)                                        (((unsigned)(x) & 0x7FFFFFFF) << 0)
 #define   G_030F14_COUNT_HI(x)                                        (((x) >> 0) & 0x7FFFFFFF)
 #define   C_030F14_COUNT_HI                                           0x80000000
 #define R_008F14_SQ_IMG_RSRC_WORD1                                      0x008F14
 #define   S_008F14_BASE_ADDRESS_HI(x)                                 (((unsigned)(x) & 0xFF) << 0)
 #define   G_008F14_BASE_ADDRESS_HI(x)                                 (((x) >> 0) & 0xFF)
 #define   C_008F14_BASE_ADDRESS_HI                                    0xFFFFFF00
 #define   S_008F14_MIN_LOD(x)                                         (((unsigned)(x) & 0xFFF) << 8)
 #define   G_008F14_MIN_LOD(x)                                         (((x) >> 8) & 0xFFF)
 #define   C_008F14_MIN_LOD                                            0xFFF000FF
-#define   S_008F14_DATA_FORMAT(x)                                     (((unsigned)(x) & 0x3F) << 20)
-#define   G_008F14_DATA_FORMAT(x)                                     (((x) >> 20) & 0x3F)
-#define   C_008F14_DATA_FORMAT                                        0xFC0FFFFF
+#define   S_008F14_DATA_FORMAT_GFX6(x)                                (((unsigned)(x) & 0x3F) << 20)
+#define   G_008F14_DATA_FORMAT_GFX6(x)                                (((x) >> 20) & 0x3F)
+#define   C_008F14_DATA_FORMAT_GFX6                                   0xFC0FFFFF
 #define     V_008F14_IMG_DATA_FORMAT_INVALID                        0x00
 #define     V_008F14_IMG_DATA_FORMAT_8                              0x01
 #define     V_008F14_IMG_DATA_FORMAT_16                             0x02
 #define     V_008F14_IMG_DATA_FORMAT_8_8                            0x03
 #define     V_008F14_IMG_DATA_FORMAT_32                             0x04
 #define     V_008F14_IMG_DATA_FORMAT_16_16                          0x05
 #define     V_008F14_IMG_DATA_FORMAT_10_11_11                       0x06
 #define     V_008F14_IMG_DATA_FORMAT_11_11_10                       0x07
 #define     V_008F14_IMG_DATA_FORMAT_10_10_10_2                     0x08
 #define     V_008F14_IMG_DATA_FORMAT_2_10_10_10                     0x09
@@ -2102,59 +2102,59 @@
 #define     V_008F14_IMG_DATA_FORMAT_GB_GR                          0x20
 #define     V_008F14_IMG_DATA_FORMAT_BG_RG                          0x21
 #define     V_008F14_IMG_DATA_FORMAT_5_9_9_9                        0x22
 #define     V_008F14_IMG_DATA_FORMAT_BC1                            0x23
 #define     V_008F14_IMG_DATA_FORMAT_BC2                            0x24
 #define     V_008F14_IMG_DATA_FORMAT_BC3                            0x25
 #define     V_008F14_IMG_DATA_FORMAT_BC4                            0x26
 #define     V_008F14_IMG_DATA_FORMAT_BC5                            0x27
 #define     V_008F14_IMG_DATA_FORMAT_BC6                            0x28
 #define     V_008F14_IMG_DATA_FORMAT_BC7                            0x29
-#define     V_008F14_IMG_DATA_FORMAT_16_AS_16_16_16_16              0x2A /* stoney+ */
-#define     V_008F14_IMG_DATA_FORMAT_16_AS_32_32_32_32              0x2B /* stoney+ */
+#define     V_008F14_IMG_DATA_FORMAT_16_AS_16_16_16_16_GFX6         0x2A /* stoney+ */
+#define     V_008F14_IMG_DATA_FORMAT_16_AS_32_32_32_32_GFX6         0x2B /* stoney+ */
 #define     V_008F14_IMG_DATA_FORMAT_FMASK8_S2_F1                   0x2C
 #define     V_008F14_IMG_DATA_FORMAT_FMASK8_S4_F1                   0x2D
 #define     V_008F14_IMG_DATA_FORMAT_FMASK8_S8_F1                   0x2E
 #define     V_008F14_IMG_DATA_FORMAT_FMASK8_S2_F2                   0x2F
 #define     V_008F14_IMG_DATA_FORMAT_FMASK8_S4_F2                   0x30
 #define     V_008F14_IMG_DATA_FORMAT_FMASK8_S4_F4                   0x31
 #define     V_008F14_IMG_DATA_FORMAT_FMASK16_S16_F1                 0x32
 #define     V_008F14_IMG_DATA_FORMAT_FMASK16_S8_F2                  0x33
 #define     V_008F14_IMG_DATA_FORMAT_FMASK32_S16_F2                 0x34
 #define     V_008F14_IMG_DATA_FORMAT_FMASK32_S8_F4                  0x35
 #define     V_008F14_IMG_DATA_FORMAT_FMASK32_S8_F8                  0x36
 #define     V_008F14_IMG_DATA_FORMAT_FMASK64_S16_F4                 0x37
 #define     V_008F14_IMG_DATA_FORMAT_FMASK64_S16_F8                 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_FORMAT_1                              0x3B
 #define     V_008F14_IMG_DATA_FORMAT_1_REVERSED                     0x3C
 #define     V_008F14_IMG_DATA_FORMAT_32_AS_8                        0x3D /* not on stoney */
 #define     V_008F14_IMG_DATA_FORMAT_32_AS_8_8                      0x3E /* not on stoney */
 #define     V_008F14_IMG_DATA_FORMAT_32_AS_32_32_32_32              0x3F
-#define   S_008F14_NUM_FORMAT(x)                                      (((unsigned)(x) & 0x0F) << 26)
-#define   G_008F14_NUM_FORMAT(x)                                      (((x) >> 26) & 0x0F)
-#define   C_008F14_NUM_FORMAT                                         0xC3FFFFFF
+#define   S_008F14_NUM_FORMAT_GFX6(x)                                 (((unsigned)(x) & 0x0F) << 26)
+#define   G_008F14_NUM_FORMAT_GFX6(x)                                 (((x) >> 26) & 0x0F)
+#define   C_008F14_NUM_FORMAT_GFX6                                    0xC3FFFFFF
 #define     V_008F14_IMG_NUM_FORMAT_UNORM                           0x00
 #define     V_008F14_IMG_NUM_FORMAT_SNORM                           0x01
 #define     V_008F14_IMG_NUM_FORMAT_USCALED                         0x02
 #define     V_008F14_IMG_NUM_FORMAT_SSCALED                         0x03
 #define     V_008F14_IMG_NUM_FORMAT_UINT                            0x04
 #define     V_008F14_IMG_NUM_FORMAT_SINT                            0x05
 #define     V_008F14_IMG_NUM_FORMAT_SNORM_OGL                       0x06
 #define     V_008F14_IMG_NUM_FORMAT_FLOAT                           0x07
 #define     V_008F14_IMG_NUM_FORMAT_RESERVED_8                      0x08
 #define     V_008F14_IMG_NUM_FORMAT_SRGB                            0x09
-#define     V_008F14_IMG_NUM_FORMAT_UBNORM                          0x0A
-#define     V_008F14_IMG_NUM_FORMAT_UBNORM_OGL                      0x0B
-#define     V_008F14_IMG_NUM_FORMAT_UBINT                           0x0C
-#define     V_008F14_IMG_NUM_FORMAT_UBSCALED                        0x0D
+#define     V_008F14_IMG_NUM_FORMAT_UBNORM                          0x0A /* not on VI+ */
+#define     V_008F14_IMG_NUM_FORMAT_UBNORM_OGL                      0x0B /* not on VI+ */
+#define     V_008F14_IMG_NUM_FORMAT_UBINT                           0x0C /* not on VI+ */
+#define     V_008F14_IMG_NUM_FORMAT_UBSCALED                        0x0D /* not on VI+ */
 #define     V_008F14_IMG_NUM_FORMAT_RESERVED_14                     0x0E
 #define     V_008F14_IMG_NUM_FORMAT_RESERVED_15                     0x0F
 /* CIK */
 #define   S_008F14_MTYPE(x)                                           (((unsigned)(x) & 0x03) << 30)
 #define   G_008F14_MTYPE(x)                                           (((x) >> 30) & 0x03)
 #define   C_008F14_MTYPE                                              0x3FFFFFFF
 /*     */
 #define R_030F18_DB_OCCLUSION_COUNT3_LOW                                0x030F18
 #define R_008F18_SQ_IMG_RSRC_WORD2                                      0x008F18
 #define   S_008F18_WIDTH(x)                                           (((unsigned)(x) & 0x3FFF) << 0)
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index efe1f41..6d0a84c 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -2921,22 +2921,22 @@ si_make_texture_descriptor(struct si_screen *screen,
 	        height = 1;
 		depth = res->array_size;
 	} else if (type == V_008F1C_SQ_RSRC_IMG_2D_ARRAY ||
 		   type == V_008F1C_SQ_RSRC_IMG_2D_MSAA_ARRAY) {
 		if (sampler || res->target != PIPE_TEXTURE_3D)
 			depth = res->array_size;
 	} else if (type == V_008F1C_SQ_RSRC_IMG_CUBE)
 		depth = res->array_size / 6;
 
 	state[0] = 0;
-	state[1] = (S_008F14_DATA_FORMAT(data_format) |
-		    S_008F14_NUM_FORMAT(num_format));
+	state[1] = (S_008F14_DATA_FORMAT_GFX6(data_format) |
+		    S_008F14_NUM_FORMAT_GFX6(num_format));
 	state[2] = (S_008F18_WIDTH(width - 1) |
 		    S_008F18_HEIGHT(height - 1) |
 		    S_008F18_PERF_MOD(4));
 	state[3] = (S_008F1C_DST_SEL_X(si_map_swizzle(swizzle[0])) |
 		    S_008F1C_DST_SEL_Y(si_map_swizzle(swizzle[1])) |
 		    S_008F1C_DST_SEL_Z(si_map_swizzle(swizzle[2])) |
 		    S_008F1C_DST_SEL_W(si_map_swizzle(swizzle[3])) |
 		    S_008F1C_BASE_LEVEL(res->nr_samples > 1 ?
 					0 : first_level) |
 		    S_008F1C_LAST_LEVEL(res->nr_samples > 1 ?
@@ -2982,22 +2982,22 @@ si_make_texture_descriptor(struct si_screen *screen,
 		case 8:
 			fmask_format = V_008F14_IMG_DATA_FORMAT_FMASK32_S8_F8;
 			break;
 		default:
 			assert(0);
 			fmask_format = V_008F14_IMG_DATA_FORMAT_INVALID;
 		}
 
 		fmask_state[0] = va >> 8;
 		fmask_state[1] = S_008F14_BASE_ADDRESS_HI(va >> 40) |
-				 S_008F14_DATA_FORMAT(fmask_format) |
-				 S_008F14_NUM_FORMAT(V_008F14_IMG_NUM_FORMAT_UINT);
+				 S_008F14_DATA_FORMAT_GFX6(fmask_format) |
+				 S_008F14_NUM_FORMAT_GFX6(V_008F14_IMG_NUM_FORMAT_UINT);
 		fmask_state[2] = S_008F18_WIDTH(width - 1) |
 				 S_008F18_HEIGHT(height - 1);
 		fmask_state[3] = S_008F1C_DST_SEL_X(V_008F1C_SQ_SEL_X) |
 				 S_008F1C_DST_SEL_Y(V_008F1C_SQ_SEL_X) |
 				 S_008F1C_DST_SEL_Z(V_008F1C_SQ_SEL_X) |
 				 S_008F1C_DST_SEL_W(V_008F1C_SQ_SEL_X) |
 				 S_008F1C_TILING_INDEX(tex->fmask.tile_mode_index) |
 				 S_008F1C_TYPE(si_tex_dim(res->target, target, 0));
 		fmask_state[4] = S_008F20_DEPTH(depth - 1) |
 				 S_008F20_PITCH_GFX6(tex->fmask.pitch_in_pixels - 1);
-- 
2.7.4



More information about the mesa-dev mailing list