anv: expose A4B4G4R4_UNORM_PACK16 support with CBCWF is disabled

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12511
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33194>
This commit is contained in:
Lionel Landwerlin
2025-01-24 10:54:42 +02:00
committed by Marge Bot
parent 7fab8675a6
commit 524dab2b10
2 changed files with 24 additions and 2 deletions
+22 -2
View File
@@ -59,6 +59,18 @@
.n_planes = 1, \
}
#define swiz_fmt1_flags(__vk_fmt, __hw_fmt, __swizzle, __flags) \
[VK_ENUM_OFFSET(__vk_fmt)] = { \
.planes = { \
{ .isl_format = __hw_fmt, .swizzle = __swizzle, \
.aspect = VK_IMAGE_ASPECT_COLOR_BIT, \
}, \
}, \
.vk_format = __vk_fmt, \
.n_planes = 1, \
.flags = __flags, \
}
#define fmt1(__vk_fmt, __hw_fmt) \
swiz_fmt1(__vk_fmt, __hw_fmt, RGBA)
@@ -320,8 +332,9 @@ static const struct anv_format main_formats[] = {
};
static const struct anv_format _4444_formats[] = {
fmt1(VK_FORMAT_A4R4G4B4_UNORM_PACK16, ISL_FORMAT_B4G4R4A4_UNORM),
fmt_unsupported(VK_FORMAT_A4B4G4R4_UNORM_PACK16),
fmt1(VK_FORMAT_A4R4G4B4_UNORM_PACK16, ISL_FORMAT_B4G4R4A4_UNORM),
swiz_fmt1_flags(VK_FORMAT_A4B4G4R4_UNORM_PACK16, ISL_FORMAT_B4G4R4A4_UNORM, BGRA,
ANV_FORMAT_FLAG_NO_CBCWF),
};
static const struct anv_format _2plane_444_formats[] = {
@@ -448,6 +461,13 @@ anv_get_format(const struct anv_physical_device *device, VkFormat vk_format)
if (format->planes[0].isl_format == ISL_FORMAT_UNSUPPORTED)
return NULL;
/* This format is only available if custom border colors without format is
* disabled.
*/
if ((format->flags & ANV_FORMAT_FLAG_NO_CBCWF) &&
device->instance->custom_border_colors_without_format)
return NULL;
return format;
}
+2
View File
@@ -5213,6 +5213,8 @@ enum anv_format_flag {
ANV_FORMAT_FLAG_CAN_YCBCR = BITFIELD_BIT(0),
/* Format supports video API */
ANV_FORMAT_FLAG_CAN_VIDEO = BITFIELD_BIT(1),
/* Format works if custom border colors without format is disabled */
ANV_FORMAT_FLAG_NO_CBCWF = BITFIELD_BIT(2),
};
struct anv_format {