Nebula
Loading...
Searching...
No Matches
vkloader.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
18//------------------------------------------------------------------------------
19#define VK_NO_PROTOTYPES
20#include <vulkan/vulkan.h>
21namespace Vulkan
22{
23
25extern void InitVulkan();
27extern void InitInstance(VkInstance instance);
28
29extern PFN_vkSetDebugUtilsObjectNameEXT VkDebugObjectName;
30
31
32} // namespace Vulkan
33
34#define _IMP_VK(name) name = (PFN_##name)vkGetInstanceProcAddr(instance, #name);n_assert_fmt(name != nullptr, "Unable to get function proc: %s\n",#name);
35#define _DEC_VK(name) extern PFN_##name name;
36#define _DEF_VK(name) PFN_##name name = nullptr;
37
38#define _IMP_VK_DYN(name, instance) name = (PFN_##name)vkGetInstanceProcAddr(instance, #name);n_assert_fmt(name != nullptr, "Unable to get function proc: %s\n",#name);
39
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45// declare context functions
46_DEC_VK(vkGetInstanceProcAddr);
47_DEC_VK(vkCreateInstance);
48_DEC_VK(vkEnumerateInstanceExtensionProperties);
49_DEC_VK(vkEnumerateInstanceLayerProperties);
50_DEC_VK(vkEnumerateInstanceVersion);
51
52// declare instance functions
53_DEC_VK(vkCreateDevice);
54_DEC_VK(vkDestroyDevice);
55_DEC_VK(vkDestroyInstance);
56_DEC_VK(vkDeviceWaitIdle);
57_DEC_VK(vkGetDeviceQueue);
58
59_DEC_VK(vkGetPhysicalDeviceSurfaceFormatsKHR);
60_DEC_VK(vkGetPhysicalDeviceSurfaceCapabilitiesKHR);
61_DEC_VK(vkGetPhysicalDeviceSurfacePresentModesKHR);
62_DEC_VK(vkGetPhysicalDeviceSurfaceSupportKHR);
63_DEC_VK(vkCreateSwapchainKHR);
64_DEC_VK(vkGetSwapchainImagesKHR);
65_DEC_VK(vkAcquireNextImageKHR);
66_DEC_VK(vkDestroySwapchainKHR);
67_DEC_VK(vkQueuePresentKHR);
68
69_DEC_VK(vkQueueSubmit);
70_DEC_VK(vkQueueBindSparse);
71_DEC_VK(vkQueueWaitIdle);
72
73_DEC_VK(vkEnumerateDeviceExtensionProperties);
74_DEC_VK(vkEnumerateDeviceLayerProperties);
75_DEC_VK(vkEnumeratePhysicalDevices);
76_DEC_VK(vkGetDeviceProcAddr);
77
78_DEC_VK(vkCreatePipelineCache);
79_DEC_VK(vkDestroyPipelineCache);
80_DEC_VK(vkGetPipelineCacheData);
81_DEC_VK(vkCreateQueryPool);
82_DEC_VK(vkDestroyQueryPool);
83_DEC_VK(vkResetQueryPool);
84
85// physical device
86_DEC_VK(vkGetPhysicalDeviceProperties2);
87_DEC_VK(vkGetPhysicalDeviceFeatures);
88_DEC_VK(vkGetPhysicalDeviceFeatures2);
89_DEC_VK(vkGetPhysicalDeviceQueueFamilyProperties);
90_DEC_VK(vkGetPhysicalDeviceMemoryProperties);
91_DEC_VK(vkGetPhysicalDeviceFormatProperties);
92_DEC_VK(vkGetPhysicalDeviceFormatProperties2);
93_DEC_VK(vkGetPhysicalDeviceSparseImageFormatProperties);
94_DEC_VK(vkGetImageSparseMemoryRequirements);
95
96// command buffer
97_DEC_VK(vkCmdDraw);
98_DEC_VK(vkCmdDrawIndexed);
99_DEC_VK(vkCmdDrawIndirect);
100_DEC_VK(vkCmdDrawIndexedIndirect);
101_DEC_VK(vkCmdDispatch);
102_DEC_VK(vkCmdResolveImage);
103
104_DEC_VK(vkCmdCopyImage);
105_DEC_VK(vkCmdBlitImage);
106_DEC_VK(vkCmdCopyBuffer);
107_DEC_VK(vkCmdUpdateBuffer);
108_DEC_VK(vkCmdCopyBufferToImage);
109_DEC_VK(vkCmdCopyImageToBuffer);
110
111_DEC_VK(vkCmdBindDescriptorSets);
112_DEC_VK(vkCmdPushConstants);
113_DEC_VK(vkCmdSetViewport);
114_DEC_VK(vkCmdSetScissor);
115_DEC_VK(vkCmdSetStencilCompareMask);
116_DEC_VK(vkCmdSetStencilWriteMask);
117_DEC_VK(vkCmdSetStencilReference);
118_DEC_VK(vkCmdSetPrimitiveTopology);
119_DEC_VK(vkCmdSetPrimitiveRestartEnable);
120_DEC_VK(vkCmdSetVertexInputEXT);
121
122_DEC_VK(vkCreateCommandPool);
123_DEC_VK(vkDestroyCommandPool);
124_DEC_VK(vkAllocateCommandBuffers);
125_DEC_VK(vkFreeCommandBuffers);
126_DEC_VK(vkCmdExecuteCommands);
127_DEC_VK(vkBeginCommandBuffer);
128_DEC_VK(vkEndCommandBuffer);
129_DEC_VK(vkResetCommandBuffer);
130
131_DEC_VK(vkCreateEvent);
132_DEC_VK(vkDestroyEvent);
133_DEC_VK(vkCmdSetEvent);
134_DEC_VK(vkCmdWaitEvents);
135_DEC_VK(vkCmdResetEvent);
136_DEC_VK(vkGetEventStatus);
137_DEC_VK(vkResetEvent);
138_DEC_VK(vkSetEvent);
139
140_DEC_VK(vkCmdPipelineBarrier);
141_DEC_VK(vkCreateFence);
142_DEC_VK(vkDestroyFence);
143_DEC_VK(vkResetFences);
144_DEC_VK(vkGetFenceStatus);
145_DEC_VK(vkWaitForFences);
146_DEC_VK(vkWaitSemaphores);
147_DEC_VK(vkGetSemaphoreCounterValue);
148
149_DEC_VK(vkCreateRenderPass);
150_DEC_VK(vkDestroyRenderPass);
151_DEC_VK(vkCmdBeginRenderPass);
152_DEC_VK(vkCmdEndRenderPass);
153_DEC_VK(vkCmdNextSubpass);
154_DEC_VK(vkCmdBindIndexBuffer);
155_DEC_VK(vkCmdBindVertexBuffers);
156_DEC_VK(vkCmdClearDepthStencilImage);
157_DEC_VK(vkCmdClearColorImage);
158_DEC_VK(vkCreateFramebuffer);
159_DEC_VK(vkDestroyFramebuffer);
160
161_DEC_VK(vkCreateGraphicsPipelines);
162_DEC_VK(vkCreateComputePipelines);
163_DEC_VK(vkDestroyPipeline);
164_DEC_VK(vkCreateShaderModule);
165_DEC_VK(vkDestroyShaderModule);
166_DEC_VK(vkCreateDescriptorSetLayout);
167_DEC_VK(vkDestroyDescriptorSetLayout);
168_DEC_VK(vkCreateDescriptorPool);
169_DEC_VK(vkDestroyDescriptorPool);
170_DEC_VK(vkAllocateDescriptorSets);
171_DEC_VK(vkFreeDescriptorSets);
172_DEC_VK(vkUpdateDescriptorSets);
173_DEC_VK(vkCreatePipelineLayout);
174_DEC_VK(vkDestroyPipelineLayout);
175_DEC_VK(vkCreateSampler);
176_DEC_VK(vkDestroySampler);
177
178_DEC_VK(vkCmdBindPipeline);
179_DEC_VK(vkCmdCopyQueryPoolResults);
180_DEC_VK(vkCmdResetQueryPool);
181_DEC_VK(vkCmdWriteTimestamp);
182_DEC_VK(vkCmdBeginQuery);
183_DEC_VK(vkCmdEndQuery);
184
185_DEC_VK(vkCreateSemaphore);
186_DEC_VK(vkDestroySemaphore);
187
188// memory
189
190_DEC_VK(vkAllocateMemory);
191_DEC_VK(vkFreeMemory);
192_DEC_VK(vkMapMemory);
193_DEC_VK(vkUnmapMemory);
194_DEC_VK(vkFlushMappedMemoryRanges);
195_DEC_VK(vkInvalidateMappedMemoryRanges);
196
197_DEC_VK(vkGetBufferMemoryRequirements);
198_DEC_VK(vkGetImageMemoryRequirements);
199
200_DEC_VK(vkCreateBuffer);
201_DEC_VK(vkCreateBufferView);
202_DEC_VK(vkDestroyBuffer);
203_DEC_VK(vkBindBufferMemory);
204
205_DEC_VK(vkCreateImage);
206_DEC_VK(vkDestroyImage);
207_DEC_VK(vkBindImageMemory);
208_DEC_VK(vkCreateImageView);
209_DEC_VK(vkDestroyImageView);
210
211// raytracing
212_DEC_VK(vkCreateRayTracingPipelinesKHR);
213_DEC_VK(vkGetAccelerationStructureBuildSizesKHR);
214_DEC_VK(vkCreateAccelerationStructureKHR);
215_DEC_VK(vkDestroyAccelerationStructureKHR);
216_DEC_VK(vkBuildAccelerationStructuresKHR);
217_DEC_VK(vkGetAccelerationStructureDeviceAddressKHR);
218_DEC_VK(vkGetDeviceAccelerationStructureCompatibilityKHR);
219_DEC_VK(vkGetBufferDeviceAddress);
220_DEC_VK(vkCmdBuildAccelerationStructuresKHR);
221_DEC_VK(vkCmdTraceRaysKHR);
222_DEC_VK(vkGetRayTracingShaderGroupHandlesKHR);
223
224// mesh shaders
225_DEC_VK(vkCmdDrawMeshTasksEXT);
226
227// Nvidia
228_DEC_VK(vkCmdSetCheckpointNV);
229_DEC_VK(vkGetQueueCheckpointDataNV);
230
231#ifdef __cplusplus
232}
233#endif
Vulkan implementation of GPU acceleration structure.
Definition vkaccelerationstructure.cc:15
void InitInstance(VkInstance instance)
initialize Vulkan instance, loads function pointers directly from driver
Definition vkloader.cc:60
PFN_vkSetDebugUtilsObjectNameEXT VkDebugObjectName
Definition vkloader.cc:13
void InitVulkan()
initialize Vulkan by loading dll and setting up the instance loader
Definition vkloader.cc:17
#define _DEC_VK(name)
Definition vkloader.h:35