mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
vulkan: do not reinvent a queue context struct
We recently introduced a public field which was a superset of the queue context we used to have. Switch to using it entirely. This also allows us to get rid of the NIH function which was valid only for video queues.
This commit is contained in:
parent
157cd820ad
commit
2e06b84e27
@ -58,10 +58,10 @@ typedef struct VulkanEncodeFFv1Context {
|
|||||||
AVFrame *frame;
|
AVFrame *frame;
|
||||||
|
|
||||||
FFVulkanContext s;
|
FFVulkanContext s;
|
||||||
FFVkQueueFamilyCtx qf;
|
AVVulkanDeviceQueueFamily *qf;
|
||||||
FFVkExecPool exec_pool;
|
FFVkExecPool exec_pool;
|
||||||
|
|
||||||
FFVkQueueFamilyCtx transfer_qf;
|
AVVulkanDeviceQueueFamily *transfer_qf;
|
||||||
FFVkExecPool transfer_exec_pool;
|
FFVkExecPool transfer_exec_pool;
|
||||||
|
|
||||||
VkBufferCopy *buf_regions;
|
VkBufferCopy *buf_regions;
|
||||||
@ -1586,8 +1586,8 @@ static av_cold int vulkan_encode_ffv1_init(AVCodecContext *avctx)
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
err = ff_vk_qf_init(&fv->s, &fv->qf, VK_QUEUE_COMPUTE_BIT);
|
fv->qf = ff_vk_qf_find(&fv->s, VK_QUEUE_COMPUTE_BIT, 0);
|
||||||
if (err < 0) {
|
if (!fv->qf) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Device has no compute queues!\n");
|
av_log(avctx, AV_LOG_ERROR, "Device has no compute queues!\n");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -1626,7 +1626,7 @@ static av_cold int vulkan_encode_ffv1_init(AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!fv->async_depth) {
|
if (!fv->async_depth) {
|
||||||
fv->async_depth = FFMIN(fv->qf.nb_queues, FFMAX(max_heap_size / maxsize, 1));
|
fv->async_depth = FFMIN(fv->qf->num, FFMAX(max_heap_size / maxsize, 1));
|
||||||
fv->async_depth = FFMAX(fv->async_depth, 1);
|
fv->async_depth = FFMAX(fv->async_depth, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1635,19 +1635,19 @@ static av_cold int vulkan_encode_ffv1_init(AVCodecContext *avctx)
|
|||||||
(fv->async_depth * maxsize) / (1024*1024),
|
(fv->async_depth * maxsize) / (1024*1024),
|
||||||
fv->async_depth);
|
fv->async_depth);
|
||||||
|
|
||||||
err = ff_vk_exec_pool_init(&fv->s, &fv->qf, &fv->exec_pool,
|
err = ff_vk_exec_pool_init(&fv->s, fv->qf, &fv->exec_pool,
|
||||||
fv->async_depth,
|
fv->async_depth,
|
||||||
0, 0, 0, NULL);
|
0, 0, 0, NULL);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
err = ff_vk_qf_init(&fv->s, &fv->transfer_qf, VK_QUEUE_TRANSFER_BIT);
|
fv->transfer_qf = ff_vk_qf_find(&fv->s, VK_QUEUE_TRANSFER_BIT, 0);
|
||||||
if (err < 0) {
|
if (!fv->transfer_qf) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Device has no transfer queues!\n");
|
av_log(avctx, AV_LOG_ERROR, "Device has no transfer queues!\n");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = ff_vk_exec_pool_init(&fv->s, &fv->transfer_qf, &fv->transfer_exec_pool,
|
err = ff_vk_exec_pool_init(&fv->s, fv->transfer_qf, &fv->transfer_exec_pool,
|
||||||
1,
|
1,
|
||||||
0, 0, 0, NULL);
|
0, 0, 0, NULL);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
|
@ -1116,21 +1116,19 @@ int ff_vk_decode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
/* Create queue context */
|
/* Create queue context */
|
||||||
vk_desc = get_codecdesc(avctx->codec_id);
|
vk_desc = get_codecdesc(avctx->codec_id);
|
||||||
err = ff_vk_video_qf_init(s, &ctx->qf,
|
ctx->qf = ff_vk_qf_find(s, VK_QUEUE_VIDEO_DECODE_BIT_KHR, vk_desc->decode_op);
|
||||||
VK_QUEUE_VIDEO_DECODE_BIT_KHR,
|
if (!ctx->qf) {
|
||||||
vk_desc->decode_op);
|
|
||||||
if (err < 0) {
|
|
||||||
av_log(avctx, AV_LOG_ERROR, "Decoding of %s is not supported by this device\n",
|
av_log(avctx, AV_LOG_ERROR, "Decoding of %s is not supported by this device\n",
|
||||||
avcodec_get_name(avctx->codec_id));
|
avcodec_get_name(avctx->codec_id));
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Enable queries if supported */
|
/* Enable queries if supported and usable */
|
||||||
if (s->query_props[ctx->qf.queue_family].queryResultStatusSupport)
|
if (s->query_props[ctx->qf->idx].queryResultStatusSupport)
|
||||||
nb_q = 1;
|
nb_q = 1;
|
||||||
|
|
||||||
session_create.flags = 0x0;
|
session_create.flags = 0x0;
|
||||||
session_create.queueFamilyIndex = ctx->qf.queue_family;
|
session_create.queueFamilyIndex = ctx->qf->idx;
|
||||||
session_create.maxCodedExtent = ctx->caps.maxCodedExtent;
|
session_create.maxCodedExtent = ctx->caps.maxCodedExtent;
|
||||||
session_create.maxDpbSlots = ctx->caps.maxDpbSlots;
|
session_create.maxDpbSlots = ctx->caps.maxDpbSlots;
|
||||||
session_create.maxActiveReferencePictures = ctx->caps.maxActiveReferencePictures;
|
session_create.maxActiveReferencePictures = ctx->caps.maxActiveReferencePictures;
|
||||||
@ -1142,8 +1140,8 @@ int ff_vk_decode_init(AVCodecContext *avctx)
|
|||||||
/* Create decode exec context for this specific main thread.
|
/* Create decode exec context for this specific main thread.
|
||||||
* 2 async contexts per thread was experimentally determined to be optimal
|
* 2 async contexts per thread was experimentally determined to be optimal
|
||||||
* for a majority of streams. */
|
* for a majority of streams. */
|
||||||
err = ff_vk_exec_pool_init(s, &ctx->qf, &ctx->exec_pool,
|
err = ff_vk_exec_pool_init(s, ctx->qf, &ctx->exec_pool,
|
||||||
FFMAX(2*ctx->qf.nb_queues, avctx->thread_count),
|
FFMAX(2*ctx->qf->num, avctx->thread_count),
|
||||||
nb_q, VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR, 0,
|
nb_q, VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR, 0,
|
||||||
profile);
|
profile);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
|
@ -46,7 +46,7 @@ typedef struct FFVulkanDecodeProfileData {
|
|||||||
typedef struct FFVulkanDecodeShared {
|
typedef struct FFVulkanDecodeShared {
|
||||||
FFVulkanContext s;
|
FFVulkanContext s;
|
||||||
FFVkVideoCommon common;
|
FFVkVideoCommon common;
|
||||||
FFVkQueueFamilyCtx qf;
|
AVVulkanDeviceQueueFamily *qf;
|
||||||
FFVkExecPool exec_pool;
|
FFVkExecPool exec_pool;
|
||||||
|
|
||||||
AVBufferPool *buf_pool;
|
AVBufferPool *buf_pool;
|
||||||
|
@ -769,10 +769,8 @@ av_cold int ff_vulkan_encode_init(AVCodecContext *avctx, FFVulkanEncodeContext *
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
/* Create queue context */
|
/* Create queue context */
|
||||||
err = ff_vk_video_qf_init(s, &ctx->qf_enc,
|
ctx->qf_enc = ff_vk_qf_find(s, VK_QUEUE_VIDEO_ENCODE_BIT_KHR, vk_desc->encode_op);
|
||||||
VK_QUEUE_VIDEO_ENCODE_BIT_KHR,
|
if (!ctx->qf_enc) {
|
||||||
vk_desc->encode_op);
|
|
||||||
if (err < 0) {
|
|
||||||
av_log(avctx, AV_LOG_ERROR, "Encoding of %s is not supported by this device\n",
|
av_log(avctx, AV_LOG_ERROR, "Encoding of %s is not supported by this device\n",
|
||||||
avcodec_get_name(avctx->codec_id));
|
avcodec_get_name(avctx->codec_id));
|
||||||
return err;
|
return err;
|
||||||
@ -846,7 +844,7 @@ av_cold int ff_vulkan_encode_init(AVCodecContext *avctx, FFVulkanEncodeContext *
|
|||||||
.encodeFeedbackFlags = ctx->enc_caps.supportedEncodeFeedbackFlags &
|
.encodeFeedbackFlags = ctx->enc_caps.supportedEncodeFeedbackFlags &
|
||||||
(~VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_HAS_OVERRIDES_BIT_KHR),
|
(~VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_HAS_OVERRIDES_BIT_KHR),
|
||||||
};
|
};
|
||||||
err = ff_vk_exec_pool_init(s, &ctx->qf_enc, &ctx->enc_pool, base_ctx->async_depth,
|
err = ff_vk_exec_pool_init(s, ctx->qf_enc, &ctx->enc_pool, base_ctx->async_depth,
|
||||||
1, VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR, 0,
|
1, VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR, 0,
|
||||||
&query_create);
|
&query_create);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
@ -994,7 +992,7 @@ av_cold int ff_vulkan_encode_init(AVCodecContext *avctx, FFVulkanEncodeContext *
|
|||||||
/* Create session */
|
/* Create session */
|
||||||
session_create.pVideoProfile = &ctx->profile;
|
session_create.pVideoProfile = &ctx->profile;
|
||||||
session_create.flags = 0x0;
|
session_create.flags = 0x0;
|
||||||
session_create.queueFamilyIndex = ctx->qf_enc.queue_family;
|
session_create.queueFamilyIndex = ctx->qf_enc->idx;
|
||||||
session_create.maxCodedExtent = ctx->caps.maxCodedExtent;
|
session_create.maxCodedExtent = ctx->caps.maxCodedExtent;
|
||||||
session_create.maxDpbSlots = ctx->caps.maxDpbSlots;
|
session_create.maxDpbSlots = ctx->caps.maxDpbSlots;
|
||||||
session_create.maxActiveReferencePictures = ctx->caps.maxActiveReferencePictures;
|
session_create.maxActiveReferencePictures = ctx->caps.maxActiveReferencePictures;
|
||||||
|
@ -188,7 +188,7 @@ typedef struct FFVulkanEncodeContext {
|
|||||||
VkVideoEncodeCapabilitiesKHR enc_caps;
|
VkVideoEncodeCapabilitiesKHR enc_caps;
|
||||||
VkVideoEncodeUsageInfoKHR usage_info;
|
VkVideoEncodeUsageInfoKHR usage_info;
|
||||||
|
|
||||||
FFVkQueueFamilyCtx qf_enc;
|
AVVulkanDeviceQueueFamily *qf_enc;
|
||||||
FFVkExecPool enc_pool;
|
FFVkExecPool enc_pool;
|
||||||
|
|
||||||
FFHWBaseEncodePicture *slots[32];
|
FFHWBaseEncodePicture *slots[32];
|
||||||
|
@ -268,20 +268,6 @@ int ff_vk_h265_profile_to_av(StdVideoH264ProfileIdc profile)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int ff_vk_video_qf_init(FFVulkanContext *s, FFVkQueueFamilyCtx *qf,
|
|
||||||
VkQueueFlagBits family, VkVideoCodecOperationFlagBitsKHR caps)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < s->hwctx->nb_qf; i++) {
|
|
||||||
if ((s->hwctx->qf[i].flags & family) &&
|
|
||||||
(s->hwctx->qf[i].video_caps & caps)) {
|
|
||||||
qf->queue_family = s->hwctx->qf[i].idx;
|
|
||||||
qf->nb_queues = s->hwctx->qf[i].num;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return AVERROR(ENOTSUP);
|
|
||||||
}
|
|
||||||
|
|
||||||
int ff_vk_create_view(FFVulkanContext *s, FFVkVideoCommon *common,
|
int ff_vk_create_view(FFVulkanContext *s, FFVkVideoCommon *common,
|
||||||
VkImageView *view, VkImageAspectFlags *aspect,
|
VkImageView *view, VkImageAspectFlags *aspect,
|
||||||
AVVkFrame *src, VkFormat vkf, int is_dpb)
|
AVVkFrame *src, VkFormat vkf, int is_dpb)
|
||||||
|
@ -63,12 +63,6 @@ VkVideoChromaSubsamplingFlagBitsKHR ff_vk_subsampling_from_av_desc(const AVPixFm
|
|||||||
*/
|
*/
|
||||||
VkVideoComponentBitDepthFlagBitsKHR ff_vk_depth_from_av_depth(int depth);
|
VkVideoComponentBitDepthFlagBitsKHR ff_vk_depth_from_av_depth(int depth);
|
||||||
|
|
||||||
/**
|
|
||||||
* Chooses a QF and loads it into a context.
|
|
||||||
*/
|
|
||||||
int ff_vk_video_qf_init(FFVulkanContext *s, FFVkQueueFamilyCtx *qf,
|
|
||||||
VkQueueFlagBits family, VkVideoCodecOperationFlagBitsKHR caps);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert level from Vulkan to AV.
|
* Convert level from Vulkan to AV.
|
||||||
*/
|
*/
|
||||||
|
@ -31,7 +31,7 @@ typedef struct AvgBlurVulkanContext {
|
|||||||
|
|
||||||
int initialized;
|
int initialized;
|
||||||
FFVkExecPool e;
|
FFVkExecPool e;
|
||||||
FFVkQueueFamilyCtx qf;
|
AVVulkanDeviceQueueFamily *qf;
|
||||||
VkSampler sampler;
|
VkSampler sampler;
|
||||||
FFVulkanShader shd;
|
FFVulkanShader shd;
|
||||||
|
|
||||||
@ -77,8 +77,14 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in)
|
|||||||
return AVERROR_EXTERNAL;
|
return AVERROR_EXTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ff_vk_qf_init(vkctx, &s->qf, VK_QUEUE_COMPUTE_BIT);
|
s->qf = ff_vk_qf_find(vkctx, VK_QUEUE_COMPUTE_BIT, 0);
|
||||||
RET(ff_vk_exec_pool_init(vkctx, &s->qf, &s->e, s->qf.nb_queues*4, 0, 0, 0, NULL));
|
if (!s->qf) {
|
||||||
|
av_log(ctx, AV_LOG_ERROR, "Device has no compute queues\n");
|
||||||
|
err = AVERROR(ENOTSUP);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
RET(ff_vk_exec_pool_init(vkctx, s->qf, &s->e, s->qf->num*4, 0, 0, 0, NULL));
|
||||||
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_LINEAR));
|
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_LINEAR));
|
||||||
RET(ff_vk_shader_init(vkctx, &s->shd, "avgblur",
|
RET(ff_vk_shader_init(vkctx, &s->shd, "avgblur",
|
||||||
VK_SHADER_STAGE_COMPUTE_BIT,
|
VK_SHADER_STAGE_COMPUTE_BIT,
|
||||||
|
@ -47,7 +47,7 @@ typedef struct BlendVulkanContext {
|
|||||||
|
|
||||||
int initialized;
|
int initialized;
|
||||||
FFVkExecPool e;
|
FFVkExecPool e;
|
||||||
FFVkQueueFamilyCtx qf;
|
AVVulkanDeviceQueueFamily *qf;
|
||||||
FFVulkanShader shd;
|
FFVulkanShader shd;
|
||||||
VkSampler sampler;
|
VkSampler sampler;
|
||||||
|
|
||||||
@ -141,8 +141,14 @@ static av_cold int init_filter(AVFilterContext *avctx)
|
|||||||
return AVERROR_EXTERNAL;
|
return AVERROR_EXTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ff_vk_qf_init(vkctx, &s->qf, VK_QUEUE_COMPUTE_BIT);
|
s->qf = ff_vk_qf_find(vkctx, VK_QUEUE_COMPUTE_BIT, 0);
|
||||||
RET(ff_vk_exec_pool_init(vkctx, &s->qf, &s->e, s->qf.nb_queues*4, 0, 0, 0, NULL));
|
if (!s->qf) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Device has no compute queues\n");
|
||||||
|
err = AVERROR(ENOTSUP);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
RET(ff_vk_exec_pool_init(vkctx, s->qf, &s->e, s->qf->num*4, 0, 0, 0, NULL));
|
||||||
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_NEAREST));
|
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_NEAREST));
|
||||||
RET(ff_vk_shader_init(vkctx, &s->shd, "blend",
|
RET(ff_vk_shader_init(vkctx, &s->shd, "blend",
|
||||||
VK_SHADER_STAGE_COMPUTE_BIT,
|
VK_SHADER_STAGE_COMPUTE_BIT,
|
||||||
|
@ -33,7 +33,7 @@ typedef struct BWDIFVulkanContext {
|
|||||||
|
|
||||||
int initialized;
|
int initialized;
|
||||||
FFVkExecPool e;
|
FFVkExecPool e;
|
||||||
FFVkQueueFamilyCtx qf;
|
AVVulkanDeviceQueueFamily *qf;
|
||||||
VkSampler sampler;
|
VkSampler sampler;
|
||||||
FFVulkanShader shd;
|
FFVulkanShader shd;
|
||||||
} BWDIFVulkanContext;
|
} BWDIFVulkanContext;
|
||||||
@ -65,8 +65,14 @@ static av_cold int init_filter(AVFilterContext *ctx)
|
|||||||
return AVERROR_EXTERNAL;
|
return AVERROR_EXTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ff_vk_qf_init(vkctx, &s->qf, VK_QUEUE_COMPUTE_BIT);
|
s->qf = ff_vk_qf_find(vkctx, VK_QUEUE_COMPUTE_BIT, 0);
|
||||||
RET(ff_vk_exec_pool_init(vkctx, &s->qf, &s->e, s->qf.nb_queues*4, 0, 0, 0, NULL));
|
if (!s->qf) {
|
||||||
|
av_log(ctx, AV_LOG_ERROR, "Device has no compute queues\n");
|
||||||
|
err = AVERROR(ENOTSUP);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
RET(ff_vk_exec_pool_init(vkctx, s->qf, &s->e, s->qf->num*4, 0, 0, 0, NULL));
|
||||||
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_NEAREST));
|
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_NEAREST));
|
||||||
|
|
||||||
RET(ff_vk_shader_init(vkctx, &s->shd, "bwdif",
|
RET(ff_vk_shader_init(vkctx, &s->shd, "bwdif",
|
||||||
|
@ -31,7 +31,7 @@ typedef struct ChromaticAberrationVulkanContext {
|
|||||||
|
|
||||||
int initialized;
|
int initialized;
|
||||||
FFVkExecPool e;
|
FFVkExecPool e;
|
||||||
FFVkQueueFamilyCtx qf;
|
AVVulkanDeviceQueueFamily *qf;
|
||||||
FFVulkanShader shd;
|
FFVulkanShader shd;
|
||||||
VkSampler sampler;
|
VkSampler sampler;
|
||||||
|
|
||||||
@ -88,8 +88,14 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in)
|
|||||||
return AVERROR_EXTERNAL;
|
return AVERROR_EXTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ff_vk_qf_init(vkctx, &s->qf, VK_QUEUE_COMPUTE_BIT);
|
s->qf = ff_vk_qf_find(vkctx, VK_QUEUE_COMPUTE_BIT, 0);
|
||||||
RET(ff_vk_exec_pool_init(vkctx, &s->qf, &s->e, s->qf.nb_queues*4, 0, 0, 0, NULL));
|
if (!s->qf) {
|
||||||
|
av_log(ctx, AV_LOG_ERROR, "Device has no compute queues\n");
|
||||||
|
err = AVERROR(ENOTSUP);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
RET(ff_vk_exec_pool_init(vkctx, s->qf, &s->e, s->qf->num*4, 0, 0, 0, NULL));
|
||||||
RET(ff_vk_init_sampler(vkctx, &s->sampler, 0, VK_FILTER_LINEAR));
|
RET(ff_vk_init_sampler(vkctx, &s->sampler, 0, VK_FILTER_LINEAR));
|
||||||
RET(ff_vk_shader_init(vkctx, &s->shd, "chromatic_abberation",
|
RET(ff_vk_shader_init(vkctx, &s->shd, "chromatic_abberation",
|
||||||
VK_SHADER_STAGE_COMPUTE_BIT,
|
VK_SHADER_STAGE_COMPUTE_BIT,
|
||||||
|
@ -38,7 +38,7 @@ typedef struct FlipVulkanContext {
|
|||||||
|
|
||||||
int initialized;
|
int initialized;
|
||||||
FFVkExecPool e;
|
FFVkExecPool e;
|
||||||
FFVkQueueFamilyCtx qf;
|
AVVulkanDeviceQueueFamily *qf;
|
||||||
FFVulkanShader shd;
|
FFVulkanShader shd;
|
||||||
VkSampler sampler;
|
VkSampler sampler;
|
||||||
} FlipVulkanContext;
|
} FlipVulkanContext;
|
||||||
@ -62,8 +62,14 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in, enum FlipType
|
|||||||
return AVERROR_EXTERNAL;
|
return AVERROR_EXTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ff_vk_qf_init(vkctx, &s->qf, VK_QUEUE_COMPUTE_BIT);
|
s->qf = ff_vk_qf_find(vkctx, VK_QUEUE_COMPUTE_BIT, 0);
|
||||||
RET(ff_vk_exec_pool_init(vkctx, &s->qf, &s->e, s->qf.nb_queues*4, 0, 0, 0, NULL));
|
if (!s->qf) {
|
||||||
|
av_log(ctx, AV_LOG_ERROR, "Device has no compute queues\n");
|
||||||
|
err = AVERROR(ENOTSUP);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
RET(ff_vk_exec_pool_init(vkctx, s->qf, &s->e, s->qf->num*4, 0, 0, 0, NULL));
|
||||||
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_LINEAR));
|
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_LINEAR));
|
||||||
RET(ff_vk_shader_init(vkctx, &s->shd, "flip",
|
RET(ff_vk_shader_init(vkctx, &s->shd, "flip",
|
||||||
VK_SHADER_STAGE_COMPUTE_BIT,
|
VK_SHADER_STAGE_COMPUTE_BIT,
|
||||||
|
@ -36,7 +36,7 @@ typedef struct GBlurVulkanContext {
|
|||||||
|
|
||||||
int initialized;
|
int initialized;
|
||||||
FFVkExecPool e;
|
FFVkExecPool e;
|
||||||
FFVkQueueFamilyCtx qf;
|
AVVulkanDeviceQueueFamily *qf;
|
||||||
VkSampler sampler;
|
VkSampler sampler;
|
||||||
FFVulkanShader shd_hor;
|
FFVulkanShader shd_hor;
|
||||||
FFVkBuffer params_hor;
|
FFVkBuffer params_hor;
|
||||||
@ -212,8 +212,14 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in)
|
|||||||
return AVERROR_EXTERNAL;
|
return AVERROR_EXTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ff_vk_qf_init(vkctx, &s->qf, VK_QUEUE_COMPUTE_BIT);
|
s->qf = ff_vk_qf_find(vkctx, VK_QUEUE_COMPUTE_BIT, 0);
|
||||||
RET(ff_vk_exec_pool_init(vkctx, &s->qf, &s->e, s->qf.nb_queues*4, 0, 0, 0, NULL));
|
if (!s->qf) {
|
||||||
|
av_log(ctx, AV_LOG_ERROR, "Device has no compute queues\n");
|
||||||
|
err = AVERROR(ENOTSUP);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
RET(ff_vk_exec_pool_init(vkctx, s->qf, &s->e, s->qf->num*4, 0, 0, 0, NULL));
|
||||||
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_LINEAR));
|
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_LINEAR));
|
||||||
|
|
||||||
desc = (FFVulkanDescriptorSetBinding []) {
|
desc = (FFVulkanDescriptorSetBinding []) {
|
||||||
|
@ -36,7 +36,7 @@ typedef struct NLMeansVulkanContext {
|
|||||||
|
|
||||||
int initialized;
|
int initialized;
|
||||||
FFVkExecPool e;
|
FFVkExecPool e;
|
||||||
FFVkQueueFamilyCtx qf;
|
AVVulkanDeviceQueueFamily *qf;
|
||||||
VkSampler sampler;
|
VkSampler sampler;
|
||||||
|
|
||||||
AVBufferPool *integral_buf_pool;
|
AVBufferPool *integral_buf_pool;
|
||||||
@ -652,8 +652,14 @@ static av_cold int init_filter(AVFilterContext *ctx)
|
|||||||
return AVERROR_EXTERNAL;
|
return AVERROR_EXTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ff_vk_qf_init(vkctx, &s->qf, VK_QUEUE_COMPUTE_BIT);
|
s->qf = ff_vk_qf_find(vkctx, VK_QUEUE_COMPUTE_BIT, 0);
|
||||||
RET(ff_vk_exec_pool_init(vkctx, &s->qf, &s->e, 1, 0, 0, 0, NULL));
|
if (!s->qf) {
|
||||||
|
av_log(ctx, AV_LOG_ERROR, "Device has no compute queues\n");
|
||||||
|
err = AVERROR(ENOTSUP);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
RET(ff_vk_exec_pool_init(vkctx, s->qf, &s->e, 1, 0, 0, 0, NULL));
|
||||||
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_NEAREST));
|
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_NEAREST));
|
||||||
|
|
||||||
RET(init_weights_pipeline(vkctx, &s->e, &s->shd_weights, s->sampler,
|
RET(init_weights_pipeline(vkctx, &s->e, &s->shd_weights, s->sampler,
|
||||||
|
@ -33,7 +33,7 @@ typedef struct OverlayVulkanContext {
|
|||||||
|
|
||||||
int initialized;
|
int initialized;
|
||||||
FFVkExecPool e;
|
FFVkExecPool e;
|
||||||
FFVkQueueFamilyCtx qf;
|
AVVulkanDeviceQueueFamily *qf;
|
||||||
FFVulkanShader shd;
|
FFVulkanShader shd;
|
||||||
VkSampler sampler;
|
VkSampler sampler;
|
||||||
|
|
||||||
@ -101,8 +101,14 @@ static av_cold int init_filter(AVFilterContext *ctx)
|
|||||||
return AVERROR_EXTERNAL;
|
return AVERROR_EXTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ff_vk_qf_init(vkctx, &s->qf, VK_QUEUE_COMPUTE_BIT);
|
s->qf = ff_vk_qf_find(vkctx, VK_QUEUE_COMPUTE_BIT, 0);
|
||||||
RET(ff_vk_exec_pool_init(vkctx, &s->qf, &s->e, s->qf.nb_queues*4, 0, 0, 0, NULL));
|
if (!s->qf) {
|
||||||
|
av_log(ctx, AV_LOG_ERROR, "Device has no compute queues\n");
|
||||||
|
err = AVERROR(ENOTSUP);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
RET(ff_vk_exec_pool_init(vkctx, s->qf, &s->e, s->qf->num*4, 0, 0, 0, NULL));
|
||||||
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_NEAREST));
|
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_NEAREST));
|
||||||
RET(ff_vk_shader_init(vkctx, &s->shd, "overlay",
|
RET(ff_vk_shader_init(vkctx, &s->shd, "overlay",
|
||||||
VK_SHADER_STAGE_COMPUTE_BIT,
|
VK_SHADER_STAGE_COMPUTE_BIT,
|
||||||
|
@ -39,7 +39,7 @@ typedef struct ScaleVulkanContext {
|
|||||||
|
|
||||||
int initialized;
|
int initialized;
|
||||||
FFVkExecPool e;
|
FFVkExecPool e;
|
||||||
FFVkQueueFamilyCtx qf;
|
AVVulkanDeviceQueueFamily *qf;
|
||||||
FFVulkanShader shd;
|
FFVulkanShader shd;
|
||||||
VkSampler sampler;
|
VkSampler sampler;
|
||||||
|
|
||||||
@ -142,8 +142,14 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in)
|
|||||||
return AVERROR_EXTERNAL;
|
return AVERROR_EXTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ff_vk_qf_init(vkctx, &s->qf, VK_QUEUE_COMPUTE_BIT);
|
s->qf = ff_vk_qf_find(vkctx, VK_QUEUE_COMPUTE_BIT, 0);
|
||||||
RET(ff_vk_exec_pool_init(vkctx, &s->qf, &s->e, s->qf.nb_queues*4, 0, 0, 0, NULL));
|
if (!s->qf) {
|
||||||
|
av_log(ctx, AV_LOG_ERROR, "Device has no compute queues\n");
|
||||||
|
err = AVERROR(ENOTSUP);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
RET(ff_vk_exec_pool_init(vkctx, s->qf, &s->e, s->qf->num*4, 0, 0, 0, NULL));
|
||||||
RET(ff_vk_init_sampler(vkctx, &s->sampler, 0, sampler_mode));
|
RET(ff_vk_init_sampler(vkctx, &s->sampler, 0, sampler_mode));
|
||||||
RET(ff_vk_shader_init(vkctx, &s->shd, "scale",
|
RET(ff_vk_shader_init(vkctx, &s->shd, "scale",
|
||||||
VK_SHADER_STAGE_COMPUTE_BIT,
|
VK_SHADER_STAGE_COMPUTE_BIT,
|
||||||
|
@ -33,7 +33,7 @@ typedef struct TransposeVulkanContext {
|
|||||||
|
|
||||||
int initialized;
|
int initialized;
|
||||||
FFVkExecPool e;
|
FFVkExecPool e;
|
||||||
FFVkQueueFamilyCtx qf;
|
AVVulkanDeviceQueueFamily *qf;
|
||||||
FFVulkanShader shd;
|
FFVulkanShader shd;
|
||||||
VkSampler sampler;
|
VkSampler sampler;
|
||||||
|
|
||||||
@ -61,8 +61,14 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in)
|
|||||||
return AVERROR_EXTERNAL;
|
return AVERROR_EXTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ff_vk_qf_init(vkctx, &s->qf, VK_QUEUE_COMPUTE_BIT);
|
s->qf = ff_vk_qf_find(vkctx, VK_QUEUE_COMPUTE_BIT, 0);
|
||||||
RET(ff_vk_exec_pool_init(vkctx, &s->qf, &s->e, s->qf.nb_queues*4, 0, 0, 0, NULL));
|
if (!s->qf) {
|
||||||
|
av_log(ctx, AV_LOG_ERROR, "Device has no compute queues\n");
|
||||||
|
err = AVERROR(ENOTSUP);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
RET(ff_vk_exec_pool_init(vkctx, s->qf, &s->e, s->qf->num*4, 0, 0, 0, NULL));
|
||||||
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_LINEAR));
|
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_LINEAR));
|
||||||
RET(ff_vk_shader_init(vkctx, &s->shd, "transpose",
|
RET(ff_vk_shader_init(vkctx, &s->shd, "transpose",
|
||||||
VK_SHADER_STAGE_COMPUTE_BIT,
|
VK_SHADER_STAGE_COMPUTE_BIT,
|
||||||
|
@ -41,7 +41,7 @@ typedef struct XFadeVulkanContext {
|
|||||||
|
|
||||||
int initialized;
|
int initialized;
|
||||||
FFVkExecPool e;
|
FFVkExecPool e;
|
||||||
FFVkQueueFamilyCtx qf;
|
AVVulkanDeviceQueueFamily *qf;
|
||||||
FFVulkanShader shd;
|
FFVulkanShader shd;
|
||||||
VkSampler sampler;
|
VkSampler sampler;
|
||||||
|
|
||||||
@ -335,8 +335,14 @@ static av_cold int init_vulkan(AVFilterContext *avctx)
|
|||||||
return AVERROR_EXTERNAL;
|
return AVERROR_EXTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ff_vk_qf_init(vkctx, &s->qf, VK_QUEUE_COMPUTE_BIT);
|
s->qf = ff_vk_qf_find(vkctx, VK_QUEUE_COMPUTE_BIT, 0);
|
||||||
RET(ff_vk_exec_pool_init(vkctx, &s->qf, &s->e, s->qf.nb_queues*4, 0, 0, 0, NULL));
|
if (!s->qf) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Device has no compute queues\n");
|
||||||
|
err = AVERROR(ENOTSUP);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
RET(ff_vk_exec_pool_init(vkctx, s->qf, &s->e, s->qf->num*4, 0, 0, 0, NULL));
|
||||||
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_NEAREST));
|
RET(ff_vk_init_sampler(vkctx, &s->sampler, 1, VK_FILTER_NEAREST));
|
||||||
RET(ff_vk_shader_init(vkctx, &s->shd, "xfade",
|
RET(ff_vk_shader_init(vkctx, &s->shd, "xfade",
|
||||||
VK_SHADER_STAGE_COMPUTE_BIT,
|
VK_SHADER_STAGE_COMPUTE_BIT,
|
||||||
|
@ -40,7 +40,7 @@ typedef struct TestSrcVulkanContext {
|
|||||||
|
|
||||||
int initialized;
|
int initialized;
|
||||||
FFVkExecPool e;
|
FFVkExecPool e;
|
||||||
FFVkQueueFamilyCtx qf;
|
AVVulkanDeviceQueueFamily *qf;
|
||||||
FFVulkanShader shd;
|
FFVulkanShader shd;
|
||||||
|
|
||||||
/* Only used by color_vulkan */
|
/* Only used by color_vulkan */
|
||||||
@ -82,8 +82,14 @@ static av_cold int init_filter(AVFilterContext *ctx, enum TestSrcVulkanMode mode
|
|||||||
return AVERROR_EXTERNAL;
|
return AVERROR_EXTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ff_vk_qf_init(vkctx, &s->qf, VK_QUEUE_COMPUTE_BIT);
|
s->qf = ff_vk_qf_find(vkctx, VK_QUEUE_COMPUTE_BIT, 0);
|
||||||
RET(ff_vk_exec_pool_init(vkctx, &s->qf, &s->e, s->qf.nb_queues*4, 0, 0, 0, NULL));
|
if (!s->qf) {
|
||||||
|
av_log(ctx, AV_LOG_ERROR, "Device has no compute queues\n");
|
||||||
|
err = AVERROR(ENOTSUP);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
RET(ff_vk_exec_pool_init(vkctx, s->qf, &s->e, s->qf->num*4, 0, 0, 0, NULL));
|
||||||
RET(ff_vk_shader_init(vkctx, &s->shd, "scale",
|
RET(ff_vk_shader_init(vkctx, &s->shd, "scale",
|
||||||
VK_SHADER_STAGE_COMPUTE_BIT,
|
VK_SHADER_STAGE_COMPUTE_BIT,
|
||||||
NULL, 0,
|
NULL, 0,
|
||||||
|
@ -104,8 +104,8 @@ typedef struct VulkanDevicePriv {
|
|||||||
void *libvulkan;
|
void *libvulkan;
|
||||||
|
|
||||||
FFVulkanContext vkctx;
|
FFVulkanContext vkctx;
|
||||||
FFVkQueueFamilyCtx compute_qf;
|
AVVulkanDeviceQueueFamily *compute_qf;
|
||||||
FFVkQueueFamilyCtx transfer_qf;
|
AVVulkanDeviceQueueFamily *transfer_qf;
|
||||||
|
|
||||||
/* Properties */
|
/* Properties */
|
||||||
VkPhysicalDeviceProperties2 props;
|
VkPhysicalDeviceProperties2 props;
|
||||||
@ -1904,8 +1904,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||||||
p->vkctx.hwctx = hwctx;
|
p->vkctx.hwctx = hwctx;
|
||||||
|
|
||||||
ff_vk_load_props(&p->vkctx);
|
ff_vk_load_props(&p->vkctx);
|
||||||
ff_vk_qf_init(&p->vkctx, &p->compute_qf, VK_QUEUE_COMPUTE_BIT);
|
p->compute_qf = ff_vk_qf_find(&p->vkctx, VK_QUEUE_COMPUTE_BIT, 0);
|
||||||
ff_vk_qf_init(&p->vkctx, &p->transfer_qf, VK_QUEUE_TRANSFER_BIT);
|
p->transfer_qf = ff_vk_qf_find(&p->vkctx, VK_QUEUE_TRANSFER_BIT, 0);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
av_free(qf_vid);
|
av_free(qf_vid);
|
||||||
@ -2789,18 +2789,18 @@ static int vulkan_frames_init(AVHWFramesContext *hwfc)
|
|||||||
if (!hwctx->unlock_frame)
|
if (!hwctx->unlock_frame)
|
||||||
hwctx->unlock_frame = unlock_frame;
|
hwctx->unlock_frame = unlock_frame;
|
||||||
|
|
||||||
err = ff_vk_exec_pool_init(&p->vkctx, &p->compute_qf, &fp->compute_exec,
|
err = ff_vk_exec_pool_init(&p->vkctx, p->compute_qf, &fp->compute_exec,
|
||||||
p->compute_qf.nb_queues, 0, 0, 0, NULL);
|
p->compute_qf->num, 0, 0, 0, NULL);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
err = ff_vk_exec_pool_init(&p->vkctx, &p->transfer_qf, &fp->upload_exec,
|
err = ff_vk_exec_pool_init(&p->vkctx, p->transfer_qf, &fp->upload_exec,
|
||||||
p->transfer_qf.nb_queues*2, 0, 0, 0, NULL);
|
p->transfer_qf->num*2, 0, 0, 0, NULL);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
err = ff_vk_exec_pool_init(&p->vkctx, &p->transfer_qf, &fp->download_exec,
|
err = ff_vk_exec_pool_init(&p->vkctx, p->transfer_qf, &fp->download_exec,
|
||||||
p->transfer_qf.nb_queues, 0, 0, 0, NULL);
|
p->transfer_qf->num, 0, 0, 0, NULL);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
@ -217,26 +217,17 @@ int ff_vk_load_props(FFVulkanContext *s)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vk_qf_get_index(FFVulkanContext *s, VkQueueFlagBits dev_family, int *nb)
|
AVVulkanDeviceQueueFamily *ff_vk_qf_find(FFVulkanContext *s,
|
||||||
|
VkQueueFlagBits dev_family,
|
||||||
|
VkVideoCodecOperationFlagBitsKHR vid_ops)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < s->hwctx->nb_qf; i++) {
|
for (int i = 0; i < s->hwctx->nb_qf; i++) {
|
||||||
if (s->hwctx->qf[i].flags & dev_family) {
|
if ((s->hwctx->qf[i].flags & dev_family) &&
|
||||||
*nb = s->hwctx->qf[i].num;
|
(s->hwctx->qf[i].video_caps & vid_ops) == vid_ops) {
|
||||||
return s->hwctx->qf[i].idx;
|
return &s->hwctx->qf[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return NULL;
|
||||||
av_assert0(0); /* Should never happen */
|
|
||||||
}
|
|
||||||
|
|
||||||
int ff_vk_qf_init(FFVulkanContext *s, FFVkQueueFamilyCtx *qf,
|
|
||||||
VkQueueFlagBits dev_family)
|
|
||||||
{
|
|
||||||
/* Fill in queue families from context if not done yet */
|
|
||||||
if (!s->nb_qfs)
|
|
||||||
load_enabled_qfs(s);
|
|
||||||
|
|
||||||
return (qf->queue_family = vk_qf_get_index(s, dev_family, &qf->nb_queues));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ff_vk_exec_pool_free(FFVulkanContext *s, FFVkExecPool *pool)
|
void ff_vk_exec_pool_free(FFVulkanContext *s, FFVkExecPool *pool)
|
||||||
@ -302,7 +293,7 @@ void ff_vk_exec_pool_free(FFVulkanContext *s, FFVkExecPool *pool)
|
|||||||
av_free(pool->contexts);
|
av_free(pool->contexts);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ff_vk_exec_pool_init(FFVulkanContext *s, FFVkQueueFamilyCtx *qf,
|
int ff_vk_exec_pool_init(FFVulkanContext *s, AVVulkanDeviceQueueFamily *qf,
|
||||||
FFVkExecPool *pool, int nb_contexts,
|
FFVkExecPool *pool, int nb_contexts,
|
||||||
int nb_queries, VkQueryType query_type, int query_64bit,
|
int nb_queries, VkQueryType query_type, int query_64bit,
|
||||||
const void *query_create_pnext)
|
const void *query_create_pnext)
|
||||||
@ -330,7 +321,7 @@ int ff_vk_exec_pool_init(FFVulkanContext *s, FFVkQueueFamilyCtx *qf,
|
|||||||
.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
|
||||||
.flags = VK_COMMAND_POOL_CREATE_TRANSIENT_BIT |
|
.flags = VK_COMMAND_POOL_CREATE_TRANSIENT_BIT |
|
||||||
VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,
|
VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,
|
||||||
.queueFamilyIndex = qf->queue_family,
|
.queueFamilyIndex = qf->idx,
|
||||||
};
|
};
|
||||||
ret = vk->CreateCommandPool(s->hwctx->act_dev, &cqueue_create,
|
ret = vk->CreateCommandPool(s->hwctx->act_dev, &cqueue_create,
|
||||||
s->hwctx->alloc, &pool->cmd_buf_pool);
|
s->hwctx->alloc, &pool->cmd_buf_pool);
|
||||||
@ -443,10 +434,9 @@ int ff_vk_exec_pool_init(FFVulkanContext *s, FFVkQueueFamilyCtx *qf,
|
|||||||
e->buf = pool->cmd_bufs[i];
|
e->buf = pool->cmd_bufs[i];
|
||||||
|
|
||||||
/* Queue index distribution */
|
/* Queue index distribution */
|
||||||
e->qi = i % qf->nb_queues;
|
e->qi = i % qf->num;
|
||||||
e->qf = qf->queue_family;
|
e->qf = qf->idx;
|
||||||
vk->GetDeviceQueue(s->hwctx->act_dev, qf->queue_family,
|
vk->GetDeviceQueue(s->hwctx->act_dev, qf->idx, e->qi, &e->queue);
|
||||||
e->qi, &e->queue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -99,11 +99,6 @@ typedef struct FFVkBuffer {
|
|||||||
uint8_t *mapped_mem;
|
uint8_t *mapped_mem;
|
||||||
} FFVkBuffer;
|
} FFVkBuffer;
|
||||||
|
|
||||||
typedef struct FFVkQueueFamilyCtx {
|
|
||||||
int queue_family;
|
|
||||||
int nb_queues;
|
|
||||||
} FFVkQueueFamilyCtx;
|
|
||||||
|
|
||||||
typedef struct FFVkExecContext {
|
typedef struct FFVkExecContext {
|
||||||
uint32_t idx;
|
uint32_t idx;
|
||||||
const struct FFVkExecPool *parent;
|
const struct FFVkExecPool *parent;
|
||||||
@ -393,10 +388,11 @@ const char *ff_vk_shader_rep_fmt(enum AVPixelFormat pix_fmt,
|
|||||||
int ff_vk_load_props(FFVulkanContext *s);
|
int ff_vk_load_props(FFVulkanContext *s);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Chooses a QF and loads it into a context.
|
* Chooses an appropriate QF.
|
||||||
*/
|
*/
|
||||||
int ff_vk_qf_init(FFVulkanContext *s, FFVkQueueFamilyCtx *qf,
|
AVVulkanDeviceQueueFamily *ff_vk_qf_find(FFVulkanContext *s,
|
||||||
VkQueueFlagBits dev_family);
|
VkQueueFlagBits dev_family,
|
||||||
|
VkVideoCodecOperationFlagBitsKHR vid_ops);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocates/frees an execution pool.
|
* Allocates/frees an execution pool.
|
||||||
@ -405,7 +401,7 @@ int ff_vk_qf_init(FFVulkanContext *s, FFVkQueueFamilyCtx *qf,
|
|||||||
* ff_vk_exec_pool_init_desc() MUST be called if ff_vk_exec_descriptor_set_add()
|
* ff_vk_exec_pool_init_desc() MUST be called if ff_vk_exec_descriptor_set_add()
|
||||||
* has been called.
|
* has been called.
|
||||||
*/
|
*/
|
||||||
int ff_vk_exec_pool_init(FFVulkanContext *s, FFVkQueueFamilyCtx *qf,
|
int ff_vk_exec_pool_init(FFVulkanContext *s, AVVulkanDeviceQueueFamily *qf,
|
||||||
FFVkExecPool *pool, int nb_contexts,
|
FFVkExecPool *pool, int nb_contexts,
|
||||||
int nb_queries, VkQueryType query_type, int query_64bit,
|
int nb_queries, VkQueryType query_type, int query_64bit,
|
||||||
const void *query_create_pnext);
|
const void *query_create_pnext);
|
||||||
|
Loading…
Reference in New Issue
Block a user