Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upRFC: gfx-rs to HAL bridge #1721
Comments
This comment has been minimized.
This comment has been minimized.
|
As nice as it sounds, implementing |
This comment has been minimized.
This comment has been minimized.
|
I think that |
This comment has been minimized.
This comment has been minimized.
|
Note https://github.com/doitsujin/dxvk that maps D3D11 to Vulkan. It's not too far from the |
kvark commentedJan 5, 2018
Introduction
Lately, I've been trying to wrap my head around what
gfx-renderis meant to be, and how we can approach it effectively. The project started before we took full course on Vulkan Portability (#1354, #1610), and the prototyping we got (thanks to @Bastacyclop fearless efforts) was not exactly bringing us the compatibility with the old/currentgfx-rs. Meanwhile, our growing userbase has been putting more and more pressure to get something compatible.Ideas
Here is the idea that struck me: if HAL ~ Vulkan (portability), then implementing
gfx-render, which would havegfx-rslike API and Vulkan-like backing, would be equal to ... implementinggfx_device_vulkan. Here is good news: we do have some code in there. Surely it needs to be updated and revamped, but the target is the same.Making one step further: given a functioning Vulkan backend, we could use the portability layer to direct it to our HAL implementation. This redirection can be done by something like
gfx_window_halthat links to HAL and provides all the function pointers.Proposed plan
Here is the concrete proposal for gfx-to-HAL bridge:
gfx_device_vulkanimplementation (this ispre-llbranch!), potentially useashfor accessing Vulkan.gfx_window_halthat links to the portability layer. It may have it's own features for different HAL backends.Fate of gfx-render
What does this mean for
gfx-render, you may ask (#1466, #1281)? Well, I think we should salvage what we can (note: if someone volunteers to continue development, you have my blessing!). There might still be space for a new non-constrained higher level library, but not much need for it:gfx-rsgfx-renderMy primary motivation behind
gfx-renderwas the compatibility with existing apps, in particular - with our own examples. But with this bridge implemented, we'd just leave those examples be inpre-llsafely, keep supportingpre-ll, and shift to developing new examples specifically for HAL and it's future wrappers (more framegraphs!:) ).Questions
Welcome to the comments section below ;)