Closed mbernat closed 11 months ago
I'm slowly working through custom glutin initialization. So far I haven't encountered any major obstacles but it's going slowly and I guess we won't know if it's working until I hook up everything correctly all the way to some glium example.
@mbernat let me know if you want me to test anything on real hardware.
Probably one of the easiest ways to see if things are working is to use the gl
crate and just clear the screen to a known color or something simple like that.
Though once we have glutin contexts working, drawing a triangle with glium is very straightforward too.
Thanks @bschwind , I'll let you know when I have anything testable.
I've spent a lot of time just following glium/glutin types and didn't really get anywhere because I just don't know anything about GBM & EGL and I also started getting some IO errors from GBM operations (likely my fault, not HW). But I found a nice example in C [1] that seems to involve all the pieces in the right order. I'll try to get it working and then I'll port it to our codebase.
[1] https://github.com/eyelash/tutorials/blob/master/drm-gbm.c
I now have some awful code that can render one broken frame and immediately crash. Also, it only works with nouveau
.
I will refactor it into a semi-reasonable PR and we can continue testing and building on that afterwards.
@mbernat I just want to say thanks for the serious progress here (on #12 and on #11) - that's some very perseverant "bashing it until it works"!
Based on my investigation so far it should be easiest to support GPU rendering via
glium
+glutin
.Window
struct holding GBM context and implementHasRawWindowHandle
&HasRawDisplayHandle
for it.glutin
with ourWindow
. It should support GBM handles out of box.glium
should work with the glutin context.Other alternatives require (minor) forking to support GBM RawWindowHandle & RawDisplayHandle.
wgpu
: after forking it should work with our framebuffers directly, just like glutin does.winit
: after forking we could use its windows for full windowing functionality and provide windows to any compatible graphics API.