ngscopeclient 0.1-dev+51fbda87c
Functions | Variables

Vulkan initialization. More...

#include "scopehal.h"
#include <glslang_c_interface.h>
#include "PipelineCacheManager.h"
#include "QueueManager.h"
#include <GLFW/glfw3.h>
#include <vkFFT.h>
Include dependency graph for VulkanInit.cpp:

Functions

bool IsDevicePreferred (const vk::PhysicalDeviceProperties &a, const vk::PhysicalDeviceProperties &b)
 Checks if a given Vulkan device is "better" than another. More...
 
void VulkanCleanup ()
 Free all global Vulkan resources in the correct order.
 
bool VulkanInit (bool skipGLFW)
 Initialize a Vulkan context for compute. More...
 

Variables

vk::raii::Context g_vkContext
 Global Vulkan context.
 
unique_ptr< vk::raii::Instance > g_vkInstance
 Global Vulkan instance.
 
shared_ptr< vk::raii::Deviceg_vkComputeDevice
 The Vulkan device selected for compute operations (may or may not be same device as rendering)
 
unique_ptr< vk::raii::CommandPool > g_vkTransferCommandPool
 Command pool for AcceleratorBuffer transfers. More...
 
unique_ptr< vk::raii::CommandBuffer > g_vkTransferCommandBuffer
 Command buffer for AcceleratorBuffer transfers. More...
 
shared_ptr< QueueHandleg_vkTransferQueue
 Queue for AcceleratorBuffer transfers. More...
 
std::unique_ptr< QueueManagerg_vkQueueManager
 Allocates QueueHandle objects. More...
 
mutex g_vkTransferMutex
 Mutex for interlocking access to g_vkTransferCommandBuffer and g_vkTransferCommandPool.
 
uint32_t g_vkPinnedMemoryType
 Vulkan memory type for CPU-based memory that is also GPU-readable.
 
uint32_t g_vkLocalMemoryType
 Vulkan memory type for GPU-based memory (generally not CPU-readable, except on unified memory systems)
 
uint8_t g_vkComputeDeviceUuid [16]
 UUID of g_vkComputeDevice.
 
uint32_t g_vkComputeDeviceDriverVer
 Driver version of g_vkComputeDevice.
 
vk::raii::PhysicalDevice * g_vkComputePhysicalDevice
 Physical device for g_vkComputeDevice.
 
uint32_t g_vkPinnedMemoryHeap = 0
 Heap from which g_vkPinnedMemoryType is allocated.
 
uint32_t g_vkLocalMemoryHeap = 0
 Heap from which g_vkLocalMemoryType is allocated.
 
bool g_hasShaderFloat64 = false
 Indicates whether the float64 type is available for use in shaders and SSBOs.
 
bool g_hasShaderInt64 = false
 Indicates whether the int64 type is available for use in shaders and SSBOs.
 
bool g_hasShaderInt16 = false
 Indicates whether the int16 type is available for use in shaders and SSBOs.
 
bool g_hasShaderInt8 = false
 Indicates whether the int8 type is available for use in shaders and SSBOs.
 
bool g_hasShaderAtomicFloat = false
 Indicates whether atomic operations on the float type are available in shaders.
 
bool g_hasDebugUtils = false
 Indicates whether the VK_EXT_debug_utils extension is available.
 
bool g_hasMemoryBudget = false
 Indicates whether the VK_EXT_memory_budget extension is available.
 
bool g_hasPushDescriptor = false
 Indicates whether the VK_KHR_push_descriptor extension is available.
 
bool g_vulkanDeviceHasUnifiedMemory = false
 Indicates whether the Vulkan device is unified memory. More...
 
size_t g_maxComputeGroupCount [3] = {0}
 Maximum size of a Vulkan dispatch group for compute shaders, in each axis.
 
bool g_vulkanDeviceIsIntelMesa = false
 Indicates that the Vulkan driver is Mesa on an Intel GPU.
 
bool g_vulkanDeviceIsAnyMesa = false
 Indicates that the Vulkan driver is Mesa on any GPU.
 
bool g_vulkanDeviceIsMoltenVK = false
 Indicates that the Vulkan driver is MoltenVK.
 

Detailed Description

Vulkan initialization.

Author
Andrew D. Zonenberg