diff options
author | Jonathan Marek <[email protected]> | 2020-02-12 14:16:16 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-02-12 21:59:59 +0000 |
commit | 18786cc7d55598e82fe1de45bd2c3ffea136418e (patch) | |
tree | ec2421c5e5f63d1ec99df700e95ad88643c32ff3 /src/gallium/drivers | |
parent | c13202af7a86976e6d0400f2cee77afcc60ea828 (diff) |
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 <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Kristian H. Kristensen <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3798>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3798>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_blitter.c | 24 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_draw.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_emit.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_format.c | 536 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_format.h | 100 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_gmem.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_image.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_resource.c | 52 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_screen.c | 10 |
9 files changed, 361 insertions, 377 deletions
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; } |