VulkanRenderer: Replace ObjectHandle by std::shared_ptr/raw pointers

This commit is contained in:
Lynix
2020-02-23 12:02:15 +01:00
parent 0c008236ba
commit 79f732ee8a
29 changed files with 80 additions and 81 deletions

View File

@@ -5,6 +5,7 @@
#include <Nazara/VulkanRenderer/Wrapper/DescriptorSet.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/VulkanRenderer/Wrapper/Instance.hpp>
#include <cassert>
#include <Nazara/VulkanRenderer/Debug.hpp>
namespace Nz
@@ -12,7 +13,7 @@ namespace Nz
namespace Vk
{
inline DescriptorSet::DescriptorSet() :
m_pool(),
m_pool(nullptr),
m_handle(VK_NULL_HANDLE)
{
}
@@ -24,7 +25,7 @@ namespace Nz
}
inline DescriptorSet::DescriptorSet(DescriptorSet&& descriptorSet) :
m_pool(std::move(descriptorSet.m_pool)),
m_pool(descriptorSet.m_pool),
m_allocator(descriptorSet.m_allocator),
m_handle(descriptorSet.m_handle),
m_lastErrorCode(descriptorSet.m_lastErrorCode)
@@ -40,7 +41,10 @@ namespace Nz
inline void DescriptorSet::Free()
{
if (m_handle)
{
assert(m_pool);
m_pool->GetDevice()->vkFreeDescriptorSets(*m_pool->GetDevice(), *m_pool, 1, &m_handle);
}
}
inline VkResult DescriptorSet::GetLastErrorCode() const
@@ -104,7 +108,7 @@ namespace Nz
m_allocator = descriptorSet.m_allocator;
m_handle = descriptorSet.m_handle;
m_lastErrorCode = descriptorSet.m_lastErrorCode;
m_pool = std::move(descriptorSet.m_pool);
m_pool = descriptorSet.m_pool;
m_handle = descriptorSet.m_handle;
descriptorSet.m_handle = VK_NULL_HANDLE;