Manages Vulkan instance, physical device, logical device, and memory allocator. More...
#include <VulkanDevice.h>
Public Member Functions | |
| VulkanDevice (const VulkanDevice &)=delete | |
| VulkanDevice & | operator= (const VulkanDevice &)=delete |
| VulkanDevice (VulkanDevice &&)=delete | |
| VulkanDevice & | operator= (VulkanDevice &&)=delete |
| void | initialize (bool enable_validation=false) |
| Initialize Vulkan instance, device, and allocator. | |
| void | shutdown () |
| Shutdown and destroy all Vulkan resources. | |
| bool | supportsAtomicFloat () const |
| Check if device supports atomic float operations. | |
| bool | isMoltenVK () const |
| Check if running on MoltenVK (macOS/iOS) | |
| VkInstance | getInstance () const |
| Get Vulkan instance. | |
| VkPhysicalDevice | getPhysicalDevice () const |
| Get physical device. | |
| VkDevice | getDevice () const |
| Get logical device. | |
| VkQueue | getComputeQueue () const |
| Get compute queue. | |
| uint32_t | getComputeQueueFamily () const |
| Get compute queue family index. | |
| VmaAllocator | getAllocator () const |
| Get VMA allocator. | |
| const VkPhysicalDeviceProperties & | getDeviceProperties () const |
| Get device properties (name, limits, etc.) | |
| void | printDeviceInfo () const |
| Print device information (name, vendor, driver version) | |
| void | probeComputeCapability () |
| Verify the device can execute compute shaders with storage buffer access. | |
Manages Vulkan instance, physical device, logical device, and memory allocator.
Handles:
Definition at line 47 of file VulkanDevice.h.
| helios::VulkanDevice::~VulkanDevice | ( | ) |
Definition at line 58 of file VulkanDevice.cpp.
|
inline |
Get VMA allocator.
Definition at line 134 of file VulkanDevice.h.
|
inline |
Get compute queue.
Definition at line 120 of file VulkanDevice.h.
|
inline |
Get compute queue family index.
Definition at line 127 of file VulkanDevice.h.
|
inline |
Get logical device.
Definition at line 113 of file VulkanDevice.h.
|
inline |
Get device properties (name, limits, etc.)
Definition at line 141 of file VulkanDevice.h.
|
inline |
Get Vulkan instance.
Definition at line 99 of file VulkanDevice.h.
|
inline |
Get physical device.
Definition at line 106 of file VulkanDevice.h.
| void helios::VulkanDevice::initialize | ( | bool | enable_validation = false | ) |
Initialize Vulkan instance, device, and allocator.
| enable_validation | Enable Vulkan validation layers (for debugging) |
Creates instance, selects physical device, creates logical device, and initializes VMA.
Definition at line 62 of file VulkanDevice.cpp.
|
inline |
Check if running on MoltenVK (macOS/iOS)
Used for platform-specific workarounds (push constant limits, etc.).
Definition at line 92 of file VulkanDevice.h.
| void helios::VulkanDevice::printDeviceInfo | ( | ) | const |
Print device information (name, vendor, driver version)
Definition at line 751 of file VulkanDevice.cpp.
| void helios::VulkanDevice::probeComputeCapability | ( | ) |
Verify the device can execute compute shaders with storage buffer access.
Dispatches a minimal compute shader that writes to a storage buffer via a descriptor set, waits for completion, and reads back the result. This catches cases where a Vulkan instance and device can be created (e.g., MoltenVK on macOS CI runners) but actual GPU compute fails with VK_ERROR_DEVICE_LOST because the VM exposes only graphics acceleration without compute support.
| helios_runtime_error | if the probe dispatch fails or produces wrong results |
Definition at line 450 of file VulkanDevice.cpp.
| void helios::VulkanDevice::shutdown | ( | ) |
Shutdown and destroy all Vulkan resources.
Destroys VMA allocator, logical device, and instance in correct order.
Definition at line 77 of file VulkanDevice.cpp.
|
inline |
Check if device supports atomic float operations.
Used to select optimized shader variant (atomic floats vs atomicCompSwap fallback).
Definition at line 81 of file VulkanDevice.h.