1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

hwcontext_vulkan: set usage for DRM imports to the frames context usage

They're nothing special, and there's no reason they should always use the
default flags.
This commit is contained in:
Lynne 2020-05-15 00:21:51 +01:00
parent 2c6366590e
commit 192997dd7f
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464

View File

@ -1944,6 +1944,7 @@ static int vulkan_map_from_drm_frame_desc(AVHWFramesContext *hwfc, AVVkFrame **f
AVVulkanDeviceContext *hwctx = ctx->hwctx; AVVulkanDeviceContext *hwctx = ctx->hwctx;
VulkanDevicePriv *p = ctx->internal->priv; VulkanDevicePriv *p = ctx->internal->priv;
VulkanFramesPriv *fp = hwfc->internal->priv; VulkanFramesPriv *fp = hwfc->internal->priv;
AVVulkanFramesContext *frames_hwctx = hwfc->hwctx;
const AVPixFmtDescriptor *fmt_desc = av_pix_fmt_desc_get(hwfc->sw_format); const AVPixFmtDescriptor *fmt_desc = av_pix_fmt_desc_get(hwfc->sw_format);
const int has_modifiers = p->extensions & EXT_DRM_MODIFIER_FLAGS; const int has_modifiers = p->extensions & EXT_DRM_MODIFIER_FLAGS;
VkSubresourceLayout plane_data[AV_NUM_DATA_POINTERS] = { 0 }; VkSubresourceLayout plane_data[AV_NUM_DATA_POINTERS] = { 0 };
@ -2043,7 +2044,7 @@ static int vulkan_map_from_drm_frame_desc(AVHWFramesContext *hwfc, AVVkFrame **f
.flags = VK_IMAGE_CREATE_ALIAS_BIT, .flags = VK_IMAGE_CREATE_ALIAS_BIT,
.tiling = f->tiling, .tiling = f->tiling,
.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED, /* specs say so */ .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED, /* specs say so */
.usage = DEFAULT_USAGE_FLAGS, .usage = frames_hwctx->usage,
.samples = VK_SAMPLE_COUNT_1_BIT, .samples = VK_SAMPLE_COUNT_1_BIT,
.pQueueFamilyIndices = p->qfs, .pQueueFamilyIndices = p->qfs,
.queueFamilyIndexCount = p->num_qfs, .queueFamilyIndexCount = p->num_qfs,