Vulkan/Device: Add GetPhysicalDevice()
Former-commit-id: 720b4a1a94e751ee70f9554173c600efb0cc1218 [formerly 0f3e615d1393dff4eb1c809a6ccf08ed6f384ccd] Former-commit-id: e84e98542b4ba69cf5c97a8cf4d76f4f9e9ae63f
This commit is contained in:
parent
c28995bc88
commit
26e2f57c35
|
|
@ -42,6 +42,7 @@ namespace Nz
|
||||||
inline Instance& GetInstance();
|
inline Instance& GetInstance();
|
||||||
inline const Instance& GetInstance() const;
|
inline const Instance& GetInstance() const;
|
||||||
inline VkResult GetLastErrorCode() const;
|
inline VkResult GetLastErrorCode() const;
|
||||||
|
inline VkPhysicalDevice GetPhysicalDevice() const;
|
||||||
|
|
||||||
inline bool IsExtensionLoaded(const String& extensionName);
|
inline bool IsExtensionLoaded(const String& extensionName);
|
||||||
inline bool IsLayerLoaded(const String& layerName);
|
inline bool IsLayerLoaded(const String& layerName);
|
||||||
|
|
@ -202,6 +203,7 @@ namespace Nz
|
||||||
Instance& m_instance;
|
Instance& m_instance;
|
||||||
VkAllocationCallbacks m_allocator;
|
VkAllocationCallbacks m_allocator;
|
||||||
VkDevice m_device;
|
VkDevice m_device;
|
||||||
|
VkPhysicalDevice m_physicalDevice;
|
||||||
VkResult m_lastErrorCode;
|
VkResult m_lastErrorCode;
|
||||||
std::unordered_set<String> m_loadedExtensions;
|
std::unordered_set<String> m_loadedExtensions;
|
||||||
std::unordered_set<String> m_loadedLayers;
|
std::unordered_set<String> m_loadedLayers;
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ namespace Nz
|
||||||
inline Device::Device(Instance& instance) :
|
inline Device::Device(Instance& instance) :
|
||||||
m_instance(instance),
|
m_instance(instance),
|
||||||
m_device(VK_NULL_HANDLE),
|
m_device(VK_NULL_HANDLE),
|
||||||
|
m_physicalDevice(VK_NULL_HANDLE)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -31,6 +32,7 @@ namespace Nz
|
||||||
vkDestroyDevice(m_device, (m_allocator.pfnAllocation) ? &m_allocator : nullptr);
|
vkDestroyDevice(m_device, (m_allocator.pfnAllocation) ? &m_allocator : nullptr);
|
||||||
|
|
||||||
m_device = VK_NULL_HANDLE;
|
m_device = VK_NULL_HANDLE;
|
||||||
|
m_physicalDevice = VK_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,6 +64,11 @@ namespace Nz
|
||||||
return m_lastErrorCode;
|
return m_lastErrorCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline VkPhysicalDevice Device::GetPhysicalDevice() const
|
||||||
|
{
|
||||||
|
return m_physicalDevice;
|
||||||
|
}
|
||||||
|
|
||||||
inline bool Device::IsExtensionLoaded(const String& extensionName)
|
inline bool Device::IsExtensionLoaded(const String& extensionName)
|
||||||
{
|
{
|
||||||
return m_loadedExtensions.count(extensionName) > 0;
|
return m_loadedExtensions.count(extensionName) > 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue