Vulkan: Add support for Descriptors

Former-commit-id: 3aeb182030040b707dd2d98ddb2991a3b7f58b19 [formerly bf30ae4035d9855f493252bd7c1c95d97e7f4bf5]
Former-commit-id: 8bdbc5f6ff1bec375c80b0974bdd1e269cfca675
This commit is contained in:
Lynix
2016-07-21 12:25:05 +02:00
parent 2e61964de4
commit 6d737b07cc
12 changed files with 450 additions and 1 deletions

View File

@@ -0,0 +1,54 @@
// Copyright (C) 2016 Jérôme Leclercq
// This file is part of the "Nazara Engine - Vulkan"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Vulkan/VkDescriptorPool.hpp>
#include <Nazara/Vulkan/Debug.hpp>
namespace Nz
{
namespace Vk
{
inline bool DescriptorPool::Create(const DeviceHandle& device, UInt32 maxSets, const VkDescriptorPoolSize& poolSize, VkDescriptorPoolCreateFlags flags, const VkAllocationCallbacks* allocator)
{
VkDescriptorPoolCreateInfo createInfo =
{
VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, // VkStructureType sType;
nullptr, // const void* pNext;
flags, // VkDescriptorPoolCreateFlags flags;
maxSets, // uint32_t maxSets;
1U, // uint32_t poolSizeCount;
&poolSize // const VkDescriptorPoolSize* pPoolSizes;
};
return Create(device, createInfo, allocator);
}
inline bool DescriptorPool::Create(const DeviceHandle& device, UInt32 maxSets, UInt32 poolSizeCount, const VkDescriptorPoolSize* poolSize, VkDescriptorPoolCreateFlags flags, const VkAllocationCallbacks* allocator)
{
VkDescriptorPoolCreateInfo createInfo =
{
VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, // VkStructureType sType;
nullptr, // const void* pNext;
flags, // VkDescriptorPoolCreateFlags flags;
maxSets, // uint32_t maxSets;
poolSizeCount, // uint32_t poolSizeCount;
poolSize // const VkDescriptorPoolSize* pPoolSizes;
};
return Create(device, createInfo, allocator);
}
inline VkResult DescriptorPool::CreateHelper(const DeviceHandle& device, const VkDescriptorPoolCreateInfo* createInfo, const VkAllocationCallbacks* allocator, VkDescriptorPool* handle)
{
return device->vkCreateDescriptorPool(*device, createInfo, allocator, handle);
}
inline void DescriptorPool::DestroyHelper(const DeviceHandle& device, VkDescriptorPool handle, const VkAllocationCallbacks* allocator)
{
return device->vkDestroyDescriptorPool(*device, handle, allocator);
}
}
}
#include <Nazara/Vulkan/DebugOff.hpp>