anv: Report disjoint images as unsupported for video usage

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35651>
This commit is contained in:
Calder Young 2025-06-23 13:26:52 -07:00 committed by Marge Bot
parent 9bbb68a817
commit 0b911356e5
2 changed files with 11 additions and 2 deletions

View file

@ -702,7 +702,8 @@ anv_get_image_format_features2(const struct anv_physical_device *physical_device
assert(aspects & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV);
if (anv_format->flags & ANV_FORMAT_FLAG_CAN_VIDEO) {
if (anv_format->flags & ANV_FORMAT_FLAG_CAN_VIDEO &&
!(create_flags & VK_IMAGE_CREATE_DISJOINT_BIT)) {
flags |= (physical_device->instance->debug & ANV_DEBUG_VIDEO_DECODE) ?
VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR |
VK_FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR : 0;
@ -914,7 +915,14 @@ anv_get_image_format_features2(const struct anv_physical_device *physical_device
}
}
if (anv_format->n_planes > 1)
/* Report disjoint for multi-planar formats, unless the video usage
* bits are set, the media engines do not support disjoint.
*/
if (anv_format->n_planes > 1 &&
!(usage & (VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR |
VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR |
VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR |
VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR)))
flags |= VK_FORMAT_FEATURE_2_DISJOINT_BIT;
flags &= ~disallowed_ycbcr_image_features;

View file

@ -6771,6 +6771,7 @@ anv_image_dpb_address(const struct anv_image_view *iv,
{
assert(iv->vk.base_mip_level == 0);
assert(iv->vk.layer_count > arrayLayer);
assert(!iv->image->disjoint);
struct anv_address addr =
anv_image_address(iv->image, &iv->image->planes[0].primary_surface.memory_range);