-
Notifications
You must be signed in to change notification settings - Fork 3
Vulkan Guide
squid233 edited this page May 5, 2025
·
1 revision
Some critical Vulkan functions are required to be loaded before creating a Vulkan instance.
Use VK::create
to load those functions.
VK.create(GLFW::glfwGetInstanceProcAddress);
Use MemoryStack
or Arena
to allocate a create info structure.
The allocated create info AND the data within it MUST be alive while invoking vkCreate*
.
A conventional code is below:
try (MemoryStack stack = MemoryStack.pushLocal()) {
var ci = Vk*CreateInfo.alloc(stack)
.sType(VK_STRUCTURE_TYPE_*_CREATE_INFO);
// other parameters
var p = stack.allocate(JAVA_LONG); // or ADDRESS for dispatchable handle
vkCreate*(dispatchableHandle, ci.segment(), pAllocator, p);
obj = p.get(JAVA_LONG, 0);
} // you can now release the create info
Copyright (c) 2022-2025 Overrun Organization. In case of any problems with this wiki, please search or create an issue.