From 18786cc7d55598e82fe1de45bd2c3ffea136418e Mon Sep 17 00:00:00 2001 From: Jonathan Marek Date: Wed, 12 Feb 2020 14:16:16 -0500 Subject: [PATCH] freedreno/a6xx: use single format enum Loses some information about which formats can be used in which cases, but we encode that information in the format table anyway. Important notes: * RB6_R10G10B10A2_UNORM becomes FMT6_R10G10B10A2_UNORM_DEST * TFMT6_8_8_8_UNORM becomes FMT6_8_8_8_X8_UNORM (not FMT6_8_8_8_UNORM) Signed-off-by: Jonathan Marek Reviewed-by: Eric Anholt Reviewed-by: Kristian H. Kristensen Tested-by: Marge Bot Part-of: --- src/freedreno/registers/a6xx.xml | 365 +++++------- src/freedreno/vulkan/tu_blit.c | 24 +- src/freedreno/vulkan/tu_cmd_buffer.c | 2 +- src/freedreno/vulkan/tu_formats.c | 488 ++++++++-------- src/freedreno/vulkan/tu_image.c | 2 +- src/freedreno/vulkan/tu_private.h | 2 +- .../drivers/freedreno/a6xx/fd6_blitter.c | 24 +- src/gallium/drivers/freedreno/a6xx/fd6_draw.c | 6 +- src/gallium/drivers/freedreno/a6xx/fd6_emit.c | 2 +- .../drivers/freedreno/a6xx/fd6_format.c | 536 +++++++++--------- .../drivers/freedreno/a6xx/fd6_format.h | 100 ++-- src/gallium/drivers/freedreno/a6xx/fd6_gmem.c | 6 +- .../drivers/freedreno/a6xx/fd6_image.c | 2 +- .../drivers/freedreno/a6xx/fd6_resource.c | 52 +- .../drivers/freedreno/a6xx/fd6_screen.c | 10 +- 15 files changed, 755 insertions(+), 866 deletions(-) diff --git a/src/freedreno/registers/a6xx.xml b/src/freedreno/registers/a6xx.xml index 2cfa49f0a3e..2c4266e90b4 100644 --- a/src/freedreno/registers/a6xx.xml +++ b/src/freedreno/registers/a6xx.xml @@ -6,57 +6,6 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -64,176 +13,134 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -1987,7 +1894,7 @@ to upconvert to 32b float internally? - + @@ -2018,7 +1925,7 @@ to upconvert to 32b float internally? - + @@ -2192,7 +2099,7 @@ to upconvert to 32b float internally? - + @@ -2330,7 +2237,7 @@ to upconvert to 32b float internally? - + @@ -2395,7 +2302,7 @@ to upconvert to 32b float internally? - + @@ -2731,7 +2638,7 @@ to upconvert to 32b float internally? - + @@ -2959,7 +2866,7 @@ to upconvert to 32b float internally? - + @@ -3054,7 +2961,7 @@ to upconvert to 32b float internally? - + @@ -3288,7 +3195,7 @@ to upconvert to 32b float internally? - + @@ -3369,7 +3276,7 @@ with a better name. used but if they are good chance position is same as TEX_CONST --> - + diff --git a/src/freedreno/vulkan/tu_blit.c b/src/freedreno/vulkan/tu_blit.c index ba0d0cc2fbb..36d071cbd65 100644 --- a/src/freedreno/vulkan/tu_blit.c +++ b/src/freedreno/vulkan/tu_blit.c @@ -61,12 +61,12 @@ static uint32_t blit_image_info(const struct tu_blit_surf *img, bool src, bool stencil_read) { const struct tu_native_format *fmt = tu6_get_native_format(img->fmt); - enum a6xx_color_fmt rb = fmt->rb; + enum a6xx_format rb = fmt->rb; enum a3xx_color_swap swap = img->tiled ? WZYX : fmt->swap; - if (rb == RB6_R10G10B10A2_UNORM && src) - rb = RB6_R10G10B10A2_FLOAT16; - if (rb == RB6_Z24_UNORM_S8_UINT) - rb = RB6_Z24_UNORM_S8_UINT_AS_R8G8B8A8; + if (rb == FMT6_10_10_10_2_UNORM_DEST && src) + rb = FMT6_10_10_10_2_UNORM; + if (rb == FMT6_Z24_UNORM_S8_UINT) + rb = FMT6_Z24_UNORM_S8_UINT_AS_R8G8B8A8; if (stencil_read) swap = XYZW; @@ -85,11 +85,11 @@ emit_blit_step(struct tu_cmd_buffer *cmdbuf, const struct tu_blit *blt) tu_cs_reserve_space(cmdbuf->device, cs, 66); - enum a6xx_color_fmt fmt = tu6_get_native_format(blt->dst.fmt)->rb; - if (fmt == RB6_Z24_UNORM_S8_UINT) - fmt = RB6_Z24_UNORM_S8_UINT_AS_R8G8B8A8; + enum a6xx_format fmt = tu6_get_native_format(blt->dst.fmt)->rb; + if (fmt == FMT6_Z24_UNORM_S8_UINT) + fmt = FMT6_Z24_UNORM_S8_UINT_AS_R8G8B8A8; - enum a6xx_2d_ifmt ifmt = tu6_rb_fmt_to_ifmt(fmt); + enum a6xx_2d_ifmt ifmt = tu6_fmt_to_ifmt(fmt); if (vk_format_is_srgb(blt->dst.fmt)) { assert(ifmt == R2D_UNORM8); @@ -99,7 +99,7 @@ emit_blit_step(struct tu_cmd_buffer *cmdbuf, const struct tu_blit *blt) uint32_t blit_cntl = A6XX_RB_2D_BLIT_CNTL_ROTATE(blt->rotation) | COND(blt->type == TU_BLIT_CLEAR, A6XX_RB_2D_BLIT_CNTL_SOLID_COLOR) | A6XX_RB_2D_BLIT_CNTL_COLOR_FORMAT(fmt) | /* not required? */ - COND(fmt == RB6_Z24_UNORM_S8_UINT_AS_R8G8B8A8, A6XX_RB_2D_BLIT_CNTL_D24S8) | + COND(fmt == FMT6_Z24_UNORM_S8_UINT_AS_R8G8B8A8, A6XX_RB_2D_BLIT_CNTL_D24S8) | A6XX_RB_2D_BLIT_CNTL_MASK(0xf) | A6XX_RB_2D_BLIT_CNTL_IFMT(ifmt); @@ -190,8 +190,8 @@ emit_blit_step(struct tu_cmd_buffer *cmdbuf, const struct tu_blit *blt) tu_cs_emit_pkt4(cs, REG_A6XX_RB_UNKNOWN_8C01, 1); tu_cs_emit(cs, 0); - if (fmt == RB6_R10G10B10A2_UNORM) - fmt = RB6_R16G16B16A16_FLOAT; + if (fmt == FMT6_10_10_10_2_UNORM_DEST) + fmt = FMT6_16_16_16_16_FLOAT; tu_cs_emit_pkt4(cs, REG_A6XX_SP_2D_SRC_FORMAT, 1); tu_cs_emit(cs, COND(vk_format_is_sint(blt->src.fmt), A6XX_SP_2D_SRC_FORMAT_SINT) | diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index 99ad052a1bc..3a0527c1849 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -2978,7 +2978,7 @@ tu6_emit_ibo(struct tu_cmd_buffer *cmd, /* We don't expose robustBufferAccess, so leave the size unlimited. */ uint32_t sz = MAX_STORAGE_BUFFER_RANGE / 4; - dst[0] = A6XX_IBO_0_FMT(TFMT6_32_UINT); + dst[0] = A6XX_IBO_0_FMT(FMT6_32_UINT); dst[1] = A6XX_IBO_1_WIDTH(sz & MASK(15)) | A6XX_IBO_1_HEIGHT(sz >> 15); dst[2] = A6XX_IBO_2_UNK4 | diff --git a/src/freedreno/vulkan/tu_formats.c b/src/freedreno/vulkan/tu_formats.c index ba86d3a7289..f49348ab916 100644 --- a/src/freedreno/vulkan/tu_formats.c +++ b/src/freedreno/vulkan/tu_formats.c @@ -51,15 +51,13 @@ #undef TU_FORMAT_TABLE_FIRST #undef TU_FORMAT_TABLE_LAST -#define VFMT6_x -1 -#define TFMT6_x -1 -#define RB6_x -1 +#define FMT6_x -1 #define TU6_FMT(vkfmt, vtxfmt, texfmt, rbfmt, swapfmt, valid) \ [VK_FORMAT_##vkfmt - TU_FORMAT_TABLE_FIRST] = { \ - .vtx = VFMT6_##vtxfmt, \ - .tex = TFMT6_##texfmt, \ - .rb = RB6_##rbfmt, \ + .vtx = FMT6_##vtxfmt, \ + .tex = FMT6_##texfmt, \ + .rb = (FMT6_##rbfmt == FMT6_10_10_10_2_UNORM) ? FMT6_10_10_10_2_UNORM_DEST : FMT6_##rbfmt, \ .swap = swapfmt, \ .present = valid, \ } @@ -69,249 +67,249 @@ * exist). It is the macro of choice that decides whether a VkFormat is * supported and how. */ -#define TU6_VTC(vk, fmt, alias, swap) TU6_FMT(vk, fmt, fmt, alias, swap, true) -#define TU6_xTC(vk, fmt, alias, swap) TU6_FMT(vk, x, fmt, alias, swap, true) -#define TU6_VTx(vk, fmt, alias, swap) TU6_FMT(vk, fmt, fmt, x, swap, true) -#define TU6_Vxx(vk, fmt, alias, swap) TU6_FMT(vk, fmt, x, x, swap, true) -#define TU6_xTx(vk, fmt, alias, swap) TU6_FMT(vk, x, fmt, x, swap, true) -#define TU6_xxx(vk, fmt, alias, swap) TU6_FMT(vk, x, x, x, WZYX, false) +#define TU6_VTC(vk, fmt, swap) TU6_FMT(vk, fmt, fmt, fmt, swap, true) +#define TU6_xTC(vk, fmt, swap) TU6_FMT(vk, x, fmt, fmt, swap, true) +#define TU6_VTx(vk, fmt, swap) TU6_FMT(vk, fmt, fmt, x, swap, true) +#define TU6_Vxx(vk, fmt, swap) TU6_FMT(vk, fmt, x, x, swap, true) +#define TU6_xTx(vk, fmt, swap) TU6_FMT(vk, x, fmt, x, swap, true) +#define TU6_xxx(vk, fmt, swap) TU6_FMT(vk, x, x, x, WZYX, false) #define TU_FORMAT_TABLE_FIRST VK_FORMAT_UNDEFINED #define TU_FORMAT_TABLE_LAST VK_FORMAT_ASTC_12x12_SRGB_BLOCK TU_FORMAT_TABLE(tu6_format_table0) = { - TU6_xxx(UNDEFINED, x, x, x), /* 0 */ + TU6_xxx(UNDEFINED, x, x), /* 0 */ /* 8-bit packed */ - TU6_xxx(R4G4_UNORM_PACK8, 4_4_UNORM, R4G4_UNORM, WZXY), /* 1 */ + TU6_xxx(R4G4_UNORM_PACK8, 4_4_UNORM, WZXY), /* 1 */ /* 16-bit packed */ - TU6_xTC(R4G4B4A4_UNORM_PACK16, 4_4_4_4_UNORM, R4G4B4A4_UNORM, XYZW), /* 2 */ - TU6_xTC(B4G4R4A4_UNORM_PACK16, 4_4_4_4_UNORM, R4G4B4A4_UNORM, ZYXW), /* 3 */ - TU6_xTC(R5G6B5_UNORM_PACK16, 5_6_5_UNORM, R5G6B5_UNORM, WXYZ), /* 4 */ - TU6_xTC(B5G6R5_UNORM_PACK16, 5_6_5_UNORM, R5G6B5_UNORM, WZYX), /* 5 */ - TU6_xxx(R5G5B5A1_UNORM_PACK16, 1_5_5_5_UNORM, A1R5G5B5_UNORM, XYZW), /* 6 */ - TU6_xxx(B5G5R5A1_UNORM_PACK16, 1_5_5_5_UNORM, A1R5G5B5_UNORM, XYZW), /* 7 */ - TU6_xTC(A1R5G5B5_UNORM_PACK16, 5_5_5_1_UNORM, R5G5B5A1_UNORM, WXYZ), /* 8 */ + TU6_xTC(R4G4B4A4_UNORM_PACK16, 4_4_4_4_UNORM, XYZW), /* 2 */ + TU6_xTC(B4G4R4A4_UNORM_PACK16, 4_4_4_4_UNORM, ZYXW), /* 3 */ + TU6_xTC(R5G6B5_UNORM_PACK16, 5_6_5_UNORM, WXYZ), /* 4 */ + TU6_xTC(B5G6R5_UNORM_PACK16, 5_6_5_UNORM, WZYX), /* 5 */ + TU6_xxx(R5G5B5A1_UNORM_PACK16, 1_5_5_5_UNORM, XYZW), /* 6 */ + TU6_xxx(B5G5R5A1_UNORM_PACK16, 1_5_5_5_UNORM, XYZW), /* 7 */ + TU6_xTC(A1R5G5B5_UNORM_PACK16, 5_5_5_1_UNORM, WXYZ), /* 8 */ /* 8-bit R */ - TU6_VTC(R8_UNORM, 8_UNORM, R8_UNORM, WZYX), /* 9 */ - TU6_VTC(R8_SNORM, 8_SNORM, R8_SNORM, WZYX), /* 10 */ - TU6_Vxx(R8_USCALED, 8_UINT, R8_UINT, WZYX), /* 11 */ - TU6_Vxx(R8_SSCALED, 8_SINT, R8_SINT, WZYX), /* 12 */ - TU6_VTC(R8_UINT, 8_UINT, R8_UINT, WZYX), /* 13 */ - TU6_VTC(R8_SINT, 8_SINT, R8_SINT, WZYX), /* 14 */ - TU6_xTC(R8_SRGB, 8_UNORM, R8_UNORM, WZYX), /* 15 */ + TU6_VTC(R8_UNORM, 8_UNORM, WZYX), /* 9 */ + TU6_VTC(R8_SNORM, 8_SNORM, WZYX), /* 10 */ + TU6_Vxx(R8_USCALED, 8_UINT, WZYX), /* 11 */ + TU6_Vxx(R8_SSCALED, 8_SINT, WZYX), /* 12 */ + TU6_VTC(R8_UINT, 8_UINT, WZYX), /* 13 */ + TU6_VTC(R8_SINT, 8_SINT, WZYX), /* 14 */ + TU6_xTC(R8_SRGB, 8_UNORM, WZYX), /* 15 */ /* 16-bit RG */ - TU6_VTC(R8G8_UNORM, 8_8_UNORM, R8G8_UNORM, WZYX), /* 16 */ - TU6_VTC(R8G8_SNORM, 8_8_SNORM, R8G8_SNORM, WZYX), /* 17 */ - TU6_Vxx(R8G8_USCALED, 8_8_UINT, R8G8_UINT, WZYX), /* 18 */ - TU6_Vxx(R8G8_SSCALED, 8_8_SINT, R8G8_SINT, WZYX), /* 19 */ - TU6_VTC(R8G8_UINT, 8_8_UINT, R8G8_UINT, WZYX), /* 20 */ - TU6_VTC(R8G8_SINT, 8_8_SINT, R8G8_SINT, WZYX), /* 21 */ - TU6_xTC(R8G8_SRGB, 8_8_UNORM, R8G8_UNORM, WZYX), /* 22 */ + TU6_VTC(R8G8_UNORM, 8_8_UNORM, WZYX), /* 16 */ + TU6_VTC(R8G8_SNORM, 8_8_SNORM, WZYX), /* 17 */ + TU6_Vxx(R8G8_USCALED, 8_8_UINT, WZYX), /* 18 */ + TU6_Vxx(R8G8_SSCALED, 8_8_SINT, WZYX), /* 19 */ + TU6_VTC(R8G8_UINT, 8_8_UINT, WZYX), /* 20 */ + TU6_VTC(R8G8_SINT, 8_8_SINT, WZYX), /* 21 */ + TU6_xTC(R8G8_SRGB, 8_8_UNORM, WZYX), /* 22 */ /* 24-bit RGB */ - TU6_Vxx(R8G8B8_UNORM, 8_8_8_UNORM, R8G8B8_UNORM, WZYX), /* 23 */ - TU6_Vxx(R8G8B8_SNORM, 8_8_8_SNORM, R8G8B8_SNORM, WZYX), /* 24 */ - TU6_Vxx(R8G8B8_USCALED, 8_8_8_UINT, R8G8B8_UINT, WZYX), /* 25 */ - TU6_Vxx(R8G8B8_SSCALED, 8_8_8_SINT, R8G8B8_SINT, WZYX), /* 26 */ - TU6_Vxx(R8G8B8_UINT, 8_8_8_UINT, R8G8B8_UINT, WZYX), /* 27 */ - TU6_Vxx(R8G8B8_SINT, 8_8_8_SINT, R8G8B8_SINT, WZYX), /* 28 */ - TU6_xxx(R8G8B8_SRGB, 8_8_8_UNORM, R8G8B8_UNORM, WZYX), /* 29 */ + TU6_Vxx(R8G8B8_UNORM, 8_8_8_UNORM, WZYX), /* 23 */ + TU6_Vxx(R8G8B8_SNORM, 8_8_8_SNORM, WZYX), /* 24 */ + TU6_Vxx(R8G8B8_USCALED, 8_8_8_UINT, WZYX), /* 25 */ + TU6_Vxx(R8G8B8_SSCALED, 8_8_8_SINT, WZYX), /* 26 */ + TU6_Vxx(R8G8B8_UINT, 8_8_8_UINT, WZYX), /* 27 */ + TU6_Vxx(R8G8B8_SINT, 8_8_8_SINT, WZYX), /* 28 */ + TU6_xxx(R8G8B8_SRGB, 8_8_8_UNORM, WZYX), /* 29 */ /* 24-bit BGR */ - TU6_xxx(B8G8R8_UNORM, 8_8_8_UNORM, R8G8B8_UNORM, WXYZ), /* 30 */ - TU6_xxx(B8G8R8_SNORM, 8_8_8_SNORM, R8G8B8_SNORM, WXYZ), /* 31 */ - TU6_xxx(B8G8R8_USCALED, 8_8_8_UINT, R8G8B8_UINT, WXYZ), /* 32 */ - TU6_xxx(B8G8R8_SSCALED, 8_8_8_SINT, R8G8B8_SINT, WXYZ), /* 33 */ - TU6_xxx(B8G8R8_UINT, 8_8_8_UINT, R8G8B8_UINT, WXYZ), /* 34 */ - TU6_xxx(B8G8R8_SINT, 8_8_8_SINT, R8G8B8_SINT, WXYZ), /* 35 */ - TU6_xxx(B8G8R8_SRGB, 8_8_8_UNORM, R8G8B8_UNORM, WXYZ), /* 36 */ + TU6_xxx(B8G8R8_UNORM, 8_8_8_UNORM, WXYZ), /* 30 */ + TU6_xxx(B8G8R8_SNORM, 8_8_8_SNORM, WXYZ), /* 31 */ + TU6_xxx(B8G8R8_USCALED, 8_8_8_UINT, WXYZ), /* 32 */ + TU6_xxx(B8G8R8_SSCALED, 8_8_8_SINT, WXYZ), /* 33 */ + TU6_xxx(B8G8R8_UINT, 8_8_8_UINT, WXYZ), /* 34 */ + TU6_xxx(B8G8R8_SINT, 8_8_8_SINT, WXYZ), /* 35 */ + TU6_xxx(B8G8R8_SRGB, 8_8_8_UNORM, WXYZ), /* 36 */ /* 32-bit RGBA */ - TU6_VTC(R8G8B8A8_UNORM, 8_8_8_8_UNORM, R8G8B8A8_UNORM, WZYX), /* 37 */ - TU6_VTC(R8G8B8A8_SNORM, 8_8_8_8_SNORM, R8G8B8A8_SNORM, WZYX), /* 38 */ - TU6_Vxx(R8G8B8A8_USCALED, 8_8_8_8_UINT, R8G8B8A8_UINT, WZYX), /* 39 */ - TU6_Vxx(R8G8B8A8_SSCALED, 8_8_8_8_SINT, R8G8B8A8_SINT, WZYX), /* 40 */ - TU6_VTC(R8G8B8A8_UINT, 8_8_8_8_UINT, R8G8B8A8_UINT, WZYX), /* 41 */ - TU6_VTC(R8G8B8A8_SINT, 8_8_8_8_SINT, R8G8B8A8_SINT, WZYX), /* 42 */ - TU6_xTC(R8G8B8A8_SRGB, 8_8_8_8_UNORM, R8G8B8A8_UNORM, WZYX), /* 43 */ + TU6_VTC(R8G8B8A8_UNORM, 8_8_8_8_UNORM, WZYX), /* 37 */ + TU6_VTC(R8G8B8A8_SNORM, 8_8_8_8_SNORM, WZYX), /* 38 */ + TU6_Vxx(R8G8B8A8_USCALED, 8_8_8_8_UINT, WZYX), /* 39 */ + TU6_Vxx(R8G8B8A8_SSCALED, 8_8_8_8_SINT, WZYX), /* 40 */ + TU6_VTC(R8G8B8A8_UINT, 8_8_8_8_UINT, WZYX), /* 41 */ + TU6_VTC(R8G8B8A8_SINT, 8_8_8_8_SINT, WZYX), /* 42 */ + TU6_xTC(R8G8B8A8_SRGB, 8_8_8_8_UNORM, WZYX), /* 43 */ /* 32-bit BGRA */ - TU6_VTC(B8G8R8A8_UNORM, 8_8_8_8_UNORM, R8G8B8A8_UNORM, WXYZ), /* 44 */ - TU6_VTC(B8G8R8A8_SNORM, 8_8_8_8_SNORM, R8G8B8A8_SNORM, WXYZ), /* 45 */ - TU6_Vxx(B8G8R8A8_USCALED, 8_8_8_8_UINT, R8G8B8A8_UINT, WXYZ), /* 46 */ - TU6_Vxx(B8G8R8A8_SSCALED, 8_8_8_8_SINT, R8G8B8A8_SINT, WXYZ), /* 47 */ - TU6_VTC(B8G8R8A8_UINT, 8_8_8_8_UINT, R8G8B8A8_UINT, WXYZ), /* 48 */ - TU6_VTC(B8G8R8A8_SINT, 8_8_8_8_SINT, R8G8B8A8_SINT, WXYZ), /* 49 */ - TU6_xTC(B8G8R8A8_SRGB, 8_8_8_8_UNORM, R8G8B8A8_UNORM, WXYZ), /* 50 */ + TU6_VTC(B8G8R8A8_UNORM, 8_8_8_8_UNORM, WXYZ), /* 44 */ + TU6_VTC(B8G8R8A8_SNORM, 8_8_8_8_SNORM, WXYZ), /* 45 */ + TU6_Vxx(B8G8R8A8_USCALED, 8_8_8_8_UINT, WXYZ), /* 46 */ + TU6_Vxx(B8G8R8A8_SSCALED, 8_8_8_8_SINT, WXYZ), /* 47 */ + TU6_VTC(B8G8R8A8_UINT, 8_8_8_8_UINT, WXYZ), /* 48 */ + TU6_VTC(B8G8R8A8_SINT, 8_8_8_8_SINT, WXYZ), /* 49 */ + TU6_xTC(B8G8R8A8_SRGB, 8_8_8_8_UNORM, WXYZ), /* 50 */ /* 32-bit packed */ - TU6_VTC(A8B8G8R8_UNORM_PACK32, 8_8_8_8_UNORM, R8G8B8A8_UNORM, WZYX), /* 51 */ - TU6_VTC(A8B8G8R8_SNORM_PACK32, 8_8_8_8_SNORM, R8G8B8A8_SNORM, WZYX), /* 52 */ - TU6_Vxx(A8B8G8R8_USCALED_PACK32, 8_8_8_8_UINT, R8G8B8A8_UINT, WZYX), /* 53 */ - TU6_Vxx(A8B8G8R8_SSCALED_PACK32, 8_8_8_8_SINT, R8G8B8A8_SINT, WZYX), /* 54 */ - TU6_VTC(A8B8G8R8_UINT_PACK32, 8_8_8_8_UINT, R8G8B8A8_UINT, WZYX), /* 55 */ - TU6_VTC(A8B8G8R8_SINT_PACK32, 8_8_8_8_SINT, R8G8B8A8_SINT, WZYX), /* 56 */ - TU6_xTC(A8B8G8R8_SRGB_PACK32, 8_8_8_8_UNORM, R8G8B8A8_UNORM, WZYX), /* 57 */ - TU6_VTC(A2R10G10B10_UNORM_PACK32, 10_10_10_2_UNORM, R10G10B10A2_UNORM, WXYZ), /* 58 */ - TU6_Vxx(A2R10G10B10_SNORM_PACK32, 10_10_10_2_SNORM, R10G10B10A2_SNORM, WXYZ), /* 59 */ - TU6_Vxx(A2R10G10B10_USCALED_PACK32, 10_10_10_2_UINT, R10G10B10A2_UINT, WXYZ), /* 60 */ - TU6_Vxx(A2R10G10B10_SSCALED_PACK32, 10_10_10_2_SINT, R10G10B10A2_SINT, WXYZ), /* 61 */ - TU6_VTC(A2R10G10B10_UINT_PACK32, 10_10_10_2_UINT, R10G10B10A2_UINT, WXYZ), /* 62 */ - TU6_Vxx(A2R10G10B10_SINT_PACK32, 10_10_10_2_SINT, R10G10B10A2_SINT, WXYZ), /* 63 */ - TU6_VTC(A2B10G10R10_UNORM_PACK32, 10_10_10_2_UNORM, R10G10B10A2_UNORM, WZYX), /* 64 */ - TU6_Vxx(A2B10G10R10_SNORM_PACK32, 10_10_10_2_SNORM, R10G10B10A2_SNORM, WZYX), /* 65 */ - TU6_Vxx(A2B10G10R10_USCALED_PACK32, 10_10_10_2_UINT, R10G10B10A2_UINT, WZYX), /* 66 */ - TU6_Vxx(A2B10G10R10_SSCALED_PACK32, 10_10_10_2_SINT, R10G10B10A2_SINT, WZYX), /* 67 */ - TU6_VTC(A2B10G10R10_UINT_PACK32, 10_10_10_2_UINT, R10G10B10A2_UINT, WZYX), /* 68 */ - TU6_Vxx(A2B10G10R10_SINT_PACK32, 10_10_10_2_SINT, R10G10B10A2_SINT, WZYX), /* 69 */ + TU6_VTC(A8B8G8R8_UNORM_PACK32, 8_8_8_8_UNORM, WZYX), /* 51 */ + TU6_VTC(A8B8G8R8_SNORM_PACK32, 8_8_8_8_SNORM, WZYX), /* 52 */ + TU6_Vxx(A8B8G8R8_USCALED_PACK32, 8_8_8_8_UINT, WZYX), /* 53 */ + TU6_Vxx(A8B8G8R8_SSCALED_PACK32, 8_8_8_8_SINT, WZYX), /* 54 */ + TU6_VTC(A8B8G8R8_UINT_PACK32, 8_8_8_8_UINT, WZYX), /* 55 */ + TU6_VTC(A8B8G8R8_SINT_PACK32, 8_8_8_8_SINT, WZYX), /* 56 */ + TU6_xTC(A8B8G8R8_SRGB_PACK32, 8_8_8_8_UNORM, WZYX), /* 57 */ + TU6_VTC(A2R10G10B10_UNORM_PACK32, 10_10_10_2_UNORM, WXYZ), /* 58 */ + TU6_Vxx(A2R10G10B10_SNORM_PACK32, 10_10_10_2_SNORM, WXYZ), /* 59 */ + TU6_Vxx(A2R10G10B10_USCALED_PACK32, 10_10_10_2_UINT, WXYZ), /* 60 */ + TU6_Vxx(A2R10G10B10_SSCALED_PACK32, 10_10_10_2_SINT, WXYZ), /* 61 */ + TU6_VTC(A2R10G10B10_UINT_PACK32, 10_10_10_2_UINT, WXYZ), /* 62 */ + TU6_Vxx(A2R10G10B10_SINT_PACK32, 10_10_10_2_SINT, WXYZ), /* 63 */ + TU6_VTC(A2B10G10R10_UNORM_PACK32, 10_10_10_2_UNORM, WZYX), /* 64 */ + TU6_Vxx(A2B10G10R10_SNORM_PACK32, 10_10_10_2_SNORM, WZYX), /* 65 */ + TU6_Vxx(A2B10G10R10_USCALED_PACK32, 10_10_10_2_UINT, WZYX), /* 66 */ + TU6_Vxx(A2B10G10R10_SSCALED_PACK32, 10_10_10_2_SINT, WZYX), /* 67 */ + TU6_VTC(A2B10G10R10_UINT_PACK32, 10_10_10_2_UINT, WZYX), /* 68 */ + TU6_Vxx(A2B10G10R10_SINT_PACK32, 10_10_10_2_SINT, WZYX), /* 69 */ /* 16-bit R */ - TU6_VTC(R16_UNORM, 16_UNORM, R16_UNORM, WZYX), /* 70 */ - TU6_VTC(R16_SNORM, 16_SNORM, R16_SNORM, WZYX), /* 71 */ - TU6_Vxx(R16_USCALED, 16_UINT, R16_UINT, WZYX), /* 72 */ - TU6_Vxx(R16_SSCALED, 16_SINT, R16_SINT, WZYX), /* 73 */ - TU6_VTC(R16_UINT, 16_UINT, R16_UINT, WZYX), /* 74 */ - TU6_VTC(R16_SINT, 16_SINT, R16_SINT, WZYX), /* 75 */ - TU6_VTC(R16_SFLOAT, 16_FLOAT, R16_FLOAT, WZYX), /* 76 */ + TU6_VTC(R16_UNORM, 16_UNORM, WZYX), /* 70 */ + TU6_VTC(R16_SNORM, 16_SNORM, WZYX), /* 71 */ + TU6_Vxx(R16_USCALED, 16_UINT, WZYX), /* 72 */ + TU6_Vxx(R16_SSCALED, 16_SINT, WZYX), /* 73 */ + TU6_VTC(R16_UINT, 16_UINT, WZYX), /* 74 */ + TU6_VTC(R16_SINT, 16_SINT, WZYX), /* 75 */ + TU6_VTC(R16_SFLOAT, 16_FLOAT, WZYX), /* 76 */ /* 32-bit RG */ - TU6_VTC(R16G16_UNORM, 16_16_UNORM, R16G16_UNORM, WZYX), /* 77 */ - TU6_VTC(R16G16_SNORM, 16_16_SNORM, R16G16_SNORM, WZYX), /* 78 */ - TU6_Vxx(R16G16_USCALED, 16_16_UINT, R16G16_UINT, WZYX), /* 79 */ - TU6_Vxx(R16G16_SSCALED, 16_16_SINT, R16G16_SINT, WZYX), /* 80 */ - TU6_VTC(R16G16_UINT, 16_16_UINT, R16G16_UINT, WZYX), /* 81 */ - TU6_VTC(R16G16_SINT, 16_16_SINT, R16G16_SINT, WZYX), /* 82 */ - TU6_VTC(R16G16_SFLOAT, 16_16_FLOAT, R16G16_FLOAT, WZYX), /* 83 */ + TU6_VTC(R16G16_UNORM, 16_16_UNORM, WZYX), /* 77 */ + TU6_VTC(R16G16_SNORM, 16_16_SNORM, WZYX), /* 78 */ + TU6_Vxx(R16G16_USCALED, 16_16_UINT, WZYX), /* 79 */ + TU6_Vxx(R16G16_SSCALED, 16_16_SINT, WZYX), /* 80 */ + TU6_VTC(R16G16_UINT, 16_16_UINT, WZYX), /* 81 */ + TU6_VTC(R16G16_SINT, 16_16_SINT, WZYX), /* 82 */ + TU6_VTC(R16G16_SFLOAT, 16_16_FLOAT, WZYX), /* 83 */ /* 48-bit RGB */ - TU6_Vxx(R16G16B16_UNORM, 16_16_16_UNORM, R16G16B16_UNORM, WZYX), /* 84 */ - TU6_Vxx(R16G16B16_SNORM, 16_16_16_SNORM, R16G16B16_SNORM, WZYX), /* 85 */ - TU6_Vxx(R16G16B16_USCALED, 16_16_16_UINT, R16G16B16_UINT, WZYX), /* 86 */ - TU6_Vxx(R16G16B16_SSCALED, 16_16_16_SINT, R16G16B16_SINT, WZYX), /* 87 */ - TU6_Vxx(R16G16B16_UINT, 16_16_16_UINT, R16G16B16_UINT, WZYX), /* 88 */ - TU6_Vxx(R16G16B16_SINT, 16_16_16_SINT, R16G16B16_SINT, WZYX), /* 89 */ - TU6_Vxx(R16G16B16_SFLOAT, 16_16_16_FLOAT, R16G16B16_FLOAT, WZYX), /* 90 */ + TU6_Vxx(R16G16B16_UNORM, 16_16_16_UNORM, WZYX), /* 84 */ + TU6_Vxx(R16G16B16_SNORM, 16_16_16_SNORM, WZYX), /* 85 */ + TU6_Vxx(R16G16B16_USCALED, 16_16_16_UINT, WZYX), /* 86 */ + TU6_Vxx(R16G16B16_SSCALED, 16_16_16_SINT, WZYX), /* 87 */ + TU6_Vxx(R16G16B16_UINT, 16_16_16_UINT, WZYX), /* 88 */ + TU6_Vxx(R16G16B16_SINT, 16_16_16_SINT, WZYX), /* 89 */ + TU6_Vxx(R16G16B16_SFLOAT, 16_16_16_FLOAT, WZYX), /* 90 */ /* 64-bit RGBA */ - TU6_VTC(R16G16B16A16_UNORM, 16_16_16_16_UNORM, R16G16B16A16_UNORM, WZYX), /* 91 */ - TU6_VTC(R16G16B16A16_SNORM, 16_16_16_16_SNORM, R16G16B16A16_SNORM, WZYX), /* 92 */ - TU6_Vxx(R16G16B16A16_USCALED, 16_16_16_16_UINT, R16G16B16A16_UINT, WZYX), /* 93 */ - TU6_Vxx(R16G16B16A16_SSCALED, 16_16_16_16_SINT, R16G16B16A16_SINT, WZYX), /* 94 */ - TU6_VTC(R16G16B16A16_UINT, 16_16_16_16_UINT, R16G16B16A16_UINT, WZYX), /* 95 */ - TU6_VTC(R16G16B16A16_SINT, 16_16_16_16_SINT, R16G16B16A16_SINT, WZYX), /* 96 */ - TU6_VTC(R16G16B16A16_SFLOAT, 16_16_16_16_FLOAT, R16G16B16A16_FLOAT, WZYX), /* 97 */ + TU6_VTC(R16G16B16A16_UNORM, 16_16_16_16_UNORM, WZYX), /* 91 */ + TU6_VTC(R16G16B16A16_SNORM, 16_16_16_16_SNORM, WZYX), /* 92 */ + TU6_Vxx(R16G16B16A16_USCALED, 16_16_16_16_UINT, WZYX), /* 93 */ + TU6_Vxx(R16G16B16A16_SSCALED, 16_16_16_16_SINT, WZYX), /* 94 */ + TU6_VTC(R16G16B16A16_UINT, 16_16_16_16_UINT, WZYX), /* 95 */ + TU6_VTC(R16G16B16A16_SINT, 16_16_16_16_SINT, WZYX), /* 96 */ + TU6_VTC(R16G16B16A16_SFLOAT, 16_16_16_16_FLOAT, WZYX), /* 97 */ /* 32-bit R */ - TU6_VTC(R32_UINT, 32_UINT, R32_UINT, WZYX), /* 98 */ - TU6_VTC(R32_SINT, 32_SINT, R32_SINT, WZYX), /* 99 */ - TU6_VTC(R32_SFLOAT, 32_FLOAT, R32_FLOAT, WZYX), /* 100 */ + TU6_VTC(R32_UINT, 32_UINT, WZYX), /* 98 */ + TU6_VTC(R32_SINT, 32_SINT, WZYX), /* 99 */ + TU6_VTC(R32_SFLOAT, 32_FLOAT, WZYX), /* 100 */ /* 64-bit RG */ - TU6_VTC(R32G32_UINT, 32_32_UINT, R32G32_UINT, WZYX), /* 101 */ - TU6_VTC(R32G32_SINT, 32_32_SINT, R32G32_SINT, WZYX), /* 102 */ - TU6_VTC(R32G32_SFLOAT, 32_32_FLOAT, R32G32_FLOAT, WZYX), /* 103 */ + TU6_VTC(R32G32_UINT, 32_32_UINT, WZYX), /* 101 */ + TU6_VTC(R32G32_SINT, 32_32_SINT, WZYX), /* 102 */ + TU6_VTC(R32G32_SFLOAT, 32_32_FLOAT, WZYX), /* 103 */ /* 96-bit RGB */ - TU6_Vxx(R32G32B32_UINT, 32_32_32_UINT, R32G32B32_UINT, WZYX), /* 104 */ - TU6_Vxx(R32G32B32_SINT, 32_32_32_SINT, R32G32B32_SINT, WZYX), /* 105 */ - TU6_Vxx(R32G32B32_SFLOAT, 32_32_32_FLOAT, R32G32B32_FLOAT, WZYX), /* 106 */ + TU6_Vxx(R32G32B32_UINT, 32_32_32_UINT, WZYX), /* 104 */ + TU6_Vxx(R32G32B32_SINT, 32_32_32_SINT, WZYX), /* 105 */ + TU6_Vxx(R32G32B32_SFLOAT, 32_32_32_FLOAT, WZYX), /* 106 */ /* 128-bit RGBA */ - TU6_VTC(R32G32B32A32_UINT, 32_32_32_32_UINT, R32G32B32A32_UINT, WZYX), /* 107 */ - TU6_VTC(R32G32B32A32_SINT, 32_32_32_32_SINT, R32G32B32A32_SINT, WZYX), /* 108 */ - TU6_VTC(R32G32B32A32_SFLOAT, 32_32_32_32_FLOAT, R32G32B32A32_FLOAT, WZYX), /* 109 */ + TU6_VTC(R32G32B32A32_UINT, 32_32_32_32_UINT, WZYX), /* 107 */ + TU6_VTC(R32G32B32A32_SINT, 32_32_32_32_SINT, WZYX), /* 108 */ + TU6_VTC(R32G32B32A32_SFLOAT, 32_32_32_32_FLOAT, WZYX), /* 109 */ /* 64-bit R */ - TU6_xxx(R64_UINT, 64_UINT, R64_UINT, WZYX), /* 110 */ - TU6_xxx(R64_SINT, 64_SINT, R64_SINT, WZYX), /* 111 */ - TU6_xxx(R64_SFLOAT, 64_FLOAT, R64_FLOAT, WZYX), /* 112 */ + TU6_xxx(R64_UINT, 64_UINT, WZYX), /* 110 */ + TU6_xxx(R64_SINT, 64_SINT, WZYX), /* 111 */ + TU6_xxx(R64_SFLOAT, 64_FLOAT, WZYX), /* 112 */ /* 128-bit RG */ - TU6_xxx(R64G64_UINT, 64_64_UINT, R64G64_UINT, WZYX), /* 113 */ - TU6_xxx(R64G64_SINT, 64_64_SINT, R64G64_SINT, WZYX), /* 114 */ - TU6_xxx(R64G64_SFLOAT, 64_64_FLOAT, R64G64_FLOAT, WZYX), /* 115 */ + TU6_xxx(R64G64_UINT, 64_64_UINT, WZYX), /* 113 */ + TU6_xxx(R64G64_SINT, 64_64_SINT, WZYX), /* 114 */ + TU6_xxx(R64G64_SFLOAT, 64_64_FLOAT, WZYX), /* 115 */ /* 192-bit RGB */ - TU6_xxx(R64G64B64_UINT, 64_64_64_UINT, R64G64B64_UINT, WZYX), /* 116 */ - TU6_xxx(R64G64B64_SINT, 64_64_64_SINT, R64G64B64_SINT, WZYX), /* 117 */ - TU6_xxx(R64G64B64_SFLOAT, 64_64_64_FLOAT, R64G64B64_FLOAT, WZYX), /* 118 */ + TU6_xxx(R64G64B64_UINT, 64_64_64_UINT, WZYX), /* 116 */ + TU6_xxx(R64G64B64_SINT, 64_64_64_SINT, WZYX), /* 117 */ + TU6_xxx(R64G64B64_SFLOAT, 64_64_64_FLOAT, WZYX), /* 118 */ /* 256-bit RGBA */ - TU6_xxx(R64G64B64A64_UINT, 64_64_64_64_UINT, R64G64B64A64_UINT, WZYX), /* 119 */ - TU6_xxx(R64G64B64A64_SINT, 64_64_64_64_SINT, R64G64B64A64_SINT, WZYX), /* 120 */ - TU6_xxx(R64G64B64A64_SFLOAT, 64_64_64_64_FLOAT, R64G64B64A64_FLOAT, WZYX), /* 121 */ + TU6_xxx(R64G64B64A64_UINT, 64_64_64_64_UINT, WZYX), /* 119 */ + TU6_xxx(R64G64B64A64_SINT, 64_64_64_64_SINT, WZYX), /* 120 */ + TU6_xxx(R64G64B64A64_SFLOAT, 64_64_64_64_FLOAT, WZYX), /* 121 */ /* 32-bit packed float */ - TU6_VTC(B10G11R11_UFLOAT_PACK32, 11_11_10_FLOAT, R11G11B10_FLOAT, WZYX), /* 122 */ - TU6_xTx(E5B9G9R9_UFLOAT_PACK32, 9_9_9_E5_FLOAT, R9G9B9E5_FLOAT, WZYX), /* 123 */ + TU6_VTC(B10G11R11_UFLOAT_PACK32, 11_11_10_FLOAT, WZYX), /* 122 */ + TU6_xTx(E5B9G9R9_UFLOAT_PACK32, 9_9_9_E5_FLOAT, WZYX), /* 123 */ /* depth/stencil */ - TU6_xTC(D16_UNORM, 16_UNORM, R16_UNORM, WZYX), /* 124 */ - TU6_xTC(X8_D24_UNORM_PACK32, Z24_UNORM_S8_UINT, Z24_UNORM_S8_UINT, WZYX), /* 125 */ - TU6_xTC(D32_SFLOAT, 32_FLOAT, R32_FLOAT, WZYX), /* 126 */ - TU6_xTC(S8_UINT, 8_UINT, R8_UINT, WZYX), /* 127 */ - TU6_xxx(D16_UNORM_S8_UINT, X8Z16_UNORM, X8Z16_UNORM, WZYX), /* 128 */ - TU6_xTC(D24_UNORM_S8_UINT, Z24_UNORM_S8_UINT, Z24_UNORM_S8_UINT, WZYX), /* 129 */ - TU6_xxx(D32_SFLOAT_S8_UINT, x, x, WZYX), /* 130 */ + TU6_xTC(D16_UNORM, 16_UNORM, WZYX), /* 124 */ + TU6_xTC(X8_D24_UNORM_PACK32, Z24_UNORM_S8_UINT, WZYX), /* 125 */ + TU6_xTC(D32_SFLOAT, 32_FLOAT, WZYX), /* 126 */ + TU6_xTC(S8_UINT, 8_UINT, WZYX), /* 127 */ + TU6_xxx(D16_UNORM_S8_UINT, X8Z16_UNORM, WZYX), /* 128 */ + TU6_xTC(D24_UNORM_S8_UINT, Z24_UNORM_S8_UINT, WZYX), /* 129 */ + TU6_xxx(D32_SFLOAT_S8_UINT, x, WZYX), /* 130 */ /* compressed */ - TU6_xTx(BC1_RGB_UNORM_BLOCK, DXT1, DXT1, WZYX), /* 131 */ - TU6_xTx(BC1_RGB_SRGB_BLOCK, DXT1, DXT1, WZYX), /* 132 */ - TU6_xTx(BC1_RGBA_UNORM_BLOCK, DXT1, DXT1, WZYX), /* 133 */ - TU6_xTx(BC1_RGBA_SRGB_BLOCK, DXT1, DXT1, WZYX), /* 134 */ - TU6_xTx(BC2_UNORM_BLOCK, DXT3, DXT3, WZYX), /* 135 */ - TU6_xTx(BC2_SRGB_BLOCK, DXT3, DXT3, WZYX), /* 136 */ - TU6_xTx(BC3_UNORM_BLOCK, DXT5, DXT5, WZYX), /* 137 */ - TU6_xTx(BC3_SRGB_BLOCK, DXT5, DXT5, WZYX), /* 138 */ - TU6_xTx(BC4_UNORM_BLOCK, RGTC1_UNORM, RGTC1_UNORM, WZYX), /* 139 */ - TU6_xTx(BC4_SNORM_BLOCK, RGTC1_SNORM, RGTC1_SNORM, WZYX), /* 140 */ - TU6_xTx(BC5_UNORM_BLOCK, RGTC2_UNORM, RGTC2_UNORM, WZYX), /* 141 */ - TU6_xTx(BC5_SNORM_BLOCK, RGTC2_SNORM, RGTC2_SNORM, WZYX), /* 142 */ - TU6_xTx(BC6H_UFLOAT_BLOCK, BPTC_UFLOAT, BPTC_UFLOAT, WZYX), /* 143 */ - TU6_xTx(BC6H_SFLOAT_BLOCK, BPTC_FLOAT, BPTC_FLOAT, WZYX), /* 144 */ - TU6_xTx(BC7_UNORM_BLOCK, BPTC, BPTC, WZYX), /* 145 */ - TU6_xTx(BC7_SRGB_BLOCK, BPTC, BPTC, WZYX), /* 146 */ - TU6_xTx(ETC2_R8G8B8_UNORM_BLOCK, ETC2_RGB8, ETC2_RGB8, WZYX), /* 147 */ - TU6_xTx(ETC2_R8G8B8_SRGB_BLOCK, ETC2_RGB8, ETC2_RGB8, WZYX), /* 148 */ - TU6_xTx(ETC2_R8G8B8A1_UNORM_BLOCK, ETC2_RGB8A1, ETC2_RGB8A1, WZYX), /* 149 */ - TU6_xTx(ETC2_R8G8B8A1_SRGB_BLOCK, ETC2_RGB8A1, ETC2_RGB8A1, WZYX), /* 150 */ - TU6_xTx(ETC2_R8G8B8A8_UNORM_BLOCK, ETC2_RGBA8, ETC2_RGBA8, WZYX), /* 151 */ - TU6_xTx(ETC2_R8G8B8A8_SRGB_BLOCK, ETC2_RGBA8, ETC2_RGBA8, WZYX), /* 152 */ - TU6_xTx(EAC_R11_UNORM_BLOCK, ETC2_R11_UNORM, ETC2_R11_UNORM, WZYX), /* 153 */ - TU6_xTx(EAC_R11_SNORM_BLOCK, ETC2_R11_SNORM, ETC2_R11_SNORM, WZYX), /* 154 */ - TU6_xTx(EAC_R11G11_UNORM_BLOCK, ETC2_RG11_UNORM, ETC2_RG11_UNORM, WZYX), /* 155 */ - TU6_xTx(EAC_R11G11_SNORM_BLOCK, ETC2_RG11_SNORM, ETC2_RG11_SNORM, WZYX), /* 156 */ - TU6_xTx(ASTC_4x4_UNORM_BLOCK, ASTC_4x4, ASTC_4x4, WZYX), /* 157 */ - TU6_xTx(ASTC_4x4_SRGB_BLOCK, ASTC_4x4, ASTC_4x4, WZYX), /* 158 */ - TU6_xTx(ASTC_5x4_UNORM_BLOCK, ASTC_5x4, ASTC_5x4, WZYX), /* 159 */ - TU6_xTx(ASTC_5x4_SRGB_BLOCK, ASTC_5x4, ASTC_5x4, WZYX), /* 160 */ - TU6_xTx(ASTC_5x5_UNORM_BLOCK, ASTC_5x5, ASTC_5x5, WZYX), /* 161 */ - TU6_xTx(ASTC_5x5_SRGB_BLOCK, ASTC_5x5, ASTC_5x5, WZYX), /* 162 */ - TU6_xTx(ASTC_6x5_UNORM_BLOCK, ASTC_6x5, ASTC_6x5, WZYX), /* 163 */ - TU6_xTx(ASTC_6x5_SRGB_BLOCK, ASTC_6x5, ASTC_6x5, WZYX), /* 164 */ - TU6_xTx(ASTC_6x6_UNORM_BLOCK, ASTC_6x6, ASTC_6x6, WZYX), /* 165 */ - TU6_xTx(ASTC_6x6_SRGB_BLOCK, ASTC_6x6, ASTC_6x6, WZYX), /* 166 */ - TU6_xTx(ASTC_8x5_UNORM_BLOCK, ASTC_8x5, ASTC_8x5, WZYX), /* 167 */ - TU6_xTx(ASTC_8x5_SRGB_BLOCK, ASTC_8x5, ASTC_8x5, WZYX), /* 168 */ - TU6_xTx(ASTC_8x6_UNORM_BLOCK, ASTC_8x6, ASTC_8x6, WZYX), /* 169 */ - TU6_xTx(ASTC_8x6_SRGB_BLOCK, ASTC_8x6, ASTC_8x6, WZYX), /* 170 */ - TU6_xTx(ASTC_8x8_UNORM_BLOCK, ASTC_8x8, ASTC_8x8, WZYX), /* 171 */ - TU6_xTx(ASTC_8x8_SRGB_BLOCK, ASTC_8x8, ASTC_8x8, WZYX), /* 172 */ - TU6_xTx(ASTC_10x5_UNORM_BLOCK, ASTC_10x5, ASTC_10x5, WZYX), /* 173 */ - TU6_xTx(ASTC_10x5_SRGB_BLOCK, ASTC_10x5, ASTC_10x5, WZYX), /* 174 */ - TU6_xTx(ASTC_10x6_UNORM_BLOCK, ASTC_10x6, ASTC_10x6, WZYX), /* 175 */ - TU6_xTx(ASTC_10x6_SRGB_BLOCK, ASTC_10x6, ASTC_10x6, WZYX), /* 176 */ - TU6_xTx(ASTC_10x8_UNORM_BLOCK, ASTC_10x8, ASTC_10x8, WZYX), /* 177 */ - TU6_xTx(ASTC_10x8_SRGB_BLOCK, ASTC_10x8, ASTC_10x8, WZYX), /* 178 */ - TU6_xTx(ASTC_10x10_UNORM_BLOCK, ASTC_10x10, ASTC_10x10, WZYX), /* 179 */ - TU6_xTx(ASTC_10x10_SRGB_BLOCK, ASTC_10x10, ASTC_10x10, WZYX), /* 180 */ - TU6_xTx(ASTC_12x10_UNORM_BLOCK, ASTC_12x10, ASTC_12x10, WZYX), /* 181 */ - TU6_xTx(ASTC_12x10_SRGB_BLOCK, ASTC_12x10, ASTC_12x10, WZYX), /* 182 */ - TU6_xTx(ASTC_12x12_UNORM_BLOCK, ASTC_12x12, ASTC_12x12, WZYX), /* 183 */ - TU6_xTx(ASTC_12x12_SRGB_BLOCK, ASTC_12x12, ASTC_12x12, WZYX), /* 184 */ + TU6_xTx(BC1_RGB_UNORM_BLOCK, DXT1, WZYX), /* 131 */ + TU6_xTx(BC1_RGB_SRGB_BLOCK, DXT1, WZYX), /* 132 */ + TU6_xTx(BC1_RGBA_UNORM_BLOCK, DXT1, WZYX), /* 133 */ + TU6_xTx(BC1_RGBA_SRGB_BLOCK, DXT1, WZYX), /* 134 */ + TU6_xTx(BC2_UNORM_BLOCK, DXT3, WZYX), /* 135 */ + TU6_xTx(BC2_SRGB_BLOCK, DXT3, WZYX), /* 136 */ + TU6_xTx(BC3_UNORM_BLOCK, DXT5, WZYX), /* 137 */ + TU6_xTx(BC3_SRGB_BLOCK, DXT5, WZYX), /* 138 */ + TU6_xTx(BC4_UNORM_BLOCK, RGTC1_UNORM, WZYX), /* 139 */ + TU6_xTx(BC4_SNORM_BLOCK, RGTC1_SNORM, WZYX), /* 140 */ + TU6_xTx(BC5_UNORM_BLOCK, RGTC2_UNORM, WZYX), /* 141 */ + TU6_xTx(BC5_SNORM_BLOCK, RGTC2_SNORM, WZYX), /* 142 */ + TU6_xTx(BC6H_UFLOAT_BLOCK, BPTC_UFLOAT, WZYX), /* 143 */ + TU6_xTx(BC6H_SFLOAT_BLOCK, BPTC_FLOAT, WZYX), /* 144 */ + TU6_xTx(BC7_UNORM_BLOCK, BPTC, WZYX), /* 145 */ + TU6_xTx(BC7_SRGB_BLOCK, BPTC, WZYX), /* 146 */ + TU6_xTx(ETC2_R8G8B8_UNORM_BLOCK, ETC2_RGB8, WZYX), /* 147 */ + TU6_xTx(ETC2_R8G8B8_SRGB_BLOCK, ETC2_RGB8, WZYX), /* 148 */ + TU6_xTx(ETC2_R8G8B8A1_UNORM_BLOCK, ETC2_RGB8A1, WZYX), /* 149 */ + TU6_xTx(ETC2_R8G8B8A1_SRGB_BLOCK, ETC2_RGB8A1, WZYX), /* 150 */ + TU6_xTx(ETC2_R8G8B8A8_UNORM_BLOCK, ETC2_RGBA8, WZYX), /* 151 */ + TU6_xTx(ETC2_R8G8B8A8_SRGB_BLOCK, ETC2_RGBA8, WZYX), /* 152 */ + TU6_xTx(EAC_R11_UNORM_BLOCK, ETC2_R11_UNORM, WZYX), /* 153 */ + TU6_xTx(EAC_R11_SNORM_BLOCK, ETC2_R11_SNORM, WZYX), /* 154 */ + TU6_xTx(EAC_R11G11_UNORM_BLOCK, ETC2_RG11_UNORM, WZYX), /* 155 */ + TU6_xTx(EAC_R11G11_SNORM_BLOCK, ETC2_RG11_SNORM, WZYX), /* 156 */ + TU6_xTx(ASTC_4x4_UNORM_BLOCK, ASTC_4x4, WZYX), /* 157 */ + TU6_xTx(ASTC_4x4_SRGB_BLOCK, ASTC_4x4, WZYX), /* 158 */ + TU6_xTx(ASTC_5x4_UNORM_BLOCK, ASTC_5x4, WZYX), /* 159 */ + TU6_xTx(ASTC_5x4_SRGB_BLOCK, ASTC_5x4, WZYX), /* 160 */ + TU6_xTx(ASTC_5x5_UNORM_BLOCK, ASTC_5x5, WZYX), /* 161 */ + TU6_xTx(ASTC_5x5_SRGB_BLOCK, ASTC_5x5, WZYX), /* 162 */ + TU6_xTx(ASTC_6x5_UNORM_BLOCK, ASTC_6x5, WZYX), /* 163 */ + TU6_xTx(ASTC_6x5_SRGB_BLOCK, ASTC_6x5, WZYX), /* 164 */ + TU6_xTx(ASTC_6x6_UNORM_BLOCK, ASTC_6x6, WZYX), /* 165 */ + TU6_xTx(ASTC_6x6_SRGB_BLOCK, ASTC_6x6, WZYX), /* 166 */ + TU6_xTx(ASTC_8x5_UNORM_BLOCK, ASTC_8x5, WZYX), /* 167 */ + TU6_xTx(ASTC_8x5_SRGB_BLOCK, ASTC_8x5, WZYX), /* 168 */ + TU6_xTx(ASTC_8x6_UNORM_BLOCK, ASTC_8x6, WZYX), /* 169 */ + TU6_xTx(ASTC_8x6_SRGB_BLOCK, ASTC_8x6, WZYX), /* 170 */ + TU6_xTx(ASTC_8x8_UNORM_BLOCK, ASTC_8x8, WZYX), /* 171 */ + TU6_xTx(ASTC_8x8_SRGB_BLOCK, ASTC_8x8, WZYX), /* 172 */ + TU6_xTx(ASTC_10x5_UNORM_BLOCK, ASTC_10x5, WZYX), /* 173 */ + TU6_xTx(ASTC_10x5_SRGB_BLOCK, ASTC_10x5, WZYX), /* 174 */ + TU6_xTx(ASTC_10x6_UNORM_BLOCK, ASTC_10x6, WZYX), /* 175 */ + TU6_xTx(ASTC_10x6_SRGB_BLOCK, ASTC_10x6, WZYX), /* 176 */ + TU6_xTx(ASTC_10x8_UNORM_BLOCK, ASTC_10x8, WZYX), /* 177 */ + TU6_xTx(ASTC_10x8_SRGB_BLOCK, ASTC_10x8, WZYX), /* 178 */ + TU6_xTx(ASTC_10x10_UNORM_BLOCK, ASTC_10x10, WZYX), /* 179 */ + TU6_xTx(ASTC_10x10_SRGB_BLOCK, ASTC_10x10, WZYX), /* 180 */ + TU6_xTx(ASTC_12x10_UNORM_BLOCK, ASTC_12x10, WZYX), /* 181 */ + TU6_xTx(ASTC_12x10_SRGB_BLOCK, ASTC_12x10, WZYX), /* 182 */ + TU6_xTx(ASTC_12x12_UNORM_BLOCK, ASTC_12x12, WZYX), /* 183 */ + TU6_xTx(ASTC_12x12_SRGB_BLOCK, ASTC_12x12, WZYX), /* 184 */ }; #undef TU_FORMAT_TABLE_FIRST #undef TU_FORMAT_TABLE_LAST @@ -336,65 +334,65 @@ tu6_get_native_format(VkFormat format) } enum a6xx_2d_ifmt -tu6_rb_fmt_to_ifmt(enum a6xx_color_fmt fmt) +tu6_fmt_to_ifmt(enum a6xx_format fmt) { switch (fmt) { - case RB6_A8_UNORM: - case RB6_R8_UNORM: - case RB6_R8_SNORM: - case RB6_R8G8_UNORM: - case RB6_R8G8_SNORM: - case RB6_R8G8B8A8_UNORM: - case RB6_R8G8B8X8_UNORM: - case RB6_R8G8B8A8_SNORM: - case RB6_R4G4B4A4_UNORM: - case RB6_R5G5B5A1_UNORM: - case RB6_R5G6B5_UNORM: - case RB6_Z24_UNORM_S8_UINT: - case RB6_Z24_UNORM_S8_UINT_AS_R8G8B8A8: + case FMT6_A8_UNORM: + case FMT6_8_UNORM: + case FMT6_8_SNORM: + case FMT6_8_8_UNORM: + case FMT6_8_8_SNORM: + case FMT6_8_8_8_8_UNORM: + case FMT6_8_8_8_X8_UNORM: + case FMT6_8_8_8_8_SNORM: + case FMT6_4_4_4_4_UNORM: + case FMT6_5_5_5_1_UNORM: + case FMT6_5_6_5_UNORM: + case FMT6_Z24_UNORM_S8_UINT: + case FMT6_Z24_UNORM_S8_UINT_AS_R8G8B8A8: return R2D_UNORM8; - case RB6_R32_UINT: - case RB6_R32_SINT: - case RB6_R32G32_UINT: - case RB6_R32G32_SINT: - case RB6_R32G32B32A32_UINT: - case RB6_R32G32B32A32_SINT: + case FMT6_32_UINT: + case FMT6_32_SINT: + case FMT6_32_32_UINT: + case FMT6_32_32_SINT: + case FMT6_32_32_32_32_UINT: + case FMT6_32_32_32_32_SINT: return R2D_INT32; - case RB6_R16_UINT: - case RB6_R16_SINT: - case RB6_R16G16_UINT: - case RB6_R16G16_SINT: - case RB6_R16G16B16A16_UINT: - case RB6_R16G16B16A16_SINT: - case RB6_R10G10B10A2_UINT: + case FMT6_16_UINT: + case FMT6_16_SINT: + case FMT6_16_16_UINT: + case FMT6_16_16_SINT: + case FMT6_16_16_16_16_UINT: + case FMT6_16_16_16_16_SINT: + case FMT6_10_10_10_2_UINT: return R2D_INT16; - case RB6_R8_UINT: - case RB6_R8_SINT: - case RB6_R8G8_UINT: - case RB6_R8G8_SINT: - case RB6_R8G8B8A8_UINT: - case RB6_R8G8B8A8_SINT: + case FMT6_8_UINT: + case FMT6_8_SINT: + case FMT6_8_8_UINT: + case FMT6_8_8_SINT: + case FMT6_8_8_8_8_UINT: + case FMT6_8_8_8_8_SINT: return R2D_INT8; - case RB6_R16_UNORM: - case RB6_R16_SNORM: - case RB6_R16G16_UNORM: - case RB6_R16G16_SNORM: - case RB6_R16G16B16A16_UNORM: - case RB6_R16G16B16A16_SNORM: - case RB6_R32_FLOAT: - case RB6_R32G32_FLOAT: - case RB6_R32G32B32A32_FLOAT: + case FMT6_16_UNORM: + case FMT6_16_SNORM: + case FMT6_16_16_UNORM: + case FMT6_16_16_SNORM: + case FMT6_16_16_16_16_UNORM: + case FMT6_16_16_16_16_SNORM: + case FMT6_32_FLOAT: + case FMT6_32_32_FLOAT: + case FMT6_32_32_32_32_FLOAT: return R2D_FLOAT32; - case RB6_R16_FLOAT: - case RB6_R16G16_FLOAT: - case RB6_R16G16B16A16_FLOAT: - case RB6_R11G11B10_FLOAT: - case RB6_R10G10B10A2_UNORM: + case FMT6_16_FLOAT: + case FMT6_16_16_FLOAT: + case FMT6_16_16_16_16_FLOAT: + case FMT6_11_11_10_FLOAT: + case FMT6_10_10_10_2_UNORM_DEST: return R2D_FLOAT16; default: @@ -660,7 +658,7 @@ tu_2d_clear_color(const VkClearColorValue *val, VkFormat format, uint32_t buf[4] return; } - enum a6xx_2d_ifmt ifmt = tu6_rb_fmt_to_ifmt(tu6_get_native_format(format)->rb); + enum a6xx_2d_ifmt ifmt = tu6_fmt_to_ifmt(tu6_get_native_format(format)->rb); assert(desc && (desc->layout == UTIL_FORMAT_LAYOUT_PLAIN || format == VK_FORMAT_B10G11R11_UFLOAT_PACK32)); diff --git a/src/freedreno/vulkan/tu_image.c b/src/freedreno/vulkan/tu_image.c index 4b804ba5c24..a9ed203439a 100644 --- a/src/freedreno/vulkan/tu_image.c +++ b/src/freedreno/vulkan/tu_image.c @@ -289,7 +289,7 @@ tu_image_view_init(struct tu_image_view *iview, unsigned fmt_tex = fmt->tex; if (iview->aspect_mask == VK_IMAGE_ASPECT_STENCIL_BIT && iview->vk_format == VK_FORMAT_D24_UNORM_S8_UINT) - fmt_tex = TFMT6_S8Z24_UINT; + fmt_tex = FMT6_S8Z24_UINT; iview->descriptor[0] = A6XX_TEX_CONST_0_TILE_MODE(tile_mode) | diff --git a/src/freedreno/vulkan/tu_private.h b/src/freedreno/vulkan/tu_private.h index e0e76bd179e..934c907b98c 100644 --- a/src/freedreno/vulkan/tu_private.h +++ b/src/freedreno/vulkan/tu_private.h @@ -1271,7 +1271,7 @@ tu_2d_clear_color(const VkClearColorValue *val, VkFormat format, uint32_t buf[4] void tu_2d_clear_zs(const VkClearDepthStencilValue *val, VkFormat format, uint32_t buf[4]); -enum a6xx_2d_ifmt tu6_rb_fmt_to_ifmt(enum a6xx_color_fmt fmt); +enum a6xx_2d_ifmt tu6_fmt_to_ifmt(enum a6xx_format fmt); enum a6xx_depth_format tu6_pipe2depth(VkFormat format); struct tu_image_level diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c index f812aab37a6..9ef8be6b5a0 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c @@ -58,7 +58,7 @@ ok_dims(const struct pipe_resource *r, const struct pipe_box *b, int lvl) static bool ok_format(enum pipe_format pfmt) { - enum a6xx_color_fmt fmt = fd6_pipe2color(pfmt); + enum a6xx_format fmt = fd6_pipe2color(pfmt); switch (pfmt) { case PIPE_FORMAT_Z24_UNORM_S8_UINT: @@ -159,7 +159,7 @@ emit_setup(struct fd_batch *batch) } static uint32_t -blit_control(enum a6xx_color_fmt fmt, bool is_srgb) +blit_control(enum a6xx_format fmt, bool is_srgb) { enum a6xx_2d_ifmt ifmt = fd6_ifmt(fmt); @@ -233,7 +233,7 @@ emit_blit_buffer(struct fd_context *ctx, struct fd_ringbuffer *ring, OUT_PKT7(ring, CP_SET_MARKER, 1); OUT_RING(ring, A6XX_CP_SET_MARKER_0_MODE(RM6_BLIT2DSCALE)); - uint32_t blit_cntl = blit_control(RB6_R8_UNORM, false) | 0x20000000; + uint32_t blit_cntl = blit_control(FMT6_8_UNORM, false) | 0x20000000; OUT_PKT4(ring, REG_A6XX_RB_2D_BLIT_CNTL, 1); OUT_RING(ring, blit_cntl); @@ -256,7 +256,7 @@ emit_blit_buffer(struct fd_context *ctx, struct fd_ringbuffer *ring, * Emit source: */ OUT_PKT4(ring, REG_A6XX_SP_PS_2D_SRC_INFO, 10); - OUT_RING(ring, A6XX_SP_PS_2D_SRC_INFO_COLOR_FORMAT(RB6_R8_UNORM) | + OUT_RING(ring, A6XX_SP_PS_2D_SRC_INFO_COLOR_FORMAT(FMT6_8_UNORM) | A6XX_SP_PS_2D_SRC_INFO_TILE_MODE(TILE6_LINEAR) | A6XX_SP_PS_2D_SRC_INFO_COLOR_SWAP(WZYX) | 0x500000); @@ -275,7 +275,7 @@ emit_blit_buffer(struct fd_context *ctx, struct fd_ringbuffer *ring, * Emit destination: */ OUT_PKT4(ring, REG_A6XX_RB_2D_DST_INFO, 9); - OUT_RING(ring, A6XX_RB_2D_DST_INFO_COLOR_FORMAT(RB6_R8_UNORM) | + OUT_RING(ring, A6XX_RB_2D_DST_INFO_COLOR_FORMAT(FMT6_8_UNORM) | A6XX_RB_2D_DST_INFO_TILE_MODE(TILE6_LINEAR) | A6XX_RB_2D_DST_INFO_COLOR_SWAP(WZYX)); OUT_RELOCW(ring, dst->bo, doff, 0, 0); /* RB_2D_DST_LO/HI */ @@ -330,7 +330,7 @@ emit_blit_or_clear_texture(struct fd_context *ctx, struct fd_ringbuffer *ring, const struct pipe_box *dbox = &info->dst.box; struct fd_resource *src, *dst; struct fdl_slice *sslice, *dslice; - enum a6xx_color_fmt sfmt, dfmt; + enum a6xx_format sfmt, dfmt; enum a6xx_tile_mode stile, dtile; enum a3xx_color_swap sswap, dswap; unsigned spitch, dpitch; @@ -404,7 +404,7 @@ emit_blit_or_clear_texture(struct fd_context *ctx, struct fd_ringbuffer *ring, color->ui[2] = (depth_unorm24 >> 16) & 0xff; color->ui[3] = stencil; - dfmt = RB6_Z24_UNORM_S8_UINT_AS_R8G8B8A8; + dfmt = FMT6_Z24_UNORM_S8_UINT_AS_R8G8B8A8; break; } case PIPE_FORMAT_B5G6R5_UNORM: @@ -435,7 +435,7 @@ emit_blit_or_clear_texture(struct fd_context *ctx, struct fd_ringbuffer *ring, OUT_RING(ring, _mesa_float_to_half(color->f[1])); OUT_RING(ring, _mesa_float_to_half(color->f[2])); OUT_RING(ring, _mesa_float_to_half(color->f[3])); - sfmt = RB6_R16G16B16A16_FLOAT; + sfmt = FMT6_16_16_16_16_FLOAT; break; case R2D_FLOAT32: @@ -485,8 +485,8 @@ emit_blit_or_clear_texture(struct fd_context *ctx, struct fd_ringbuffer *ring, enum a3xx_msaa_samples samples = fd_msaa_samples(src->base.nr_samples); - if (sfmt == RB6_R10G10B10A2_UNORM) - sfmt = RB6_R10G10B10A2_FLOAT16; + if (sfmt == FMT6_10_10_10_2_UNORM_DEST) + sfmt = FMT6_10_10_10_2_UNORM; OUT_PKT4(ring, REG_A6XX_SP_PS_2D_SRC_INFO, 10); OUT_RING(ring, A6XX_SP_PS_2D_SRC_INFO_COLOR_FORMAT(sfmt) | @@ -562,8 +562,8 @@ emit_blit_or_clear_texture(struct fd_context *ctx, struct fd_ringbuffer *ring, OUT_PKT4(ring, REG_A6XX_RB_UNKNOWN_8C01, 1); OUT_RING(ring, 0); - if (dfmt == RB6_R10G10B10A2_UNORM) - sfmt = RB6_R16G16B16A16_FLOAT; + if (dfmt == FMT6_10_10_10_2_UNORM_DEST) + sfmt = FMT6_16_16_16_16_FLOAT; /* This register is probably badly named... it seems that it's * controlling the internal/accumulator format or something like diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c index 18f741fbd58..f2d26a0eadf 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c @@ -397,11 +397,11 @@ fd6_clear_lrz(struct fd_batch *batch, struct fd_resource *zsbuf, double depth) OUT_RING(ring, 0x0000f410); OUT_PKT4(ring, REG_A6XX_GRAS_2D_BLIT_CNTL, 1); - OUT_RING(ring, A6XX_GRAS_2D_BLIT_CNTL_COLOR_FORMAT(RB6_R16_UNORM) | + OUT_RING(ring, A6XX_GRAS_2D_BLIT_CNTL_COLOR_FORMAT(FMT6_16_UNORM) | 0x4f00080); OUT_PKT4(ring, REG_A6XX_RB_2D_BLIT_CNTL, 1); - OUT_RING(ring, A6XX_RB_2D_BLIT_CNTL_COLOR_FORMAT(RB6_R16_UNORM) | + OUT_RING(ring, A6XX_RB_2D_BLIT_CNTL_COLOR_FORMAT(FMT6_16_UNORM) | 0x4f00080); fd6_event_write(batch, ring, UNK_1D, true); @@ -414,7 +414,7 @@ fd6_clear_lrz(struct fd_batch *batch, struct fd_resource *zsbuf, double depth) OUT_RING(ring, 0x00000000); OUT_PKT4(ring, REG_A6XX_RB_2D_DST_INFO, 9); - OUT_RING(ring, A6XX_RB_2D_DST_INFO_COLOR_FORMAT(RB6_R16_UNORM) | + OUT_RING(ring, A6XX_RB_2D_DST_INFO_COLOR_FORMAT(FMT6_16_UNORM) | A6XX_RB_2D_DST_INFO_TILE_MODE(TILE6_LINEAR) | A6XX_RB_2D_DST_INFO_COLOR_SWAP(WZYX)); OUT_RELOCW(ring, zsbuf->lrz, 0, 0, 0); diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c index 767c2335971..8a72ff07025 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c @@ -652,7 +652,7 @@ build_vbo_state(struct fd6_emit *emit, const struct ir3_shader_variant *vp) &vtx->vertexbuf.vb[elem->vertex_buffer_index]; struct fd_resource *rsc = fd_resource(vb->buffer.resource); enum pipe_format pfmt = elem->src_format; - enum a6xx_vtx_fmt fmt = fd6_pipe2vtx(pfmt); + enum a6xx_format fmt = fd6_pipe2vtx(pfmt); bool isint = util_format_is_pure_integer(pfmt); uint32_t off = vb->buffer_offset + elem->src_offset; uint32_t size = fd_bo_size(rsc->bo) - off; diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_format.c b/src/gallium/drivers/freedreno/a6xx/fd6_format.c index ec0e8b0ce8a..0c6d79b71b2 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_format.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_format.c @@ -37,315 +37,299 @@ */ struct fd6_format { - enum a6xx_vtx_fmt vtx; - enum a6xx_tex_fmt tex; - enum a6xx_color_fmt rb; + enum a6xx_format vtx; + enum a6xx_format tex; + enum a6xx_format rb; enum a3xx_color_swap swap; boolean present; }; -#define RB6_NONE ~0 +#define FMT6_NONE ~0 -/* vertex + texture */ -#define VT(pipe, fmt, rbfmt, swapfmt) \ +#define FMT(pipe, vtxfmt, texfmt, rbfmt, swapfmt) \ [PIPE_FORMAT_ ## pipe] = { \ .present = 1, \ - .vtx = VFMT6_ ## fmt, \ - .tex = TFMT6_ ## fmt, \ - .rb = RB6_ ## rbfmt, \ + .vtx = FMT6_ ## vtxfmt, \ + .tex = FMT6_ ## texfmt, \ + .rb = FMT6_ ## rbfmt, \ .swap = swapfmt \ } -/* texture-only */ -#define _T(pipe, fmt, rbfmt, swapfmt) \ - [PIPE_FORMAT_ ## pipe] = { \ - .present = 1, \ - .vtx = ~0, \ - .tex = TFMT6_ ## fmt, \ - .rb = RB6_ ## rbfmt, \ - .swap = swapfmt \ - } +/* vertex + texture + color */ +#define VTC(pipe, fmt, swapfmt) FMT(pipe, fmt, fmt, fmt, swapfmt) -/* vertex-only */ -#define V_(pipe, fmt, rbfmt, swapfmt) \ - [PIPE_FORMAT_ ## pipe] = { \ - .present = 1, \ - .vtx = VFMT6_ ## fmt, \ - .tex = ~0, \ - .rb = RB6_ ## rbfmt, \ - .swap = swapfmt \ - } +#define _TC(pipe, fmt, swapfmt) FMT(pipe, NONE, fmt, fmt, swapfmt) +#define _T_(pipe, fmt, swapfmt) FMT(pipe, NONE, fmt, NONE, swapfmt) +#define VT_(pipe, fmt, swapfmt) FMT(pipe, fmt, fmt, NONE, swapfmt) +#define V__(pipe, fmt, swapfmt) FMT(pipe, fmt, NONE, NONE, swapfmt) static struct fd6_format formats[PIPE_FORMAT_COUNT] = { - /* for blitting, treat PIPE_FORMAT_NONE as 8bit R8: */ - _T(R8_UINT, 8_UINT, R8_UINT, WZYX), - /* 8-bit */ - VT(R8_UNORM, 8_UNORM, R8_UNORM, WZYX), - VT(R8_SNORM, 8_SNORM, R8_SNORM, WZYX), - VT(R8_UINT, 8_UINT, R8_UINT, WZYX), - VT(R8_SINT, 8_SINT, R8_SINT, WZYX), - V_(R8_USCALED, 8_UINT, NONE, WZYX), - V_(R8_SSCALED, 8_SINT, NONE, WZYX), - - _T(A8_UNORM, 8_UNORM, A8_UNORM, WZYX), - _T(L8_UNORM, 8_UNORM, R8_UNORM, WZYX), - _T(I8_UNORM, 8_UNORM, NONE, WZYX), - - _T(A8_UINT, 8_UINT, NONE, WZYX), - _T(A8_SINT, 8_SINT, NONE, WZYX), - _T(L8_UINT, 8_UINT, NONE, WZYX), - _T(L8_SINT, 8_SINT, NONE, WZYX), - _T(I8_UINT, 8_UINT, NONE, WZYX), - _T(I8_SINT, 8_SINT, NONE, WZYX), - - _T(S8_UINT, 8_UINT, R8_UNORM, WZYX), + VTC(R8_UNORM, 8_UNORM, WZYX), + VTC(R8_SNORM, 8_SNORM, WZYX), + VTC(R8_UINT, 8_UINT, WZYX), + VTC(R8_SINT, 8_SINT, WZYX), + V__(R8_USCALED, 8_UINT, WZYX), + V__(R8_SSCALED, 8_SINT, WZYX), + + FMT(A8_UNORM, NONE, 8_UNORM, A8_UNORM, WZYX), + _TC(L8_UNORM, 8_UNORM, WZYX), + _T_(I8_UNORM, 8_UNORM, WZYX), + + _T_(A8_UINT, 8_UINT, WZYX), + _T_(A8_SINT, 8_SINT, WZYX), + _T_(L8_UINT, 8_UINT, WZYX), + _T_(L8_SINT, 8_SINT, WZYX), + _T_(I8_UINT, 8_UINT, WZYX), + _T_(I8_SINT, 8_SINT, WZYX), + + _TC(S8_UINT, 8_UINT, WZYX), /* 16-bit */ - VT(R16_UNORM, 16_UNORM, R16_UNORM, WZYX), - VT(R16_SNORM, 16_SNORM, R16_SNORM, WZYX), - VT(R16_UINT, 16_UINT, R16_UINT, WZYX), - VT(R16_SINT, 16_SINT, R16_SINT, WZYX), - V_(R16_USCALED, 16_UINT, NONE, WZYX), - V_(R16_SSCALED, 16_SINT, NONE, WZYX), - VT(R16_FLOAT, 16_FLOAT, R16_FLOAT, WZYX), - _T(Z16_UNORM, 16_UNORM, R16_UNORM, WZYX), - - _T(A16_UNORM, 16_UNORM, NONE, WZYX), - _T(A16_SNORM, 16_SNORM, NONE, WZYX), - _T(A16_UINT, 16_UINT, NONE, WZYX), - _T(A16_SINT, 16_SINT, NONE, WZYX), - _T(L16_UNORM, 16_UNORM, NONE, WZYX), - _T(L16_SNORM, 16_SNORM, NONE, WZYX), - _T(L16_UINT, 16_UINT, NONE, WZYX), - _T(L16_SINT, 16_SINT, NONE, WZYX), - _T(I16_UNORM, 16_UNORM, NONE, WZYX), - _T(I16_SNORM, 16_SNORM, NONE, WZYX), - _T(I16_UINT, 16_UINT, NONE, WZYX), - _T(I16_SINT, 16_SINT, NONE, WZYX), - - VT(R8G8_UNORM, 8_8_UNORM, R8G8_UNORM, WZYX), - VT(R8G8_SNORM, 8_8_SNORM, R8G8_SNORM, WZYX), - VT(R8G8_UINT, 8_8_UINT, R8G8_UINT, WZYX), - VT(R8G8_SINT, 8_8_SINT, R8G8_SINT, WZYX), - V_(R8G8_USCALED, 8_8_UINT, NONE, WZYX), - V_(R8G8_SSCALED, 8_8_SINT, NONE, WZYX), - - _T(L8A8_UINT, 8_8_UINT, NONE, WZYX), - _T(L8A8_SINT, 8_8_SINT, NONE, WZYX), - - _T(B5G6R5_UNORM, 5_6_5_UNORM, R5G6B5_UNORM, WXYZ), - _T(B5G5R5A1_UNORM, 5_5_5_1_UNORM, R5G5B5A1_UNORM, WXYZ), - _T(B5G5R5X1_UNORM, 5_5_5_1_UNORM, R5G5B5A1_UNORM, WXYZ), - _T(B4G4R4A4_UNORM, 4_4_4_4_UNORM, R4G4B4A4_UNORM, WXYZ), + VTC(R16_UNORM, 16_UNORM, WZYX), + VTC(R16_SNORM, 16_SNORM, WZYX), + VTC(R16_UINT, 16_UINT, WZYX), + VTC(R16_SINT, 16_SINT, WZYX), + V__(R16_USCALED, 16_UINT, WZYX), + V__(R16_SSCALED, 16_SINT, WZYX), + VTC(R16_FLOAT, 16_FLOAT, WZYX), + _TC(Z16_UNORM, 16_UNORM, WZYX), + + _T_(A16_UNORM, 16_UNORM, WZYX), + _T_(A16_SNORM, 16_SNORM, WZYX), + _T_(A16_UINT, 16_UINT, WZYX), + _T_(A16_SINT, 16_SINT, WZYX), + _T_(L16_UNORM, 16_UNORM, WZYX), + _T_(L16_SNORM, 16_SNORM, WZYX), + _T_(L16_UINT, 16_UINT, WZYX), + _T_(L16_SINT, 16_SINT, WZYX), + _T_(I16_UNORM, 16_UNORM, WZYX), + _T_(I16_SNORM, 16_SNORM, WZYX), + _T_(I16_UINT, 16_UINT, WZYX), + _T_(I16_SINT, 16_SINT, WZYX), + + VTC(R8G8_UNORM, 8_8_UNORM, WZYX), + VTC(R8G8_SNORM, 8_8_SNORM, WZYX), + VTC(R8G8_UINT, 8_8_UINT, WZYX), + VTC(R8G8_SINT, 8_8_SINT, WZYX), + V__(R8G8_USCALED, 8_8_UINT, WZYX), + V__(R8G8_SSCALED, 8_8_SINT, WZYX), + + _T_(L8A8_UINT, 8_8_UINT, WZYX), + _T_(L8A8_SINT, 8_8_SINT, WZYX), + + _TC(B5G6R5_UNORM, 5_6_5_UNORM, WXYZ), + _TC(B5G5R5A1_UNORM, 5_5_5_1_UNORM, WXYZ), + _TC(B5G5R5X1_UNORM, 5_5_5_1_UNORM, WXYZ), + _TC(B4G4R4A4_UNORM, 4_4_4_4_UNORM, WXYZ), /* 24-bit */ - V_(R8G8B8_UNORM, 8_8_8_UNORM, NONE, WZYX), - V_(R8G8B8_SNORM, 8_8_8_SNORM, NONE, WZYX), - V_(R8G8B8_UINT, 8_8_8_UINT, NONE, WZYX), - V_(R8G8B8_SINT, 8_8_8_SINT, NONE, WZYX), - V_(R8G8B8_USCALED, 8_8_8_UINT, NONE, WZYX), - V_(R8G8B8_SSCALED, 8_8_8_SINT, NONE, WZYX), + V__(R8G8B8_UNORM, 8_8_8_UNORM, WZYX), + V__(R8G8B8_SNORM, 8_8_8_SNORM, WZYX), + V__(R8G8B8_UINT, 8_8_8_UINT, WZYX), + V__(R8G8B8_SINT, 8_8_8_SINT, WZYX), + V__(R8G8B8_USCALED, 8_8_8_UINT, WZYX), + V__(R8G8B8_SSCALED, 8_8_8_SINT, WZYX), /* 32-bit */ - VT(R32_UINT, 32_UINT, R32_UINT, WZYX), - VT(R32_SINT, 32_SINT, R32_SINT, WZYX), - V_(R32_USCALED, 32_UINT, NONE, WZYX), - V_(R32_SSCALED, 32_SINT, NONE, WZYX), - VT(R32_FLOAT, 32_FLOAT, R32_FLOAT,WZYX), - V_(R32_FIXED, 32_FIXED, NONE, WZYX), - - _T(A32_UINT, 32_UINT, NONE, WZYX), - _T(A32_SINT, 32_SINT, NONE, WZYX), - _T(L32_UINT, 32_UINT, NONE, WZYX), - _T(L32_SINT, 32_SINT, NONE, WZYX), - _T(I32_UINT, 32_UINT, NONE, WZYX), - _T(I32_SINT, 32_SINT, NONE, WZYX), - - VT(R16G16_UNORM, 16_16_UNORM, R16G16_UNORM, WZYX), - VT(R16G16_SNORM, 16_16_SNORM, R16G16_SNORM, WZYX), - VT(R16G16_UINT, 16_16_UINT, R16G16_UINT, WZYX), - VT(R16G16_SINT, 16_16_SINT, R16G16_SINT, WZYX), - VT(R16G16_USCALED, 16_16_UINT, NONE, WZYX), - VT(R16G16_SSCALED, 16_16_SINT, NONE, WZYX), - VT(R16G16_FLOAT, 16_16_FLOAT, R16G16_FLOAT, WZYX), - - _T(L16A16_UNORM, 16_16_UNORM, NONE, WZYX), - _T(L16A16_SNORM, 16_16_SNORM, NONE, WZYX), - _T(L16A16_UINT, 16_16_UINT, NONE, WZYX), - _T(L16A16_SINT, 16_16_SINT, NONE, WZYX), - - VT(R8G8B8A8_UNORM, 8_8_8_8_UNORM, R8G8B8A8_UNORM, WZYX), - _T(R8G8B8X8_UNORM, 8_8_8_8_UNORM, R8G8B8X8_UNORM, WZYX), - _T(R8G8B8A8_SRGB, 8_8_8_8_UNORM, R8G8B8A8_UNORM, WZYX), - _T(R8G8B8X8_SRGB, 8_8_8_8_UNORM, R8G8B8X8_UNORM, WZYX), - VT(R8G8B8A8_SNORM, 8_8_8_8_SNORM, R8G8B8A8_SNORM, WZYX), - VT(R8G8B8A8_UINT, 8_8_8_8_UINT, R8G8B8A8_UINT, WZYX), - VT(R8G8B8A8_SINT, 8_8_8_8_SINT, R8G8B8A8_SINT, WZYX), - V_(R8G8B8A8_USCALED, 8_8_8_8_UINT, NONE, WZYX), - V_(R8G8B8A8_SSCALED, 8_8_8_8_SINT, NONE, WZYX), - - VT(B8G8R8A8_UNORM, 8_8_8_8_UNORM, R8G8B8A8_UNORM, WXYZ), - _T(B8G8R8X8_UNORM, 8_8_8_8_UNORM, R8G8B8X8_UNORM, WXYZ), - VT(B8G8R8A8_SRGB, 8_8_8_8_UNORM, R8G8B8A8_UNORM, WXYZ), - _T(B8G8R8X8_SRGB, 8_8_8_8_UNORM, R8G8B8X8_UNORM, WXYZ), - - VT(A8B8G8R8_UNORM, 8_8_8_8_UNORM, R8G8B8A8_UNORM, XYZW), - _T(X8B8G8R8_UNORM, 8_8_8_8_UNORM, R8G8B8X8_UNORM, XYZW), - _T(A8B8G8R8_SRGB, 8_8_8_8_UNORM, R8G8B8A8_UNORM, XYZW), - _T(X8B8G8R8_SRGB, 8_8_8_8_UNORM, R8G8B8X8_UNORM, XYZW), - - VT(A8R8G8B8_UNORM, 8_8_8_8_UNORM, R8G8B8A8_UNORM, ZYXW), - _T(X8R8G8B8_UNORM, 8_8_8_8_UNORM, R8G8B8X8_UNORM, ZYXW), - _T(A8R8G8B8_SRGB, 8_8_8_8_UNORM, R8G8B8A8_UNORM, ZYXW), - _T(X8R8G8B8_SRGB, 8_8_8_8_UNORM, R8G8B8X8_UNORM, ZYXW), - - VT(R10G10B10A2_UNORM, 10_10_10_2_UNORM, R10G10B10A2_UNORM, WZYX), - VT(B10G10R10A2_UNORM, 10_10_10_2_UNORM, R10G10B10A2_UNORM, WXYZ), - _T(B10G10R10X2_UNORM, 10_10_10_2_UNORM, R10G10B10A2_UNORM, WXYZ), - V_(R10G10B10A2_SNORM, 10_10_10_2_SNORM, NONE, WZYX), - V_(B10G10R10A2_SNORM, 10_10_10_2_SNORM, NONE, WXYZ), - VT(R10G10B10A2_UINT, 10_10_10_2_UINT, R10G10B10A2_UINT, WZYX), - VT(B10G10R10A2_UINT, 10_10_10_2_UINT, R10G10B10A2_UINT, WXYZ), - V_(R10G10B10A2_USCALED, 10_10_10_2_UINT, NONE, WZYX), - V_(B10G10R10A2_USCALED, 10_10_10_2_UINT, NONE, WXYZ), - V_(R10G10B10A2_SSCALED, 10_10_10_2_SINT, NONE, WZYX), - V_(B10G10R10A2_SSCALED, 10_10_10_2_SINT, NONE, WXYZ), - - VT(R11G11B10_FLOAT, 11_11_10_FLOAT, R11G11B10_FLOAT, WZYX), - _T(R9G9B9E5_FLOAT, 9_9_9_E5_FLOAT, NONE, WZYX), - - _T(Z24X8_UNORM, X8Z24_UNORM, Z24_UNORM_S8_UINT, WZYX), - _T(X24S8_UINT, 8_8_8_8_UINT, Z24_UNORM_S8_UINT, WZYX), - _T(Z24_UNORM_S8_UINT, X8Z24_UNORM, Z24_UNORM_S8_UINT, WZYX), - _T(Z32_FLOAT, 32_FLOAT, R32_FLOAT, WZYX), - _T(Z32_FLOAT_S8X24_UINT, 32_FLOAT, R32_FLOAT, WZYX), - _T(X32_S8X24_UINT, 8_UINT, R8_UINT, WZYX), + VTC(R32_UINT, 32_UINT, WZYX), + VTC(R32_SINT, 32_SINT, WZYX), + V__(R32_USCALED, 32_UINT, WZYX), + V__(R32_SSCALED, 32_SINT, WZYX), + VTC(R32_FLOAT, 32_FLOAT, WZYX), + V__(R32_FIXED, 32_FIXED, WZYX), + + _T_(A32_UINT, 32_UINT, WZYX), + _T_(A32_SINT, 32_SINT, WZYX), + _T_(L32_UINT, 32_UINT, WZYX), + _T_(L32_SINT, 32_SINT, WZYX), + _T_(I32_UINT, 32_UINT, WZYX), + _T_(I32_SINT, 32_SINT, WZYX), + + VTC(R16G16_UNORM, 16_16_UNORM, WZYX), + VTC(R16G16_SNORM, 16_16_SNORM, WZYX), + VTC(R16G16_UINT, 16_16_UINT, WZYX), + VTC(R16G16_SINT, 16_16_SINT, WZYX), + VT_(R16G16_USCALED, 16_16_UINT, WZYX), + VT_(R16G16_SSCALED, 16_16_SINT, WZYX), + VTC(R16G16_FLOAT, 16_16_FLOAT, WZYX), + + _T_(L16A16_UNORM, 16_16_UNORM, WZYX), + _T_(L16A16_SNORM, 16_16_SNORM, WZYX), + _T_(L16A16_UINT, 16_16_UINT, WZYX), + _T_(L16A16_SINT, 16_16_SINT, WZYX), + + VTC(R8G8B8A8_UNORM, 8_8_8_8_UNORM, WZYX), + _TC(R8G8B8X8_UNORM, 8_8_8_8_UNORM, WZYX), + _TC(R8G8B8A8_SRGB, 8_8_8_8_UNORM, WZYX), + _TC(R8G8B8X8_SRGB, 8_8_8_8_UNORM, WZYX), + VTC(R8G8B8A8_SNORM, 8_8_8_8_SNORM, WZYX), + VTC(R8G8B8A8_UINT, 8_8_8_8_UINT, WZYX), + VTC(R8G8B8A8_SINT, 8_8_8_8_SINT, WZYX), + V__(R8G8B8A8_USCALED, 8_8_8_8_UINT, WZYX), + V__(R8G8B8A8_SSCALED, 8_8_8_8_SINT, WZYX), + + VTC(B8G8R8A8_UNORM, 8_8_8_8_UNORM, WXYZ), + _TC(B8G8R8X8_UNORM, 8_8_8_8_UNORM, WXYZ), + VTC(B8G8R8A8_SRGB, 8_8_8_8_UNORM, WXYZ), + _TC(B8G8R8X8_SRGB, 8_8_8_8_UNORM, WXYZ), + + VTC(A8B8G8R8_UNORM, 8_8_8_8_UNORM, XYZW), + _TC(X8B8G8R8_UNORM, 8_8_8_8_UNORM, XYZW), + _TC(A8B8G8R8_SRGB, 8_8_8_8_UNORM, XYZW), + _TC(X8B8G8R8_SRGB, 8_8_8_8_UNORM, XYZW), + + VTC(A8R8G8B8_UNORM, 8_8_8_8_UNORM, ZYXW), + _TC(X8R8G8B8_UNORM, 8_8_8_8_UNORM, ZYXW), + _TC(A8R8G8B8_SRGB, 8_8_8_8_UNORM, ZYXW), + _TC(X8R8G8B8_SRGB, 8_8_8_8_UNORM, ZYXW), + + FMT(R10G10B10A2_UNORM, 10_10_10_2_UNORM, 10_10_10_2_UNORM, 10_10_10_2_UNORM_DEST, WZYX), + FMT(B10G10R10A2_UNORM, 10_10_10_2_UNORM, 10_10_10_2_UNORM, 10_10_10_2_UNORM_DEST, WXYZ), + FMT(B10G10R10X2_UNORM, NONE, 10_10_10_2_UNORM, 10_10_10_2_UNORM_DEST, WXYZ), + V__(R10G10B10A2_SNORM, 10_10_10_2_SNORM, WZYX), + V__(B10G10R10A2_SNORM, 10_10_10_2_SNORM, WXYZ), + VTC(R10G10B10A2_UINT, 10_10_10_2_UINT, WZYX), + VTC(B10G10R10A2_UINT, 10_10_10_2_UINT, WXYZ), + V__(R10G10B10A2_USCALED, 10_10_10_2_UINT, WZYX), + V__(B10G10R10A2_USCALED, 10_10_10_2_UINT, WXYZ), + V__(R10G10B10A2_SSCALED, 10_10_10_2_SINT, WZYX), + V__(B10G10R10A2_SSCALED, 10_10_10_2_SINT, WXYZ), + + VTC(R11G11B10_FLOAT, 11_11_10_FLOAT, WZYX), + _T_(R9G9B9E5_FLOAT, 9_9_9_E5_FLOAT, WZYX), + + _TC(Z24X8_UNORM, Z24_UNORM_S8_UINT, WZYX), + _TC(X24S8_UINT, 8_8_8_8_UINT, WZYX), + _TC(Z24_UNORM_S8_UINT, Z24_UNORM_S8_UINT, WZYX), + _TC(Z32_FLOAT, 32_FLOAT, WZYX), + _TC(Z32_FLOAT_S8X24_UINT, 32_FLOAT, WZYX), + _TC(X32_S8X24_UINT, 8_UINT, WZYX), /* special format for blits: */ - _T(Z24_UNORM_S8_UINT_AS_R8G8B8A8, Z24_UNORM_S8_UINT, Z24_UNORM_S8_UINT_AS_R8G8B8A8, WZYX), + _TC(Z24_UNORM_S8_UINT_AS_R8G8B8A8, Z24_UNORM_S8_UINT, WZYX), /* 48-bit */ - V_(R16G16B16_UNORM, 16_16_16_UNORM, NONE, WZYX), - V_(R16G16B16_SNORM, 16_16_16_SNORM, NONE, WZYX), - V_(R16G16B16_UINT, 16_16_16_UINT, NONE, WZYX), - V_(R16G16B16_SINT, 16_16_16_SINT, NONE, WZYX), - V_(R16G16B16_USCALED, 16_16_16_UINT, NONE, WZYX), - V_(R16G16B16_SSCALED, 16_16_16_SINT, NONE, WZYX), - V_(R16G16B16_FLOAT, 16_16_16_FLOAT, NONE, WZYX), + V__(R16G16B16_UNORM, 16_16_16_UNORM, WZYX), + V__(R16G16B16_SNORM, 16_16_16_SNORM, WZYX), + V__(R16G16B16_UINT, 16_16_16_UINT, WZYX), + V__(R16G16B16_SINT, 16_16_16_SINT, WZYX), + V__(R16G16B16_USCALED, 16_16_16_UINT, WZYX), + V__(R16G16B16_SSCALED, 16_16_16_SINT, WZYX), + V__(R16G16B16_FLOAT, 16_16_16_FLOAT, WZYX), /* 64-bit */ - VT(R16G16B16A16_UNORM, 16_16_16_16_UNORM, R16G16B16A16_UNORM, WZYX), - VT(R16G16B16X16_UNORM, 16_16_16_16_UNORM, R16G16B16A16_UNORM, WZYX), - VT(R16G16B16A16_SNORM, 16_16_16_16_SNORM, R16G16B16A16_SNORM, WZYX), - VT(R16G16B16X16_SNORM, 16_16_16_16_SNORM, R16G16B16A16_SNORM, WZYX), - VT(R16G16B16A16_UINT, 16_16_16_16_UINT, R16G16B16A16_UINT, WZYX), - VT(R16G16B16X16_UINT, 16_16_16_16_UINT, R16G16B16A16_UINT, WZYX), - VT(R16G16B16A16_SINT, 16_16_16_16_SINT, R16G16B16A16_SINT, WZYX), - VT(R16G16B16X16_SINT, 16_16_16_16_SINT, R16G16B16A16_SINT, WZYX), - VT(R16G16B16A16_USCALED, 16_16_16_16_UINT, NONE, WZYX), - VT(R16G16B16A16_SSCALED, 16_16_16_16_SINT, NONE, WZYX), - VT(R16G16B16A16_FLOAT, 16_16_16_16_FLOAT, R16G16B16A16_FLOAT, WZYX), - VT(R16G16B16X16_FLOAT, 16_16_16_16_FLOAT, R16G16B16A16_FLOAT, WZYX), - - VT(R32G32_UINT, 32_32_UINT, R32G32_UINT, WZYX), - VT(R32G32_SINT, 32_32_SINT, R32G32_SINT, WZYX), - V_(R32G32_USCALED, 32_32_UINT, NONE, WZYX), - V_(R32G32_SSCALED, 32_32_SINT, NONE, WZYX), - VT(R32G32_FLOAT, 32_32_FLOAT, R32G32_FLOAT,WZYX), - V_(R32G32_FIXED, 32_32_FIXED, NONE, WZYX), - - _T(L32A32_UINT, 32_32_UINT, NONE, WZYX), - _T(L32A32_SINT, 32_32_SINT, NONE, WZYX), + VTC(R16G16B16A16_UNORM, 16_16_16_16_UNORM, WZYX), + VTC(R16G16B16X16_UNORM, 16_16_16_16_UNORM, WZYX), + VTC(R16G16B16A16_SNORM, 16_16_16_16_SNORM, WZYX), + VTC(R16G16B16X16_SNORM, 16_16_16_16_SNORM, WZYX), + VTC(R16G16B16A16_UINT, 16_16_16_16_UINT, WZYX), + VTC(R16G16B16X16_UINT, 16_16_16_16_UINT, WZYX), + VTC(R16G16B16A16_SINT, 16_16_16_16_SINT, WZYX), + VTC(R16G16B16X16_SINT, 16_16_16_16_SINT, WZYX), + VT_(R16G16B16A16_USCALED, 16_16_16_16_UINT, WZYX), + VT_(R16G16B16A16_SSCALED, 16_16_16_16_SINT, WZYX), + VTC(R16G16B16A16_FLOAT, 16_16_16_16_FLOAT, WZYX), + VTC(R16G16B16X16_FLOAT, 16_16_16_16_FLOAT, WZYX), + + VTC(R32G32_UINT, 32_32_UINT, WZYX), + VTC(R32G32_SINT, 32_32_SINT, WZYX), + V__(R32G32_USCALED, 32_32_UINT, WZYX), + V__(R32G32_SSCALED, 32_32_SINT, WZYX), + VTC(R32G32_FLOAT, 32_32_FLOAT, WZYX), + V__(R32G32_FIXED, 32_32_FIXED, WZYX), + + _T_(L32A32_UINT, 32_32_UINT, WZYX), + _T_(L32A32_SINT, 32_32_SINT, WZYX), /* 96-bit */ - VT(R32G32B32_UINT, 32_32_32_UINT, NONE, WZYX), - VT(R32G32B32_SINT, 32_32_32_SINT, NONE, WZYX), - V_(R32G32B32_USCALED, 32_32_32_UINT, NONE, WZYX), - V_(R32G32B32_SSCALED, 32_32_32_SINT, NONE, WZYX), - VT(R32G32B32_FLOAT, 32_32_32_FLOAT, NONE, WZYX), - V_(R32G32B32_FIXED, 32_32_32_FIXED, NONE, WZYX), + VT_(R32G32B32_UINT, 32_32_32_UINT, WZYX), + VT_(R32G32B32_SINT, 32_32_32_SINT, WZYX), + V__(R32G32B32_USCALED, 32_32_32_UINT, WZYX), + V__(R32G32B32_SSCALED, 32_32_32_SINT, WZYX), + VT_(R32G32B32_FLOAT, 32_32_32_FLOAT, WZYX), + V__(R32G32B32_FIXED, 32_32_32_FIXED, WZYX), /* 128-bit */ - VT(R32G32B32A32_UINT, 32_32_32_32_UINT, R32G32B32A32_UINT, WZYX), - _T(R32G32B32X32_UINT, 32_32_32_32_UINT, R32G32B32A32_UINT, WZYX), - VT(R32G32B32A32_SINT, 32_32_32_32_SINT, R32G32B32A32_SINT, WZYX), - _T(R32G32B32X32_SINT, 32_32_32_32_SINT, R32G32B32A32_SINT, WZYX), - V_(R32G32B32A32_USCALED, 32_32_32_32_UINT, NONE, WZYX), - V_(R32G32B32A32_SSCALED, 32_32_32_32_SINT, NONE, WZYX), - VT(R32G32B32A32_FLOAT, 32_32_32_32_FLOAT, R32G32B32A32_FLOAT, WZYX), - _T(R32G32B32X32_FLOAT, 32_32_32_32_FLOAT, R32G32B32A32_FLOAT, WZYX), - V_(R32G32B32A32_FIXED, 32_32_32_32_FIXED, NONE, WZYX), + VTC(R32G32B32A32_UINT, 32_32_32_32_UINT, WZYX), + _TC(R32G32B32X32_UINT, 32_32_32_32_UINT, WZYX), + VTC(R32G32B32A32_SINT, 32_32_32_32_SINT, WZYX), + _TC(R32G32B32X32_SINT, 32_32_32_32_SINT, WZYX), + V__(R32G32B32A32_USCALED, 32_32_32_32_UINT, WZYX), + V__(R32G32B32A32_SSCALED, 32_32_32_32_SINT, WZYX), + VTC(R32G32B32A32_FLOAT, 32_32_32_32_FLOAT, WZYX), + _TC(R32G32B32X32_FLOAT, 32_32_32_32_FLOAT, WZYX), + V__(R32G32B32A32_FIXED, 32_32_32_32_FIXED, WZYX), /* compressed */ - _T(ETC1_RGB8, ETC1, NONE, WZYX), - _T(ETC2_RGB8, ETC2_RGB8, NONE, WZYX), - _T(ETC2_SRGB8, ETC2_RGB8, NONE, WZYX), - _T(ETC2_RGB8A1, ETC2_RGB8A1, NONE, WZYX), - _T(ETC2_SRGB8A1, ETC2_RGB8A1, NONE, WZYX), - _T(ETC2_RGBA8, ETC2_RGBA8, NONE, WZYX), - _T(ETC2_SRGBA8, ETC2_RGBA8, NONE, WZYX), - _T(ETC2_R11_UNORM, ETC2_R11_UNORM, NONE, WZYX), - _T(ETC2_R11_SNORM, ETC2_R11_SNORM, NONE, WZYX), - _T(ETC2_RG11_UNORM, ETC2_RG11_UNORM, NONE, WZYX), - _T(ETC2_RG11_SNORM, ETC2_RG11_SNORM, NONE, WZYX), - - _T(DXT1_RGB, DXT1, NONE, WZYX), - _T(DXT1_SRGB, DXT1, NONE, WZYX), - _T(DXT1_RGBA, DXT1, NONE, WZYX), - _T(DXT1_SRGBA, DXT1, NONE, WZYX), - _T(DXT3_RGBA, DXT3, NONE, WZYX), - _T(DXT3_SRGBA, DXT3, NONE, WZYX), - _T(DXT5_RGBA, DXT5, NONE, WZYX), - _T(DXT5_SRGBA, DXT5, NONE, WZYX), - - _T(BPTC_RGBA_UNORM, BPTC, NONE, WZYX), - _T(BPTC_SRGBA, BPTC, NONE, WZYX), - _T(BPTC_RGB_FLOAT, BPTC_FLOAT, NONE, WZYX), - _T(BPTC_RGB_UFLOAT, BPTC_UFLOAT, NONE, WZYX), - - _T(RGTC1_UNORM, RGTC1_UNORM, NONE, WZYX), - _T(RGTC1_SNORM, RGTC1_SNORM, NONE, WZYX), - _T(RGTC2_UNORM, RGTC2_UNORM, NONE, WZYX), - _T(RGTC2_SNORM, RGTC2_SNORM, NONE, WZYX), - _T(LATC1_UNORM, RGTC1_UNORM, NONE, WZYX), - _T(LATC1_SNORM, RGTC1_SNORM, NONE, WZYX), - _T(LATC2_UNORM, RGTC2_UNORM, NONE, WZYX), - _T(LATC2_SNORM, RGTC2_SNORM, NONE, WZYX), - - _T(ASTC_4x4, ASTC_4x4, NONE, WZYX), - _T(ASTC_5x4, ASTC_5x4, NONE, WZYX), - _T(ASTC_5x5, ASTC_5x5, NONE, WZYX), - _T(ASTC_6x5, ASTC_6x5, NONE, WZYX), - _T(ASTC_6x6, ASTC_6x6, NONE, WZYX), - _T(ASTC_8x5, ASTC_8x5, NONE, WZYX), - _T(ASTC_8x6, ASTC_8x6, NONE, WZYX), - _T(ASTC_8x8, ASTC_8x8, NONE, WZYX), - _T(ASTC_10x5, ASTC_10x5, NONE, WZYX), - _T(ASTC_10x6, ASTC_10x6, NONE, WZYX), - _T(ASTC_10x8, ASTC_10x8, NONE, WZYX), - _T(ASTC_10x10, ASTC_10x10, NONE, WZYX), - _T(ASTC_12x10, ASTC_12x10, NONE, WZYX), - _T(ASTC_12x12, ASTC_12x12, NONE, WZYX), - - _T(ASTC_4x4_SRGB, ASTC_4x4, NONE, WZYX), - _T(ASTC_5x4_SRGB, ASTC_5x4, NONE, WZYX), - _T(ASTC_5x5_SRGB, ASTC_5x5, NONE, WZYX), - _T(ASTC_6x5_SRGB, ASTC_6x5, NONE, WZYX), - _T(ASTC_6x6_SRGB, ASTC_6x6, NONE, WZYX), - _T(ASTC_8x5_SRGB, ASTC_8x5, NONE, WZYX), - _T(ASTC_8x6_SRGB, ASTC_8x6, NONE, WZYX), - _T(ASTC_8x8_SRGB, ASTC_8x8, NONE, WZYX), - _T(ASTC_10x5_SRGB, ASTC_10x5, NONE, WZYX), - _T(ASTC_10x6_SRGB, ASTC_10x6, NONE, WZYX), - _T(ASTC_10x8_SRGB, ASTC_10x8, NONE, WZYX), - _T(ASTC_10x10_SRGB, ASTC_10x10, NONE, WZYX), - _T(ASTC_12x10_SRGB, ASTC_12x10, NONE, WZYX), - _T(ASTC_12x12_SRGB, ASTC_12x12, NONE, WZYX), + _T_(ETC1_RGB8, ETC1, WZYX), + _T_(ETC2_RGB8, ETC2_RGB8, WZYX), + _T_(ETC2_SRGB8, ETC2_RGB8, WZYX), + _T_(ETC2_RGB8A1, ETC2_RGB8A1, WZYX), + _T_(ETC2_SRGB8A1, ETC2_RGB8A1, WZYX), + _T_(ETC2_RGBA8, ETC2_RGBA8, WZYX), + _T_(ETC2_SRGBA8, ETC2_RGBA8, WZYX), + _T_(ETC2_R11_UNORM, ETC2_R11_UNORM, WZYX), + _T_(ETC2_R11_SNORM, ETC2_R11_SNORM, WZYX), + _T_(ETC2_RG11_UNORM, ETC2_RG11_UNORM, WZYX), + _T_(ETC2_RG11_SNORM, ETC2_RG11_SNORM, WZYX), + + _T_(DXT1_RGB, DXT1, WZYX), + _T_(DXT1_SRGB, DXT1, WZYX), + _T_(DXT1_RGBA, DXT1, WZYX), + _T_(DXT1_SRGBA, DXT1, WZYX), + _T_(DXT3_RGBA, DXT3, WZYX), + _T_(DXT3_SRGBA, DXT3, WZYX), + _T_(DXT5_RGBA, DXT5, WZYX), + _T_(DXT5_SRGBA, DXT5, WZYX), + + _T_(BPTC_RGBA_UNORM, BPTC, WZYX), + _T_(BPTC_SRGBA, BPTC, WZYX), + _T_(BPTC_RGB_FLOAT, BPTC_FLOAT, WZYX), + _T_(BPTC_RGB_UFLOAT, BPTC_UFLOAT, WZYX), + + _T_(RGTC1_UNORM, RGTC1_UNORM, WZYX), + _T_(RGTC1_SNORM, RGTC1_SNORM, WZYX), + _T_(RGTC2_UNORM, RGTC2_UNORM, WZYX), + _T_(RGTC2_SNORM, RGTC2_SNORM, WZYX), + _T_(LATC1_UNORM, RGTC1_UNORM, WZYX), + _T_(LATC1_SNORM, RGTC1_SNORM, WZYX), + _T_(LATC2_UNORM, RGTC2_UNORM, WZYX), + _T_(LATC2_SNORM, RGTC2_SNORM, WZYX), + + _T_(ASTC_4x4, ASTC_4x4, WZYX), + _T_(ASTC_5x4, ASTC_5x4, WZYX), + _T_(ASTC_5x5, ASTC_5x5, WZYX), + _T_(ASTC_6x5, ASTC_6x5, WZYX), + _T_(ASTC_6x6, ASTC_6x6, WZYX), + _T_(ASTC_8x5, ASTC_8x5, WZYX), + _T_(ASTC_8x6, ASTC_8x6, WZYX), + _T_(ASTC_8x8, ASTC_8x8, WZYX), + _T_(ASTC_10x5, ASTC_10x5, WZYX), + _T_(ASTC_10x6, ASTC_10x6, WZYX), + _T_(ASTC_10x8, ASTC_10x8, WZYX), + _T_(ASTC_10x10, ASTC_10x10, WZYX), + _T_(ASTC_12x10, ASTC_12x10, WZYX), + _T_(ASTC_12x12, ASTC_12x12, WZYX), + + _T_(ASTC_4x4_SRGB, ASTC_4x4, WZYX), + _T_(ASTC_5x4_SRGB, ASTC_5x4, WZYX), + _T_(ASTC_5x5_SRGB, ASTC_5x5, WZYX), + _T_(ASTC_6x5_SRGB, ASTC_6x5, WZYX), + _T_(ASTC_6x6_SRGB, ASTC_6x6, WZYX), + _T_(ASTC_8x5_SRGB, ASTC_8x5, WZYX), + _T_(ASTC_8x6_SRGB, ASTC_8x6, WZYX), + _T_(ASTC_8x8_SRGB, ASTC_8x8, WZYX), + _T_(ASTC_10x5_SRGB, ASTC_10x5, WZYX), + _T_(ASTC_10x6_SRGB, ASTC_10x6, WZYX), + _T_(ASTC_10x8_SRGB, ASTC_10x8, WZYX), + _T_(ASTC_10x10_SRGB, ASTC_10x10, WZYX), + _T_(ASTC_12x10_SRGB, ASTC_12x10, WZYX), + _T_(ASTC_12x12_SRGB, ASTC_12x12, WZYX), }; /* convert pipe format to vertex buffer format: */ -enum a6xx_vtx_fmt +enum a6xx_format fd6_pipe2vtx(enum pipe_format format) { if (!formats[format].present) @@ -354,7 +338,7 @@ fd6_pipe2vtx(enum pipe_format format) } /* convert pipe format to texture sampler format: */ -enum a6xx_tex_fmt +enum a6xx_format fd6_pipe2tex(enum pipe_format format) { if (!formats[format].present) @@ -363,7 +347,7 @@ fd6_pipe2tex(enum pipe_format format) } /* convert pipe format to MRT / copydest format used for render-target: */ -enum a6xx_color_fmt +enum a6xx_format fd6_pipe2color(enum pipe_format format) { if (!formats[format].present) diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_format.h b/src/gallium/drivers/freedreno/a6xx/fd6_format.h index 5f84f9958d6..ef8818f233f 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_format.h +++ b/src/gallium/drivers/freedreno/a6xx/fd6_format.h @@ -33,9 +33,9 @@ #include "a6xx.xml.h" -enum a6xx_vtx_fmt fd6_pipe2vtx(enum pipe_format format); -enum a6xx_tex_fmt fd6_pipe2tex(enum pipe_format format); -enum a6xx_color_fmt fd6_pipe2color(enum pipe_format format); +enum a6xx_format fd6_pipe2vtx(enum pipe_format format); +enum a6xx_format fd6_pipe2tex(enum pipe_format format); +enum a6xx_format fd6_pipe2color(enum pipe_format format); enum a3xx_color_swap fd6_pipe2swap(enum pipe_format format); enum a6xx_tex_fetchsize fd6_pipe2fetchsize(enum pipe_format format); enum a6xx_depth_format fd6_pipe2depth(enum pipe_format format); @@ -51,67 +51,67 @@ uint32_t fd6_tex_const_0(struct pipe_resource *prsc, unsigned swizzle_b, unsigned swizzle_a); static inline enum a6xx_2d_ifmt -fd6_ifmt(enum a6xx_color_fmt fmt) +fd6_ifmt(enum a6xx_format fmt) { switch (fmt) { - case RB6_A8_UNORM: - case RB6_R8_UNORM: - case RB6_R8_SNORM: - case RB6_R8G8_UNORM: - case RB6_R8G8_SNORM: - case RB6_R8G8B8A8_UNORM: - case RB6_R8G8B8X8_UNORM: - case RB6_R8G8B8A8_SNORM: + case FMT6_A8_UNORM: + case FMT6_8_UNORM: + case FMT6_8_SNORM: + case FMT6_8_8_UNORM: + case FMT6_8_8_SNORM: + case FMT6_8_8_8_8_UNORM: + case FMT6_8_8_8_X8_UNORM: + case FMT6_8_8_8_8_SNORM: return R2D_UNORM8; - case RB6_R32_UINT: - case RB6_R32_SINT: - case RB6_R32G32_UINT: - case RB6_R32G32_SINT: - case RB6_R32G32B32A32_UINT: - case RB6_R32G32B32A32_SINT: + case FMT6_32_UINT: + case FMT6_32_SINT: + case FMT6_32_32_UINT: + case FMT6_32_32_SINT: + case FMT6_32_32_32_32_UINT: + case FMT6_32_32_32_32_SINT: return R2D_INT32; - case RB6_R16_UINT: - case RB6_R16_SINT: - case RB6_R16G16_UINT: - case RB6_R16G16_SINT: - case RB6_R16G16B16A16_UINT: - case RB6_R16G16B16A16_SINT: + case FMT6_16_UINT: + case FMT6_16_SINT: + case FMT6_16_16_UINT: + case FMT6_16_16_SINT: + case FMT6_16_16_16_16_UINT: + case FMT6_16_16_16_16_SINT: return R2D_INT16; - case RB6_R8_UINT: - case RB6_R8_SINT: - case RB6_R8G8_UINT: - case RB6_R8G8_SINT: - case RB6_R8G8B8A8_UINT: - case RB6_R8G8B8A8_SINT: + case FMT6_8_UINT: + case FMT6_8_SINT: + case FMT6_8_8_UINT: + case FMT6_8_8_SINT: + case FMT6_8_8_8_8_UINT: + case FMT6_8_8_8_8_SINT: return R2D_INT8; - case RB6_R16_UNORM: - case RB6_R16_SNORM: - case RB6_R16G16_UNORM: - case RB6_R16G16_SNORM: - case RB6_R16G16B16A16_UNORM: - case RB6_R16G16B16A16_SNORM: - case RB6_R32_FLOAT: - case RB6_R32G32_FLOAT: - case RB6_R32G32B32A32_FLOAT: + case FMT6_16_UNORM: + case FMT6_16_SNORM: + case FMT6_16_16_UNORM: + case FMT6_16_16_SNORM: + case FMT6_16_16_16_16_UNORM: + case FMT6_16_16_16_16_SNORM: + case FMT6_32_FLOAT: + case FMT6_32_32_FLOAT: + case FMT6_32_32_32_32_FLOAT: return R2D_FLOAT32; - case RB6_R16_FLOAT: - case RB6_R16G16_FLOAT: - case RB6_R16G16B16A16_FLOAT: - case RB6_R11G11B10_FLOAT: + case FMT6_16_FLOAT: + case FMT6_16_16_FLOAT: + case FMT6_16_16_16_16_FLOAT: + case FMT6_11_11_10_FLOAT: return R2D_FLOAT16; - case RB6_R10G10B10A2_UNORM: - case RB6_R4G4B4A4_UNORM: - case RB6_R5G5B5A1_UNORM: - case RB6_R5G6B5_UNORM: - case RB6_R10G10B10A2_UINT: - case RB6_Z24_UNORM_S8_UINT: - case RB6_Z24_UNORM_S8_UINT_AS_R8G8B8A8: + case FMT6_10_10_10_2_UNORM_DEST: + case FMT6_4_4_4_4_UNORM: + case FMT6_5_5_5_1_UNORM: + case FMT6_5_6_5_UNORM: + case FMT6_10_10_10_2_UINT: + case FMT6_Z24_UNORM_S8_UINT: + case FMT6_Z24_UNORM_S8_UINT_AS_R8G8B8A8: return R2D_RAW; default: unreachable("bad format"); diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c b/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c index 11dc3792216..37820614da3 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c @@ -80,7 +80,7 @@ emit_mrt(struct fd_ringbuffer *ring, struct pipe_framebuffer_state *pfb, unsigned type = 0; for (i = 0; i < pfb->nr_cbufs; i++) { - enum a6xx_color_fmt format = 0; + enum a6xx_format format = 0; enum a3xx_color_swap swap = WZYX; bool sint = false, uint = false; struct fd_resource *rsc = NULL; @@ -957,7 +957,7 @@ emit_blit(struct fd_batch *batch, debug_assert(psurf->u.tex.first_layer == psurf->u.tex.last_layer); - enum a6xx_color_fmt format = fd6_pipe2color(pfmt); + enum a6xx_format format = fd6_pipe2color(pfmt); uint32_t stride = slice->pitch * rsc->layout.cpp; uint32_t size = slice->size0; enum a3xx_color_swap swap = fd6_resource_swap(rsc, pfmt); @@ -1134,7 +1134,7 @@ emit_clears(struct fd_batch *batch, struct fd_ringbuffer *ring) OUT_PKT4(ring, REG_A6XX_RB_BLIT_DST_INFO, 1); OUT_RING(ring, A6XX_RB_BLIT_DST_INFO_TILE_MODE(TILE6_LINEAR) | A6XX_RB_BLIT_DST_INFO_SAMPLES(samples) | - A6XX_RB_BLIT_DST_INFO_COLOR_FORMAT(RB6_R8_UINT)); + A6XX_RB_BLIT_DST_INFO_COLOR_FORMAT(FMT6_8_UINT)); OUT_PKT4(ring, REG_A6XX_RB_BLIT_INFO, 1); OUT_RING(ring, A6XX_RB_BLIT_INFO_GMEM | diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_image.c b/src/gallium/drivers/freedreno/a6xx/fd6_image.c index 4e87e2e9c6e..6ac3cc5c4c9 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_image.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_image.c @@ -38,7 +38,7 @@ struct fd6_image { struct pipe_resource *prsc; enum pipe_format pfmt; - enum a6xx_tex_fmt fmt; + enum a6xx_format fmt; enum a6xx_tex_fetchsize fetchsize; enum a6xx_tex_type type; bool srgb; diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_resource.c b/src/gallium/drivers/freedreno/a6xx/fd6_resource.c index 70ae2649179..2018c3afdd9 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_resource.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_resource.c @@ -59,32 +59,32 @@ ok_ubwc_format(struct fd_resource *rsc, enum pipe_format pfmt) return false; switch (fd6_pipe2color(pfmt)) { - case RB6_R10G10B10A2_UINT: - case RB6_R10G10B10A2_UNORM: - case RB6_R11G11B10_FLOAT: - case RB6_R16_FLOAT: - case RB6_R16G16B16A16_FLOAT: - case RB6_R16G16B16A16_SINT: - case RB6_R16G16B16A16_UINT: - case RB6_R16G16_FLOAT: - case RB6_R16G16_SINT: - case RB6_R16G16_UINT: - case RB6_R16_SINT: - case RB6_R16_UINT: - case RB6_R32G32B32A32_SINT: - case RB6_R32G32B32A32_UINT: - case RB6_R32G32_SINT: - case RB6_R32G32_UINT: - case RB6_R5G6B5_UNORM: - case RB6_R8G8B8A8_SINT: - case RB6_R8G8B8A8_UINT: - case RB6_R8G8B8A8_UNORM: - case RB6_R8G8B8X8_UNORM: - case RB6_R8G8_SINT: - case RB6_R8G8_UINT: - case RB6_R8G8_UNORM: - case RB6_Z24_UNORM_S8_UINT: - case RB6_Z24_UNORM_S8_UINT_AS_R8G8B8A8: + case FMT6_10_10_10_2_UINT: + case FMT6_10_10_10_2_UNORM_DEST: + case FMT6_11_11_10_FLOAT: + case FMT6_16_FLOAT: + case FMT6_16_16_16_16_FLOAT: + case FMT6_16_16_16_16_SINT: + case FMT6_16_16_16_16_UINT: + case FMT6_16_16_FLOAT: + case FMT6_16_16_SINT: + case FMT6_16_16_UINT: + case FMT6_16_SINT: + case FMT6_16_UINT: + case FMT6_32_32_32_32_SINT: + case FMT6_32_32_32_32_UINT: + case FMT6_32_32_SINT: + case FMT6_32_32_UINT: + case FMT6_5_6_5_UNORM: + case FMT6_8_8_8_8_SINT: + case FMT6_8_8_8_8_UINT: + case FMT6_8_8_8_8_UNORM: + case FMT6_8_8_8_X8_UNORM: + case FMT6_8_8_SINT: + case FMT6_8_8_UINT: + case FMT6_8_8_UNORM: + case FMT6_Z24_UNORM_S8_UINT: + case FMT6_Z24_UNORM_S8_UINT_AS_R8G8B8A8: return true; default: return false; diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_screen.c b/src/gallium/drivers/freedreno/a6xx/fd6_screen.c index bf1f9680c7c..20383d4ff48 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_screen.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_screen.c @@ -77,12 +77,12 @@ fd6_screen_is_format_supported(struct pipe_screen *pscreen, return false; if ((usage & PIPE_BIND_VERTEX_BUFFER) && - (fd6_pipe2vtx(format) != (enum a6xx_vtx_fmt)~0)) { + (fd6_pipe2vtx(format) != (enum a6xx_format)~0)) { retval |= PIPE_BIND_VERTEX_BUFFER; } if ((usage & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SHADER_IMAGE)) && - (fd6_pipe2tex(format) != (enum a6xx_tex_fmt)~0) && + (fd6_pipe2tex(format) != (enum a6xx_format)~0) && (target == PIPE_BUFFER || util_format_get_blocksize(format) != 12)) { retval |= usage & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SHADER_IMAGE); @@ -93,8 +93,8 @@ fd6_screen_is_format_supported(struct pipe_screen *pscreen, PIPE_BIND_SCANOUT | PIPE_BIND_SHARED | PIPE_BIND_COMPUTE_RESOURCE)) && - (fd6_pipe2color(format) != (enum a6xx_color_fmt)~0) && - (fd6_pipe2tex(format) != (enum a6xx_tex_fmt)~0)) { + (fd6_pipe2color(format) != (enum a6xx_format)~0) && + (fd6_pipe2tex(format) != (enum a6xx_format)~0)) { retval |= usage & (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SCANOUT | @@ -109,7 +109,7 @@ fd6_screen_is_format_supported(struct pipe_screen *pscreen, if ((usage & PIPE_BIND_DEPTH_STENCIL) && (fd6_pipe2depth(format) != (enum a6xx_depth_format)~0) && - (fd6_pipe2tex(format) != (enum a6xx_tex_fmt)~0)) { + (fd6_pipe2tex(format) != (enum a6xx_format)~0)) { retval |= PIPE_BIND_DEPTH_STENCIL; } -- 2.30.2