Replace DeviceHandle by references

and keep device alive until Vulkan is freed
This commit is contained in:
Lynix
2020-03-13 18:38:26 +01:00
parent 4cf24cde7d
commit 63547fcd4e
56 changed files with 303 additions and 268 deletions

View File

@@ -12,30 +12,6 @@ namespace Nz
{
namespace Vk
{
inline Device::Device(Instance& instance) :
m_instance(instance),
m_physicalDevice(nullptr),
m_device(VK_NULL_HANDLE)
{
}
inline Device::~Device()
{
Destroy();
}
inline void Device::Destroy()
{
if (m_device != VK_NULL_HANDLE)
{
vkDeviceWaitIdle(m_device);
vkDestroyDevice(m_device, (m_allocator.pfnAllocation) ? &m_allocator : nullptr);
m_device = VK_NULL_HANDLE;
m_physicalDevice = nullptr;
}
}
inline const std::vector<Device::QueueFamilyInfo>& Device::GetEnabledQueues() const
{
return m_enabledQueuesInfos;