27 class rv_InstanceData;
32 class RV_VKCommandPool;
34 class RV_VKCommandBufferAllocator;
54 static RV_Instance* getInstance(
bool *created =
nullptr);
56 static RV_Instance* getSwiftShaderInstance(
bool *created =
nullptr);
62 static bool hasInstance();
64 static void destroyInstance();
66 static void destroySwiftShaderInstance();
69 static void exitCallback(
void*);
72 static void addPostCreateCB(
bool (*cb)(
RV_Instance*));
73 static bool hasPostCreateCBs();
78 static void addPreDestroyCB(
bool (*cb)(
RV_Instance*));
79 static bool hasPreDestroyCBs();
103 static void addExtraDeviceExtension(
104 const char* ext_name,
106 exint struct_size_bytes = 0);
111 static bool hasExtraDeviceExtension(
112 const char* ext_name,
114 exint feature_struct_size_bytes = 0);
118 static void addExtraInstanceExtension(
const char* ext_name);
123 bool extraExtensionsChanged()
const;
136 static RV_Instance* create(
bool use_swiftshader =
false);
141 bool initializeDevice();
144 VkDevice getDevice();
146 VkPhysicalDevice getPhysicalDevice();
148 VkInstance getVkInst();
162 void getDeviceUUID(
RV_UUID &uuid)
const;
165 const RV_UUID& getDeviceUUID()
const;
171 VkQueue getVkGraphicsQueue();
183 static uint32_t getInstanceVersion();
186 uint32_t getDeviceVersion();
194 static bool usingDebugValidation();
197 static bool usingVulkanMultithreading();
200 int getMaxColorSamples()
const;
203 int getMaxDepthSamples()
const;
206 int getMaxTextureSize2D()
const;
209 int getMaxTextureSize3D()
const;
212 float getLineWidthGranularity()
const;
218 float getPointSizeGranularity()
const;
227 bool extEnabled(
const char* vk_ext_name )
const;
233 bool getFeatureStruct(
235 exint feature_struct_size_bytes)
const;
238 bool useLinearTilingForGLInterop()
const;
241 bool useSemaphoreForGLInterop()
const;
244 bool supportsSampleLocations(
int aa)
const;
247 void waitDeviceIdle();
266 bool validateImage(
RV_ResourceID id,
bool allow_pending_delete =
false)
const;
272 bool validateBuffer(
RV_ResourceID id,
bool allow_pending_delete =
false)
const;
278 bool validateAccelStruct(
RV_ResourceID id,
bool allow_pending_delete =
false)
const;
284 bool validateSet(
RV_ResourceID id,
bool allow_pending_delete =
false)
const;
290 bool validateVarSet(
RV_ResourceID id,
bool allow_pending_delete =
false)
const;
294 void printIDs()
const;
312 bool myUseSwiftShader =
false;
A collection of Vulkan UBO, SSBO, and Image shader bindings (descriptor set)
rvTraceCtx getTraceContext()
GLenum GLuint GLenum GLsizei const GLchar * buf
RV_VKMemAllocator & getMemAllocator()
Our Vulkan memory allocator implementation.
bool isSwiftShader() const
RV_VKQueue & getGraphicsQueue()
Main Queue supporting graphics, compute and transfer.
RV_DescriptorAllocator & getDescAllocator()
Our Vulkan descriptor set allocator.
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
constexpr auto set(type rhs) -> int
const UT_StringHolder & deviceName() const
std::function< T > UT_Function
Handle to the main interface of Vulkan.
UT_Function< void(RV_Instance *)> RenderCallback
RV_VKExt * getExt()
Object containing function pointers to Vulkan extensions.