-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bgfx as rendering backend #425
Comments
We already discussed that. Unfortunately, the shaderc tool is a major downside of bgfx, because it completely prohibits cross-compilation. At the moment, cross-compilation is the primary way I am able to support Windows as a first-class platform. I'm also not a fan of their general approach; it does work to an extent, but it's a huge hack, and I don't look forward to having to support it. One can note that the effort required to port SolveSpace to use bgfx is similar to the effort required to port it to Vulkan. However, Vulkan is a standard API with industry backing, and it actually provides something quite like bgfx: Vulkan Portability Initiative. The VPI implementation that's likely going to be the most usable is gfx-rs. Of course, until someone (not me) implements a Vulkan rendering backend, the question is moot. Even once that happens, we can still ship two rendering backends until the point where major additions or changes are needed. At that point, the decision to drop ANGLE and MoltenVK in favor of gfx-rs or something similar will be made.
That actually works just fine, because the GL 3 port is carefully written to run on GL ES 2 as well. |
Thanks for the info. The reasons are very clear indeed. I would also like to see Vulkan implemented, but it certainly is a big task. I may, however, give a shot in the future (when I'll have less stuff to do, hopefully) as a way to learn Vulkan well, unless the current OpenGL rendering backend is doing particularly complex stuff (I'm still at "beginner+" level on graphics APIs). Also I guess Vulkan will require GTK4 or Qt, since Solvespace is currently using GTK 3.x, right? |
Sounds great! The current OpenGL rendering backend is about as basic as it gets if you're using GL ES 2.
Unfortunately, yes. And we also can't drop GTK 3 any time soon. I'm not sure how bad exactly it will be, but skimming this document suggests it will be a major nightmare, possibly close to a complete rewrite. Not looking forward to that... |
I had a read, not knowing how and how much SolveSpace uses GTK I can't have an opinion on how difficult the port will be (or would be, if another toolkit is choosen). What would be the best way to start playing around with Vulkan in the short term? If there's even a way (without first completely moving to a toolkit that supports it, I mean). Also, in alternative to GTK and Qt, given the main reasons for having a "native" toolkit (i.e. not ImGUI or things like that) is native OS integration/look&feel, isn't there any library like |
I'm not really sure. The thing about GTK 4 is that as far as I can tell it's not really released yet (it has a version "3.96"...) and I can't even get it installed in Debian, so a port would be... premature. I suggest looking at the Emscripten port for inspiration. I think you can do this: stub out pretty much everything UI-related other than bare rendering itself, and use something like glfw to set up a Vulkan context. Then you're free to work on those parts alone. Let me know if you need assistance with that.
Yes. It's called |
Many thanks, if I find some time to experiment with a Vulkan renderer in the next months I'll definitely accept some help in regard. I'm not familiar with the codebase so some insight on where stuff is will definitely be necessary.
I'll surely take a look as a first step. Just out of curiosity, when you talked about gfx-rs, how do you see that being glued with the rest given it's written in Rust? Do you mean using it as a library, thus the language doesn't matter as long as it exports with the C ABI, or would the renderer need to be written in Rust and maybe use the rest of Solvespace as a library or something like that? |
Yes, it exports a subset of the Vulkan ABI. That's what Vulkan Portability Initiative is about. They can run unmodified DOTA 2 against gfx-rs so it should be well good enough. |
@whitequark I guess this can be closed since "Bgfx as rendering backend" is no longer relevant? When I'll find some time to play around with Vulkan for rendering I guess I'll open another issue or contact you somewhere else like on IRC? |
Sure. |
Just out of curiosity, would Bgfx be useful for Solvespace? If I understand correctly it's a single graphics API that sort of translates to multiple backends (including Vulkan, OpenGL ES, WebGL, Direct3D, etc...). I know there have been discussions regarding MacOS support now that only Metal will be supported and an Emscripten port is in progress. This would still allow for those while enabling newer backends (like Vulkan) for modern hardware that supports it, with better performance (I guess?)
The text was updated successfully, but these errors were encountered: