mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 05:50:11 +01:00
vk/image: fix view creation for planar video aspects
drivers do implement this cc: mesa-stable Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31318>
This commit is contained in:
parent
e0efab520e
commit
c4d6d9254a
1 changed files with 8 additions and 3 deletions
|
|
@ -441,6 +441,12 @@ vk_image_view_init(struct vk_device *device,
|
|||
vk_image_expand_aspect_mask(image, range->aspectMask);
|
||||
|
||||
assert(!(image_view->aspects & ~image->aspects));
|
||||
const VkImageUsageFlags video = VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR |
|
||||
VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR |
|
||||
VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR |
|
||||
VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR |
|
||||
VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR |
|
||||
VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR;
|
||||
|
||||
/* From the Vulkan 1.2.184 spec:
|
||||
*
|
||||
|
|
@ -456,11 +462,10 @@ vk_image_view_init(struct vk_device *device,
|
|||
* be identical to the image format, and the sampler to be used with the
|
||||
* image view must enable sampler Y′CBCR conversion."
|
||||
*
|
||||
* Since no one implements video yet, we can ignore the bits about video
|
||||
* create flags and assume YCbCr formats match.
|
||||
*/
|
||||
if ((image->aspects & VK_IMAGE_ASPECT_PLANE_1_BIT) &&
|
||||
(range->aspectMask == VK_IMAGE_ASPECT_COLOR_BIT))
|
||||
(range->aspectMask == VK_IMAGE_ASPECT_COLOR_BIT) &&
|
||||
!(image->usage & video))
|
||||
assert(image_view->format == image->format);
|
||||
|
||||
/* From the Vulkan 1.2.184 spec:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue