gfx-d
gfx-d copied to clipboard
Provide high level API
It is intended to provide a high level API on top of Graal. This API should make writing code easy (Graal is just as complicated as Vulkan, just a little less verbose), but still enable power and flexibility. This issue is about discussing/gathering specifications for this API.
- Swapchain creation should be done in a few lines of code
- Pipeline creation scriptable with Lua
- Be bindless or nearly. Every binding should be done in the context of another object (no global binding).
- High scalability over multiple threads
- Do not hide Graal away. Rather provide helpers on top of it.
I've been implementing my own Vulkan-based game engine in D, but just discovered this project. It seems like you're quite a lot further along with this abstraction. 😄️
I'm going to investigate swapping out my Vulkan implementation with your library...
Regarding higher level swapchain creation, what of something like my abstraction?
Device.createSwapChain: https://github.com/chances/teraflop-d/blob/vulkan/source/vulkan.d#L216SwapChainclass: https://github.com/chances/teraflop-d/blob/vulkan/source/vulkan.d#L275- Each
Window"has" aSwapChain: https://github.com/chances/teraflop-d/blob/vulkan/source/game.d#L25 SwapChain's are recreated when windows resize with little hassle: https://github.com/chances/teraflop-d/blob/vulkan/source/game.d#L209
@chances First, thanks for your interest in this project!
I've started something similar in spirit: The GraphicsSurface class manages its own swapchain and some data per image in the swapchain. (still WIP) Your swapchain abstraction goes a little bit further:
- it handles the presentation
- it creates a renderpass and framebuffer (this assumes a particular attachments layout)
I'm not so sure yet how to move forward. On thing is sure: I can't assume anything about the attachement layout (e.g. color + depth). But I may pass attachment description and use this to manage renderpass and framebuffer.
I have a fairly complex example (deferred), with multiple passes and framebuffers. This will be a good crash test for this API.