aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/vulkan.c
Commit message (Collapse)AuthorAgeFilesLines
* all: fix typos found by codespellTimo Rothenpieler25 hours1-1/+1
|
* avutil/hwcontext_vulkan: don't over-map buffers with prior paddingNiklas Haas2025-07-151-1/+2
| | | | | | | | | | | | | If the image data is not at the start of the buffer allocation, such as when the buffer has padding before the image data, this function maps too much memory, since src_data + src_buf->size exceeds the buffer size. Fix this by subtracting the difference between the buffer start and the provided image data pointer from the size of the memory range to map. An easy way to reproduce this issue is using the vf_pad filter, which allocates image data buffers with a nonzero offset whenever padding is requested before the start of the image data.
* vulkan: maintain compatibility with old headersLynne2025-06-171-1/+1
| | | | Previous patch to fix these issues was incomplete.
* vulkan: maintain compatibility with older headersLynne2025-06-121-1/+1
|
* hwcontext_vulkan: fix image copyLynne2025-06-111-1/+3
| | | | | The patch was applied by mistake in an unfinished form. This fixes the build and lets the code run.
* vulkan: fix leak in FFVkExecPoolaverne2025-06-111-0/+2
|
* hwcontext_vulkan: use host image copyLynne2025-06-111-0/+35
|
* avutil/vulkan: automatically enable shader device address usage bitNiklas Haas2025-05-281-0/+10
| | | | | We require this internally when using descriptor buffers, so it makes sense to enable it internally, also.
* avutil/vulkan: add YUVA pixel formats supportNiklas Haas2025-05-281-2/+13
| | | | | Signed-off-by: Niklas Haas <git@haasn.dev> Sponsored-by: nxtedition
* hwcontext_vulkan: support AV_PIX_FMT_GBRPLynne2025-05-011-2/+4
| | | | | Support was partially added previously in vulkan.c, but now it's fully supported.
* vulkan: use _KHR suffix for push descriptor properties struct IDLynne2025-04-231-1/+1
|
* vulkan: move OPT_CHAIN out of hwcontext_vulkanLynne2025-04-221-48/+28
| | | | | | This allows for it to be shared. Technically, implementations should not give drivers structs that the drivers are not familiar with.
* vulkan: check that the max number of push descriptors is not exceededLynne2025-04-221-5/+10
| | | | | | Just correctness. We don't exceed this on any known hardware, but its better to check. If we do, we simply fall back to regular descriptors.
* vulkan: move feature<->usage mapping code outside of hwcontext_vulkan.cLynne2025-04-221-0/+34
| | | | | Allows for it to be reused. In particular, for a future patch to make vulkan hwaccels output DMABUF-backed VkImages.
* vulkan: drop bgr_workaroundLynne2025-04-191-37/+0
| | | | | | | | | | | | | Vulkan's main issue around using BGR is simple. The letters in the shader don't match up (rgba in shader, bgra in format). So of course, rather than allowing "bgra" or other permutations of formats in the shader, they went the nuclear option and spent months writing an extension to get rid of the need to have a format in the shader to begin with. All this to solve a problem that should never have existed to begin with. This fixes BGRA images since enabling WithoutFormat, as the GPU now remaps without your involvement.
* vulkan: always enable ReadWithoutFormat/WriteWithoutFormatLynne2025-04-191-5/+11
| | | | | | | | | | | | This implements support for reading and writing storage images with no format. The issue is that we define our images as arrays, and arrays can only have a single type, which means that f.ex. NV12 needs two different images, R8 and RG8. The only driver known not to advertise support for the extension as a whole is Intel, because they have parial support for odd formats we never use. Therefore, just always enable it by default.
* vulkan: use a single command buffer per command buffer poolLynne2025-04-161-32/+46
| | | | | | | | | | We violated the spec, which, despite the actual command buffer pool *not* being involved in any functions which require external synchronization of the pool, *require* external synchronization even if only the command buffers are used. This also has the effect of *significantly* speeding up execution in case command buffers are contended.
* vulkan: add support for expect/assumeLynne2025-04-141-0/+6
| | | | | | This commit adds support for compiler hints. While on AMD these are not used/needed, Nvidia benefits from them, and gives a sizeable 10% speedup on 4k.
* vulkan: fix logging level when erroring upon creating shader moduleLynne2025-04-141-1/+1
|
* lavu/vulkan: skip adding NULL buffers as deps in ff_vk_exec_add_dep_bufLynne2025-03-271-0/+3
| | | | Allows for cleaner code.
* vulkan: add support for AV_PIX_FMT_GBRAP32Lynne2025-03-171-1/+11
|
* vulkan: add ff_vk_exec_add_dep_wait_sem()Lynne2025-03-171-8/+20
| | | | | This adds a function which adds a regular timeline semaphore as a wait-only dependency.
* vulkan: unify handling of BGR and simplify ffv1_rctLynne2025-03-171-0/+46
|
* vulkan: workaround BGR storage image undefined behaviourLynne2025-03-171-0/+25
|
* vulkan: copy host-mapping buffer code from hwcontextLynne2025-03-171-2/+161
| | | | This is useful elsewhere.
* vulkan: add ff_vk_create_imageviewLynne2025-03-171-0/+51
|
* vulkan: rename ff_vk_set_descriptor_image to ff_vk_shader_update_imgLynne2025-03-171-17/+17
|
* avutil/vulkan: Remove unused ff_vk_create_avbuf()Andreas Rheinhardt2025-03-111-35/+0
| | | | | | | Unused since aea4d4b423c62aecf326ef3ae1578710faa3eca6. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* vulkan: take refs of frames using the regular buffer ref pathLynne2025-03-031-6/+14
| | | | | | | | | | | This simplifies the code, reduces allocations, and critically, does not store references of frames, along with references to hw_frames_ctx. The issue was that storing refs to frames while transferring stored refs to hw_frames_ctx of frames, and so created a circular dependency, which caused the Vulkan device to never be terminated. This only stores what it strictly needs as a dependency, and enables the frames context to be freed, even while doing asynchronous transfers.
* vulkan: add support for AV_PIX_FMT_GRAY32Lynne2025-03-011-3/+4
|
* libavutil/vulkan: Expose ff_vk_set_descriptor_imageIndecisiveTurtle2025-02-281-6/+6
| | | | Useful when creating a descriptor array of separate images
* vulkan: add .buf_elems to FFVulkanDescriptorSetLynne2025-02-211-2/+2
| | | | | | | | | | This enables users to specify a number that would be appended to the buf_content string. Saves users from needing to manually print to a string. An earlier commit tried doing this via .elems, but it was faulty, as this also incremented the total number of descriptors in the descriptor set.
* vulkan: don't query video queue properties unless the extension is enabledLynne2025-02-211-1/+1
| | | | Fixes validation errors.
* vulkan: fix crash in ff_vk_shader_freeLynne2025-02-181-4/+6
| | | | | The issue is if a shader fails to compile, shd->desc_layout would not exist, but nb_descriptor_sets would.
* vulkan: enable using .elems field for buffer content definitionsLynne2025-01-221-3/+11
| | | | | This avoids needing to snprintf when the buffer only contains an array of a struct, while letting the validation layers detect errors more reliably.
* vulkan: do not reinvent a queue context structLynne2024-12-231-22/+12
| | | | | | | | | | 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.
* vulkan: remove pointless mutex locksLynne2024-12-231-12/+0
| | | | | | | | | This code was simply incorrect through and through. It did not protect what actually has to be protected in a multi-threaded setup. Perhaps it was used to silence threading errors? Either way, remove it, and document the correct way to use execution pools in a threaded environment.
* vulkan: fix use of atomics for the current context indexLynne2024-11-281-11/+3
| | | | | | | | | The code used to use atomic, but over time, this got broken. This commit also remmoves the is-the-last-submission-ready shortcut, which rarely did anything. There's also value in relying on the fact that contexts always carry their frames in a strictly incremental order with no gaps.
* vulkan: only wait for fences on uninit if the context had a submissionLynne2024-11-261-1/+2
| | | | This fixes a potential deadlock on exit.
* vulkan: zero out AVBufferRef in case of failureLynne2024-11-261-0/+4
| | | | | This resulted in uninit errors and was never caught as we generally did not use massive allocations before.
* vulkan: only apply shortcut for next context selection if selection has a ↵Lynne2024-11-261-1/+2
| | | | submission
* hwcontext_vulkan: add support for AV_PIX_FMT_GBRAP10/12/14Lynne2024-11-261-1/+6
|
* hwcontext_vulkan: add support for AV_PIX_FMT_GBRP12/14/16Lynne2024-11-261-1/+5
|
* hwcontext_vulkan: add support for AV_PIX_FMT_GRAY10/12/14Lynne2024-11-261-0/+3
|
* vulkan: fix sw_frame_deps counterLynne2024-11-201-0/+2
| | | | | | The code used as a basis was the buffer dependency code, where the counter was incremented after each buffer, but for the sw_frame dep API, we only support adding individual frames at a time.
* vulkan: add ff_vk_exec_add_dep_sw_frameLynne2024-11-181-0/+26
| | | | | Some software frames may be mapped, and we'd like to have them as proper dependencies.
* vulkan: retrieve Vulkan 1.1 propertiesLynne2024-11-181-1/+5
| | | | Required to know the subgroup size.
* vulkan: fix printing descriptors to shader for shaders with no descriptorsLynne2024-11-181-1/+1
|
* vulkan: add support for 10-bit planar RGBLynne2024-11-181-0/+2
|
* hwcontext_vulkan: fix planar RGB imagesLynne2024-11-181-7/+20
| | | | They were non-working for quite a while.