.NET port of the VkBootstrap C++ library.
See BasicUsage to see 500 lines slimmed down to about 50.
using Fuchsium.VkBootstrapNet;
static void InitVulkan() {
InstanceBuilder builder = new();
var instRet = builder.SetAppName("Example Vulkan Application")
.RequestValidationLayers()
.UseDefaultDebugMessenger()
.Build();
if(!instRet.IsSuccessful) { /* report */ }
var inst = instRet.Value;
PhysicalDeviceSelector selector = new(vkb_inst);
var physRet = selector.SetSurface(surface)
.SetMinimumVersion(1, 1)
.RequireDedicatedTransferQueue()
.Select();
if(!physRet.IsSuccessful) { /* report */ }
DeviceBuilder device_builder = new(physRet.Value);
var devRet = device_builder.Build();
if (!devRet.IsSuccessful) { /* report */ }
Device device = devRet.Value;
var graphicsQueueRet = vkb_device.GetQueue(QueueType.Graphics);
if(!graphicsQueueRet) { /* report */ }
VkQueue graphicsQueue = graphicsQueueRet.Value;
}VkBootstrapNet has taken several creative liberties that differentiate it with the original. These include:
- All API names have been re-written to fit in with the rest of the .NET ecosystem.
- The DotNext framework is utilized for the result type instead of a custom implementation.
- OpenTK's Vulkan bindings are used instead of a custom loader. This means that types like
Devicedo not contain a dispatch table.