Shared Handles (#1619)
authorIlya Doroshenko <agrael@live.ru>
Tue, 19 Sep 2023 11:04:36 +0000 (13:04 +0200)
committerGitHub <noreply@github.com>
Tue, 19 Sep 2023 11:04:36 +0000 (13:04 +0200)
commit5d0d3b7bd9c2fa7b5485d16ecc76e90cee92dc02
treeaba3864ea17d0dca3085d3c3ec336eeaa4380a9a
parentd60453f6ea56f85a1e66c1ee565c66c659f4947f
Shared Handles (#1619)

* stage 1: added shared handles and all traits

* moved deleter to the shared part, now Shared handle weights 2 pointers

* Fixed Destroy Function

* generated headers

* At least no errors.

TODO: get image overload of shared handle back
make an example

* fixed all SFINAE issues, moved image specialization

* Added a sample

* made better example, added specialization for swapchain, added shared handles to readme

* Major update:
Fixed all wishes
Made std::shared_ptr do heavy lifting
Reduced code complexity
Added ParentType to basic handles
Added put and put_native for cross-abi usage

* more readme

* safer release()
removed put() for now

* better synchronization
inspired by STL shared_ptr implementation

* removed test shared pointer

* added forward type for better interop with VMA
added parent checking

* fixed getParent()

* added non-deleting overloads for Queue, DisplayKHR and PhysicalDevice

* Shared non-destoyed type now have handles

* using constructors are made to comply standard

* fixed leak

* shared handles migrated to own header,
made module entries

* header is independent now

* rebased repo, updated the example

* fixed most of the stuff

* renamed parent of, added guide to make shared handles

* vulkansc

* moved destructor to shared handle traits

* resolved issues with CI

* more relaxed memory ordering for release operation

* trying to remove submodule

* renamed to destructorType

* suppressed function cast warning

* only GCC should be affected
15 files changed:
README.md
VulkanHppGenerator.cpp
VulkanHppGenerator.hpp
samples/CMakeLists.txt
samples/SharedHandles/CMakeLists.txt [new file with mode: 0644]
samples/SharedHandles/SharedHandles.cpp [new file with mode: 0644]
snippets/SharedDestroy.hpp [new file with mode: 0644]
snippets/SharedHandle.hpp [new file with mode: 0644]
snippets/SharedHandleSpecializations.hpp [new file with mode: 0644]
vulkan/vulkan.cppm
vulkan/vulkan.hpp
vulkan/vulkan_shared.hpp [new file with mode: 0644]
vulkan/vulkansc.cppm
vulkan/vulkansc.hpp
vulkan/vulkansc_shared.hpp [new file with mode: 0644]