mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
anv: Handle UNDEFINED format in image format list
It's not invalid to have this value in the list, but the only case it
is actually valid as format in the creation of an image or image view
is with Android Hardware Buffers which have their format specified
externally.
So we can just ignore all entries with VK_FORMAT_UNDEFINED.
Cc: 22.2 <mesa-stable>
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17182>
(cherry picked from commit 9899151361)
This commit is contained in:
parent
1122231f95
commit
b189a72fe4
3 changed files with 14 additions and 1 deletions
|
|
@ -3163,7 +3163,7 @@
|
|||
"description": "anv: Handle UNDEFINED format in image format list",
|
||||
"nominated": false,
|
||||
"nomination_type": null,
|
||||
"resolution": 4,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1037,6 +1037,10 @@ anv_get_image_format_properties(
|
|||
if ((info->flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) && format_list_info) {
|
||||
for (uint32_t i = 0; i < format_list_info->viewFormatCount; ++i) {
|
||||
VkFormat vk_view_format = format_list_info->pViewFormats[i];
|
||||
|
||||
if (vk_view_format == VK_FORMAT_UNDEFINED)
|
||||
continue;
|
||||
|
||||
const struct anv_format *anv_view_format = anv_get_format(vk_view_format);
|
||||
VkFormatFeatureFlags2 view_format_features =
|
||||
anv_get_image_format_features2(devinfo, vk_view_format,
|
||||
|
|
|
|||
|
|
@ -364,6 +364,9 @@ can_fast_clear_with_non_zero_color(const struct intel_device_info *devinfo,
|
|||
|
||||
/* Check bit compatibility for clear color components */
|
||||
for (uint32_t i = 0; i < fmt_list->viewFormatCount; i++) {
|
||||
if (fmt_list->pViewFormats[i] == VK_FORMAT_UNDEFINED)
|
||||
continue;
|
||||
|
||||
struct anv_format_plane view_format_plane =
|
||||
anv_get_format_plane(devinfo, fmt_list->pViewFormats[i],
|
||||
plane, image->vk.tiling);
|
||||
|
|
@ -401,6 +404,9 @@ storage_image_format_supports_atomic(const struct intel_device_info *devinfo,
|
|||
|
||||
if (fmt_list) {
|
||||
for (uint32_t i = 0; i < fmt_list->viewFormatCount; i++) {
|
||||
if (fmt_list->pViewFormats[i] == VK_FORMAT_UNDEFINED)
|
||||
continue;
|
||||
|
||||
enum isl_format view_format =
|
||||
anv_get_isl_format(devinfo, fmt_list->pViewFormats[i],
|
||||
VK_IMAGE_ASPECT_COLOR_BIT, vk_tiling);
|
||||
|
|
@ -469,6 +475,9 @@ formats_ccs_e_compatible(const struct intel_device_info *devinfo,
|
|||
return false;
|
||||
|
||||
for (uint32_t i = 0; i < fmt_list->viewFormatCount; i++) {
|
||||
if (fmt_list->pViewFormats[i] == VK_FORMAT_UNDEFINED)
|
||||
continue;
|
||||
|
||||
enum isl_format view_format =
|
||||
anv_get_isl_format_with_usage(devinfo, fmt_list->pViewFormats[i],
|
||||
VK_IMAGE_ASPECT_COLOR_BIT, vk_usage,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue