1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00

lavu/vulkan: move common Vulkan code from libavfilter to libavutil

This commit is contained in:
Lynne
2021-11-19 07:46:15 +01:00
parent 8c150d3d97
commit d1133e8c44
15 changed files with 2258 additions and 2197 deletions

View File

@@ -38,6 +38,7 @@
#include "hwcontext_internal.h"
#include "hwcontext_vulkan.h"
#include "vulkan.h"
#include "vulkan_loader.h"
#if CONFIG_LIBDRM
@@ -131,11 +132,6 @@ typedef struct AVVkFrameInternal {
#endif
} AVVkFrameInternal;
#define DEFAULT_USAGE_FLAGS (VK_IMAGE_USAGE_SAMPLED_BIT | \
VK_IMAGE_USAGE_STORAGE_BIT | \
VK_IMAGE_USAGE_TRANSFER_SRC_BIT | \
VK_IMAGE_USAGE_TRANSFER_DST_BIT)
#define ADD_VAL_TO_LIST(list, count, val) \
do { \
list = av_realloc_array(list, sizeof(*list), ++count); \
@@ -251,7 +247,7 @@ static int pixfmt_is_supported(AVHWDeviceContext *dev_ctx, enum AVPixelFormat p,
vk->GetPhysicalDeviceFormatProperties2(hwctx->phys_dev, fmt[i], &prop);
flags = linear ? prop.formatProperties.linearTilingFeatures :
prop.formatProperties.optimalTilingFeatures;
if (!(flags & DEFAULT_USAGE_FLAGS))
if (!(flags & FF_VK_DEFAULT_USAGE_FLAGS))
return 0;
}
@@ -2041,7 +2037,7 @@ static int vulkan_frames_init(AVHWFramesContext *hwfc)
VK_IMAGE_TILING_LINEAR : VK_IMAGE_TILING_OPTIMAL;
if (!hwctx->usage)
hwctx->usage = DEFAULT_USAGE_FLAGS;
hwctx->usage = FF_VK_DEFAULT_USAGE_FLAGS;
err = create_exec_ctx(hwfc, &fp->conv_ctx,
dev_hwctx->queue_family_comp_index,