Added template class scoped_handle, which supports auto deletion of the objects, after they have been released (must!) and gone out of scope. Also added #ifndefs for Macro called VULKAN_HPP_DISABLE_SCOPED_HANDLING, which allows disabling of default enabled scoped handling.

This commit is contained in:
Victor Müller 2016-09-07 00:02:12 +02:00
parent ac9510cb7d
commit f9f1415cb2

View File

@ -39,6 +39,9 @@
# include <memory> # include <memory>
# include <vector> # include <vector>
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
#include <functional>
#endif
static_assert(VK_HEADER_VERSION == 21, "Wrong VK_HEADER_VERSION!"); static_assert(VK_HEADER_VERSION == 21, "Wrong VK_HEADER_VERSION!");
@ -344,7 +347,6 @@ namespace vk
default: return "invalid"; default: return "invalid";
} }
} }
#if defined(_MSC_VER) && (_MSC_VER == 1800) #if defined(_MSC_VER) && (_MSC_VER == 1800)
# define noexcept _NOEXCEPT # define noexcept _NOEXCEPT
#endif #endif
@ -910,6 +912,171 @@ namespace vk
} }
#endif /*VK_USE_PLATFORM_XCB_KHR*/ #endif /*VK_USE_PLATFORM_XCB_KHR*/
#ifndef VULKAN_HPP_DISABLE_SCOPED_HANDLING
template<class T, typename... _ARGS>
auto ptrMemberFnc(void(T::*p)(_ARGS...) const) {
return p;
};
class Instance;
class Device;
class DescriptorPool;
class DescriptorSet;
class CommandPool;
class CommandBuffer;
template<typename T>
class Optional;
class AllocationCallbacks;
template<class T>
class scoped_handle {
protected:
T object{ VK_NULL_HANDLE };
std::function<void(T object)> delete_func;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
bool released = false, auto_release_copies = false;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
using INS = vk::Instance; using DEV = vk::Device;
public:
scoped_handle(const scoped_handle<T>& s) {
std::cout << "copy constructor" << std::endl;
this->object = s.object;
this->delete_func = s.delete_func;
this->released = s.auto_release_copies;
}
template<typename Fnc, typename alloc>
std::function<void(T, alloc)> bindFnc(void(Fnc::*p)(T, alloc) const, scoped_handle<Fnc>&v) {
using namespace std;
return bind(p, v.get(), placeholders::_1, placeholders::_2);
}
template<typename Fnc, typename alloc>
std::function<void(T, alloc)> bindFnc(void(Fnc::*p)(T, alloc) const, const Fnc& v) {
using namespace std;
return bind(p, v, placeholders::_1, placeholders::_2);
}
scoped_handle(std::function<void(T)> fnc = [](T obj) {}, T obj = T()) {
this->delete_func = fnc;
this->object = obj;
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
scoped_handle(void(INS::*p)(T, Optional<const AllocationCallbacks>) const,
scoped_handle<INS>& i, Optional<const AllocationCallbacks> alloc = nullptr, T obj = T()) {
if (alloc != nullptr) this->delete_func = [p, &i, &alloc, this](T o) {this->bindFnc<INS, Optional<const AllocationCallbacks>>(p, i)(o, alloc); };
else this->delete_func = [p, &i, this](T obj) {this->bindFnc<INS, Optional<const AllocationCallbacks>>(p, i)(obj, nullptr); };
this->object = obj;
}
scoped_handle(void(INS::*p)(T, Optional<const AllocationCallbacks>) const,
const INS& i, Optional<const AllocationCallbacks> alloc = nullptr, T obj = T()) {
if (alloc != nullptr) this->delete_func = [p, &i, &alloc, this](T o) {this->bindFnc<INS, Optional<const AllocationCallbacks>>(p, i)(o, alloc); };
else this->delete_func = [p, &i, this](T obj) {this->bindFnc<INS, Optional<const AllocationCallbacks>>(p, i)(obj, nullptr); };
this->object = obj;
}
scoped_handle(void(DEV::*p)(T, Optional<const AllocationCallbacks>) const, scoped_handle<DEV>& d, Optional<const AllocationCallbacks> alloc = nullptr, T obj = T())
{
if (alloc != nullptr)this->delete_func = [p, &d, &alloc, this](T o) {this->bindFnc<DEV, Optional<const AllocationCallbacks>>(p, d)(o, alloc); };
else this->delete_func = [p, &d, this](T o) {this->bindFnc<DEV, Optional<const AllocationCallbacks>>(p, d)(o, nullptr); };
this->object = obj;
}
scoped_handle(void(DEV::*p)(T, Optional<const AllocationCallbacks>) const, const DEV& d, Optional<const AllocationCallbacks> alloc = nullptr, T obj = T())
{
if (alloc != nullptr)this->delete_func = [p, d, &alloc, this](T o) {this->bindFnc<DEV, Optional<const AllocationCallbacks>>(p, d)(o, alloc); };
else this->delete_func = [p, &d, this](T o) {this->bindFnc<DEV, Optional<const AllocationCallbacks>>(p, d)(o, nullptr); };
this->object = obj;
}
#endif
scoped_handle(void(INS::*p)(T,const AllocationCallbacks*) const,
scoped_handle<INS>& i, const AllocationCallbacks* alloc = nullptr, T obj = T()) {
if (alloc != nullptr) this->delete_func = [p, &i, &alloc, this](T o) {this->bindFnc<INS, const AllocationCallbacks*>(p, i)(o, alloc); };
else this->delete_func = [p, &i, this](T obj) {this->bindFnc<INS, const AllocationCallbacks*>(p, i)(obj, nullptr); };
this->object = obj;
}
scoped_handle(void(INS::*p)(T, const AllocationCallbacks*) const,
const INS& i, const AllocationCallbacks* alloc = nullptr, T obj = T()) {
if (alloc != nullptr) this->delete_func = [p, &i, &alloc, this](T o) {this->bindFnc<INS, const AllocationCallbacks*>(p, i)(o, alloc); };
else this->delete_func = [p, &i, this](T obj) {this->bindFnc<INS, const AllocationCallbacks*>(p, i)(obj, nullptr); };
this->object = obj;
}
scoped_handle(void(DEV::*p)(T, const AllocationCallbacks*) const, scoped_handle<DEV>& d, const AllocationCallbacks* alloc = nullptr, T obj = T())
{
if (alloc != nullptr)this->delete_func = [p, &d, &alloc, this](T o) {this->bindFnc<DEV, const AllocationCallbacks*>(p, d)(o, alloc); };
else this->delete_func = [p, &d, this](T o) {this->bindFnc<DEV, const AllocationCallbacks*>(p, d)(o, nullptr); };
this->object = obj;
}
scoped_handle(void(DEV::*p)(T, const AllocationCallbacks*) const, const DEV& d, const AllocationCallbacks* alloc = nullptr, T obj = T())
{
if (alloc != nullptr)this->delete_func = [p, &d, &alloc, this](T o) {this->bindFnc<DEV, AllocationCallbacks*>(p, d)(o, alloc); };
else this->delete_func = [p, &d, this](T o) {this->bindFnc<DEV, AllocationCallbacks*>(p, d)(o, nullptr); };
this->object = obj;
}
operator T() const {
return object;
}
void operator= (T obj) {
destroy();
this->object = obj;
}
T& get() {
return object;
}
#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE
void destroy() {
if (this->object)
this->delete_func(this->object);
this->object = VK_NULL_HANDLE;
}
#else
void release() {
released = true;
auto_release_copies = true;
}
void doAutoReleaseCopies(bool state) {
auto_release_copies = state;
}
bool isAutoReleasingCopies() {
return auto_release_copies;
}
void destroy() {
if (this->object && released) {
std::cout << "Deleting object of type " << typeid(object).name() << std::endl;
this->delete_func(this->object);
}
this->object = VK_NULL_HANDLE;
}
#endif
bool isEmpty() {
return this->object;
}
T* operator &() {
return &object;
}
~scoped_handle() {
destroy();
}
};
#endif
class DeviceMemory class DeviceMemory
{ {
public: public:
@ -1537,6 +1704,8 @@ namespace vk
}; };
static_assert(sizeof(DescriptorSet) == sizeof(VkDescriptorSet), "handle and wrapper have different size!"); static_assert(sizeof(DescriptorSet) == sizeof(VkDescriptorSet), "handle and wrapper have different size!");
class DescriptorSetLayout class DescriptorSetLayout
{ {
public: public:
@ -15720,8 +15889,9 @@ namespace vk
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
Queue getQueue(uint32_t queueFamilyIndex, uint32_t queueIndex) const Queue getQueue(uint32_t queueFamilyIndex, uint32_t queueIndex) const
{ {
Queue queue; Queue queue = Queue();
vkGetDeviceQueue(m_device, queueFamilyIndex, queueIndex, reinterpret_cast<VkQueue*>(&queue)); vkGetDeviceQueue(m_device, queueFamilyIndex, queueIndex, reinterpret_cast<VkQueue*>(&queue));
if (&queue == nullptr)std::cout << "fail" << std::endl;
return queue; return queue;
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
@ -15740,7 +15910,7 @@ namespace vk
return createResultValue(result, "vk::Device::waitIdle"); return createResultValue(result, "vk::Device::waitIdle");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result allocateMemory(const MemoryAllocateInfo* pAllocateInfo, const AllocationCallbacks* pAllocator, DeviceMemory* pMemory) const Result allocateMemory(const MemoryAllocateInfo* pAllocateInfo, const AllocationCallbacks* pAllocator, DeviceMemory* pMemory) const
{ {
return static_cast<Result>(vkAllocateMemory(m_device, reinterpret_cast<const VkMemoryAllocateInfo*>(pAllocateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkDeviceMemory*>(pMemory))); return static_cast<Result>(vkAllocateMemory(m_device, reinterpret_cast<const VkMemoryAllocateInfo*>(pAllocateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkDeviceMemory*>(pMemory)));
@ -15754,6 +15924,21 @@ namespace vk
return createResultValue(result, memory, "vk::Device::allocateMemory"); return createResultValue(result, memory, "vk::Device::allocateMemory");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result allocateMemory(const MemoryAllocateInfo* pAllocateInfo, const AllocationCallbacks* pAllocator, scoped_handle<DeviceMemory>* pMemory) const
{
return static_cast<Result>(vkAllocateMemory(m_device, reinterpret_cast<const VkMemoryAllocateInfo*>(pAllocateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkDeviceMemory*>(&pMemory->get())));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<DeviceMemory>>::type allocateMemory(const MemoryAllocateInfo & allocateInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<DeviceMemory> memory(ptrMemberFnc < Device, DeviceMemory, Optional<const AllocationCallbacks>>(&Device::freeMemory), *this, allocator);
Result result = static_cast<Result>(vkAllocateMemory(m_device, reinterpret_cast<const VkMemoryAllocateInfo*>(&allocateInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkDeviceMemory*>(&memory)));
return createResultValue(result, memory, "vk::Device::allocateMemory");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
void freeMemory(DeviceMemory memory, const AllocationCallbacks* pAllocator) const void freeMemory(DeviceMemory memory, const AllocationCallbacks* pAllocator) const
{ {
@ -15913,6 +16098,7 @@ namespace vk
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createFence(const FenceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Fence* pFence) const Result createFence(const FenceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Fence* pFence) const
{ {
return static_cast<Result>(vkCreateFence(m_device, reinterpret_cast<const VkFenceCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkFence*>(pFence))); return static_cast<Result>(vkCreateFence(m_device, reinterpret_cast<const VkFenceCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkFence*>(pFence)));
@ -15926,6 +16112,21 @@ namespace vk
return createResultValue(result, fence, "vk::Device::createFence"); return createResultValue(result, fence, "vk::Device::createFence");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createFence(const FenceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Fence* pFence) const
{
return static_cast<Result>(vkCreateFence(m_device, reinterpret_cast<const VkFenceCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkFence*>(pFence)));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<Fence>>::type createFence(const FenceCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<Fence> fence(ptrMemberFnc<Device, Fence, Optional<const AllocationCallbacks>>(&Device::destroyFence), *this, allocator);
Result result = static_cast<Result>(vkCreateFence(m_device, reinterpret_cast<const VkFenceCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkFence*>(&fence)));
return createResultValue(result, fence, "vk::Device::createFence");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
void destroyFence(Fence fence, const AllocationCallbacks* pAllocator) const void destroyFence(Fence fence, const AllocationCallbacks* pAllocator) const
{ {
@ -15980,6 +16181,7 @@ namespace vk
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createSemaphore(const SemaphoreCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Semaphore* pSemaphore) const Result createSemaphore(const SemaphoreCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Semaphore* pSemaphore) const
{ {
return static_cast<Result>(vkCreateSemaphore(m_device, reinterpret_cast<const VkSemaphoreCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkSemaphore*>(pSemaphore))); return static_cast<Result>(vkCreateSemaphore(m_device, reinterpret_cast<const VkSemaphoreCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkSemaphore*>(pSemaphore)));
@ -15993,6 +16195,21 @@ namespace vk
return createResultValue(result, semaphore, "vk::Device::createSemaphore"); return createResultValue(result, semaphore, "vk::Device::createSemaphore");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createSemaphore(const SemaphoreCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<Semaphore>* pSemaphore) const
{
return static_cast<Result>(vkCreateSemaphore(m_device, reinterpret_cast<const VkSemaphoreCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkSemaphore*>(pSemaphore)));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<Semaphore>>::type createSemaphore(const SemaphoreCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<Semaphore> semaphore(ptrMemberFnc<Device, Semaphore, Optional<const AllocationCallbacks>>(&Device::destroySemaphore), *this, allocator);
Result result = static_cast<Result>(vkCreateSemaphore(m_device, reinterpret_cast<const VkSemaphoreCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkSemaphore*>(&semaphore)));
return createResultValue(result, semaphore, "vk::Device::createSemaphore");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
void destroySemaphore(Semaphore semaphore, const AllocationCallbacks* pAllocator) const void destroySemaphore(Semaphore semaphore, const AllocationCallbacks* pAllocator) const
{ {
@ -16006,6 +16223,7 @@ namespace vk
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createEvent(const EventCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Event* pEvent) const Result createEvent(const EventCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Event* pEvent) const
{ {
return static_cast<Result>(vkCreateEvent(m_device, reinterpret_cast<const VkEventCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkEvent*>(pEvent))); return static_cast<Result>(vkCreateEvent(m_device, reinterpret_cast<const VkEventCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkEvent*>(pEvent)));
@ -16019,6 +16237,21 @@ namespace vk
return createResultValue(result, event, "vk::Device::createEvent"); return createResultValue(result, event, "vk::Device::createEvent");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createEvent(const EventCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<Event>* pEvent) const
{
return static_cast<Result>(vkCreateEvent(m_device, reinterpret_cast<const VkEventCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkEvent*>(pEvent)));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<Event>>::type createEvent(const EventCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<Event> event(ptrMemberFnc<Device, Event, Optional<const AllocationCallbacks>>(&Device::destroyEvent), *this, allocator);
Result result = static_cast<Result>(vkCreateEvent(m_device, reinterpret_cast<const VkEventCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkEvent*>(&event)));
return createResultValue(result, event, "vk::Device::createEvent");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
void destroyEvent(Event event, const AllocationCallbacks* pAllocator) const void destroyEvent(Event event, const AllocationCallbacks* pAllocator) const
{ {
@ -16077,6 +16310,7 @@ namespace vk
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createQueryPool(const QueryPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, QueryPool* pQueryPool) const Result createQueryPool(const QueryPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, QueryPool* pQueryPool) const
{ {
return static_cast<Result>(vkCreateQueryPool(m_device, reinterpret_cast<const VkQueryPoolCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkQueryPool*>(pQueryPool))); return static_cast<Result>(vkCreateQueryPool(m_device, reinterpret_cast<const VkQueryPoolCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkQueryPool*>(pQueryPool)));
@ -16090,6 +16324,21 @@ namespace vk
return createResultValue(result, queryPool, "vk::Device::createQueryPool"); return createResultValue(result, queryPool, "vk::Device::createQueryPool");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createQueryPool(const QueryPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<QueryPool>* pQueryPool) const
{
return static_cast<Result>(vkCreateQueryPool(m_device, reinterpret_cast<const VkQueryPoolCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkQueryPool*>(pQueryPool)));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<QueryPool>>::type createQueryPool(const QueryPoolCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<QueryPool> queryPool(ptrMemberFnc<Device, QueryPool, Optional<const AllocationCallbacks>>(&Device::destroyQueryPool), *this, allocator);
Result result = static_cast<Result>(vkCreateQueryPool(m_device, reinterpret_cast<const VkQueryPoolCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkQueryPool*>(&queryPool)));
return createResultValue(result, queryPool, "vk::Device::createQueryPool");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
void destroyQueryPool(QueryPool queryPool, const AllocationCallbacks* pAllocator) const void destroyQueryPool(QueryPool queryPool, const AllocationCallbacks* pAllocator) const
{ {
@ -16116,7 +16365,7 @@ namespace vk
return createResultValue(result, "vk::Device::getQueryPoolResults", { Result::eSuccess, Result::eNotReady }); return createResultValue(result, "vk::Device::getQueryPoolResults", { Result::eSuccess, Result::eNotReady });
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createBuffer(const BufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Buffer* pBuffer) const Result createBuffer(const BufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Buffer* pBuffer) const
{ {
return static_cast<Result>(vkCreateBuffer(m_device, reinterpret_cast<const VkBufferCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkBuffer*>(pBuffer))); return static_cast<Result>(vkCreateBuffer(m_device, reinterpret_cast<const VkBufferCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkBuffer*>(pBuffer)));
@ -16130,7 +16379,20 @@ namespace vk
return createResultValue(result, buffer, "vk::Device::createBuffer"); return createResultValue(result, buffer, "vk::Device::createBuffer");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createBuffer(const BufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<Buffer>* buffer) const
{
return static_cast<Result>(vkCreateBuffer(m_device, reinterpret_cast<const VkBufferCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkBuffer*>(&buffer->get())));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<Buffer>::type createBuffer(const BufferCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
auto buffer = scoped_handle<Buffer>(ptrMemberFnc<Device, Buffer, Optional<const AllocationCallbacks>>(&Device::destroyBuffer), *this, allocator);
Result result = static_cast<Result>(vkCreateBuffer(m_device, reinterpret_cast<const VkBufferCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkBuffer*>(&buffer)));
return createResultValue(result, buffer, "vk::Device::createBuffer");
}
#endif
void destroyBuffer(Buffer buffer, const AllocationCallbacks* pAllocator) const void destroyBuffer(Buffer buffer, const AllocationCallbacks* pAllocator) const
{ {
vkDestroyBuffer(m_device, static_cast<VkBuffer>(buffer), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator)); vkDestroyBuffer(m_device, static_cast<VkBuffer>(buffer), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator));
@ -16142,7 +16404,8 @@ namespace vk
vkDestroyBuffer(m_device, static_cast<VkBuffer>(buffer), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator))); vkDestroyBuffer(m_device, static_cast<VkBuffer>(buffer), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)));
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createBufferView(const BufferViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, BufferView* pView) const Result createBufferView(const BufferViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, BufferView* pView) const
{ {
return static_cast<Result>(vkCreateBufferView(m_device, reinterpret_cast<const VkBufferViewCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkBufferView*>(pView))); return static_cast<Result>(vkCreateBufferView(m_device, reinterpret_cast<const VkBufferViewCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkBufferView*>(pView)));
@ -16156,7 +16419,21 @@ namespace vk
return createResultValue(result, view, "vk::Device::createBufferView"); return createResultValue(result, view, "vk::Device::createBufferView");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createBufferView(const BufferViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<BufferView>* pView) const
{
return static_cast<Result>(vkCreateBufferView(m_device, reinterpret_cast<const VkBufferViewCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkBufferView*>(&pView->get())));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<BufferView>>::type createBufferView(const BufferViewCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<BufferView> view(ptrMemberFnc<Device, BufferView, Optional<const AllocationCallbacks>>(&Device::destroyBufferView), *this, allocator);
Result result = static_cast<Result>(vkCreateBufferView(m_device, reinterpret_cast<const VkBufferViewCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkBufferView*>(&view)));
return createResultValue(result, view, "vk::Device::createBufferView");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
void destroyBufferView(BufferView bufferView, const AllocationCallbacks* pAllocator) const void destroyBufferView(BufferView bufferView, const AllocationCallbacks* pAllocator) const
{ {
vkDestroyBufferView(m_device, static_cast<VkBufferView>(bufferView), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator)); vkDestroyBufferView(m_device, static_cast<VkBufferView>(bufferView), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator));
@ -16169,6 +16446,7 @@ namespace vk
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createImage(const ImageCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Image* pImage) const Result createImage(const ImageCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Image* pImage) const
{ {
return static_cast<Result>(vkCreateImage(m_device, reinterpret_cast<const VkImageCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkImage*>(pImage))); return static_cast<Result>(vkCreateImage(m_device, reinterpret_cast<const VkImageCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkImage*>(pImage)));
@ -16182,6 +16460,22 @@ namespace vk
return createResultValue(result, image, "vk::Device::createImage"); return createResultValue(result, image, "vk::Device::createImage");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createImage(const ImageCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<Image>& image) const
{
return static_cast<Result>(vkCreateImage(m_device, reinterpret_cast<const VkImageCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkImage*>(&image)));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<Image>>::type createImage(const ImageCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<Image> image(ptrMemberFnc<Device, Image, Optional<const AllocationCallbacks>>(&Device::destroyImage), *this, allocator);
Result result = static_cast<Result>(vkCreateImage(m_device, reinterpret_cast<const VkImageCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkImage*>(&image)));
return createResultValue(result, image, "vk::Device::createImage");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif
void destroyImage(Image image, const AllocationCallbacks* pAllocator) const void destroyImage(Image image, const AllocationCallbacks* pAllocator) const
{ {
@ -16209,6 +16503,7 @@ namespace vk
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createImageView(const ImageViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ImageView* pView) const Result createImageView(const ImageViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ImageView* pView) const
{ {
return static_cast<Result>(vkCreateImageView(m_device, reinterpret_cast<const VkImageViewCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkImageView*>(pView))); return static_cast<Result>(vkCreateImageView(m_device, reinterpret_cast<const VkImageViewCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkImageView*>(pView)));
@ -16222,7 +16517,21 @@ namespace vk
return createResultValue(result, view, "vk::Device::createImageView"); return createResultValue(result, view, "vk::Device::createImageView");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createImageView(const ImageViewCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<ImageView>& view) const
{
return static_cast<Result>(vkCreateImageView(m_device, reinterpret_cast<const VkImageViewCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkImageView*>(&view)));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<ImageView>>::type createImageView(const ImageViewCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
auto view = scoped_handle<ImageView>(ptrMemberFnc<Device, ImageView, Optional<const AllocationCallbacks>>(&Device::destroyImageView), *this, allocator);
Result result = static_cast<Result>(vkCreateImageView(m_device, reinterpret_cast<const VkImageViewCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkImageView*>(&view)));
return createResultValue(result, view, "vk::Device::createImageView");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
void destroyImageView(ImageView imageView, const AllocationCallbacks* pAllocator) const void destroyImageView(ImageView imageView, const AllocationCallbacks* pAllocator) const
{ {
vkDestroyImageView(m_device, static_cast<VkImageView>(imageView), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator)); vkDestroyImageView(m_device, static_cast<VkImageView>(imageView), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator));
@ -16235,6 +16544,7 @@ namespace vk
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createShaderModule(const ShaderModuleCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ShaderModule* pShaderModule) const Result createShaderModule(const ShaderModuleCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, ShaderModule* pShaderModule) const
{ {
return static_cast<Result>(vkCreateShaderModule(m_device, reinterpret_cast<const VkShaderModuleCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkShaderModule*>(pShaderModule))); return static_cast<Result>(vkCreateShaderModule(m_device, reinterpret_cast<const VkShaderModuleCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkShaderModule*>(pShaderModule)));
@ -16248,7 +16558,21 @@ namespace vk
return createResultValue(result, shaderModule, "vk::Device::createShaderModule"); return createResultValue(result, shaderModule, "vk::Device::createShaderModule");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createShaderModule(const ShaderModuleCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<ShaderModule>* pShaderModule) const
{
return static_cast<Result>(vkCreateShaderModule(m_device, reinterpret_cast<const VkShaderModuleCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkShaderModule*>(pShaderModule)));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<ShaderModule>>::type createShaderModule(const ShaderModuleCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<ShaderModule> shaderModule(ptrMemberFnc<Device, ShaderModule, Optional<const AllocationCallbacks>>(&Device::destroyShaderModule), *this, allocator);
Result result = static_cast<Result>(vkCreateShaderModule(m_device, reinterpret_cast<const VkShaderModuleCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkShaderModule*>(&shaderModule)));
return createResultValue(result, shaderModule, "vk::Device::createShaderModule");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
void destroyShaderModule(ShaderModule shaderModule, const AllocationCallbacks* pAllocator) const void destroyShaderModule(ShaderModule shaderModule, const AllocationCallbacks* pAllocator) const
{ {
vkDestroyShaderModule(m_device, static_cast<VkShaderModule>(shaderModule), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator)); vkDestroyShaderModule(m_device, static_cast<VkShaderModule>(shaderModule), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator));
@ -16260,7 +16584,7 @@ namespace vk
vkDestroyShaderModule(m_device, static_cast<VkShaderModule>(shaderModule), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator))); vkDestroyShaderModule(m_device, static_cast<VkShaderModule>(shaderModule), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)));
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createPipelineCache(const PipelineCacheCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineCache* pPipelineCache) const Result createPipelineCache(const PipelineCacheCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineCache* pPipelineCache) const
{ {
return static_cast<Result>(vkCreatePipelineCache(m_device, reinterpret_cast<const VkPipelineCacheCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkPipelineCache*>(pPipelineCache))); return static_cast<Result>(vkCreatePipelineCache(m_device, reinterpret_cast<const VkPipelineCacheCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkPipelineCache*>(pPipelineCache)));
@ -16274,7 +16598,21 @@ namespace vk
return createResultValue(result, pipelineCache, "vk::Device::createPipelineCache"); return createResultValue(result, pipelineCache, "vk::Device::createPipelineCache");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createPipelineCache(const PipelineCacheCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<PipelineCache>* pPipelineCache) const
{
return static_cast<Result>(vkCreatePipelineCache(m_device, reinterpret_cast<const VkPipelineCacheCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkPipelineCache*>(pPipelineCache)));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<PipelineCache>>::type createPipelineCache(const PipelineCacheCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<PipelineCache> pipelineCache(ptrMemberFnc<Device, PipelineCache, Optional<const AllocationCallbacks>>(&Device::destroyPipelineCache), *this, allocator);
Result result = static_cast<Result>(vkCreatePipelineCache(m_device, reinterpret_cast<const VkPipelineCacheCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkPipelineCache*>(&pipelineCache)));
return createResultValue(result, pipelineCache, "vk::Device::createPipelineCache");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
void destroyPipelineCache(PipelineCache pipelineCache, const AllocationCallbacks* pAllocator) const void destroyPipelineCache(PipelineCache pipelineCache, const AllocationCallbacks* pAllocator) const
{ {
vkDestroyPipelineCache(m_device, static_cast<VkPipelineCache>(pipelineCache), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator)); vkDestroyPipelineCache(m_device, static_cast<VkPipelineCache>(pipelineCache), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator));
@ -16326,10 +16664,10 @@ namespace vk
return createResultValue(result, "vk::Device::mergePipelineCaches"); return createResultValue(result, "vk::Device::mergePipelineCaches");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createGraphicsPipelines(PipelineCache pipelineCache, uint32_t createInfoCount, const GraphicsPipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines) const Result createGraphicsPipelines(PipelineCache pipelineCache, uint32_t createInfoCount, const GraphicsPipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines) const
{ {
return static_cast<Result>( vkCreateGraphicsPipelines( m_device, static_cast<VkPipelineCache>( pipelineCache ), createInfoCount, reinterpret_cast<const VkGraphicsPipelineCreateInfo*>( pCreateInfos ), reinterpret_cast<const VkAllocationCallbacks*>( pAllocator ), reinterpret_cast<VkPipeline*>( pPipelines ) ) ); return static_cast<Result>(vkCreateGraphicsPipelines(m_device, static_cast<VkPipelineCache>(pipelineCache), createInfoCount, reinterpret_cast<const VkGraphicsPipelineCreateInfo*>(pCreateInfos), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkPipeline*>(pipelines)));
} }
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE #ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
@ -16348,7 +16686,39 @@ namespace vk
return createResultValue(result, pipeline, "vk::Device::createGraphicsPipeline"); return createResultValue(result, pipeline, "vk::Device::createGraphicsPipeline");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createGraphicsPipelines(PipelineCache pipelineCache, uint32_t createInfoCount, const GraphicsPipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, scoped_handle<Pipeline>* pPipelines) const
{
Pipeline* pPipelinesRaw = new Pipeline[createInfoCount];
auto result = static_cast<Result>(vkCreateGraphicsPipelines(m_device, static_cast<VkPipelineCache>(pipelineCache), createInfoCount, reinterpret_cast<const VkGraphicsPipelineCreateInfo*>(pCreateInfos), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkPipeline*>(pPipelinesRaw)));
if (result == Result::eSuccess)
for (uint32_t i = 0; i < createInfoCount; i++)
pPipelines[i] = pPipelinesRaw[i];
delete[] pPipelinesRaw;
return result;
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Allocator = std::allocator<scoped_handle<Pipeline>>>
typename ResultValueType<std::vector<scoped_handle<Pipeline>, Allocator>>::type createGraphicsPipelines(PipelineCache pipelineCache, ArrayProxy<const GraphicsPipelineCreateInfo> createInfos, Optional<const AllocationCallbacks> allocator = nullptr) const
{
std::vector<Pipeline> pipelinesRaw(createInfos.size());
Result result = static_cast<Result>(vkCreateGraphicsPipelines(m_device, static_cast<VkPipelineCache>(pipelineCache), createInfos.size(), reinterpret_cast<const VkGraphicsPipelineCreateInfo*>(createInfos.data()), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkPipeline*>(pipelinesRaw.data())));
std::vector<scoped_handle<Pipeline>, Allocator> pipelines(createInfos.size());
std::transform(pipelinesRaw.begin(), pipelinesRaw.end(), pipelines.begin(), [this, &allocator](Pipeline p) {return scoped_handle<Pipeline>(ptrMemberFnc<Device, Pipeline, Optional<const AllocationCallbacks>>(&Device::destroyPipeline), *this, allocator, p); });
return createResultValue(result, pipelines, "vk::Device::createGraphicsPipelines");
}
ResultValueType<scoped_handle<Pipeline>>::type createGraphicsPipeline(PipelineCache pipelineCache, const GraphicsPipelineCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<Pipeline> pipeline(ptrMemberFnc<Device, Pipeline, Optional<const AllocationCallbacks>>(&Device::destroyPipeline), *this, allocator);
Result result = static_cast<Result>(vkCreateGraphicsPipelines(m_device, static_cast<VkPipelineCache>(pipelineCache), 1, reinterpret_cast<const VkGraphicsPipelineCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkPipeline*>(&pipeline)));
return createResultValue(result, pipeline, "vk::Device::createGraphicsPipeline");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createComputePipelines(PipelineCache pipelineCache, uint32_t createInfoCount, const ComputePipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines) const Result createComputePipelines(PipelineCache pipelineCache, uint32_t createInfoCount, const ComputePipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, Pipeline* pPipelines) const
{ {
return static_cast<Result>(vkCreateComputePipelines(m_device, static_cast<VkPipelineCache>(pipelineCache), createInfoCount, reinterpret_cast<const VkComputePipelineCreateInfo*>(pCreateInfos), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkPipeline*>(pPipelines))); return static_cast<Result>(vkCreateComputePipelines(m_device, static_cast<VkPipelineCache>(pipelineCache), createInfoCount, reinterpret_cast<const VkComputePipelineCreateInfo*>(pCreateInfos), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkPipeline*>(pPipelines)));
@ -16370,6 +16740,37 @@ namespace vk
return createResultValue(result, pipeline, "vk::Device::createComputePipeline"); return createResultValue(result, pipeline, "vk::Device::createComputePipeline");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createComputePipelines(PipelineCache pipelineCache, uint32_t createInfoCount, const ComputePipelineCreateInfo* pCreateInfos, const AllocationCallbacks* pAllocator, scoped_handle<Pipeline>* pPipelines) const
{
Pipeline* pPipelinesRaw = new Pipeline[createInfoCount];
auto result = static_cast<Result>(vkCreateComputePipelines(m_device, static_cast<VkPipelineCache>(pipelineCache), createInfoCount, reinterpret_cast<const VkComputePipelineCreateInfo*>(pCreateInfos), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkPipeline*>(pPipelines)));
if (result == Result::eSuccess)
for (uint32_t i = 0; i < createInfoCount; i++)
pPipelines[i] = pPipelinesRaw[i];
delete[] pPipelinesRaw;
return result;
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Allocator = std::allocator<scoped_handle<Pipeline>>>
typename ResultValueType<std::vector<scoped_handle<Pipeline>, Allocator>>::type createComputePipelines(PipelineCache pipelineCache, ArrayProxy<const ComputePipelineCreateInfo> createInfos, Optional<const AllocationCallbacks> allocator = nullptr) const
{
std::vector<Pipeline> pipelinesRaw(createInfos.size());
Result result = static_cast<Result>(vkCreateComputePipelines(m_device, static_cast<VkPipelineCache>(pipelineCache), createInfos.size(), reinterpret_cast<const VkComputePipelineCreateInfo*>(createInfos.data()), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkPipeline*>(pipelinesRaw.data())));
std::vector<scoped_handle<Pipeline>, Allocator> pipelines(createInfos.size());
std::transform(pipelinesRaw.begin(), pipelinesRaw.end(), pipelines.begin(), [this, &allocator](Pipeline p) {return scoped_handle<Pipeline>(ptrMemberFnc<Device, Pipeline, Optional<const AllocationCallbacks>>(&Device::destroyPipeline), *this, allocator, p); });
return createResultValue(result, pipelines, "vk::Device::createComputePipelines");
}
ResultValueType<scoped_handle<Pipeline>>::type createComputePipeline(PipelineCache pipelineCache, const ComputePipelineCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<Pipeline> pipeline(ptrMemberFnc<Device, Pipeline, Optional<const AllocationCallbacks>>(&Device::destroyPipeline), *this, allocator);
Result result = static_cast<Result>(vkCreateComputePipelines(m_device, static_cast<VkPipelineCache>(pipelineCache), 1, reinterpret_cast<const VkComputePipelineCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkPipeline*>(&pipeline)));
return createResultValue(result, pipeline, "vk::Device::createComputePipeline");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
void destroyPipeline(Pipeline pipeline, const AllocationCallbacks* pAllocator) const void destroyPipeline(Pipeline pipeline, const AllocationCallbacks* pAllocator) const
{ {
@ -16383,6 +16784,7 @@ namespace vk
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createPipelineLayout(const PipelineLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineLayout* pPipelineLayout) const Result createPipelineLayout(const PipelineLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, PipelineLayout* pPipelineLayout) const
{ {
return static_cast<Result>(vkCreatePipelineLayout(m_device, reinterpret_cast<const VkPipelineLayoutCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkPipelineLayout*>(pPipelineLayout))); return static_cast<Result>(vkCreatePipelineLayout(m_device, reinterpret_cast<const VkPipelineLayoutCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkPipelineLayout*>(pPipelineLayout)));
@ -16396,6 +16798,21 @@ namespace vk
return createResultValue(result, pipelineLayout, "vk::Device::createPipelineLayout"); return createResultValue(result, pipelineLayout, "vk::Device::createPipelineLayout");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createPipelineLayout(const PipelineLayoutCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<PipelineLayout>* pPipelineLayout) const
{
return static_cast<Result>(vkCreatePipelineLayout(m_device, reinterpret_cast<const VkPipelineLayoutCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkPipelineLayout*>(pPipelineLayout)));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<PipelineLayout>>::type createPipelineLayout(const PipelineLayoutCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<PipelineLayout> pipelineLayout(ptrMemberFnc<Device, PipelineLayout, Optional<const AllocationCallbacks>>(&Device::destroyPipelineLayout), *this, allocator);
Result result = static_cast<Result>(vkCreatePipelineLayout(m_device, reinterpret_cast<const VkPipelineLayoutCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkPipelineLayout*>(&pipelineLayout)));
return createResultValue(result, pipelineLayout, "vk::Device::createPipelineLayout");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
void destroyPipelineLayout(PipelineLayout pipelineLayout, const AllocationCallbacks* pAllocator) const void destroyPipelineLayout(PipelineLayout pipelineLayout, const AllocationCallbacks* pAllocator) const
{ {
@ -16409,6 +16826,7 @@ namespace vk
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createSampler(const SamplerCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Sampler* pSampler) const Result createSampler(const SamplerCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Sampler* pSampler) const
{ {
return static_cast<Result>(vkCreateSampler(m_device, reinterpret_cast<const VkSamplerCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkSampler*>(pSampler))); return static_cast<Result>(vkCreateSampler(m_device, reinterpret_cast<const VkSamplerCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkSampler*>(pSampler)));
@ -16422,6 +16840,21 @@ namespace vk
return createResultValue(result, sampler, "vk::Device::createSampler"); return createResultValue(result, sampler, "vk::Device::createSampler");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createSampler(const SamplerCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<Sampler>* pSampler) const
{
return static_cast<Result>(vkCreateSampler(m_device, reinterpret_cast<const VkSamplerCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkSampler*>(pSampler)));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<Sampler>>::type createSampler(const SamplerCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<Sampler> sampler(ptrMemberFnc<Device, Sampler, Optional<const AllocationCallbacks>>(&Device::destroySampler), m_device, allocator);
Result result = static_cast<Result>(vkCreateSampler(m_device, reinterpret_cast<const VkSamplerCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkSampler*>(&sampler)));
return createResultValue(result, sampler, "vk::Device::createSampler");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif
void destroySampler(Sampler sampler, const AllocationCallbacks* pAllocator) const void destroySampler(Sampler sampler, const AllocationCallbacks* pAllocator) const
{ {
@ -16461,6 +16894,7 @@ namespace vk
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createDescriptorPool(const DescriptorPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorPool* pDescriptorPool) const Result createDescriptorPool(const DescriptorPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, DescriptorPool* pDescriptorPool) const
{ {
return static_cast<Result>(vkCreateDescriptorPool(m_device, reinterpret_cast<const VkDescriptorPoolCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkDescriptorPool*>(pDescriptorPool))); return static_cast<Result>(vkCreateDescriptorPool(m_device, reinterpret_cast<const VkDescriptorPoolCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkDescriptorPool*>(pDescriptorPool)));
@ -16474,6 +16908,21 @@ namespace vk
return createResultValue(result, descriptorPool, "vk::Device::createDescriptorPool"); return createResultValue(result, descriptorPool, "vk::Device::createDescriptorPool");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createDescriptorPool(const DescriptorPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<DescriptorPool>* pDescriptorPool) const
{
return static_cast<Result>(vkCreateDescriptorPool(m_device, reinterpret_cast<const VkDescriptorPoolCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkDescriptorPool*>(pDescriptorPool)));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<DescriptorPool>>::type createDescriptorPool(const DescriptorPoolCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<DescriptorPool> descriptorPool(ptrMemberFnc<Device, DescriptorPool, Optional< const AllocationCallbacks>>(&Device::destroyDescriptorPool), m_device, allocator);
Result result = static_cast<Result>(vkCreateDescriptorPool(m_device, reinterpret_cast<const VkDescriptorPoolCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkDescriptorPool*>(&descriptorPool)));
return createResultValue(result, descriptorPool, "vk::Device::createDescriptorPool");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif
void destroyDescriptorPool(DescriptorPool descriptorPool, const AllocationCallbacks* pAllocator) const void destroyDescriptorPool(DescriptorPool descriptorPool, const AllocationCallbacks* pAllocator) const
{ {
@ -16502,6 +16951,7 @@ namespace vk
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
Result allocateDescriptorSets(const DescriptorSetAllocateInfo* pAllocateInfo, DescriptorSet* pDescriptorSets) const Result allocateDescriptorSets(const DescriptorSetAllocateInfo* pAllocateInfo, DescriptorSet* pDescriptorSets) const
{ {
return static_cast<Result>(vkAllocateDescriptorSets(m_device, reinterpret_cast<const VkDescriptorSetAllocateInfo*>(pAllocateInfo), reinterpret_cast<VkDescriptorSet*>(pDescriptorSets))); return static_cast<Result>(vkAllocateDescriptorSets(m_device, reinterpret_cast<const VkDescriptorSetAllocateInfo*>(pAllocateInfo), reinterpret_cast<VkDescriptorSet*>(pDescriptorSets)));
@ -16516,7 +16966,6 @@ namespace vk
return createResultValue(result, descriptorSets, "vk::Device::allocateDescriptorSets"); return createResultValue(result, descriptorSets, "vk::Device::allocateDescriptorSets");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
Result freeDescriptorSets(DescriptorPool descriptorPool, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets) const Result freeDescriptorSets(DescriptorPool descriptorPool, uint32_t descriptorSetCount, const DescriptorSet* pDescriptorSets) const
{ {
return static_cast<Result>(vkFreeDescriptorSets(m_device, static_cast<VkDescriptorPool>(descriptorPool), descriptorSetCount, reinterpret_cast<const VkDescriptorSet*>(pDescriptorSets))); return static_cast<Result>(vkFreeDescriptorSets(m_device, static_cast<VkDescriptorPool>(descriptorPool), descriptorSetCount, reinterpret_cast<const VkDescriptorSet*>(pDescriptorSets)));
@ -16542,6 +16991,7 @@ namespace vk
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createFramebuffer(const FramebufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Framebuffer* pFramebuffer) const Result createFramebuffer(const FramebufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Framebuffer* pFramebuffer) const
{ {
return static_cast<Result>(vkCreateFramebuffer(m_device, reinterpret_cast<const VkFramebufferCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkFramebuffer*>(pFramebuffer))); return static_cast<Result>(vkCreateFramebuffer(m_device, reinterpret_cast<const VkFramebufferCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkFramebuffer*>(pFramebuffer)));
@ -16555,6 +17005,21 @@ namespace vk
return createResultValue(result, framebuffer, "vk::Device::createFramebuffer"); return createResultValue(result, framebuffer, "vk::Device::createFramebuffer");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createFramebuffer(const FramebufferCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<Framebuffer> framebuffer) const
{
return static_cast<Result>(vkCreateFramebuffer(m_device, reinterpret_cast<const VkFramebufferCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkFramebuffer*>(&framebuffer)));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<Framebuffer>>::type createFramebuffer(const FramebufferCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<Framebuffer> framebuffer(ptrMemberFnc<Device, Framebuffer, Optional<const AllocationCallbacks>>(&Device::destroyFramebuffer), *this, allocator);
Result result = static_cast<Result>(vkCreateFramebuffer(m_device, reinterpret_cast<const VkFramebufferCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkFramebuffer*>(&framebuffer)));
return createResultValue(result, framebuffer, "vk::Device::createFramebuffer");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
void destroyFramebuffer(Framebuffer framebuffer, const AllocationCallbacks* pAllocator) const void destroyFramebuffer(Framebuffer framebuffer, const AllocationCallbacks* pAllocator) const
{ {
@ -16568,6 +17033,7 @@ namespace vk
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createRenderPass(const RenderPassCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, RenderPass* pRenderPass) const Result createRenderPass(const RenderPassCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, RenderPass* pRenderPass) const
{ {
return static_cast<Result>(vkCreateRenderPass(m_device, reinterpret_cast<const VkRenderPassCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkRenderPass*>(pRenderPass))); return static_cast<Result>(vkCreateRenderPass(m_device, reinterpret_cast<const VkRenderPassCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkRenderPass*>(pRenderPass)));
@ -16581,6 +17047,21 @@ namespace vk
return createResultValue(result, renderPass, "vk::Device::createRenderPass"); return createResultValue(result, renderPass, "vk::Device::createRenderPass");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createRenderPass(const RenderPassCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<RenderPass>* pRenderPass) const
{
return static_cast<Result>(vkCreateRenderPass(m_device, reinterpret_cast<const VkRenderPassCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkRenderPass*>(&pRenderPass->get())));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<RenderPass>>::type createRenderPass(const RenderPassCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<RenderPass> renderPass(ptrMemberFnc < Device, RenderPass, Optional<const AllocationCallbacks>>(&Device::destroyRenderPass), *this, allocator);
Result result = static_cast<Result>(vkCreateRenderPass(m_device, reinterpret_cast<const VkRenderPassCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkRenderPass*>(&renderPass)));
return createResultValue(result, renderPass, "vk::Device::createRenderPass");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
void destroyRenderPass(RenderPass renderPass, const AllocationCallbacks* pAllocator) const void destroyRenderPass(RenderPass renderPass, const AllocationCallbacks* pAllocator) const
{ {
@ -16608,6 +17089,7 @@ namespace vk
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createCommandPool(const CommandPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, CommandPool* pCommandPool) const Result createCommandPool(const CommandPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, CommandPool* pCommandPool) const
{ {
return static_cast<Result>(vkCreateCommandPool(m_device, reinterpret_cast<const VkCommandPoolCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkCommandPool*>(pCommandPool))); return static_cast<Result>(vkCreateCommandPool(m_device, reinterpret_cast<const VkCommandPoolCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkCommandPool*>(pCommandPool)));
@ -16621,6 +17103,21 @@ namespace vk
return createResultValue(result, commandPool, "vk::Device::createCommandPool"); return createResultValue(result, commandPool, "vk::Device::createCommandPool");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createCommandPool(const CommandPoolCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<CommandPool>* pCommandPool) const
{
return static_cast<Result>(vkCreateCommandPool(m_device, reinterpret_cast<const VkCommandPoolCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkCommandPool*>(&pCommandPool->get())));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<CommandPool>>::type createCommandPool(const CommandPoolCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<CommandPool> commandPool(ptrMemberFnc<Device, CommandPool, Optional<const AllocationCallbacks>>(&Device::destroyCommandPool), *this, allocator);
Result result = static_cast<Result>(vkCreateCommandPool(m_device, reinterpret_cast<const VkCommandPoolCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkCommandPool*>(&commandPool)));
return createResultValue(result, commandPool, "vk::Device::createCommandPool");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
void destroyCommandPool(CommandPool commandPool, const AllocationCallbacks* pAllocator) const void destroyCommandPool(CommandPool commandPool, const AllocationCallbacks* pAllocator) const
{ {
@ -16676,6 +17173,7 @@ namespace vk
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createSharedSwapchainsKHR(uint32_t swapchainCount, const SwapchainCreateInfoKHR* pCreateInfos, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchains) const Result createSharedSwapchainsKHR(uint32_t swapchainCount, const SwapchainCreateInfoKHR* pCreateInfos, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchains) const
{ {
return static_cast<Result>(vkCreateSharedSwapchainsKHR(m_device, swapchainCount, reinterpret_cast<const VkSwapchainCreateInfoKHR*>(pCreateInfos), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkSwapchainKHR*>(pSwapchains))); return static_cast<Result>(vkCreateSharedSwapchainsKHR(m_device, swapchainCount, reinterpret_cast<const VkSwapchainCreateInfoKHR*>(pCreateInfos), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkSwapchainKHR*>(pSwapchains)));
@ -16697,7 +17195,30 @@ namespace vk
return createResultValue(result, swapchain, "vk::Device::createSharedSwapchainKHR"); return createResultValue(result, swapchain, "vk::Device::createSharedSwapchainKHR");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createSharedSwapchainsKHR(uint32_t swapchainCount, const SwapchainCreateInfoKHR* pCreateInfos, const AllocationCallbacks* pAllocator, scoped_handle<SwapchainKHR>* pSwapchains) const
{
return static_cast<Result>(vkCreateSharedSwapchainsKHR(m_device, swapchainCount, reinterpret_cast<const VkSwapchainCreateInfoKHR*>(pCreateInfos), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkSwapchainKHR*>(pSwapchains)));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Allocator = std::allocator<scoped_handle<SwapchainKHR>>>
typename ResultValueType<std::vector<scoped_handle<SwapchainKHR>, Allocator>>::type createSharedSwapchainsKHR(ArrayProxy<const SwapchainCreateInfoKHR> createInfos, Optional<const AllocationCallbacks> allocator = nullptr) const
{
std::vector<scoped_handle<SwapchainKHR>, Allocator> swapchains(createInfos.size(), scoped_handle<SwapchainKHR>(ptrMemberFnc<Device, SwapchainKHR, Optional<const AllocationCallbacks>>(&Device::destroySwapchainKHR), m_device, allocator, false));
Result result = static_cast<Result>(vkCreateSharedSwapchainsKHR(m_device, createInfos.size(), reinterpret_cast<const VkSwapchainCreateInfoKHR*>(createInfos.data()), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkSwapchainKHR*>(swapchains.data())));
return createResultValue(result, swapchains, "vk::Device::createSharedSwapchainsKHR");
}
ResultValueType<scoped_handle<SwapchainKHR>>::type createSharedSwapchainKHR(const SwapchainCreateInfoKHR & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<SwapchainKHR> swapchain(ptrMemberFnc<Device, SwapchainKHR, Optional<const AllocationCallbacks>>(&Device::destroySwapchainKHR), m_device, allocator);
Result result = static_cast<Result>(vkCreateSharedSwapchainsKHR(m_device, 1, reinterpret_cast<const VkSwapchainCreateInfoKHR*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkSwapchainKHR*>(&swapchain)));
return createResultValue(result, swapchain, "vk::Device::createSharedSwapchainKHR");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createSwapchainKHR(const SwapchainCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchain) const Result createSwapchainKHR(const SwapchainCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, SwapchainKHR* pSwapchain) const
{ {
return static_cast<Result>(vkCreateSwapchainKHR(m_device, reinterpret_cast<const VkSwapchainCreateInfoKHR*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkSwapchainKHR*>(pSwapchain))); return static_cast<Result>(vkCreateSwapchainKHR(m_device, reinterpret_cast<const VkSwapchainCreateInfoKHR*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkSwapchainKHR*>(pSwapchain)));
@ -16711,7 +17232,21 @@ namespace vk
return createResultValue(result, swapchain, "vk::Device::createSwapchainKHR"); return createResultValue(result, swapchain, "vk::Device::createSwapchainKHR");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createSwapchainKHR(const SwapchainCreateInfoKHR* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<SwapchainKHR>* pSwapchain) const
{
return static_cast<Result>(vkCreateSwapchainKHR(m_device, reinterpret_cast<const VkSwapchainCreateInfoKHR*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkSwapchainKHR*>(pSwapchain)));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<SwapchainKHR>>::type createSwapchainKHR(const SwapchainCreateInfoKHR & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<SwapchainKHR> swapchain(ptrMemberFnc<Device, SwapchainKHR, Optional<const AllocationCallbacks>>(&Device::destroySwapchainKHR), *this, allocator);
Result result = static_cast<Result>(vkCreateSwapchainKHR(m_device, reinterpret_cast<const VkSwapchainCreateInfoKHR*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkSwapchainKHR*>(&swapchain)));
return createResultValue(result, swapchain, "vk::Device::createSwapchainKHR");
}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
void destroySwapchainKHR(SwapchainKHR swapchain, const AllocationCallbacks* pAllocator) const void destroySwapchainKHR(SwapchainKHR swapchain, const AllocationCallbacks* pAllocator) const
{ {
vkDestroySwapchainKHR(m_device, static_cast<VkSwapchainKHR>(swapchain), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator)); vkDestroySwapchainKHR(m_device, static_cast<VkSwapchainKHR>(swapchain), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator));
@ -16814,6 +17349,7 @@ namespace vk
private: private:
VkDevice m_device; VkDevice m_device;
}; };
static_assert(sizeof(Device) == sizeof(VkDevice), "handle and wrapper have different size!"); static_assert(sizeof(Device) == sizeof(VkDevice), "handle and wrapper have different size!");
class PhysicalDevice class PhysicalDevice
@ -16937,7 +17473,7 @@ namespace vk
return createResultValue(result, imageFormatProperties, "vk::PhysicalDevice::getImageFormatProperties"); return createResultValue(result, imageFormatProperties, "vk::PhysicalDevice::getImageFormatProperties");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#ifdef VULKAN_HPP_DISABLE_SCOPED_HANDLING
Result createDevice(const DeviceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Device* pDevice) const Result createDevice(const DeviceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, Device* pDevice) const
{ {
return static_cast<Result>(vkCreateDevice(m_physicalDevice, reinterpret_cast<const VkDeviceCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkDevice*>(pDevice))); return static_cast<Result>(vkCreateDevice(m_physicalDevice, reinterpret_cast<const VkDeviceCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkDevice*>(pDevice)));
@ -16951,7 +17487,21 @@ namespace vk
return createResultValue(result, device, "vk::PhysicalDevice::createDevice"); return createResultValue(result, device, "vk::PhysicalDevice::createDevice");
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#else
Result createDevice(const DeviceCreateInfo* pCreateInfo, const AllocationCallbacks* pAllocator, scoped_handle<Device>& Device) const
{
return static_cast<Result>(vkCreateDevice(m_physicalDevice, reinterpret_cast<const VkDeviceCreateInfo*>(pCreateInfo), reinterpret_cast<const VkAllocationCallbacks*>(pAllocator), reinterpret_cast<VkDevice*>(&Device)));
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
ResultValueType<scoped_handle<Device>>::type createDevice(const DeviceCreateInfo & createInfo, Optional<const AllocationCallbacks> allocator = nullptr) const
{
scoped_handle<Device> device([](Device& d) {d.destroy(); });
Result result = static_cast<Result>(vkCreateDevice(m_physicalDevice, reinterpret_cast<const VkDeviceCreateInfo*>(&createInfo), reinterpret_cast<const VkAllocationCallbacks*>(static_cast<const AllocationCallbacks*>(allocator)), reinterpret_cast<VkDevice*>(&device)));
return createResultValue(result, device, "vk::PhysicalDevice::createDevice");
}
#endif
#endif /*VULKAN_HPP_DISABLE_SCOPED_HANDLING*/
Result enumerateDeviceLayerProperties(uint32_t* pPropertyCount, LayerProperties* pProperties) const Result enumerateDeviceLayerProperties(uint32_t* pPropertyCount, LayerProperties* pProperties) const
{ {
return static_cast<Result>(vkEnumerateDeviceLayerProperties(m_physicalDevice, pPropertyCount, reinterpret_cast<VkLayerProperties*>(pProperties))); return static_cast<Result>(vkEnumerateDeviceLayerProperties(m_physicalDevice, pPropertyCount, reinterpret_cast<VkLayerProperties*>(pProperties)));
@ -17771,6 +18321,8 @@ namespace vk
} }
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ #endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
inline std::string to_string(FramebufferCreateFlagBits) inline std::string to_string(FramebufferCreateFlagBits)
{ {
return "(void)"; return "(void)";