Skip to content

Commit 2638ad1

Browse files
authored
Add volkLoadInstanceOnly (#41)
* Add gitignore * Add volkLoadInstanceOnly, fix warnings
1 parent 5e23ac9 commit 2638ad1

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/
2+
CMakeLists.txt.user

volk.c

+6
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ void volkLoadInstance(VkInstance instance)
104104
volkGenLoadDevice(instance, vkGetInstanceProcAddrStub);
105105
}
106106

107+
void volkLoadInstanceOnly(VkInstance instance)
108+
{
109+
loadedInstance = instance;
110+
volkGenLoadInstance(instance, vkGetInstanceProcAddrStub);
111+
}
112+
107113
VkInstance volkGetLoadedInstance()
108114
{
109115
return loadedInstance;

volk.h

+8-2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ uint32_t volkGetInstanceVersion(void);
8181
*/
8282
void volkLoadInstance(VkInstance instance);
8383

84+
/**
85+
* Load global function pointers using application-created VkInstance; call this function after creating the Vulkan instance.
86+
* Skips loading device-based function pointers, requires usage of volkLoadDevice afterwards.
87+
*/
88+
void volkLoadInstanceOnly(VkInstance instance);
89+
8490
/**
8591
* Load global function pointers using application-created VkDevice; call this function after creating the Vulkan device.
8692
*
@@ -92,13 +98,13 @@ void volkLoadDevice(VkDevice device);
9298
* Return last VkInstance for which global function pointers have been loaded via volkLoadInstance(),
9399
* or VK_NULL_HANDLE if volkLoadInstance() has not been called.
94100
*/
95-
VkInstance volkGetLoadedInstance();
101+
VkInstance volkGetLoadedInstance(void);
96102

97103
/**
98104
* Return last VkDevice for which global function pointers have been loaded via volkLoadDevice(),
99105
* or VK_NULL_HANDLE if volkLoadDevice() has not been called.
100106
*/
101-
VkDevice volkGetLoadedDevice();
107+
VkDevice volkGetLoadedDevice(void);
102108

103109
/**
104110
* Load function pointers using application-created VkDevice into a table.

0 commit comments

Comments
 (0)