7 struct MANDRILL_API DeviceProperties {
8 VkPhysicalDeviceProperties physicalDevice;
9 VkPhysicalDeviceMemoryProperties memory;
10 VkPhysicalDeviceRayTracingPipelinePropertiesKHR rayTracingPipeline;
11 VkPhysicalDeviceAccelerationStructurePropertiesKHR accelerationStucture;
20 MANDRILL_NON_COPYABLE(
Device)
31 MANDRILL_API
Device(GLFWwindow* pWindow,
32 const std::vector<const char*>& extensions = std::vector<const char*>(),
33 VkPhysicalDeviceFeatures2* pFeatures =
nullptr, uint32_t physicalDeviceIndex = 0);
64 return mPhysicalDevice;
118 return mQueueFamilyIndex;
127 return mRayTracingSupport;
157 void createDebugMessenger();
159 void createInstance();
160 void createDevice(
const std::vector<const char*>& extensions, VkPhysicalDeviceFeatures2* pFeatures,
161 uint32_t physicalDeviceIndex);
162 void createCommandPool();
163 void createSurface();
164 void createExtensionProcAddrs();
166 GLFWwindow* mpWindow;
169 VkDebugUtilsMessengerEXT mDebugMessenger;
172 VkInstance mInstance;
173 VkPhysicalDevice mPhysicalDevice;
175 VkSurfaceKHR mSurface;
177 DeviceProperties mProperties;
179 uint32_t mQueueFamilyIndex;
180 VkCommandPool mCommandPool;
183 bool mRayTracingSupport;
Device class abstracting the physical and logical Vulkan device, as well as handling extensions and f...
Definition Device.h:18
MANDRILL_API void setVsync(bool vsync)
Set a vertical sync mode.
Definition Device.h:144
MANDRILL_API VkDevice getDevice() const
Get Vulkan device handle.
Definition Device.h:44
MANDRILL_API bool getVsync() const
Get the current verical sync mode.
Definition Device.h:134
MANDRILL_API VkPhysicalDevice getPhysicalDevice() const
Get Vulkan physical device handle.
Definition Device.h:62
MANDRILL_API uint32_t getQueueFamily() const
Get the queue family.
Definition Device.h:116
MANDRILL_API VkQueue getQueue() const
Get the queue.
Definition Device.h:107
MANDRILL_API VkSampleCountFlagBits getSampleCount() const
Get the multisample anti-aliasing sample count.
Definition Device.cpp:118
MANDRILL_API bool supportsRayTracing() const
Check if the given context supports ray tracing.
Definition Device.h:125
MANDRILL_API VkInstance getInstance() const
Get Vulkan instance handle.
Definition Device.h:53
MANDRILL_API ~Device()
Destructor for device.
Definition Device.cpp:97
MANDRILL_API GLFWwindow * getWindow() const
Get the window that the device is bound to.
Definition Device.h:80
MANDRILL_API VkCommandPool getCommandPool() const
Get the command pool.
Definition Device.h:98
MANDRILL_API VkSurfaceKHR getSurface() const
Get the presentation surface of the application.
Definition Device.h:89
MANDRILL_API DeviceProperties getProperties() const
Get device and physical device properties.
Definition Device.h:71