mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
v3dv/format: add v3dv_get_format_swizzle
Heavily based on the equivalent v3d v3d_get_formar_swizzle. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
parent
62ca997476
commit
6cb24a3b39
2 changed files with 13 additions and 0 deletions
|
|
@ -201,6 +201,18 @@ v3dv_get_internal_type_bpp_for_output_format(uint32_t format,
|
|||
}
|
||||
}
|
||||
|
||||
const uint8_t *
|
||||
v3dv_get_format_swizzle(VkFormat f)
|
||||
{
|
||||
const struct v3dv_format *vf = v3dv_get_format(f);
|
||||
static const uint8_t fallback[] = {0, 1, 2, 3};
|
||||
|
||||
if (!vf)
|
||||
return fallback;
|
||||
|
||||
return vf->swizzle;
|
||||
}
|
||||
|
||||
static VkFormatFeatureFlags
|
||||
image_format_features(VkFormat vk_format,
|
||||
const struct v3dv_format *v3dv_format,
|
||||
|
|
|
|||
|
|
@ -457,6 +457,7 @@ void v3dv_loge(const char *format, ...) v3dv_printflike(1, 2);
|
|||
void v3dv_loge_v(const char *format, va_list va);
|
||||
|
||||
const struct v3dv_format *v3dv_get_format(VkFormat);
|
||||
const uint8_t *v3dv_get_format_swizzle(VkFormat f);
|
||||
void v3dv_get_internal_type_bpp_for_output_format(uint32_t format, uint32_t *type, uint32_t *bpp);
|
||||
|
||||
uint32_t v3d_utile_width(int cpp);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue