fix outdated loader example in README.md

This commit is contained in:
2026-07-20 12:22:00 +00:00
parent e2b99d7045
commit c80b9e68db
+9 -4
View File
@@ -38,11 +38,16 @@ This namespace contains metadata from the registry for:
### `Vulkan.Loader` ### `Vulkan.Loader`
This namespace contains a loader simlar to volk This namespace contains a loader simlar to volk
```beef ```beef
VulkanLoader.Init(); // volkInitialize VulkanLoadedFunctions vulkanPfns = default;
result = vkCreateInstance(instanceCI, null, let instance); // c-style call vulkanPfns.Load(vkGetInstanceProcAddr); // get pfn from platform wrapper (SDL or glfw)
VulkanLoadedFunctions.current = &vulkanPfns;
result = vkCreateInstance(instanceCI, null, let instance);
CheckResult(result); CheckResult(result);
VulkanLoader.LoadInstance(instance); // volkLoadInstanceOnly
defer instance.Destroy(); // pretty call vulkanPfns.LoadInstance(instance);
defer instance.Destroy(); // Vulkan-Hpp style call
result = instance.EnumeratePhysicalDevices_Scope!(let physicalDevices); // get an array result = instance.EnumeratePhysicalDevices_Scope!(let physicalDevices); // get an array
CheckResult(result); CheckResult(result);