Commit 18786cc7 authored by Jonathan Marek's avatar Jonathan Marek Committed by Marge Bot
Browse files

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's avatarJonathan Marek <jonathan@marek.ca>
Reviewed-by: Emma Anholt's avatarEric Anholt <eric@anholt.net>
Reviewed-by: Kristian H. Kristensen's avatarKristian H. Kristensen <hoegsberg@google.com>
Tested-by: Marge Bot <mesa/mesa!3798>
Part-of: <mesa/mesa!3798>
parent c13202af
This diff is collapsed.
......@@ -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) |
......
......@@ -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 |
......
This diff is collapsed.
......@@ -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) |
......
......@@ -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
......
......@@ -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
......
......@@ -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);
......
......@@ -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;
......
......@@ -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");
......
......@@ -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 |
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment