freedreno/fdl: Add fd6_texture_format_supported()

Helper so we can deal with special cases where a device adds/
removes format support.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34867>
This commit is contained in:
Rob Clark
2025-06-05 12:22:03 -07:00
committed by Marge Bot
parent 30de94b91d
commit 130972c52f
4 changed files with 16 additions and 8 deletions
+7
View File
@@ -421,6 +421,13 @@ fd6_texture_format(enum pipe_format format, enum a6xx_tile_mode tile_mode,
return formats[format].tex;
}
bool
fd6_texture_format_supported(const struct fd_dev_info *info, enum pipe_format format,
enum a6xx_tile_mode tile_mode, bool is_mutable)
{
return fd6_texture_format(format, tile_mode, is_mutable) != FMT6_NONE;
}
enum a3xx_color_swap
fd6_texture_swap(enum pipe_format format, enum a6xx_tile_mode tile_mode,
bool is_mutable)
+5
View File
@@ -21,6 +21,8 @@
BEGINC;
struct fd_dev_info;
static inline enum a6xx_tex_swiz
fdl6_swiz(unsigned char swiz)
{
@@ -40,6 +42,9 @@ enum a3xx_color_swap fd6_vertex_swap(enum pipe_format format) ATTRIBUTE_CONST;
enum a6xx_format fd6_texture_format(enum pipe_format format,
enum a6xx_tile_mode tile_mode,
bool is_mutable) ATTRIBUTE_CONST;
bool fd6_texture_format_supported(const struct fd_dev_info *info, enum pipe_format format,
enum a6xx_tile_mode tile_mode, bool is_mutable)
ATTRIBUTE_CONST;
enum a3xx_color_swap fd6_texture_swap(enum pipe_format format,
enum a6xx_tile_mode tile_mode,
bool is_mutable) ATTRIBUTE_CONST;
+2 -7
View File
@@ -56,12 +56,6 @@ tu6_format_color(enum pipe_format format, enum a6xx_tile_mode tile_mode,
return fmt;
}
static bool
tu6_format_texture_supported(enum pipe_format format)
{
return fd6_texture_format(format, TILE6_LINEAR, false) != FMT6_NONE;
}
struct tu_native_format
tu6_format_texture(enum pipe_format format, enum a6xx_tile_mode tile_mode,
bool is_mutable)
@@ -119,7 +113,8 @@ tu_physical_device_get_format_properties(
bool supported_vtx = tu6_format_vtx_supported(format);
bool supported_color = tu6_format_color_supported(format);
bool supported_tex = tu6_format_texture_supported(format);
bool supported_tex = fd6_texture_format_supported(physical_device->info, format,
TILE6_LINEAR, false);
bool is_npot = !util_is_power_of_two_or_zero(desc->block.bits);
if (format == PIPE_FORMAT_NONE ||
@@ -46,6 +46,7 @@ fd6_screen_is_format_supported(struct pipe_screen *pscreen,
unsigned sample_count,
unsigned storage_sample_count, unsigned usage)
{
struct fd_screen *screen = fd_screen(pscreen);
unsigned retval = 0;
if ((target >= PIPE_MAX_TEXTURE_TYPES) ||
@@ -64,7 +65,7 @@ fd6_screen_is_format_supported(struct pipe_screen *pscreen,
}
bool has_color = fd6_color_format(format, TILE6_LINEAR) != FMT6_NONE;
bool has_tex = fd6_texture_format(format, TILE6_LINEAR, false) != FMT6_NONE;
bool has_tex = fd6_texture_format_supported(screen->info, format, TILE6_LINEAR, false);
if ((usage & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_SHADER_IMAGE)) &&
has_tex &&