HDK
|
Handle to the main interface of Vulkan. More...
#include <RV_Instance.h>
Public Types | |
using | RenderCallback = UT_Function< void(RV_Instance *)> |
Public Member Functions | |
void | addPostRenderCB (const RenderCallback &callback) |
void | finishRendering (RV_Render *r) |
~RV_Instance () | |
bool | initializeDevice () |
Set up Vulkan once the instance is created. More... | |
VkDevice | getDevice () |
Get the raw vulkan device assocated with this instance. More... | |
VkPhysicalDevice | getPhysicalDevice () |
Get the raw vulkan physical device assocated with this instance. More... | |
VkInstance | getVkInst () |
Get the raw vulkan instance. More... | |
const VkPhysicalDeviceMemoryProperties * | getMemoryProps () const |
Raw Vulkan memory properties of the physical device. More... | |
const VkPhysicalDeviceAccelerationStructurePropertiesKHR * | getAccelStructProps () const |
Raw Vulkan acceleration structure properties of the physical device. More... | |
const VkPhysicalDeviceLimits * | getVulkanDeviceLimits () const |
Raw Vulkan acceleration structure properties of the physical device. More... | |
void | getDeviceUUID (uint8(&uuid)[16]) const |
Vulkan device UUID, used to match devices for cross-API interop. More... | |
RV_VKQueue & | getGraphicsQueue () |
Main Queue supporting graphics, compute and transfer. More... | |
RV_VKMemAllocator & | getMemAllocator () |
Our Vulkan memory allocator implementation. More... | |
RV_DescriptorAllocator & | getDescAllocator () |
Our Vulkan descriptor set allocator. More... | |
void | fetchDriverInfo (UT_WorkBuffer &info) |
Get text information about the current driver and device. More... | |
uint32_t | getDeviceVersion () |
The Vulkan version as implemented by the device driver. More... | |
RV_GraphicsDevice | getDeviceVendor () const |
The vendor of the device (AMD, Intel, NVIDIA, MoltenVK) More... | |
const UT_StringHolder & | deviceName () const |
int | getMaxColorSamples () const |
Maximum supported number of color samples in a multisample framebuffer. More... | |
int | getMaxDepthSamples () const |
Maximum supported number of depth samples in a multisample framebuffer. More... | |
int | getMaxTextureSize2D () const |
Maximum size of 2D texture. More... | |
int | getMaxTextureSize3D () const |
Maximum size of 3D texture. More... | |
float | getLineWidthGranularity () const |
Granularity of Line width setting. More... | |
UT_Vector2F | getLineWidthRange () const |
Range of Line width setting. More... | |
float | getPointSizeGranularity () const |
Granularity of Point Size setting. More... | |
UT_Vector2F | getPointSizeRange () const |
Range of Point Size setting. More... | |
RV_VKExt * | getExt () |
Object containing function pointers to Vulkan extensions. More... | |
bool | extEnabled (const char *vk_ext_name) const |
Query if the given Vulkan extension is enabled in the device. More... | |
bool | useLinearTilingForGLInterop () const |
Query restriction for GL to Vulkan interop texture. If true, must use linear textures. More... | |
void | waitDeviceIdle () |
Block until the device has finished all commands (Call with care!) More... | |
const VE_PhysicalDeviceFeatures & | getPhysicalDeviceFeatures () const |
RV_ResourceID | registerImage (RV_VKImage *img) |
void | clearImage (RV_VKImage *img) |
bool | validateImage (RV_ResourceID id, bool allow_pending_delete=false) const |
void | setDeletePending (RV_VKImage *img) |
RV_ResourceID | registerBuffer (RV_VKBuffer *buf) |
void | clearBuffer (RV_VKBuffer *buf) |
bool | validateBuffer (RV_ResourceID id, bool allow_pending_delete=false) const |
void | setDeletePending (RV_VKBuffer *buf) |
RV_ResourceID | registerAccelStruct (RV_VKAccelerationStructure *accel_struct) |
void | clearAccelStruct (RV_VKAccelerationStructure *accel_struct) |
bool | validateAccelStruct (RV_ResourceID id, bool allow_pending_delete=false) const |
void | setDeletePending (RV_VKAccelerationStructure *accel_struct) |
RV_ResourceID | registerSet (RV_VKDescriptorSet *set) |
void | clearSet (RV_VKDescriptorSet *set) |
bool | validateSet (RV_ResourceID id, bool allow_pending_delete=false) const |
void | setDeletePending (RV_VKDescriptorSet *set) |
void | printIDs () const |
Static Public Member Functions | |
static RV_Instance * | getInstance () |
The global vulkan instance, creating it if it hasn't been created yet. More... | |
static bool | hasInstance () |
Returns whether the global vulkan instance exists. More... | |
static void | destroyInstance () |
Destroy the global instance. For system exit. More... | |
static void | exitCallback (void *) |
The callback that's called on app exit to destroy the global instance. More... | |
static void | addPostCreateCB (bool(*cb)(RV_Instance *)) |
add callbacks to be called as soon as instance is created More... | |
static bool | hasPostCreateCBs () |
static void | addPreDestroyCB (bool(*cb)(RV_Instance *)) |
static bool | hasPreDestroyCBs () |
static RV_Instance * | create () |
Create the global vulkan instance. Used only at startup. More... | |
static uint32_t | getInstanceVersion () |
static bool | usingDebugValidation () |
True if the debug validation layers are active. More... | |
static bool | usingVulkanMultithreading () |
True if Vulkan multithreading env var is set to true. More... | |
Handle to the main interface of Vulkan.
Definition at line 44 of file RV_Instance.h.
using RV_Instance::RenderCallback = UT_Function<void(RV_Instance*)> |
add callback to be called when current rendering is finished. Typed as a UT_Function instead of function ptr , so capturing lambdas can be used as callbacks
Definition at line 70 of file RV_Instance.h.
RV_Instance::~RV_Instance | ( | ) |
|
static |
add callbacks to be called as soon as instance is created
void RV_Instance::addPostRenderCB | ( | const RenderCallback & | callback | ) |
|
static |
add callbacks to be called as soon as instance is created. the list is cleared after the instance is destroyed, so they must be re-added for a new instance
void RV_Instance::clearAccelStruct | ( | RV_VKAccelerationStructure * | accel_struct | ) |
void RV_Instance::clearBuffer | ( | RV_VKBuffer * | buf | ) |
void RV_Instance::clearImage | ( | RV_VKImage * | img | ) |
void RV_Instance::clearSet | ( | RV_VKDescriptorSet * | set | ) |
|
static |
Create the global vulkan instance. Used only at startup.
|
static |
Destroy the global instance. For system exit.
|
inline |
Definition at line 121 of file RV_Instance.h.
The callback that's called on app exit to destroy the global instance.
bool RV_Instance::extEnabled | ( | const char * | vk_ext_name | ) | const |
Query if the given Vulkan extension is enabled in the device.
void RV_Instance::fetchDriverInfo | ( | UT_WorkBuffer & | info | ) |
Get text information about the current driver and device.
notification from active RV_Render that current rendering tasks are about to flushed
const VkPhysicalDeviceAccelerationStructurePropertiesKHR* RV_Instance::getAccelStructProps | ( | ) | const |
Raw Vulkan acceleration structure properties of the physical device.
|
inline |
Our Vulkan descriptor set allocator.
Definition at line 109 of file RV_Instance.h.
VkDevice RV_Instance::getDevice | ( | ) |
Get the raw vulkan device assocated with this instance.
Vulkan device UUID, used to match devices for cross-API interop.
RV_GraphicsDevice RV_Instance::getDeviceVendor | ( | ) | const |
The vendor of the device (AMD, Intel, NVIDIA, MoltenVK)
uint32_t RV_Instance::getDeviceVersion | ( | ) |
The Vulkan version as implemented by the device driver.
|
inline |
Object containing function pointers to Vulkan extensions.
Definition at line 154 of file RV_Instance.h.
|
inline |
Main Queue supporting graphics, compute and transfer.
Definition at line 105 of file RV_Instance.h.
|
static |
The global vulkan instance, creating it if it hasn't been created yet.
|
static |
float RV_Instance::getLineWidthGranularity | ( | ) | const |
Granularity of Line width setting.
UT_Vector2F RV_Instance::getLineWidthRange | ( | ) | const |
Range of Line width setting.
int RV_Instance::getMaxColorSamples | ( | ) | const |
Maximum supported number of color samples in a multisample framebuffer.
int RV_Instance::getMaxDepthSamples | ( | ) | const |
Maximum supported number of depth samples in a multisample framebuffer.
int RV_Instance::getMaxTextureSize2D | ( | ) | const |
Maximum size of 2D texture.
int RV_Instance::getMaxTextureSize3D | ( | ) | const |
Maximum size of 3D texture.
|
inline |
Our Vulkan memory allocator implementation.
Definition at line 107 of file RV_Instance.h.
const VkPhysicalDeviceMemoryProperties* RV_Instance::getMemoryProps | ( | ) | const |
Raw Vulkan memory properties of the physical device.
VkPhysicalDevice RV_Instance::getPhysicalDevice | ( | ) |
Get the raw vulkan physical device assocated with this instance.
const VE_PhysicalDeviceFeatures& RV_Instance::getPhysicalDeviceFeatures | ( | ) | const |
Returns the physical device features that have been enabled on our device
float RV_Instance::getPointSizeGranularity | ( | ) | const |
Granularity of Point Size setting.
UT_Vector2F RV_Instance::getPointSizeRange | ( | ) | const |
Range of Point Size setting.
VkInstance RV_Instance::getVkInst | ( | ) |
Get the raw vulkan instance.
const VkPhysicalDeviceLimits* RV_Instance::getVulkanDeviceLimits | ( | ) | const |
Raw Vulkan acceleration structure properties of the physical device.
|
static |
Returns whether the global vulkan instance exists.
|
static |
|
static |
bool RV_Instance::initializeDevice | ( | ) |
Set up Vulkan once the instance is created.
void RV_Instance::printIDs | ( | ) | const |
RV_ResourceID RV_Instance::registerAccelStruct | ( | RV_VKAccelerationStructure * | accel_struct | ) |
RV_ResourceID RV_Instance::registerBuffer | ( | RV_VKBuffer * | buf | ) |
RV_ResourceID RV_Instance::registerImage | ( | RV_VKImage * | img | ) |
register
- called on creation, to get a Unique ID for the resource clear
- called on destruction validate
- can be called to check if the ID's resource is still valid setDeletePending
- flags the resource as being queued for deletion by
RV_ResourceID RV_Instance::registerSet | ( | RV_VKDescriptorSet * | set | ) |
void RV_Instance::setDeletePending | ( | RV_VKImage * | img | ) |
void RV_Instance::setDeletePending | ( | RV_VKBuffer * | buf | ) |
void RV_Instance::setDeletePending | ( | RV_VKAccelerationStructure * | accel_struct | ) |
void RV_Instance::setDeletePending | ( | RV_VKDescriptorSet * | set | ) |
bool RV_Instance::useLinearTilingForGLInterop | ( | ) | const |
Query restriction for GL to Vulkan interop texture. If true, must use linear textures.
|
static |
True if the debug validation layers are active.
|
static |
True if Vulkan multithreading env var is set to true.
bool RV_Instance::validateAccelStruct | ( | RV_ResourceID | id, |
bool | allow_pending_delete = false |
||
) | const |
bool RV_Instance::validateBuffer | ( | RV_ResourceID | id, |
bool | allow_pending_delete = false |
||
) | const |
bool RV_Instance::validateImage | ( | RV_ResourceID | id, |
bool | allow_pending_delete = false |
||
) | const |
bool RV_Instance::validateSet | ( | RV_ResourceID | id, |
bool | allow_pending_delete = false |
||
) | const |
void RV_Instance::waitDeviceIdle | ( | ) |
Block until the device has finished all commands (Call with care!)