Commit Graph

11 Commits

Author SHA1 Message Date
Lynne
eb5088d28c
vulkan_filter: require storage images properly, set usage flags explicitly
This caused images to be created without a storage usage, which broke
at least lavapipe.
2024-09-09 07:05:44 +02:00
Lynne
a797317ab1
vulkan_filter: don't require the storage flag for the base frames format
We check for whether subformats support storage immediately below.
Those are the ones we require storage for, rather than the base format
itself.

This permits better reuse of AVHWFrame contexts.

The patch also removes an always-false check in the subformat check.
2024-08-16 01:22:17 +02:00
Lynne
b165f144e7
vulkan_filter: allow reusing frame contexts with DRM tiling
There's no reason not to permit this, particularly if a user wants
to manipulate images which will be exported back to DRM.
2024-08-16 01:22:17 +02:00
Lynne
18d964fc2c
vulkan: enable encoding of images if video_maintenance1 is enabled
Vulkan encoding was designed in a very... consolidated way.
You had to know the exact codec and profile that the image was going to
eventually be encoded as at... image creation time. Unfortunately, as good
as our code is, glimpsing into the exact future isn't what its capable of.

video_maintenance1 removed that requirement, which only then made encoding
images practically possible.
2024-08-16 01:22:16 +02:00
Anton Khirnov
7f17e0e6dd lavfi: move AVFilterLink.hw_frames_ctx to FilterLink 2024-08-15 19:34:24 +02:00
Haihao Xiang
eb7d019b32 lavfi/vulkan_filter: fix input format
Otherwise s->input_format is always yuv420p.

This fixes invalid output format for hwframe download in the command
below:
./ffmpeg -init_hw_device vulkan -f lavfi \
	-i testsrc=duration=1,format=nv12 \
	-vf 'hwupload,format=vulkan,scale_vulkan=1024:768,hwdownload,format=nv12' \
	-f null -

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2024-03-08 10:10:51 +08:00
Andreas Rheinhardt
e429b0fdb7 avutil/vulkan: Don't autoinclude vulkan_loader.h
Only include it where necessary.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-03 22:55:26 +01:00
Andreas Rheinhardt
f62c441e7a avfilter/vulkan_filter: Remove unused label
Unused since 81cc0e1345.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-06 12:28:45 +02:00
Lynne
81cc0e1345
hwcontext_vulkan: properly support STORAGE usage for mutliplane images
Fixes multiplane support on Nvidia.

Also, remove the ENCODE usage, even if the driver signals it as supported.
Currently, it's not used, and when it is used, it'll be gated behind
two extension checks.
2023-10-05 23:50:30 +02:00
Lynne
05ce6473ac
lavfi: add lavfi-only Vulkan infrastructure 2023-05-29 00:41:51 +02:00
Lynne
f6dd30df24
lavfi/vulkan: split off lavfi-specific code into vulkan_filter.c
The issue is that libavfilter depends on libavcodec, and when doing a
static build, if libavcodec also includes "libavfilter/vulkan.c", then
during link-time, compiling programs will fail as there would be multiple
definitions of the same symbols in both libavfilter and libavcodec's
object files.
Linkers are, however, more permitting if both files that include
a common file that's used as a template are one-to-one identical.
Hence, to make both files the same in the future, export all avfilter
specific functions to a separate file.
There is some work in progress to make templated files like this be
compiled only once, so this is not a long-term solution.

This also removes a macro that could be used to toggle SPIRV compilation
capability on #include-time, as this could cause the files to be different.
2021-11-19 16:47:26 +01:00