Device class abstracting the physical and logical Vulkan device, as well as handling extensions and features.
More...
#include <Device.h>
|
MANDRILL_API | Device (GLFWwindow *pWindow, const std::vector< const char * > &extensions=std::vector< const char * >(), VkPhysicalDeviceFeatures2 *pFeatures=nullptr, uint32_t physicalDeviceIndex=0) |
| Device that abstracts the physical and logical device, and their features and properties.
|
|
MANDRILL_API | ~Device () |
| Destructor for device.
|
|
MANDRILL_API VkDevice | getDevice () const |
| Get Vulkan device handle.
|
|
MANDRILL_API VkInstance | getInstance () const |
| Get Vulkan instance handle.
|
|
MANDRILL_API VkPhysicalDevice | getPhysicalDevice () const |
| Get Vulkan physical device handle.
|
|
MANDRILL_API DeviceProperties | getProperties () const |
| Get device and physical device properties.
|
|
MANDRILL_API GLFWwindow * | getWindow () const |
| Get the window that the device is bound to.
|
|
MANDRILL_API VkSurfaceKHR | getSurface () const |
| Get the presentation surface of the application.
|
|
MANDRILL_API VkCommandPool | getCommandPool () const |
| Get the command pool.
|
|
MANDRILL_API VkQueue | getQueue () const |
| Get the queue.
|
|
MANDRILL_API uint32_t | getQueueFamily () const |
| Get the queue family.
|
|
MANDRILL_API bool | supportsRayTracing () const |
| Check if the given context supports ray tracing.
|
|
MANDRILL_API bool | getVsync () const |
| Get the current verical sync mode.
|
|
MANDRILL_API void | setVsync (bool vsync) |
| Set a vertical sync mode.
|
|
MANDRILL_API VkSampleCountFlagBits | getSampleCount () const |
| Get the multisample anti-aliasing sample count.
|
|
Device class abstracting the physical and logical Vulkan device, as well as handling extensions and features.
◆ Device()
Device::Device |
( |
GLFWwindow * |
pWindow, |
|
|
const std::vector< const char * > & |
extensions = std::vector<const char*>() , |
|
|
VkPhysicalDeviceFeatures2 * |
pFeatures = nullptr , |
|
|
uint32_t |
physicalDeviceIndex = 0 |
|
) |
| |
Device that abstracts the physical and logical device, and their features and properties.
- Parameters
-
window | GLFW window to create render context for |
extensions | Extra device extensions to activate |
pFeatures | Pointer to a pNext-chain of features to link with when creating device, can be nullptr in which case a set of required default features will be used |
physicalDeviceIndex | Physical device to use. Set this explicitly if device 0 is not the intended one. |
◆ getCommandPool()
MANDRILL_API VkCommandPool Mandrill::Device::getCommandPool |
( |
| ) |
const |
|
inline |
Get the command pool.
- Returns
- A Vulkan command pool handle
◆ getDevice()
MANDRILL_API VkDevice Mandrill::Device::getDevice |
( |
| ) |
const |
|
inline |
Get Vulkan device handle.
- Returns
- Vulkan device handle
◆ getInstance()
MANDRILL_API VkInstance Mandrill::Device::getInstance |
( |
| ) |
const |
|
inline |
Get Vulkan instance handle.
- Returns
- Vulkan instance handle
◆ getPhysicalDevice()
MANDRILL_API VkPhysicalDevice Mandrill::Device::getPhysicalDevice |
( |
| ) |
const |
|
inline |
Get Vulkan physical device handle.
- Returns
- Vulkan physical device handle
◆ getProperties()
MANDRILL_API DeviceProperties Mandrill::Device::getProperties |
( |
| ) |
const |
|
inline |
Get device and physical device properties.
- Returns
- DeviceProperties struct containing properties
◆ getQueue()
MANDRILL_API VkQueue Mandrill::Device::getQueue |
( |
| ) |
const |
|
inline |
Get the queue.
- Returns
- A Vulkan queue handle
◆ getQueueFamily()
MANDRILL_API uint32_t Mandrill::Device::getQueueFamily |
( |
| ) |
const |
|
inline |
Get the queue family.
- Returns
- A Vulkan queue family handle
◆ getSampleCount()
VkSampleCountFlagBits Device::getSampleCount |
( |
| ) |
const |
Get the multisample anti-aliasing sample count.
- Returns
- Sample count
◆ getSurface()
MANDRILL_API VkSurfaceKHR Mandrill::Device::getSurface |
( |
| ) |
const |
|
inline |
Get the presentation surface of the application.
- Returns
- The current VkSurfaceKHR
◆ getVsync()
MANDRILL_API bool Mandrill::Device::getVsync |
( |
| ) |
const |
|
inline |
Get the current verical sync mode.
- Returns
- True if vertical sync is activated, otherwise false.
◆ getWindow()
MANDRILL_API GLFWwindow * Mandrill::Device::getWindow |
( |
| ) |
const |
|
inline |
Get the window that the device is bound to.
- Returns
- A GLFWwindow pointer
◆ setVsync()
MANDRILL_API void Mandrill::Device::setVsync |
( |
bool |
vsync | ) |
|
|
inline |
Set a vertical sync mode.
- Parameters
-
vsync | True if vertical sync should be on, otherwise false. |
- Returns
◆ supportsRayTracing()
MANDRILL_API bool Mandrill::Device::supportsRayTracing |
( |
| ) |
const |
|
inline |
Check if the given context supports ray tracing.
- Returns
- True if ray tracing is supported, otherwise false.
The documentation for this class was generated from the following files:
- /home/runner/work/Mandrill/Mandrill/src/Device.h
- /home/runner/work/Mandrill/Mandrill/src/Device.cpp