pvr: Add macros to iterate all supported tex formats
Signed-off-by: Matt Coster <matt.coster@imgtec.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
This commit is contained in:
@@ -304,6 +304,10 @@ ForEachMacros: [
|
||||
'pco_foreach_phase_in_igrp_rev',
|
||||
'pco_foreach_phase_rev',
|
||||
'pco_foreach_phi_src_in_instr',
|
||||
'pvr_foreach_supported_tex_format',
|
||||
'pvr_foreach_supported_tex_format_',
|
||||
'pvr_foreach_supported_tex_format_compressed',
|
||||
'pvr_foreach_supported_tex_format_compressed_',
|
||||
'rogue_foreach_block',
|
||||
'rogue_foreach_block_safe',
|
||||
'rogue_foreach_block_rev',
|
||||
|
||||
@@ -233,11 +233,36 @@ bool pvr_tex_format_is_supported(uint32_t tex_format);
|
||||
const struct pvr_tex_format_description *
|
||||
pvr_get_tex_format_description(uint32_t tex_format);
|
||||
|
||||
#define pvr_foreach_supported_tex_format_(format) \
|
||||
for (enum PVRX(TEXSTATE_FORMAT) format = 0; format < PVR_TEX_FORMAT_COUNT; \
|
||||
format++) \
|
||||
if (pvr_tex_format_is_supported(format))
|
||||
|
||||
#define pvr_foreach_supported_tex_format(format, desc) \
|
||||
pvr_foreach_supported_tex_format_ (format) \
|
||||
for (const struct pvr_tex_format_description *desc = \
|
||||
pvr_get_tex_format_description(format); \
|
||||
desc; \
|
||||
desc = NULL)
|
||||
|
||||
bool pvr_tex_format_compressed_is_supported(uint32_t tex_format);
|
||||
|
||||
const struct pvr_tex_format_compressed_description *
|
||||
pvr_get_tex_format_compressed_description(uint32_t tex_format);
|
||||
|
||||
#define pvr_foreach_supported_tex_format_compressed_(format) \
|
||||
for (enum PVRX(TEXSTATE_FORMAT_COMPRESSED) format = 0; \
|
||||
format < PVR_TEX_FORMAT_COUNT; \
|
||||
format++) \
|
||||
if (pvr_tex_format_compressed_is_supported(format))
|
||||
|
||||
#define pvr_foreach_supported_tex_format_compressed(format, desc) \
|
||||
pvr_foreach_supported_tex_format_compressed_ (format) \
|
||||
for (const struct pvr_tex_format_compressed_description *desc = \
|
||||
pvr_get_tex_format_compressed_description(format); \
|
||||
desc; \
|
||||
desc = NULL)
|
||||
|
||||
const uint8_t *pvr_get_format_swizzle(VkFormat vk_format);
|
||||
uint32_t pvr_get_tex_format(VkFormat vk_format);
|
||||
uint32_t pvr_get_tex_format_aspect(VkFormat vk_format,
|
||||
|
||||
Reference in New Issue
Block a user