This commit is contained in:
2025-09-10 04:09:26 +03:00
parent 1e060cba27
commit fd9d39bf8b
163 changed files with 14832 additions and 1030 deletions
+3
View File
@@ -3,3 +3,6 @@
/Test/VulkanWrapperSandbox/x64
/build
/out
/Tools/VulkanWrapperGenerator/.vs
/Tools/VulkanWrapperGenerator/bin
/Tools/VulkanWrapperGenerator/obj
+3 -1
View File
@@ -87,6 +87,8 @@
"random": "cpp",
"regex": "cpp",
"variant": "cpp",
"vulkan_raii.hpp": "c"
"vulkan_raii.hpp": "c",
"vulkanfunctions.hpp": "c",
"intrusiveptr.h": "c"
}
}
+8 -1
View File
@@ -4,8 +4,15 @@
#include <vulkan/vulkan_win32.h>
#endif
#include <VulkanPP/VulkanFunctions.hpp>
bool Renderer::Init() {
_vulkanLibrary = std::make_shared<VulkanDynamicLibrary>();
VulkanPP::vk.loadGlobal();
//_vulkanLibrary = std::make_shared<VulkanDynamicLibrary>();
auto layers = _vulkanLibrary->getSupportedLayers();
+7 -6
View File
@@ -10,8 +10,9 @@
#include <memory>
#include <dxgidebug.h>
#include <sstream>
#include <RenderFramework/Vulkan/VulkanDynamicLibrary.h>
#include <RenderFramework/Vulkan/VulkanLogicalDevice.h>
#include <VulkanPP/Device.hpp>
#include <wrl.h>
#include <optional>
@@ -22,7 +23,7 @@ class Renderer {
public:
bool Init();
PVulkanLogicalDevice GetLogicalDevice();
VulkanPP::PDevice GetLogicalDevice();
//ComPtr<IDXGIAdapter1> GetAdapter() {
// return dxgiAdapter;
@@ -42,9 +43,9 @@ public:
//std::shared_ptr<D3d12DescriptorHeapAllocator> getSrvDescriptorsAllocator();
private:
std::shared_ptr<VulkanDynamicLibrary> _vulkanLibrary;
IntrusivePtr<VulkanInstance> _vulkanInstance;
PVulkanLogicalDevice _logicalDevice;
//std::shared_ptr<VulkanDynamicLibrary> _vulkanLibrary;
//IntrusivePtr<VulkanInstance> _vulkanInstance;
VulkanPP::PDevice _logicalDevice;
std::optional<std::uint32_t> _graphicsQueueFamilyIndex;
std::optional<std::uint32_t> _presentQueueFamilyIndex;
+110 -55
View File
@@ -2,7 +2,7 @@
include(VulkanTools)
Vulkan_generateFunctionsFile("${CMAKE_CURRENT_LIST_DIR}")
#Vulkan_generateFunctionsFile("${CMAKE_CURRENT_LIST_DIR}")
add_library(VulkanWrapper INTERFACE)
@@ -13,62 +13,115 @@ INTERFACE
target_sources(VulkanWrapper
INTERFACE
Application.cpp
Application.h
CMakeLists.txt
DynamicLibrary.cpp
DynamicLibrary.h
FragmentShader_unknown.h
FunctionTraits.h
Generated/VulkanPP/AccelerationStructureKHR.cpp
Generated/VulkanPP/AccelerationStructureKHR.hpp
Generated/VulkanPP/AccelerationStructureNV.cpp
Generated/VulkanPP/AccelerationStructureNV.hpp
Generated/VulkanPP/Buffer.cpp
Generated/VulkanPP/Buffer.hpp
#Generated/VulkanPP/BufferCollectionFUCHSIA.cpp
#Generated/VulkanPP/BufferCollectionFUCHSIA.hpp
Generated/VulkanPP/BufferView.cpp
Generated/VulkanPP/BufferView.hpp
Generated/VulkanPP/CommandBuffer.cpp
Generated/VulkanPP/CommandBuffer.hpp
Generated/VulkanPP/CommandPool.cpp
Generated/VulkanPP/CommandPool.hpp
Generated/VulkanPP/CudaFunctionNV.cpp
Generated/VulkanPP/CudaFunctionNV.hpp
Generated/VulkanPP/CudaModuleNV.cpp
Generated/VulkanPP/CudaModuleNV.hpp
Generated/VulkanPP/CuFunctionNVX.cpp
Generated/VulkanPP/CuFunctionNVX.hpp
Generated/VulkanPP/CuModuleNVX.cpp
Generated/VulkanPP/CuModuleNVX.hpp
Generated/VulkanPP/DebugReportCallbackEXT.cpp
Generated/VulkanPP/DebugReportCallbackEXT.hpp
Generated/VulkanPP/DebugUtilsMessengerEXT.cpp
Generated/VulkanPP/DebugUtilsMessengerEXT.hpp
Generated/VulkanPP/DeferredOperationKHR.cpp
Generated/VulkanPP/DeferredOperationKHR.hpp
Generated/VulkanPP/DescriptorPool.cpp
Generated/VulkanPP/DescriptorPool.hpp
Generated/VulkanPP/DescriptorSet.cpp
Generated/VulkanPP/DescriptorSet.hpp
Generated/VulkanPP/DescriptorSetLayout.cpp
Generated/VulkanPP/DescriptorSetLayout.hpp
Generated/VulkanPP/DescriptorUpdateTemplate.cpp
Generated/VulkanPP/DescriptorUpdateTemplate.hpp
Generated/VulkanPP/Device.cpp
Generated/VulkanPP/Device.hpp
Generated/VulkanPP/DeviceMemory.cpp
Generated/VulkanPP/DeviceMemory.hpp
Generated/VulkanPP/DisplayKHR.cpp
Generated/VulkanPP/DisplayKHR.hpp
Generated/VulkanPP/DisplayModeKHR.cpp
Generated/VulkanPP/DisplayModeKHR.hpp
Generated/VulkanPP/Event.cpp
Generated/VulkanPP/Event.hpp
Generated/VulkanPP/ExternalComputeQueueNV.cpp
Generated/VulkanPP/ExternalComputeQueueNV.hpp
Generated/VulkanPP/Fence.cpp
Generated/VulkanPP/Fence.hpp
Generated/VulkanPP/Framebuffer.cpp
Generated/VulkanPP/Framebuffer.hpp
Generated/VulkanPP/Image.cpp
Generated/VulkanPP/Image.hpp
Generated/VulkanPP/ImageView.cpp
Generated/VulkanPP/ImageView.hpp
Generated/VulkanPP/IndirectCommandsLayoutEXT.cpp
Generated/VulkanPP/IndirectCommandsLayoutEXT.hpp
Generated/VulkanPP/IndirectCommandsLayoutNV.cpp
Generated/VulkanPP/IndirectCommandsLayoutNV.hpp
Generated/VulkanPP/IndirectExecutionSetEXT.cpp
Generated/VulkanPP/IndirectExecutionSetEXT.hpp
Generated/VulkanPP/Instance.cpp
Generated/VulkanPP/Instance.hpp
Generated/VulkanPP/MicromapEXT.cpp
Generated/VulkanPP/MicromapEXT.hpp
Generated/VulkanPP/OpticalFlowSessionNV.cpp
Generated/VulkanPP/OpticalFlowSessionNV.hpp
Generated/VulkanPP/PhysicalDevice.cpp
Generated/VulkanPP/PhysicalDevice.hpp
Generated/VulkanPP/Pipeline.cpp
Generated/VulkanPP/Pipeline.hpp
Generated/VulkanPP/PipelineCache.cpp
Generated/VulkanPP/PipelineCache.hpp
Generated/VulkanPP/PipelineLayout.cpp
Generated/VulkanPP/PipelineLayout.hpp
Generated/VulkanPP/PrivateDataSlot.cpp
Generated/VulkanPP/PrivateDataSlot.hpp
Generated/VulkanPP/QueryPool.cpp
Generated/VulkanPP/QueryPool.hpp
Generated/VulkanPP/Queue.cpp
Generated/VulkanPP/Queue.hpp
Generated/VulkanPP/RenderPass.cpp
Generated/VulkanPP/RenderPass.hpp
Generated/VulkanPP/Sampler.cpp
Generated/VulkanPP/Sampler.hpp
Generated/VulkanPP/SamplerYcbcrConversion.cpp
Generated/VulkanPP/SamplerYcbcrConversion.hpp
Generated/VulkanPP/Semaphore.cpp
Generated/VulkanPP/Semaphore.hpp
Generated/VulkanPP/ShaderEXT.cpp
Generated/VulkanPP/ShaderEXT.hpp
Generated/VulkanPP/ShaderModule.cpp
Generated/VulkanPP/ShaderModule.hpp
Generated/VulkanPP/SurfaceKHR.cpp
Generated/VulkanPP/SurfaceKHR.hpp
Generated/VulkanPP/SwapchainKHR.cpp
Generated/VulkanPP/SwapchainKHR.hpp
Generated/VulkanPP/ValidationCacheEXT.cpp
Generated/VulkanPP/ValidationCacheEXT.hpp
Generated/VulkanPP/VideoSessionKHR.cpp
Generated/VulkanPP/VideoSessionKHR.hpp
Generated/VulkanPP/VideoSessionParametersKHR.cpp
Generated/VulkanPP/VideoSessionParametersKHR.hpp
Generated/VulkanPP/VulkanFunctions.cpp
Generated/VulkanPP/VulkanFunctions.hpp
IntrusivePtr.h
main.cpp
RefCountedObject.h
RenderWindow.h
RenderWindowWindows.cpp
ShaderCompiler.h
TempFile.h
VertexShader_unknown.h
VulkanApplicationInfo.h
VulkanBuffer.h
VulkanCommon.h
VulkanDynamicLibrary.h
VulkanFunctions.h
VulkanImageView.h
VulkanInstance.cpp
VulkanInstance.h
VulkanLibrary.cpp
VulkanLibrary.h
VulkanLogicalDevice.cpp
VulkanLogicalDevice.h
VulkanMemory.h
VulkanMemoryProperties.h
VulkanPhysicalDevice.cpp
VulkanPhysicalDevice.h
VulkanQueueFamilyProperties.h
VulkanSemaphore.h
VulkanShaderModule.h
VulkanSwapChain.h
WindowWindows.h
VulkanDeviceFunctions.h
VulkanInstanceFunctions.h
VulkanGlobalFunctions.h
Vertex.h
VulkanPipelineLayout.h
VulkanPipelineLayout.cpp
VulkanPipeline.h
VulkanPipeline.cpp
VulkanFrameBuffer.h
VulkanFrameBuffer.cpp
VulkanDescriptorSetLayout.h
VulkanDescriptorSetLayout.cpp
UboPerObjectData.h
UniformBuffer.h
${Vulkan_INCLUDE_DIR}/../Source/SPIRV-Reflect/spirv_reflect.h
${Vulkan_INCLUDE_DIR}/../Source/SPIRV-Reflect/spirv_reflect.c
@@ -76,6 +129,8 @@ INTERFACE
target_include_directories(VulkanWrapper
INTERFACE
./
Generated
${Vulkan_INCLUDE_DIR}/../Source/SPIRV-Reflect
)
@@ -0,0 +1,33 @@
#include <VulkanPP/AccelerationStructureKHR.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
AccelerationStructureKHR::AccelerationStructureKHR(IntrusivePtr<Device> owner0, VkAccelerationStructureKHR handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
AccelerationStructureKHR::~AccelerationStructureKHR() {
if (_handle && _owned) {
(void)vk.vkDestroyAccelerationStructureKHR(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkCreateAccelerationStructureKHR
AccelerationStructureKHR::AccelerationStructureKHR(IntrusivePtr<Device> parent, const VkAccelerationStructureCreateInfoKHR* pCreateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkAccelerationStructureKHR _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateAccelerationStructureKHR(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateAccelerationStructureKHR failed");
_handle = _out;
}
// Original: vkCreateAccelerationStructureKHR (factory)
IntrusivePtr<AccelerationStructureKHR> AccelerationStructureKHR::create(IntrusivePtr<Device> parent, const VkAccelerationStructureCreateInfoKHR* pCreateInfo) {
return IntrusivePtr<AccelerationStructureKHR>(new AccelerationStructureKHR(parent, pCreateInfo));
}
} // namespace VulkanPP
@@ -0,0 +1,43 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Device;
// === Lifetime summary (deterministic) ===
// Handle: VkAccelerationStructureKHR
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class AccelerationStructureKHR : public RefCounted {
public:
VkAccelerationStructureKHR getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<AccelerationStructureKHR> fromHandle(IntrusivePtr<Device> owner0, VkAccelerationStructureKHR handle) {
return IntrusivePtr<AccelerationStructureKHR>(new AccelerationStructureKHR(owner0, handle, false));
}
private:
explicit AccelerationStructureKHR(IntrusivePtr<Device> owner0, VkAccelerationStructureKHR handle, bool owned);
~AccelerationStructureKHR() override;
private:
VkAccelerationStructureKHR _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
public:
// Original: vkCreateAccelerationStructureKHR
explicit AccelerationStructureKHR(IntrusivePtr<Device> parent, const VkAccelerationStructureCreateInfoKHR* pCreateInfo);
// Original: vkCreateAccelerationStructureKHR (factory)
static IntrusivePtr<AccelerationStructureKHR> create(IntrusivePtr<Device> parent, const VkAccelerationStructureCreateInfoKHR* pCreateInfo);
};
using PAccelerationStructureKHR = IntrusivePtr<AccelerationStructureKHR>;
} // namespace VulkanPP
@@ -0,0 +1,33 @@
#include <VulkanPP/AccelerationStructureNV.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
AccelerationStructureNV::AccelerationStructureNV(IntrusivePtr<Device> owner0, VkAccelerationStructureNV handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
AccelerationStructureNV::~AccelerationStructureNV() {
if (_handle && _owned) {
(void)vk.vkDestroyAccelerationStructureNV(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkCreateAccelerationStructureNV
AccelerationStructureNV::AccelerationStructureNV(IntrusivePtr<Device> parent, const VkAccelerationStructureCreateInfoNV* pCreateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkAccelerationStructureNV _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateAccelerationStructureNV(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateAccelerationStructureNV failed");
_handle = _out;
}
// Original: vkCreateAccelerationStructureNV (factory)
IntrusivePtr<AccelerationStructureNV> AccelerationStructureNV::create(IntrusivePtr<Device> parent, const VkAccelerationStructureCreateInfoNV* pCreateInfo) {
return IntrusivePtr<AccelerationStructureNV>(new AccelerationStructureNV(parent, pCreateInfo));
}
} // namespace VulkanPP
@@ -0,0 +1,43 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Device;
// === Lifetime summary (deterministic) ===
// Handle: VkAccelerationStructureNV
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class AccelerationStructureNV : public RefCounted {
public:
VkAccelerationStructureNV getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<AccelerationStructureNV> fromHandle(IntrusivePtr<Device> owner0, VkAccelerationStructureNV handle) {
return IntrusivePtr<AccelerationStructureNV>(new AccelerationStructureNV(owner0, handle, false));
}
private:
explicit AccelerationStructureNV(IntrusivePtr<Device> owner0, VkAccelerationStructureNV handle, bool owned);
~AccelerationStructureNV() override;
private:
VkAccelerationStructureNV _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
public:
// Original: vkCreateAccelerationStructureNV
explicit AccelerationStructureNV(IntrusivePtr<Device> parent, const VkAccelerationStructureCreateInfoNV* pCreateInfo);
// Original: vkCreateAccelerationStructureNV (factory)
static IntrusivePtr<AccelerationStructureNV> create(IntrusivePtr<Device> parent, const VkAccelerationStructureCreateInfoNV* pCreateInfo);
};
using PAccelerationStructureNV = IntrusivePtr<AccelerationStructureNV>;
} // namespace VulkanPP
@@ -0,0 +1,33 @@
#include <VulkanPP/Buffer.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
Buffer::Buffer(IntrusivePtr<Device> owner0, VkBuffer handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
Buffer::~Buffer() {
if (_handle && _owned) {
(void)vk.vkDestroyBuffer(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkCreateBuffer
Buffer::Buffer(IntrusivePtr<Device> parent, const VkBufferCreateInfo* pCreateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkBuffer _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateBuffer(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateBuffer failed");
_handle = _out;
}
// Original: vkCreateBuffer (factory)
IntrusivePtr<Buffer> Buffer::create(IntrusivePtr<Device> parent, const VkBufferCreateInfo* pCreateInfo) {
return IntrusivePtr<Buffer>(new Buffer(parent, pCreateInfo));
}
} // namespace VulkanPP
@@ -0,0 +1,43 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Device;
// === Lifetime summary (deterministic) ===
// Handle: VkBuffer
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class Buffer : public RefCounted {
public:
VkBuffer getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<Buffer> fromHandle(IntrusivePtr<Device> owner0, VkBuffer handle) {
return IntrusivePtr<Buffer>(new Buffer(owner0, handle, false));
}
private:
explicit Buffer(IntrusivePtr<Device> owner0, VkBuffer handle, bool owned);
~Buffer() override;
private:
VkBuffer _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
public:
// Original: vkCreateBuffer
explicit Buffer(IntrusivePtr<Device> parent, const VkBufferCreateInfo* pCreateInfo);
// Original: vkCreateBuffer (factory)
static IntrusivePtr<Buffer> create(IntrusivePtr<Device> parent, const VkBufferCreateInfo* pCreateInfo);
};
using PBuffer = IntrusivePtr<Buffer>;
} // namespace VulkanPP
@@ -0,0 +1,37 @@
#include <VulkanPP/BufferCollectionFUCHSIA.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
BufferCollectionFUCHSIA::BufferCollectionFUCHSIA(IntrusivePtr<Device> owner0, VkBufferCollectionFUCHSIA handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
BufferCollectionFUCHSIA::~BufferCollectionFUCHSIA() {
if (_handle && _owned) {
#if defined(VK_USE_PLATFORM_FUCHSIA)
(void)vk.vkDestroyBufferCollectionFUCHSIA(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
#endif
}
}
#if defined(VK_USE_PLATFORM_FUCHSIA)
// Original: vkCreateBufferCollectionFUCHSIA
BufferCollectionFUCHSIA::BufferCollectionFUCHSIA(IntrusivePtr<Device> parent, const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkBufferCollectionFUCHSIA _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateBufferCollectionFUCHSIA(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateBufferCollectionFUCHSIA failed");
_handle = _out;
}
// Original: vkCreateBufferCollectionFUCHSIA (factory)
IntrusivePtr<BufferCollectionFUCHSIA> BufferCollectionFUCHSIA::create(IntrusivePtr<Device> parent, const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo) {
return IntrusivePtr<BufferCollectionFUCHSIA>(new BufferCollectionFUCHSIA(parent, pCreateInfo));
}
#endif
} // namespace VulkanPP
@@ -0,0 +1,45 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Device;
// === Lifetime summary (deterministic) ===
// Handle: VkBufferCollectionFUCHSIA
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class BufferCollectionFUCHSIA : public RefCounted {
public:
VkBufferCollectionFUCHSIA getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<BufferCollectionFUCHSIA> fromHandle(IntrusivePtr<Device> owner0, VkBufferCollectionFUCHSIA handle) {
return IntrusivePtr<BufferCollectionFUCHSIA>(new BufferCollectionFUCHSIA(owner0, handle, false));
}
private:
explicit BufferCollectionFUCHSIA(IntrusivePtr<Device> owner0, VkBufferCollectionFUCHSIA handle, bool owned);
~BufferCollectionFUCHSIA() override;
private:
VkBufferCollectionFUCHSIA _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
#if defined(VK_USE_PLATFORM_FUCHSIA)
public:
// Original: vkCreateBufferCollectionFUCHSIA
explicit BufferCollectionFUCHSIA(IntrusivePtr<Device> parent, const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo);
// Original: vkCreateBufferCollectionFUCHSIA (factory)
static IntrusivePtr<BufferCollectionFUCHSIA> create(IntrusivePtr<Device> parent, const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo);
#endif
};
using PBufferCollectionFUCHSIA = IntrusivePtr<BufferCollectionFUCHSIA>;
} // namespace VulkanPP
@@ -0,0 +1,36 @@
#include <VulkanPP/BufferView.hpp>
#include <VulkanPP/Buffer.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
BufferView::BufferView(IntrusivePtr<Device> owner0, VkBufferView handle, bool owned, IntrusivePtr<Buffer> owner_Buffer)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
, _lifetime_owner_Buffer(std::move(owner_Buffer))
{ }
BufferView::~BufferView() {
if (_handle && _owned) {
(void)vk.vkDestroyBufferView(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkCreateBufferView
BufferView::BufferView(IntrusivePtr<Device> parent, const VkBufferViewCreateInfo* pCreateInfo, IntrusivePtr<Buffer> owner_Buffer) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
, _lifetime_owner_Buffer(owner_Buffer)
{
VkBufferView _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateBufferView(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateBufferView failed");
_handle = _out;
}
// Original: vkCreateBufferView (factory)
IntrusivePtr<BufferView> BufferView::create(IntrusivePtr<Device> parent, const VkBufferViewCreateInfo* pCreateInfo, IntrusivePtr<Buffer> owner_Buffer) {
return IntrusivePtr<BufferView>(new BufferView(parent, pCreateInfo, owner_Buffer));
}
} // namespace VulkanPP
@@ -0,0 +1,46 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Buffer;
class Device;
// === Lifetime summary (deterministic) ===
// Handle: VkBufferView
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): Buffer via VkBufferViewCreateInfo::buffer
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class BufferView : public RefCounted {
public:
VkBufferView getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
IntrusivePtr<Buffer> getBuffer() const noexcept { return _lifetime_owner_Buffer; }
public:
static IntrusivePtr<BufferView> fromHandle(IntrusivePtr<Device> owner0, VkBufferView handle) {
return IntrusivePtr<BufferView>(new BufferView(owner0, handle, false, IntrusivePtr<Buffer>()));
}
private:
explicit BufferView(IntrusivePtr<Device> owner0, VkBufferView handle, bool owned, IntrusivePtr<Buffer> owner_Buffer);
~BufferView() override;
private:
VkBufferView _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
IntrusivePtr<Buffer> _lifetime_owner_Buffer;
public:
// Original: vkCreateBufferView
explicit BufferView(IntrusivePtr<Device> parent, const VkBufferViewCreateInfo* pCreateInfo, IntrusivePtr<Buffer> owner_Buffer);
// Original: vkCreateBufferView (factory)
static IntrusivePtr<BufferView> create(IntrusivePtr<Device> parent, const VkBufferViewCreateInfo* pCreateInfo, IntrusivePtr<Buffer> owner_Buffer);
};
using PBufferView = IntrusivePtr<BufferView>;
} // namespace VulkanPP
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,33 @@
#include <VulkanPP/CommandPool.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
CommandPool::CommandPool(IntrusivePtr<Device> owner0, VkCommandPool handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
CommandPool::~CommandPool() {
if (_handle && _owned) {
(void)vk.vkDestroyCommandPool(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkCreateCommandPool
CommandPool::CommandPool(IntrusivePtr<Device> parent, const VkCommandPoolCreateInfo* pCreateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkCommandPool _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateCommandPool(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateCommandPool failed");
_handle = _out;
}
// Original: vkCreateCommandPool (factory)
IntrusivePtr<CommandPool> CommandPool::create(IntrusivePtr<Device> parent, const VkCommandPoolCreateInfo* pCreateInfo) {
return IntrusivePtr<CommandPool>(new CommandPool(parent, pCreateInfo));
}
} // namespace VulkanPP
@@ -0,0 +1,43 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Device;
// === Lifetime summary (deterministic) ===
// Handle: VkCommandPool
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class CommandPool : public RefCounted {
public:
VkCommandPool getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<CommandPool> fromHandle(IntrusivePtr<Device> owner0, VkCommandPool handle) {
return IntrusivePtr<CommandPool>(new CommandPool(owner0, handle, false));
}
private:
explicit CommandPool(IntrusivePtr<Device> owner0, VkCommandPool handle, bool owned);
~CommandPool() override;
private:
VkCommandPool _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
public:
// Original: vkCreateCommandPool
explicit CommandPool(IntrusivePtr<Device> parent, const VkCommandPoolCreateInfo* pCreateInfo);
// Original: vkCreateCommandPool (factory)
static IntrusivePtr<CommandPool> create(IntrusivePtr<Device> parent, const VkCommandPoolCreateInfo* pCreateInfo);
};
using PCommandPool = IntrusivePtr<CommandPool>;
} // namespace VulkanPP
@@ -0,0 +1,33 @@
#include <VulkanPP/CuFunctionNVX.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
CuFunctionNVX::CuFunctionNVX(IntrusivePtr<Device> owner0, VkCuFunctionNVX handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
CuFunctionNVX::~CuFunctionNVX() {
if (_handle && _owned) {
(void)vk.vkDestroyCuFunctionNVX(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkCreateCuFunctionNVX
CuFunctionNVX::CuFunctionNVX(IntrusivePtr<Device> parent, const VkCuFunctionCreateInfoNVX* pCreateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkCuFunctionNVX _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateCuFunctionNVX(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateCuFunctionNVX failed");
_handle = _out;
}
// Original: vkCreateCuFunctionNVX (factory)
IntrusivePtr<CuFunctionNVX> CuFunctionNVX::create(IntrusivePtr<Device> parent, const VkCuFunctionCreateInfoNVX* pCreateInfo) {
return IntrusivePtr<CuFunctionNVX>(new CuFunctionNVX(parent, pCreateInfo));
}
} // namespace VulkanPP
@@ -0,0 +1,43 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Device;
// === Lifetime summary (deterministic) ===
// Handle: VkCuFunctionNVX
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class CuFunctionNVX : public RefCounted {
public:
VkCuFunctionNVX getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<CuFunctionNVX> fromHandle(IntrusivePtr<Device> owner0, VkCuFunctionNVX handle) {
return IntrusivePtr<CuFunctionNVX>(new CuFunctionNVX(owner0, handle, false));
}
private:
explicit CuFunctionNVX(IntrusivePtr<Device> owner0, VkCuFunctionNVX handle, bool owned);
~CuFunctionNVX() override;
private:
VkCuFunctionNVX _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
public:
// Original: vkCreateCuFunctionNVX
explicit CuFunctionNVX(IntrusivePtr<Device> parent, const VkCuFunctionCreateInfoNVX* pCreateInfo);
// Original: vkCreateCuFunctionNVX (factory)
static IntrusivePtr<CuFunctionNVX> create(IntrusivePtr<Device> parent, const VkCuFunctionCreateInfoNVX* pCreateInfo);
};
using PCuFunctionNVX = IntrusivePtr<CuFunctionNVX>;
} // namespace VulkanPP
@@ -0,0 +1,33 @@
#include <VulkanPP/CuModuleNVX.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
CuModuleNVX::CuModuleNVX(IntrusivePtr<Device> owner0, VkCuModuleNVX handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
CuModuleNVX::~CuModuleNVX() {
if (_handle && _owned) {
(void)vk.vkDestroyCuModuleNVX(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkCreateCuModuleNVX
CuModuleNVX::CuModuleNVX(IntrusivePtr<Device> parent, const VkCuModuleCreateInfoNVX* pCreateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkCuModuleNVX _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateCuModuleNVX(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateCuModuleNVX failed");
_handle = _out;
}
// Original: vkCreateCuModuleNVX (factory)
IntrusivePtr<CuModuleNVX> CuModuleNVX::create(IntrusivePtr<Device> parent, const VkCuModuleCreateInfoNVX* pCreateInfo) {
return IntrusivePtr<CuModuleNVX>(new CuModuleNVX(parent, pCreateInfo));
}
} // namespace VulkanPP
@@ -0,0 +1,43 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Device;
// === Lifetime summary (deterministic) ===
// Handle: VkCuModuleNVX
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class CuModuleNVX : public RefCounted {
public:
VkCuModuleNVX getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<CuModuleNVX> fromHandle(IntrusivePtr<Device> owner0, VkCuModuleNVX handle) {
return IntrusivePtr<CuModuleNVX>(new CuModuleNVX(owner0, handle, false));
}
private:
explicit CuModuleNVX(IntrusivePtr<Device> owner0, VkCuModuleNVX handle, bool owned);
~CuModuleNVX() override;
private:
VkCuModuleNVX _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
public:
// Original: vkCreateCuModuleNVX
explicit CuModuleNVX(IntrusivePtr<Device> parent, const VkCuModuleCreateInfoNVX* pCreateInfo);
// Original: vkCreateCuModuleNVX (factory)
static IntrusivePtr<CuModuleNVX> create(IntrusivePtr<Device> parent, const VkCuModuleCreateInfoNVX* pCreateInfo);
};
using PCuModuleNVX = IntrusivePtr<CuModuleNVX>;
} // namespace VulkanPP
@@ -0,0 +1,37 @@
#include <VulkanPP/CudaFunctionNV.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
CudaFunctionNV::CudaFunctionNV(IntrusivePtr<Device> owner0, VkCudaFunctionNV handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
CudaFunctionNV::~CudaFunctionNV() {
if (_handle && _owned) {
#if defined(VK_ENABLE_BETA_EXTENSIONS)
(void)vk.vkDestroyCudaFunctionNV(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
#endif
}
}
#if defined(VK_ENABLE_BETA_EXTENSIONS)
// Original: vkCreateCudaFunctionNV
CudaFunctionNV::CudaFunctionNV(IntrusivePtr<Device> parent, const VkCudaFunctionCreateInfoNV* pCreateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkCudaFunctionNV _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateCudaFunctionNV(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateCudaFunctionNV failed");
_handle = _out;
}
// Original: vkCreateCudaFunctionNV (factory)
IntrusivePtr<CudaFunctionNV> CudaFunctionNV::create(IntrusivePtr<Device> parent, const VkCudaFunctionCreateInfoNV* pCreateInfo) {
return IntrusivePtr<CudaFunctionNV>(new CudaFunctionNV(parent, pCreateInfo));
}
#endif
} // namespace VulkanPP
@@ -0,0 +1,45 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Device;
// === Lifetime summary (deterministic) ===
// Handle: VkCudaFunctionNV
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class CudaFunctionNV : public RefCounted {
public:
VkCudaFunctionNV getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<CudaFunctionNV> fromHandle(IntrusivePtr<Device> owner0, VkCudaFunctionNV handle) {
return IntrusivePtr<CudaFunctionNV>(new CudaFunctionNV(owner0, handle, false));
}
private:
explicit CudaFunctionNV(IntrusivePtr<Device> owner0, VkCudaFunctionNV handle, bool owned);
~CudaFunctionNV() override;
private:
VkCudaFunctionNV _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
#if defined(VK_ENABLE_BETA_EXTENSIONS)
public:
// Original: vkCreateCudaFunctionNV
explicit CudaFunctionNV(IntrusivePtr<Device> parent, const VkCudaFunctionCreateInfoNV* pCreateInfo);
// Original: vkCreateCudaFunctionNV (factory)
static IntrusivePtr<CudaFunctionNV> create(IntrusivePtr<Device> parent, const VkCudaFunctionCreateInfoNV* pCreateInfo);
#endif
};
using PCudaFunctionNV = IntrusivePtr<CudaFunctionNV>;
} // namespace VulkanPP
@@ -0,0 +1,37 @@
#include <VulkanPP/CudaModuleNV.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
CudaModuleNV::CudaModuleNV(IntrusivePtr<Device> owner0, VkCudaModuleNV handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
CudaModuleNV::~CudaModuleNV() {
if (_handle && _owned) {
#if defined(VK_ENABLE_BETA_EXTENSIONS)
(void)vk.vkDestroyCudaModuleNV(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
#endif
}
}
#if defined(VK_ENABLE_BETA_EXTENSIONS)
// Original: vkCreateCudaModuleNV
CudaModuleNV::CudaModuleNV(IntrusivePtr<Device> parent, const VkCudaModuleCreateInfoNV* pCreateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkCudaModuleNV _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateCudaModuleNV(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateCudaModuleNV failed");
_handle = _out;
}
// Original: vkCreateCudaModuleNV (factory)
IntrusivePtr<CudaModuleNV> CudaModuleNV::create(IntrusivePtr<Device> parent, const VkCudaModuleCreateInfoNV* pCreateInfo) {
return IntrusivePtr<CudaModuleNV>(new CudaModuleNV(parent, pCreateInfo));
}
#endif
} // namespace VulkanPP
@@ -0,0 +1,45 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Device;
// === Lifetime summary (deterministic) ===
// Handle: VkCudaModuleNV
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class CudaModuleNV : public RefCounted {
public:
VkCudaModuleNV getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<CudaModuleNV> fromHandle(IntrusivePtr<Device> owner0, VkCudaModuleNV handle) {
return IntrusivePtr<CudaModuleNV>(new CudaModuleNV(owner0, handle, false));
}
private:
explicit CudaModuleNV(IntrusivePtr<Device> owner0, VkCudaModuleNV handle, bool owned);
~CudaModuleNV() override;
private:
VkCudaModuleNV _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
#if defined(VK_ENABLE_BETA_EXTENSIONS)
public:
// Original: vkCreateCudaModuleNV
explicit CudaModuleNV(IntrusivePtr<Device> parent, const VkCudaModuleCreateInfoNV* pCreateInfo);
// Original: vkCreateCudaModuleNV (factory)
static IntrusivePtr<CudaModuleNV> create(IntrusivePtr<Device> parent, const VkCudaModuleCreateInfoNV* pCreateInfo);
#endif
};
using PCudaModuleNV = IntrusivePtr<CudaModuleNV>;
} // namespace VulkanPP
@@ -0,0 +1,33 @@
#include <VulkanPP/DebugReportCallbackEXT.hpp>
#include <VulkanPP/Instance.hpp>
namespace VulkanPP {
DebugReportCallbackEXT::DebugReportCallbackEXT(IntrusivePtr<Instance> owner0, VkDebugReportCallbackEXT handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
DebugReportCallbackEXT::~DebugReportCallbackEXT() {
if (_handle && _owned) {
(void)vk.vkDestroyDebugReportCallbackEXT(_owner0 ? _owner0->getHandle() : (VkInstance)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkCreateDebugReportCallbackEXT
DebugReportCallbackEXT::DebugReportCallbackEXT(IntrusivePtr<Instance> parent, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkDebugReportCallbackEXT _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateDebugReportCallbackEXT(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateDebugReportCallbackEXT failed");
_handle = _out;
}
// Original: vkCreateDebugReportCallbackEXT (factory)
IntrusivePtr<DebugReportCallbackEXT> DebugReportCallbackEXT::create(IntrusivePtr<Instance> parent, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo) {
return IntrusivePtr<DebugReportCallbackEXT>(new DebugReportCallbackEXT(parent, pCreateInfo));
}
} // namespace VulkanPP
@@ -0,0 +1,43 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Instance;
// === Lifetime summary (deterministic) ===
// Handle: VkDebugReportCallbackEXT
// Holds (destroy/free owners + creation parent, or producer parent): Instance
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class DebugReportCallbackEXT : public RefCounted {
public:
VkDebugReportCallbackEXT getHandle() const noexcept { return _handle; }
IntrusivePtr<Instance> getInstance() const noexcept { return _owner0; }
public:
static IntrusivePtr<DebugReportCallbackEXT> fromHandle(IntrusivePtr<Instance> owner0, VkDebugReportCallbackEXT handle) {
return IntrusivePtr<DebugReportCallbackEXT>(new DebugReportCallbackEXT(owner0, handle, false));
}
private:
explicit DebugReportCallbackEXT(IntrusivePtr<Instance> owner0, VkDebugReportCallbackEXT handle, bool owned);
~DebugReportCallbackEXT() override;
private:
VkDebugReportCallbackEXT _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Instance> _owner0;
public:
// Original: vkCreateDebugReportCallbackEXT
explicit DebugReportCallbackEXT(IntrusivePtr<Instance> parent, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo);
// Original: vkCreateDebugReportCallbackEXT (factory)
static IntrusivePtr<DebugReportCallbackEXT> create(IntrusivePtr<Instance> parent, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo);
};
using PDebugReportCallbackEXT = IntrusivePtr<DebugReportCallbackEXT>;
} // namespace VulkanPP
@@ -0,0 +1,33 @@
#include <VulkanPP/DebugUtilsMessengerEXT.hpp>
#include <VulkanPP/Instance.hpp>
namespace VulkanPP {
DebugUtilsMessengerEXT::DebugUtilsMessengerEXT(IntrusivePtr<Instance> owner0, VkDebugUtilsMessengerEXT handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
DebugUtilsMessengerEXT::~DebugUtilsMessengerEXT() {
if (_handle && _owned) {
(void)vk.vkDestroyDebugUtilsMessengerEXT(_owner0 ? _owner0->getHandle() : (VkInstance)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkCreateDebugUtilsMessengerEXT
DebugUtilsMessengerEXT::DebugUtilsMessengerEXT(IntrusivePtr<Instance> parent, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkDebugUtilsMessengerEXT _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateDebugUtilsMessengerEXT(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateDebugUtilsMessengerEXT failed");
_handle = _out;
}
// Original: vkCreateDebugUtilsMessengerEXT (factory)
IntrusivePtr<DebugUtilsMessengerEXT> DebugUtilsMessengerEXT::create(IntrusivePtr<Instance> parent, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo) {
return IntrusivePtr<DebugUtilsMessengerEXT>(new DebugUtilsMessengerEXT(parent, pCreateInfo));
}
} // namespace VulkanPP
@@ -0,0 +1,43 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Instance;
// === Lifetime summary (deterministic) ===
// Handle: VkDebugUtilsMessengerEXT
// Holds (destroy/free owners + creation parent, or producer parent): Instance
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class DebugUtilsMessengerEXT : public RefCounted {
public:
VkDebugUtilsMessengerEXT getHandle() const noexcept { return _handle; }
IntrusivePtr<Instance> getInstance() const noexcept { return _owner0; }
public:
static IntrusivePtr<DebugUtilsMessengerEXT> fromHandle(IntrusivePtr<Instance> owner0, VkDebugUtilsMessengerEXT handle) {
return IntrusivePtr<DebugUtilsMessengerEXT>(new DebugUtilsMessengerEXT(owner0, handle, false));
}
private:
explicit DebugUtilsMessengerEXT(IntrusivePtr<Instance> owner0, VkDebugUtilsMessengerEXT handle, bool owned);
~DebugUtilsMessengerEXT() override;
private:
VkDebugUtilsMessengerEXT _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Instance> _owner0;
public:
// Original: vkCreateDebugUtilsMessengerEXT
explicit DebugUtilsMessengerEXT(IntrusivePtr<Instance> parent, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo);
// Original: vkCreateDebugUtilsMessengerEXT (factory)
static IntrusivePtr<DebugUtilsMessengerEXT> create(IntrusivePtr<Instance> parent, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo);
};
using PDebugUtilsMessengerEXT = IntrusivePtr<DebugUtilsMessengerEXT>;
} // namespace VulkanPP
@@ -0,0 +1,33 @@
#include <VulkanPP/DeferredOperationKHR.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
DeferredOperationKHR::DeferredOperationKHR(IntrusivePtr<Device> owner0, VkDeferredOperationKHR handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
DeferredOperationKHR::~DeferredOperationKHR() {
if (_handle && _owned) {
(void)vk.vkDestroyDeferredOperationKHR(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkCreateDeferredOperationKHR
DeferredOperationKHR::DeferredOperationKHR(IntrusivePtr<Device> parent) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkDeferredOperationKHR _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateDeferredOperationKHR(parent->getHandle(), nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateDeferredOperationKHR failed");
_handle = _out;
}
// Original: vkCreateDeferredOperationKHR (factory)
IntrusivePtr<DeferredOperationKHR> DeferredOperationKHR::create(IntrusivePtr<Device> parent) {
return IntrusivePtr<DeferredOperationKHR>(new DeferredOperationKHR(parent));
}
} // namespace VulkanPP
@@ -0,0 +1,43 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Device;
// === Lifetime summary (deterministic) ===
// Handle: VkDeferredOperationKHR
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class DeferredOperationKHR : public RefCounted {
public:
VkDeferredOperationKHR getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<DeferredOperationKHR> fromHandle(IntrusivePtr<Device> owner0, VkDeferredOperationKHR handle) {
return IntrusivePtr<DeferredOperationKHR>(new DeferredOperationKHR(owner0, handle, false));
}
private:
explicit DeferredOperationKHR(IntrusivePtr<Device> owner0, VkDeferredOperationKHR handle, bool owned);
~DeferredOperationKHR() override;
private:
VkDeferredOperationKHR _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
public:
// Original: vkCreateDeferredOperationKHR
explicit DeferredOperationKHR(IntrusivePtr<Device> parent);
// Original: vkCreateDeferredOperationKHR (factory)
static IntrusivePtr<DeferredOperationKHR> create(IntrusivePtr<Device> parent);
};
using PDeferredOperationKHR = IntrusivePtr<DeferredOperationKHR>;
} // namespace VulkanPP
@@ -0,0 +1,33 @@
#include <VulkanPP/DescriptorPool.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
DescriptorPool::DescriptorPool(IntrusivePtr<Device> owner0, VkDescriptorPool handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
DescriptorPool::~DescriptorPool() {
if (_handle && _owned) {
(void)vk.vkDestroyDescriptorPool(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkCreateDescriptorPool
DescriptorPool::DescriptorPool(IntrusivePtr<Device> parent, const VkDescriptorPoolCreateInfo* pCreateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkDescriptorPool _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateDescriptorPool(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateDescriptorPool failed");
_handle = _out;
}
// Original: vkCreateDescriptorPool (factory)
IntrusivePtr<DescriptorPool> DescriptorPool::create(IntrusivePtr<Device> parent, const VkDescriptorPoolCreateInfo* pCreateInfo) {
return IntrusivePtr<DescriptorPool>(new DescriptorPool(parent, pCreateInfo));
}
} // namespace VulkanPP
@@ -0,0 +1,43 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Device;
// === Lifetime summary (deterministic) ===
// Handle: VkDescriptorPool
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class DescriptorPool : public RefCounted {
public:
VkDescriptorPool getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<DescriptorPool> fromHandle(IntrusivePtr<Device> owner0, VkDescriptorPool handle) {
return IntrusivePtr<DescriptorPool>(new DescriptorPool(owner0, handle, false));
}
private:
explicit DescriptorPool(IntrusivePtr<Device> owner0, VkDescriptorPool handle, bool owned);
~DescriptorPool() override;
private:
VkDescriptorPool _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
public:
// Original: vkCreateDescriptorPool
explicit DescriptorPool(IntrusivePtr<Device> parent, const VkDescriptorPoolCreateInfo* pCreateInfo);
// Original: vkCreateDescriptorPool (factory)
static IntrusivePtr<DescriptorPool> create(IntrusivePtr<Device> parent, const VkDescriptorPoolCreateInfo* pCreateInfo);
};
using PDescriptorPool = IntrusivePtr<DescriptorPool>;
} // namespace VulkanPP
@@ -0,0 +1,36 @@
#include <VulkanPP/DescriptorSet.hpp>
#include <VulkanPP/DescriptorPool.hpp>
#include <VulkanPP/DescriptorSetLayout.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
DescriptorSet::DescriptorSet(IntrusivePtr<Device> owner0, IntrusivePtr<DescriptorPool> owner1, VkDescriptorSet handle, bool owned, const std::vector<IntrusivePtr<DescriptorSetLayout>>& owners_DescriptorSetLayout)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
, _owner1(std::move(owner1))
, _lifetime_owners_DescriptorSetLayout(owners_DescriptorSetLayout)
{ }
DescriptorSet::~DescriptorSet() {
if (_handle && _owned) {
(void)vk.vkFreeDescriptorSets(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _owner1 ? _owner1->getHandle() : (VkDescriptorPool)VK_NULL_HANDLE, 0, 1, &_handle);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkAllocateDescriptorSets
std::vector<IntrusivePtr<DescriptorSet>> DescriptorSet::createMany(IntrusivePtr<Device> parent, const VkDescriptorSetAllocateInfo* pAllocateInfo, const std::vector<IntrusivePtr<DescriptorSetLayout>>& owners_DescriptorSetLayout) {
std::vector<VkDescriptorSet> _out;
_out.resize(pAllocateInfo->descriptorSetCount);
auto _res = vk.vkAllocateDescriptorSets(parent->getHandle(), pAllocateInfo, _out.data());
if (_res != VK_SUCCESS) throw std::runtime_error("vkAllocateDescriptorSets failed");
std::vector<IntrusivePtr<DescriptorSet>> _ret; _ret.reserve(_out.size());
for (auto h : _out) {
_ret.emplace_back(new DescriptorSet(parent, parent, h, true, owners_DescriptorSetLayout));
}
return _ret;
}
} // namespace VulkanPP
@@ -0,0 +1,47 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class DescriptorPool;
class DescriptorSetLayout;
class Device;
// === Lifetime summary (deterministic) ===
// Handle: VkDescriptorSet
// Holds (destroy/free owners + creation parent, or producer parent): Device, DescriptorPool
// Keeps (from *CreateInfo/*AllocateInfo): DescriptorSetLayout[] via VkDescriptorSetAllocateInfo::pSetLayouts[]
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class DescriptorSet : public RefCounted {
public:
VkDescriptorSet getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
IntrusivePtr<DescriptorPool> getDescriptorPool() const noexcept { return _owner1; }
const std::vector<IntrusivePtr<DescriptorSetLayout>>& getDescriptorSetLayouts() const noexcept { return _lifetime_owners_DescriptorSetLayout; }
public:
static IntrusivePtr<DescriptorSet> fromHandle(IntrusivePtr<Device> owner0, IntrusivePtr<DescriptorPool> owner1, VkDescriptorSet handle) {
return IntrusivePtr<DescriptorSet>(new DescriptorSet(owner0, owner1, handle, false, std::vector<IntrusivePtr<DescriptorSetLayout>>()));
}
private:
explicit DescriptorSet(IntrusivePtr<Device> owner0, IntrusivePtr<DescriptorPool> owner1, VkDescriptorSet handle, bool owned, const std::vector<IntrusivePtr<DescriptorSetLayout>>& owners_DescriptorSetLayout);
~DescriptorSet() override;
private:
VkDescriptorSet _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
IntrusivePtr<DescriptorPool> _owner1;
std::vector<IntrusivePtr<DescriptorSetLayout>> _lifetime_owners_DescriptorSetLayout;
public:
// Original: vkAllocateDescriptorSets
static std::vector<IntrusivePtr<DescriptorSet>> createMany(IntrusivePtr<Device> parent, const VkDescriptorSetAllocateInfo* pAllocateInfo, const std::vector<IntrusivePtr<DescriptorSetLayout>>& owners_DescriptorSetLayout);
};
using PDescriptorSet = IntrusivePtr<DescriptorSet>;
} // namespace VulkanPP
@@ -0,0 +1,36 @@
#include <VulkanPP/DescriptorSetLayout.hpp>
#include <VulkanPP/Device.hpp>
#include <VulkanPP/Sampler.hpp>
namespace VulkanPP {
DescriptorSetLayout::DescriptorSetLayout(IntrusivePtr<Device> owner0, VkDescriptorSetLayout handle, bool owned, const std::vector<IntrusivePtr<Sampler>>& owners_Sampler)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
, _lifetime_owners_Sampler(owners_Sampler)
{ }
DescriptorSetLayout::~DescriptorSetLayout() {
if (_handle && _owned) {
(void)vk.vkDestroyDescriptorSetLayout(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkCreateDescriptorSetLayout
DescriptorSetLayout::DescriptorSetLayout(IntrusivePtr<Device> parent, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const std::vector<IntrusivePtr<Sampler>>& owners_Sampler) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
, _lifetime_owners_Sampler(owners_Sampler)
{
VkDescriptorSetLayout _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateDescriptorSetLayout(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateDescriptorSetLayout failed");
_handle = _out;
}
// Original: vkCreateDescriptorSetLayout (factory)
IntrusivePtr<DescriptorSetLayout> DescriptorSetLayout::create(IntrusivePtr<Device> parent, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const std::vector<IntrusivePtr<Sampler>>& owners_Sampler) {
return IntrusivePtr<DescriptorSetLayout>(new DescriptorSetLayout(parent, pCreateInfo, owners_Sampler));
}
} // namespace VulkanPP
@@ -0,0 +1,46 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Device;
class Sampler;
// === Lifetime summary (deterministic) ===
// Handle: VkDescriptorSetLayout
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): Sampler[] via VkDescriptorSetLayoutBinding::pImmutableSamplers[]
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class DescriptorSetLayout : public RefCounted {
public:
VkDescriptorSetLayout getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
const std::vector<IntrusivePtr<Sampler>>& getSamplers() const noexcept { return _lifetime_owners_Sampler; }
public:
static IntrusivePtr<DescriptorSetLayout> fromHandle(IntrusivePtr<Device> owner0, VkDescriptorSetLayout handle) {
return IntrusivePtr<DescriptorSetLayout>(new DescriptorSetLayout(owner0, handle, false, std::vector<IntrusivePtr<Sampler>>()));
}
private:
explicit DescriptorSetLayout(IntrusivePtr<Device> owner0, VkDescriptorSetLayout handle, bool owned, const std::vector<IntrusivePtr<Sampler>>& owners_Sampler);
~DescriptorSetLayout() override;
private:
VkDescriptorSetLayout _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
std::vector<IntrusivePtr<Sampler>> _lifetime_owners_Sampler;
public:
// Original: vkCreateDescriptorSetLayout
explicit DescriptorSetLayout(IntrusivePtr<Device> parent, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const std::vector<IntrusivePtr<Sampler>>& owners_Sampler);
// Original: vkCreateDescriptorSetLayout (factory)
static IntrusivePtr<DescriptorSetLayout> create(IntrusivePtr<Device> parent, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const std::vector<IntrusivePtr<Sampler>>& owners_Sampler);
};
using PDescriptorSetLayout = IntrusivePtr<DescriptorSetLayout>;
} // namespace VulkanPP
@@ -0,0 +1,55 @@
#include <VulkanPP/DescriptorUpdateTemplate.hpp>
#include <VulkanPP/DescriptorSetLayout.hpp>
#include <VulkanPP/Device.hpp>
#include <VulkanPP/PipelineLayout.hpp>
namespace VulkanPP {
DescriptorUpdateTemplate::DescriptorUpdateTemplate(IntrusivePtr<Device> owner0, VkDescriptorUpdateTemplate handle, bool owned, IntrusivePtr<DescriptorSetLayout> owner_DescriptorSetLayout, IntrusivePtr<PipelineLayout> owner_PipelineLayout)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
, _lifetime_owner_DescriptorSetLayout(std::move(owner_DescriptorSetLayout))
, _lifetime_owner_PipelineLayout(std::move(owner_PipelineLayout))
{ }
DescriptorUpdateTemplate::~DescriptorUpdateTemplate() {
if (_handle && _owned) {
(void)vk.vkDestroyDescriptorUpdateTemplate(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkCreateDescriptorUpdateTemplate
DescriptorUpdateTemplate::DescriptorUpdateTemplate(IntrusivePtr<Device> parent, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, IntrusivePtr<DescriptorSetLayout> owner_DescriptorSetLayout, IntrusivePtr<PipelineLayout> owner_PipelineLayout) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
, _lifetime_owner_DescriptorSetLayout(owner_DescriptorSetLayout)
, _lifetime_owner_PipelineLayout(owner_PipelineLayout)
{
VkDescriptorUpdateTemplate _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateDescriptorUpdateTemplate(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateDescriptorUpdateTemplate failed");
_handle = _out;
}
// Original: vkCreateDescriptorUpdateTemplate (factory)
IntrusivePtr<DescriptorUpdateTemplate> DescriptorUpdateTemplate::create(IntrusivePtr<Device> parent, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, IntrusivePtr<DescriptorSetLayout> owner_DescriptorSetLayout, IntrusivePtr<PipelineLayout> owner_PipelineLayout) {
return IntrusivePtr<DescriptorUpdateTemplate>(new DescriptorUpdateTemplate(parent, pCreateInfo, owner_DescriptorSetLayout, owner_PipelineLayout));
}
// Original: vkCreateDescriptorUpdateTemplateKHR
DescriptorUpdateTemplate::DescriptorUpdateTemplate(IntrusivePtr<Device> parent, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, IntrusivePtr<DescriptorSetLayout> owner_DescriptorSetLayout, IntrusivePtr<PipelineLayout> owner_PipelineLayout) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
, _lifetime_owner_DescriptorSetLayout(owner_DescriptorSetLayout)
, _lifetime_owner_PipelineLayout(owner_PipelineLayout)
{
VkDescriptorUpdateTemplate _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateDescriptorUpdateTemplateKHR(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateDescriptorUpdateTemplateKHR failed");
_handle = _out;
}
// Original: vkCreateDescriptorUpdateTemplateKHR (factory)
IntrusivePtr<DescriptorUpdateTemplate> DescriptorUpdateTemplate::create(IntrusivePtr<Device> parent, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, IntrusivePtr<DescriptorSetLayout> owner_DescriptorSetLayout, IntrusivePtr<PipelineLayout> owner_PipelineLayout) {
return IntrusivePtr<DescriptorUpdateTemplate>(new DescriptorUpdateTemplate(parent, pCreateInfo, owner_DescriptorSetLayout, owner_PipelineLayout));
}
} // namespace VulkanPP
@@ -0,0 +1,56 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class DescriptorSetLayout;
class Device;
class PipelineLayout;
// === Lifetime summary (deterministic) ===
// Handle: VkDescriptorUpdateTemplate
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): DescriptorSetLayout via VkDescriptorUpdateTemplateCreateInfo::descriptorSetLayout; PipelineLayout via VkDescriptorUpdateTemplateCreateInfo::pipelineLayout
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class DescriptorUpdateTemplate : public RefCounted {
public:
VkDescriptorUpdateTemplate getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
IntrusivePtr<DescriptorSetLayout> getDescriptorSetLayout() const noexcept { return _lifetime_owner_DescriptorSetLayout; }
IntrusivePtr<PipelineLayout> getPipelineLayout() const noexcept { return _lifetime_owner_PipelineLayout; }
public:
static IntrusivePtr<DescriptorUpdateTemplate> fromHandle(IntrusivePtr<Device> owner0, VkDescriptorUpdateTemplate handle) {
return IntrusivePtr<DescriptorUpdateTemplate>(new DescriptorUpdateTemplate(owner0, handle, false, IntrusivePtr<DescriptorSetLayout>(), IntrusivePtr<PipelineLayout>()));
}
private:
explicit DescriptorUpdateTemplate(IntrusivePtr<Device> owner0, VkDescriptorUpdateTemplate handle, bool owned, IntrusivePtr<DescriptorSetLayout> owner_DescriptorSetLayout, IntrusivePtr<PipelineLayout> owner_PipelineLayout);
~DescriptorUpdateTemplate() override;
private:
VkDescriptorUpdateTemplate _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
IntrusivePtr<DescriptorSetLayout> _lifetime_owner_DescriptorSetLayout;
IntrusivePtr<PipelineLayout> _lifetime_owner_PipelineLayout;
public:
// Original: vkCreateDescriptorUpdateTemplate
explicit DescriptorUpdateTemplate(IntrusivePtr<Device> parent, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, IntrusivePtr<DescriptorSetLayout> owner_DescriptorSetLayout, IntrusivePtr<PipelineLayout> owner_PipelineLayout);
// Original: vkCreateDescriptorUpdateTemplate (factory)
static IntrusivePtr<DescriptorUpdateTemplate> create(IntrusivePtr<Device> parent, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, IntrusivePtr<DescriptorSetLayout> owner_DescriptorSetLayout, IntrusivePtr<PipelineLayout> owner_PipelineLayout);
public:
// Original: vkCreateDescriptorUpdateTemplateKHR
explicit DescriptorUpdateTemplate(IntrusivePtr<Device> parent, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, IntrusivePtr<DescriptorSetLayout> owner_DescriptorSetLayout, IntrusivePtr<PipelineLayout> owner_PipelineLayout);
// Original: vkCreateDescriptorUpdateTemplateKHR (factory)
static IntrusivePtr<DescriptorUpdateTemplate> create(IntrusivePtr<Device> parent, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, IntrusivePtr<DescriptorSetLayout> owner_DescriptorSetLayout, IntrusivePtr<PipelineLayout> owner_PipelineLayout);
};
using PDescriptorUpdateTemplate = IntrusivePtr<DescriptorUpdateTemplate>;
} // namespace VulkanPP
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,33 @@
#include <VulkanPP/DeviceMemory.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
DeviceMemory::DeviceMemory(IntrusivePtr<Device> owner0, VkDeviceMemory handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
DeviceMemory::~DeviceMemory() {
if (_handle && _owned) {
(void)vk.vkFreeMemory(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkAllocateMemory
DeviceMemory::DeviceMemory(IntrusivePtr<Device> parent, const VkMemoryAllocateInfo* pAllocateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkDeviceMemory _out = VK_NULL_HANDLE;
auto _res = vk.vkAllocateMemory(parent->getHandle(), pAllocateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkAllocateMemory failed");
_handle = _out;
}
// Original: vkAllocateMemory (factory)
IntrusivePtr<DeviceMemory> DeviceMemory::create(IntrusivePtr<Device> parent, const VkMemoryAllocateInfo* pAllocateInfo) {
return IntrusivePtr<DeviceMemory>(new DeviceMemory(parent, pAllocateInfo));
}
} // namespace VulkanPP
@@ -0,0 +1,43 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Device;
// === Lifetime summary (deterministic) ===
// Handle: VkDeviceMemory
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class DeviceMemory : public RefCounted {
public:
VkDeviceMemory getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<DeviceMemory> fromHandle(IntrusivePtr<Device> owner0, VkDeviceMemory handle) {
return IntrusivePtr<DeviceMemory>(new DeviceMemory(owner0, handle, false));
}
private:
explicit DeviceMemory(IntrusivePtr<Device> owner0, VkDeviceMemory handle, bool owned);
~DeviceMemory() override;
private:
VkDeviceMemory _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
public:
// Original: vkAllocateMemory
explicit DeviceMemory(IntrusivePtr<Device> parent, const VkMemoryAllocateInfo* pAllocateInfo);
// Original: vkAllocateMemory (factory)
static IntrusivePtr<DeviceMemory> create(IntrusivePtr<Device> parent, const VkMemoryAllocateInfo* pAllocateInfo);
};
using PDeviceMemory = IntrusivePtr<DeviceMemory>;
} // namespace VulkanPP
@@ -0,0 +1,17 @@
#include <VulkanPP/DisplayKHR.hpp>
#include <VulkanPP/PhysicalDevice.hpp>
namespace VulkanPP {
DisplayKHR::DisplayKHR(IntrusivePtr<PhysicalDevice> owner0, VkDisplayKHR handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
DisplayKHR::~DisplayKHR() {
if (_handle && _owned) {
}
}
} // namespace VulkanPP
@@ -0,0 +1,36 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class PhysicalDevice;
// === Lifetime summary (deterministic) ===
// Handle: VkDisplayKHR
// Holds (destroy/free owners + creation parent, or producer parent): PhysicalDevice
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class DisplayKHR : public RefCounted {
public:
VkDisplayKHR getHandle() const noexcept { return _handle; }
IntrusivePtr<PhysicalDevice> getPhysicalDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<DisplayKHR> fromHandle(IntrusivePtr<PhysicalDevice> owner0, VkDisplayKHR handle) {
return IntrusivePtr<DisplayKHR>(new DisplayKHR(owner0, handle, false));
}
private:
explicit DisplayKHR(IntrusivePtr<PhysicalDevice> owner0, VkDisplayKHR handle, bool owned);
~DisplayKHR() override;
private:
VkDisplayKHR _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<PhysicalDevice> _owner0;
};
using PDisplayKHR = IntrusivePtr<DisplayKHR>;
} // namespace VulkanPP
@@ -0,0 +1,32 @@
#include <VulkanPP/DisplayModeKHR.hpp>
#include <VulkanPP/DisplayKHR.hpp>
#include <VulkanPP/PhysicalDevice.hpp>
namespace VulkanPP {
DisplayModeKHR::DisplayModeKHR(IntrusivePtr<PhysicalDevice> owner0, VkDisplayModeKHR handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
DisplayModeKHR::~DisplayModeKHR() {
if (_handle && _owned) {
}
}
// Original: vkCreateDisplayModeKHR
DisplayModeKHR::DisplayModeKHR(IntrusivePtr<PhysicalDevice> parent, IntrusivePtr<DisplayKHR> display, const VkDisplayModeCreateInfoKHR* pCreateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkDisplayModeKHR _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateDisplayModeKHR(parent->getHandle(), display->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateDisplayModeKHR failed");
_handle = _out;
}
// Original: vkCreateDisplayModeKHR (factory)
IntrusivePtr<DisplayModeKHR> DisplayModeKHR::create(IntrusivePtr<PhysicalDevice> parent, IntrusivePtr<DisplayKHR> display, const VkDisplayModeCreateInfoKHR* pCreateInfo) {
return IntrusivePtr<DisplayModeKHR>(new DisplayModeKHR(parent, display, pCreateInfo));
}
} // namespace VulkanPP
@@ -0,0 +1,44 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class DisplayKHR;
class PhysicalDevice;
// === Lifetime summary (deterministic) ===
// Handle: VkDisplayModeKHR
// Holds (destroy/free owners + creation parent, or producer parent): PhysicalDevice
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class DisplayModeKHR : public RefCounted {
public:
VkDisplayModeKHR getHandle() const noexcept { return _handle; }
IntrusivePtr<PhysicalDevice> getPhysicalDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<DisplayModeKHR> fromHandle(IntrusivePtr<PhysicalDevice> owner0, VkDisplayModeKHR handle) {
return IntrusivePtr<DisplayModeKHR>(new DisplayModeKHR(owner0, handle, false));
}
private:
explicit DisplayModeKHR(IntrusivePtr<PhysicalDevice> owner0, VkDisplayModeKHR handle, bool owned);
~DisplayModeKHR() override;
private:
VkDisplayModeKHR _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<PhysicalDevice> _owner0;
public:
// Original: vkCreateDisplayModeKHR
explicit DisplayModeKHR(IntrusivePtr<PhysicalDevice> parent, IntrusivePtr<DisplayKHR> display, const VkDisplayModeCreateInfoKHR* pCreateInfo);
// Original: vkCreateDisplayModeKHR (factory)
static IntrusivePtr<DisplayModeKHR> create(IntrusivePtr<PhysicalDevice> parent, IntrusivePtr<DisplayKHR> display, const VkDisplayModeCreateInfoKHR* pCreateInfo);
};
using PDisplayModeKHR = IntrusivePtr<DisplayModeKHR>;
} // namespace VulkanPP
@@ -0,0 +1,33 @@
#include <VulkanPP/Event.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
Event::Event(IntrusivePtr<Device> owner0, VkEvent handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
Event::~Event() {
if (_handle && _owned) {
(void)vk.vkDestroyEvent(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkCreateEvent
Event::Event(IntrusivePtr<Device> parent, const VkEventCreateInfo* pCreateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkEvent _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateEvent(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateEvent failed");
_handle = _out;
}
// Original: vkCreateEvent (factory)
IntrusivePtr<Event> Event::create(IntrusivePtr<Device> parent, const VkEventCreateInfo* pCreateInfo) {
return IntrusivePtr<Event>(new Event(parent, pCreateInfo));
}
} // namespace VulkanPP
@@ -0,0 +1,43 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Device;
// === Lifetime summary (deterministic) ===
// Handle: VkEvent
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class Event : public RefCounted {
public:
VkEvent getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<Event> fromHandle(IntrusivePtr<Device> owner0, VkEvent handle) {
return IntrusivePtr<Event>(new Event(owner0, handle, false));
}
private:
explicit Event(IntrusivePtr<Device> owner0, VkEvent handle, bool owned);
~Event() override;
private:
VkEvent _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
public:
// Original: vkCreateEvent
explicit Event(IntrusivePtr<Device> parent, const VkEventCreateInfo* pCreateInfo);
// Original: vkCreateEvent (factory)
static IntrusivePtr<Event> create(IntrusivePtr<Device> parent, const VkEventCreateInfo* pCreateInfo);
};
using PEvent = IntrusivePtr<Event>;
} // namespace VulkanPP
@@ -0,0 +1,38 @@
#include <VulkanPP/ExternalComputeQueueNV.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
ExternalComputeQueueNV::ExternalComputeQueueNV(IntrusivePtr<Device> owner0, VkExternalComputeQueueNV handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
ExternalComputeQueueNV::~ExternalComputeQueueNV() {
if (_handle && _owned) {
(void)vk.vkDestroyExternalComputeQueueNV(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkCreateExternalComputeQueueNV
ExternalComputeQueueNV::ExternalComputeQueueNV(IntrusivePtr<Device> parent, const VkExternalComputeQueueCreateInfoNV* pCreateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkExternalComputeQueueNV _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateExternalComputeQueueNV(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateExternalComputeQueueNV failed");
_handle = _out;
}
// Original: vkCreateExternalComputeQueueNV (factory)
IntrusivePtr<ExternalComputeQueueNV> ExternalComputeQueueNV::create(IntrusivePtr<Device> parent, const VkExternalComputeQueueCreateInfoNV* pCreateInfo) {
return IntrusivePtr<ExternalComputeQueueNV>(new ExternalComputeQueueNV(parent, pCreateInfo));
}
// Original: vkGetExternalComputeQueueDataNV
void ExternalComputeQueueNV::getExternalComputeQueueDataNV(VkExternalComputeQueueDataParamsNV* params, void* pData) {
vk.vkGetExternalComputeQueueDataNV(_handle, params, pData);
}
} // namespace VulkanPP
@@ -0,0 +1,48 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class Device;
// === Lifetime summary (deterministic) ===
// Handle: VkExternalComputeQueueNV
// Holds (destroy/free owners + creation parent, or producer parent): Device
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class ExternalComputeQueueNV : public RefCounted {
public:
VkExternalComputeQueueNV getHandle() const noexcept { return _handle; }
IntrusivePtr<Device> getDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<ExternalComputeQueueNV> fromHandle(IntrusivePtr<Device> owner0, VkExternalComputeQueueNV handle) {
return IntrusivePtr<ExternalComputeQueueNV>(new ExternalComputeQueueNV(owner0, handle, false));
}
private:
explicit ExternalComputeQueueNV(IntrusivePtr<Device> owner0, VkExternalComputeQueueNV handle, bool owned);
~ExternalComputeQueueNV() override;
private:
VkExternalComputeQueueNV _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<Device> _owner0;
public:
// Original: vkCreateExternalComputeQueueNV
explicit ExternalComputeQueueNV(IntrusivePtr<Device> parent, const VkExternalComputeQueueCreateInfoNV* pCreateInfo);
// Original: vkCreateExternalComputeQueueNV (factory)
static IntrusivePtr<ExternalComputeQueueNV> create(IntrusivePtr<Device> parent, const VkExternalComputeQueueCreateInfoNV* pCreateInfo);
public:
// Original: vkGetExternalComputeQueueDataNV
void getExternalComputeQueueDataNV(VkExternalComputeQueueDataParamsNV* params, void* pData);
};
using PExternalComputeQueueNV = IntrusivePtr<ExternalComputeQueueNV>;
} // namespace VulkanPP
@@ -0,0 +1,33 @@
#include <VulkanPP/Fence.hpp>
#include <VulkanPP/Device.hpp>
namespace VulkanPP {
Fence::Fence(IntrusivePtr<Device> owner0, VkFence handle, bool owned)
: _handle(handle), _owned(owned)
, _owner0(std::move(owner0))
{ }
Fence::~Fence() {
if (_handle && _owned) {
(void)vk.vkDestroyFence(_owner0 ? _owner0->getHandle() : (VkDevice)VK_NULL_HANDLE, _handle, nullptr);
_handle = VK_NULL_HANDLE;
}
}
// Original: vkCreateFence
Fence::Fence(IntrusivePtr<Device> parent, const VkFenceCreateInfo* pCreateInfo) : _handle(VK_NULL_HANDLE), _owned(true)
, _owner0(parent)
{
VkFence _out = VK_NULL_HANDLE;
auto _res = vk.vkCreateFence(parent->getHandle(), pCreateInfo, nullptr, &_out);
if (_res != VK_SUCCESS) throw std::runtime_error("vkCreateFence failed");
_handle = _out;
}
// Original: vkCreateFence (factory)
IntrusivePtr<Fence> Fence::create(IntrusivePtr<Device> parent, const VkFenceCreateInfo* pCreateInfo) {
return IntrusivePtr<Fence>(new Fence(parent, pCreateInfo));
}
} // namespace VulkanPP

Some files were not shown because too many files have changed in this diff Show More