TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::vulkan::VulkanDeviceContext::ExternalDevice Struct Reference

A host's Vulkan handles for SetExternalDevice, so the GUI renders on the host's device (an engine hosting it as its editor, say) and can share resources with it. More...

#include <gui_core/graphics/vulkan/vk_device_context.h>

Public Attributes

VkInstance instance = VK_NULL_HANDLE
 Must enable the window backend's surface extensions.
VkPhysicalDevice physicalDevice = VK_NULL_HANDLE
 The GPU device was made on.
VkDevice device = VK_NULL_HANDLE
 Made with GetDeviceRequirements() enabled.
VkQueue graphicsQueue = VK_NULL_HANDLE
 Every GUI submit and present goes here; it supports graphics and presenting to the GUI's windows.
uint32_t graphicsQueueFamily = 0
 graphicsQueue's family.
VmaAllocator allocator = VK_NULL_HANDLE
 Optional.
std::mutex * queueMutex = nullptr
 Optional.

Detailed Description

A host's Vulkan handles for SetExternalDevice, so the GUI renders on the host's device (an engine hosting it as its editor, say) and can share resources with it.

The GUI never destroys what it didn't create. The device must satisfy GetDeviceRequirements(), the instance must enable the window backend's surface extensions (SDL: SDL_Vulkan_GetInstanceExtensions).

Examples
host_device/host_device.cpp.

Member Data Documentation

◆ instance

VkInstance tachyon::vulkan::VulkanDeviceContext::ExternalDevice::instance = VK_NULL_HANDLE

Must enable the window backend's surface extensions.

Examples
host_device/host_device.cpp.

◆ physicalDevice

VkPhysicalDevice tachyon::vulkan::VulkanDeviceContext::ExternalDevice::physicalDevice = VK_NULL_HANDLE

The GPU device was made on.

Examples
host_device/host_device.cpp.

◆ device

VkDevice tachyon::vulkan::VulkanDeviceContext::ExternalDevice::device = VK_NULL_HANDLE

◆ graphicsQueue

VkQueue tachyon::vulkan::VulkanDeviceContext::ExternalDevice::graphicsQueue = VK_NULL_HANDLE

Every GUI submit and present goes here; it supports graphics and presenting to the GUI's windows.

Examples
host_device/host_device.cpp.

◆ graphicsQueueFamily

uint32_t tachyon::vulkan::VulkanDeviceContext::ExternalDevice::graphicsQueueFamily = 0

graphicsQueue's family.

Examples
host_device/host_device.cpp.

◆ allocator

VmaAllocator tachyon::vulkan::VulkanDeviceContext::ExternalDevice::allocator = VK_NULL_HANDLE

Optional.

When null the GUI creates (and owns) its own allocator. Must be created with VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT.

◆ queueMutex

std::mutex* tachyon::vulkan::VulkanDeviceContext::ExternalDevice::queueMutex = nullptr

Optional.

Vulkan queues need external synchronization: if the host submits to graphicsQueue from other threads it must pass the mutex it locks around its own vkQueueSubmit/vkQueuePresentKHR calls, and the GUI will lock the same mutex. When null the GUI uses a private mutex, which only protects against its own threads.

Examples
host_device/host_device.cpp.

The documentation for this struct was generated from the following file: