Closed zicklag closed 3 years ago
Add the feature flags you want (such as rafx-vulkan,rafx-gles3) and use the API-specific init functions such as RafxApi::new_vulkan
or RafxApi::new_gles3
. RafxApi::new
demonstrates this and probably does what you want by default.
Long term, API selection could be made by having a config file that explicitly pairs PCI device IDs/driver versions with APIs (for example to ban an old GPU from vulkan if it is known to have a buggy driver). This could also be used to enable/disable rendering settings based on the performance of that particular GPU. This is outside the scope of this project for the time being and is a fairly opinionated thing.
Oh, cool, I didn't realize it would work with multiple backends enabled at the same time. Perfect!
Would it make sense to be able to select the graphics API to use at runtime, instead of at compile time?
For instance, on Linux, if I wanted to use Vulkan when possible, but to switch to OpenGL when Vulkan is not supported.
If this would require drastic changes I can understand it being a non-goal, and for my use-case, for distributing PC games, I wouldn't mind terribly if there was a separate build that would be downloaded if OpenGL support was required, but I was curious as to the potential.