VulkanRenderer: Move vulkan wrappers to a separate directory

This commit is contained in:
Lynix
2016-10-29 01:59:06 +02:00
parent 8d06c57d0d
commit e61c6d0a8e
58 changed files with 108 additions and 108 deletions

View File

@@ -0,0 +1,53 @@
// Copyright (C) 2016 Jérôme Leclercq
// This file is part of the "Nazara Engine - Vulkan Renderer"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/VulkanRenderer/Wrapper/DescriptorPool.hpp>
#include <Nazara/VulkanRenderer/Wrapper/DescriptorSet.hpp>
#include <Nazara/VulkanRenderer/Debug.hpp>
namespace Nz
{
namespace Vk
{
DescriptorSet DescriptorPool::AllocateDescriptorSet(const VkDescriptorSetLayout& setLayouts)
{
VkDescriptorSetAllocateInfo createInfo =
{
VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, // VkStructureType sType;
nullptr, // const void* pNext;
m_handle, // VkDescriptorPool descriptorPool;
1U, // uint32_t descriptorSetCount;
&setLayouts // const VkDescriptorSetLayout* pSetLayouts;
};
VkDescriptorSet handle = VK_NULL_HANDLE;
m_lastErrorCode = m_device->vkAllocateDescriptorSets(*m_device, &createInfo, &handle);
return DescriptorSet(*this, handle);
}
std::vector<DescriptorSet> DescriptorPool::AllocateDescriptorSets(UInt32 descriptorSetCount, const VkDescriptorSetLayout* setLayouts)
{
VkDescriptorSetAllocateInfo createInfo =
{
VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, // VkStructureType sType;
nullptr, // const void* pNext;
m_handle, // VkDescriptorPool descriptorPool;
descriptorSetCount, // uint32_t descriptorSetCount;
setLayouts // const VkDescriptorSetLayout* pSetLayouts;
};
std::vector<VkDescriptorSet> handles(descriptorSetCount, VK_NULL_HANDLE);
m_lastErrorCode = m_device->vkAllocateDescriptorSets(*m_device, &createInfo, handles.data());
if (m_lastErrorCode != VkResult::VK_SUCCESS)
return std::vector<DescriptorSet>();
std::vector<DescriptorSet> descriptorSets;
for (UInt32 i = 0; i < descriptorSetCount; ++i)
descriptorSets.emplace_back(DescriptorSet(*this, handles[i]));
return descriptorSets;
}
}
}