Files
Vulkan-Beef/README.md
T

55 lines
1.6 KiB
Markdown

# Vulkan-Beef
Vulkan Bindings for Beef. See https://git.unicon-gmbh.de/Rune/Vulkan-Beef-Example for an example.
## Namespaces
### `Vulkan`/`Vulkan.Video`
These namespaces contain all types and should be compatible with any C library bindings
```beef
VkInstanceCreateInfo* instanceCI = scope .(
pNext: scope VkDebugUtilsMessengerCreateInfoEXT(null, 0,
messageSeverity: .ErrorEXT | .WarningEXT,
messageType: .ValidationEXT | .PerformanceEXT,
(messageSeverity, messageTypes, pCallbackData, pUserData) =>
{
Debug.WriteLine(StringView(pCallbackData.pMessage));
return VK_FALSE;
}
),
pApplicationInfo: scope .()
{
pApplicationName = "Example",
applicationVersion = VK_MAKE_VERSION(1, 0, 0),
apiVersion = VK_API_VERSION_1_0,
},
enabledLayerNames: .("VK_LAYER_KHRONOS_validation"),
enabledExtensionNames: instanceExtensions
);
```
### `Vulkan.Metadata`
This namespace contains metadata from the registry for:
- extensions
- formats
- device features
- structure types
- commands/function
### `Vulkan.Loader`
This namespace contains a loader simlar to volk
```beef
VulkanLoadedFunctions vulkanPfns = default;
vulkanPfns.Load(vkGetInstanceProcAddr); // get pfn from platform wrapper (SDL or glfw)
VulkanLoadedFunctions.current = &vulkanPfns;
result = vkCreateInstance(instanceCI, null, let instance);
CheckResult(result);
vulkanPfns.LoadInstance(instance);
defer instance.Destroy(); // Vulkan-Hpp style call
result = instance.EnumeratePhysicalDevices_Scope!(let physicalDevices); // get an array
CheckResult(result);
```