Added missing move assignment and extra check for command buffer destructor
This commit is contained in:
parent
cfa07e9b3b
commit
e5df98aaa6
|
@ -24,7 +24,7 @@ namespace SHADE
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
SHVkCommandBuffer::~SHVkCommandBuffer(void) noexcept
|
SHVkCommandBuffer::~SHVkCommandBuffer(void) noexcept
|
||||||
{
|
{
|
||||||
if (vkCommandBuffer)
|
if (vkCommandBuffer && parentPool)
|
||||||
parentPool->GetLogicalDevice()->GetVkLogicalDevice().freeCommandBuffers(parentPool->GetVkCommandPool(), commandBufferCount, &vkCommandBuffer);
|
parentPool->GetLogicalDevice()->GetVkLogicalDevice().freeCommandBuffers(parentPool->GetVkCommandPool(), commandBufferCount, &vkCommandBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,8 +102,6 @@ namespace SHADE
|
||||||
logicalDeviceHdl = rhs.logicalDeviceHdl;
|
logicalDeviceHdl = rhs.logicalDeviceHdl;
|
||||||
transient = rhs.transient;
|
transient = rhs.transient;
|
||||||
|
|
||||||
static_cast<ISelfHandle<SHVkCommandPool>&>(*this) = static_cast<ISelfHandle<SHVkCommandPool>&>(rhs);
|
|
||||||
|
|
||||||
rhs.vkCommandPool = VK_NULL_HANDLE;
|
rhs.vkCommandPool = VK_NULL_HANDLE;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
@ -251,6 +251,22 @@ namespace SHADE
|
||||||
vkLogicalDevice.destroy(nullptr);
|
vkLogicalDevice.destroy(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SHVkLogicalDevice& SHVkLogicalDevice::operator=(SHVkLogicalDevice&& rhs) noexcept
|
||||||
|
{
|
||||||
|
if (this == &rhs)
|
||||||
|
return *this;
|
||||||
|
|
||||||
|
vkLogicalDevice = std::move (rhs.vkLogicalDevice);
|
||||||
|
queueFamilyIndices = std::move (rhs.queueFamilyIndices);
|
||||||
|
vmaAllocator = rhs.vmaAllocator;
|
||||||
|
nonDedicatedBestIndex = 0;
|
||||||
|
parentPhysicalDeviceHdl = rhs.parentPhysicalDeviceHdl;
|
||||||
|
|
||||||
|
rhs.vkLogicalDevice = VK_NULL_HANDLE;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
/*!
|
/*!
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ namespace SHADE
|
||||||
~SHVkLogicalDevice (void) noexcept;
|
~SHVkLogicalDevice (void) noexcept;
|
||||||
|
|
||||||
SHVkLogicalDevice& operator= (SHVkLogicalDevice const& rhs) noexcept = default;
|
SHVkLogicalDevice& operator= (SHVkLogicalDevice const& rhs) noexcept = default;
|
||||||
SHVkLogicalDevice& operator= (SHVkLogicalDevice&& rhs) noexcept = default;
|
SHVkLogicalDevice& operator= (SHVkLogicalDevice&& rhs) noexcept;
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
/* PUBLIC MEMBER VARIABLES */
|
/* PUBLIC MEMBER VARIABLES */
|
||||||
|
|
Loading…
Reference in New Issue