Vulkan/Device: Add useful accessors
Former-commit-id: b2b6378b2b9a8de2ad1c47b72f2acd6dd86a087a
This commit is contained in:
parent
da3682149c
commit
3d09177795
|
|
@ -30,6 +30,8 @@ namespace Nz
|
|||
inline void Destroy();
|
||||
|
||||
inline void GetDeviceQueue(UInt32 queueFamilyIndex, UInt32 queueIndex, VkQueue* queue);
|
||||
inline Instance& GetInstance();
|
||||
inline const Instance& GetInstance() const;
|
||||
inline VkResult GetLastErrorCode() const;
|
||||
|
||||
inline bool WaitForIdle();
|
||||
|
|
@ -37,6 +39,8 @@ namespace Nz
|
|||
Device& operator=(const Device&) = delete;
|
||||
Device& operator=(Device&&) = delete;
|
||||
|
||||
inline operator VkDevice();
|
||||
|
||||
// Vulkan functions
|
||||
#define NAZARA_VULKAN_DEVICE_FUNCTION(func) PFN_##func func
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,16 @@ namespace Nz
|
|||
return vkGetDeviceQueue(m_device, queueFamilyIndex, queueIndex, queue);
|
||||
}
|
||||
|
||||
inline Instance& Device::GetInstance()
|
||||
{
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
inline const Instance& Device::GetInstance() const
|
||||
{
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
inline VkResult Device::GetLastErrorCode() const
|
||||
{
|
||||
return m_lastErrorCode;
|
||||
|
|
@ -53,6 +63,11 @@ namespace Nz
|
|||
return true;
|
||||
}
|
||||
|
||||
inline Device::operator VkDevice()
|
||||
{
|
||||
return m_device;
|
||||
}
|
||||
|
||||
inline PFN_vkVoidFunction Device::GetProcAddr(const char* name)
|
||||
{
|
||||
PFN_vkVoidFunction func = m_instance.GetDeviceProcAddr(m_device, name);
|
||||
|
|
|
|||
Loading…
Reference in New Issue