mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
radv/video: fix reporting video format props for encode.
When encode isn't enabled, refuse the image usage, also use
the correct error on the decode check.
Fixes: 05cd42417f ("radv/video: enable video encoding behind perftest flag")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30838>
This commit is contained in:
parent
7f7ecaf08c
commit
68cd36d9b4
1 changed files with 8 additions and 1 deletions
|
|
@ -763,11 +763,18 @@ radv_GetPhysicalDeviceVideoFormatPropertiesKHR(VkPhysicalDevice physicalDevice,
|
|||
uint32_t *pVideoFormatPropertyCount,
|
||||
VkVideoFormatPropertiesKHR *pVideoFormatProperties)
|
||||
{
|
||||
VK_FROM_HANDLE(radv_physical_device, pdev, physicalDevice);
|
||||
|
||||
if ((pVideoFormatInfo->imageUsage & (VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR |
|
||||
VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR)) &&
|
||||
!pdev->video_encode_enabled)
|
||||
return VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR;
|
||||
|
||||
/* radv requires separate allocates for DPB and decode video. */
|
||||
if ((pVideoFormatInfo->imageUsage &
|
||||
(VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR | VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR)) ==
|
||||
(VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR | VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR))
|
||||
return VK_ERROR_FORMAT_NOT_SUPPORTED;
|
||||
return VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR;
|
||||
|
||||
VK_OUTARRAY_MAKE_TYPED(VkVideoFormatPropertiesKHR, out, pVideoFormatProperties, pVideoFormatPropertyCount);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue