Vulkan: Make device objects take a device handle at creation
Former-commit-id: 985b9f5b04aef4d6de55ee6d360a2da92bed8940 [formerly e31d84225897da96b0438d49dbdf6473a7873a17] Former-commit-id: 82ed4eeccde614312fff717ab1f469335c861292
This commit is contained in:
@@ -11,12 +11,7 @@ namespace Nz
|
||||
{
|
||||
namespace Vk
|
||||
{
|
||||
inline CommandPool::CommandPool(Device& device) :
|
||||
DeviceObject(device)
|
||||
{
|
||||
}
|
||||
|
||||
inline bool CommandPool::Create(UInt32 queueFamilyIndex, VkCommandPoolCreateFlags flags, const VkAllocationCallbacks* allocator)
|
||||
inline bool CommandPool::Create(const DeviceHandle& device, UInt32 queueFamilyIndex, VkCommandPoolCreateFlags flags, const VkAllocationCallbacks* allocator)
|
||||
{
|
||||
VkCommandPoolCreateInfo createInfo =
|
||||
{
|
||||
@@ -26,26 +21,26 @@ namespace Nz
|
||||
queueFamilyIndex
|
||||
};
|
||||
|
||||
return Create(createInfo, allocator);
|
||||
return Create(device, createInfo, allocator);
|
||||
}
|
||||
|
||||
inline bool CommandPool::Reset(VkCommandPoolResetFlags flags)
|
||||
{
|
||||
m_lastErrorCode = m_device.vkResetCommandPool(m_device, m_handle, flags);
|
||||
m_lastErrorCode = m_device->vkResetCommandPool(*m_device, m_handle, flags);
|
||||
if (m_lastErrorCode != VkResult::VK_SUCCESS)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
inline VkResult CommandPool::CreateHelper(Device& device, const VkCommandPoolCreateInfo* createInfo, const VkAllocationCallbacks* allocator, VkCommandPool* handle)
|
||||
inline VkResult CommandPool::CreateHelper(const DeviceHandle& device, const VkCommandPoolCreateInfo* createInfo, const VkAllocationCallbacks* allocator, VkCommandPool* handle)
|
||||
{
|
||||
return device.vkCreateCommandPool(device, createInfo, allocator, handle);
|
||||
return device->vkCreateCommandPool(*device, createInfo, allocator, handle);
|
||||
}
|
||||
|
||||
inline void CommandPool::DestroyHelper(Device& device, VkCommandPool handle, const VkAllocationCallbacks* allocator)
|
||||
inline void CommandPool::DestroyHelper(const DeviceHandle& device, VkCommandPool handle, const VkAllocationCallbacks* allocator)
|
||||
{
|
||||
return device.vkDestroyCommandPool(device, handle, allocator);
|
||||
return device->vkDestroyCommandPool(*device, handle, allocator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user