Learning how to write a Vulkan render pipeline #601
-
Could I please get some suggestions for learning how to create a rendering pipeline with Vulkan using Silk? My teammate wants to build a Vulkan based rendering pipeline using Silk. He is new to Vulkan but has some OpenGL experience. planning on using Net6 if that matters. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I recommend following a tutorial like vkguide - these are written in C but they port over to Silk.NET pretty nicely. The only things Silk.NET do differently are Windowing, Input, Loading, and Extensions. WindowingUse the OpenGL Hello Window example as a base for this. You will have to change WindowOptions.Default to WindowOptions.DefaultVulkan to enable Vulkan support. In the Window’s Load callback, you can query the instance extensions you need and create a surface using the APIs accessed via window.VkSurface. InputThis is also demonstrated in the OpenGL Hello Window example. LoadingIn Silk.NET, all native functions are accessed through an “API object”. For Vulkan, you can create this by doing Vk.GetApi - this is an expensive call so make sure you cache the object you get somewhere in your program and pass it around as needed. ExtensionsIn Silk.NET, each extension has their own package and class. As such, if you want to use a function which is defined in an extension you’ll need to install the relevant package (prefixed with Silk.NET.Vulkan.Extensions.) and use the TryGetInstanceExtension or TryGetDeviceExtension methods to access an API object for those functions - again cache the objects you get back. Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
cc @HurricanKai as Vulkan SME |
Beta Was this translation helpful? Give feedback.
I recommend following a tutorial like vkguide - these are written in C but they port over to Silk.NET pretty nicely.
The only things Silk.NET do differently are Windowing, Input, Loading, and Extensions.
Windowing
Use the OpenGL Hello Window example as a base for this. You will have to change WindowOptions.Default to WindowOptions.DefaultVulkan to enable Vulkan support. In the Window’s Load callback, you can query the instance extensions you need and create a surface using the APIs accessed via window.VkSurface.
Input
This is also demonstrated in the OpenGL Hello Window example.
Loading
In Silk.NET, all native functions are accessed through an “API object”. For Vulkan, you can create this…