Commit graph

181 commits

Author SHA1 Message Date
Matthew Waters
c3685bafa4 vulkanviewconvert: clear the cached uniforms on caps change
Caps changes can change the output/input layout which needs to be
reflected in the input uniforms to the shader.
2019-12-05 03:21:21 +00:00
Matthew Waters
81d1e16b6b vulkan: move fullscreenquad object to library
It's useful and extensible enough to be used by us and other elements
2019-12-04 07:20:27 +00:00
Matthew Waters
24d096597b vulkan: implement caching and reuse of a couple of vulkan resources
Includes a new GstVulkanHandlePool base class for pooling different
resources togther.  The descriptor cache object is ported to
GstVulkanHandlePool with the exact same functionality.

A new GstVulkanFenceCache is also implemented for caching fences
which is used internally by GstVulkanDevice for creating or reusing
fences.

The existing GstVulkanTrashFenceList object now caches trash objects.
2019-11-28 23:27:21 +00:00
Matthew Waters
f810147709 vulkancolorconvert: disable YUY2 conversion
It doesn't work and never seemed to
2019-11-28 23:27:21 +00:00
Matthew Waters
615022ad93 vulkan: split vkfullscreenrender into two
Part 1 is a base class (vkvideofilter) that handles instance, device,
queue retrieval and holding that has been moved to the library
Part 2 is a fullscreenrenderquad that is still in the plugin that
performs all of the previous vulkan-specific functionality.
2019-11-28 23:27:21 +00:00
Matthew Waters
756d52ef15 vulkan/upload: allocate from the correct pool
Only relevant when upstream does not use our provided pool.
2019-11-28 23:27:21 +00:00
Matthew Waters
4f3051fd2d vulkan: add a couple of missing fence unrefs 2019-11-28 23:27:21 +00:00
Matthew Waters
a3454edeb2 vulkan/colorconvert: zero out sampler create struct 2019-11-28 23:27:21 +00:00
Matthew Waters
9f4b043161 vulkan/queue: be sure to take a lock around command submission
This ensures that only one thread is submitting commands at a time as
required by the Vulkan specification.
2019-11-14 07:10:16 +00:00
Matthew Waters
c89f21388d vulkan/render: fix indent command comment typo 2019-11-14 07:10:16 +00:00
Matthew Waters
726261aa05 vulkan: NULL check destruction of vulkan resources
If the element fails to start up, any number of vulkan resources could
have not been created.
2019-11-13 22:27:59 +00:00
Matthew Waters
0c3eec57f2 vulkan: make new trash objects ref the fence
Avoids gst_vulkan_fence_ref at each call site of the trash object
creation
2019-11-13 22:27:59 +00:00
Matthew Waters
32b3387ae6 vulkan: implement proper descriptor set handling
The major functionality gain this provides is proper reference counting
for a descriptor set.  Overall this allows us to create descriptor sets
when they are needed (or reused from a cache) without violating any of
vulkan's object synchronisation requirements.

As there are a fixed number of sets available in a pool, the number of
descriptors in elements is currently hardcoded to 32.  This can be extended
in a future change to create pools on the fly if that limit is ever overrun.
2019-11-07 20:01:57 +00:00
Matthew Waters
1c89096b4f vulkan/fence: add always-signalled fence type
Allows a cleaner control flow when there is no fence available for use
with the trash list.  An always signalled fence type will always return
TRUE for gst_vulkan_fence_is_signalled.
2019-11-07 20:01:57 +00:00
Matthew Waters
66244e9342 vulkanviewconvert: fix typo of output image view name 2019-11-07 20:01:57 +00:00
Matthew Waters
7a1bb3001a vulkan: use VK_NULL_HANDLE in more places
Fixes compiler warnings on 32-bit platforms assigning a void * to a
64-bit integer value.
2019-11-07 20:01:57 +00:00
Matthew Waters
475a2b0acd vulkan/image: use the full video info for returning vulkan formats
We may need some colorspace information for returning sRGB vs no sRGB.
2019-11-07 20:01:57 +00:00
Yeongjin Jeong
56333073a9 vulkan: Fix build error when gstvulkan is not installed
The following build error occurs:

vkdeviceprovider.h:30:10: fatal error: gst/vulkan/vulkan.h: No such file or directory
  #include <gst/vulkan/vulkan.h>
           ^~~~~~~~~~~~~~~~~~~~~
2019-11-07 03:31:19 +00:00
Aaron Boxer
6d3429af34 documentation: fixed a heap o' typos 2019-11-05 09:11:25 -05:00
Matthew Waters
ecca6cbfd2 vulkanimage: move fence creation earlier
Fixes a critical:

GStreamer-CRITICAL **: 02:26:34.698: gst_mini_object_ref: assertion 'mini_object != NULL' failed
2019-10-28 07:22:45 +00:00
Matthew Waters
103112725c vulkan: change to clamp to edge rather than clamp to border
clamp-to-border will return the border color which is typically black,
white or transparent.  When linear filtering the edge pixels will
typeically be combined with the border color which is not typically what
we want.  Especially when color converting, this removes a green box
around the edge when converting YUV->RGB.
2019-10-28 07:22:45 +00:00
Matthew Waters
34ff895040 vulkan: remove VkImageView from the memory
There can be multiple views per image for different subresource ranges
or planes in multi-planer images.
2019-09-25 11:11:02 +00:00
Matthew Waters
452bb72292 vkbuffer: remove buffer view from the memory
It's only really useful for texture buffers which we currently do not
use.
2019-09-25 11:11:02 +00:00
Matthew Waters
82e86573b8 vulkan: implement command buffer reuse
Using a similar design for reference counting as
GstBuffer/GstBufferPool.
2019-09-19 02:01:35 +00:00
Matthew Waters
2af2402880 vulkan: add device provider implementation 2019-09-17 13:02:44 +10:00
Matthew Waters
66ed62b794 vulkansink: attempt a context query for a device 2019-09-17 13:02:44 +10:00
Matthew Waters
5f76c84feb vulkan: split physical device from logical device 2019-09-17 13:02:44 +10:00
Matthew Waters
407dab607f vulkan: only pass the device/instance/display in to *_handle_*() functions
We don't need to change the pointer value in these functions.
2019-09-17 13:02:43 +10:00
Yeongjin Jeong
8bc5144020 vulkan: Don't dereference null pointer when printing error
When printing error message because the function failed, the GError variable
may not be used and it can be NULL.
2019-08-29 11:19:37 +00:00
Matthew Waters
d9248560e4 vulkancolorconvert: explicitly initalize swizzle arrays
Fixes uninitialized access of the indexed values larger than
the number of planes in the video format.
2019-08-28 10:34:39 +00:00
Matthew Waters
833c596bc5 vulkan/fullscreenrender: free the attachment descriptions
Fixes a memory leak of the attachment descriptions we receive from the
subclass.
2019-08-22 14:57:02 +10:00
Matthew Waters
837cdd598a vulkanviewconvert: perform a renegotiation on multiview mode/flag property changes
Otherwise changing the output* properties have no effect until someone else
performs a renegotiation.
2019-08-22 11:51:01 +10:00
Matthew Waters
e5d574534c shaders/view-convert: remove some debugging colours
Fixes left and right output modes.
2019-08-22 11:50:51 +10:00
Seungha Yang
6b6bb6b203 vulkan: Fix incompatible type build warning
Make declare/define a function consistent.
Note that GstBaseTransform::set_caps should return gboolean

Compiling C object subprojects/gst-plugins-bad/ext/vulkan/f3f9d6b@@gstvulkan@sha/vkviewconvert.c.obj.
../subprojects/gst-plugins-bad/ext/vulkan/vkviewconvert.c(644):
  warning C4133: '=': incompatible types - from 'GstFlowReturn (__cdecl *)(GstBaseTransform *,GstCaps *,GstCaps *)'
  to 'gboolean (__cdecl *)(GstBaseTransform *,GstCaps *,GstCaps *)'
2019-07-09 01:42:58 +00:00
Matthew Waters
014642e188 vulkan: add view converter element 2019-07-05 15:04:28 +10:00
Matthew Waters
6ebaf7276e vulkan: fix output framebuffer creation size
We don't scale when color converting so there is no impact.
2019-07-05 10:47:45 +10:00
Matthew Waters
69af8a9360 vulkan: move swapper object to the gstvulkan library
Allows other sinks and/or user code to display to a VkSurface
2019-07-04 14:18:15 +10:00
Matthew Waters
b5256d94fc vulkan: move trash list to library 2019-07-04 14:18:15 +10:00
Matthew Waters
ec9ea06591 vkswapper: support rescaling to the output size 2019-06-24 16:23:29 +10:00
Matthew Waters
35325fdffb vksink: Don't take vulkan buffer's as input 2019-06-24 16:23:29 +10:00
Matthew Waters
dcff70d6bf vulkan: remove unused downsample AYUV shader 2019-06-20 05:44:47 +00:00
Matthew Waters
d43fea06c5 vkcolorconvert: add support for RGB<->NV12 2019-06-20 01:41:56 +10:00
Matthew Waters
0cb416db11 vkbuffermemory: report requested size of the memory
Rather than using Vulkan's much larger aligned sizes. Fixes multi-planer
video with the GstVideoFrame API.
2019-06-20 01:41:56 +10:00
Matthew Waters
2180fbb498 vulkancolorconvert: support RGB <-> AYUV/YUY2/UYVY 2019-06-20 01:41:56 +10:00
Matthew Waters
dbf60a1738 vktrash: add mini_object_unref destroy function 2019-06-20 01:41:56 +10:00
Matthew Waters
b93de8b0d8 vkfullscreenrender: create descriptor sets later
The desciptor sets may be dependant on the caps
2019-06-20 01:41:56 +10:00
Matthew Waters
2e34dd891d vulkan/shaders: change glslc compilation args based on configurations
Add depfile support so that modifying an #included glsl snippet
rebuilds all the dependant shaders.
2019-06-20 01:41:56 +10:00
Matthew Waters
5363b30f6c vulkan: add a color conversion element
Currently converts between all 4-component RGBA/RGBx formats.
2019-06-20 01:41:56 +10:00
Matthew Waters
31728880fe vkupload: Also implement copying non vulkan memory into vulkan buffers
The only way we can upload things is through our memory so any
non-vulkan memory that appears must be copied into our memory.
2019-06-20 01:41:56 +10:00
Matthew Waters
3fef510c48 vulkan: add download element
Currently only downloads images into a host-visible buffer and
synchronises immediately.
2019-06-20 01:41:56 +10:00