Open expenses opened 2 years ago
I've been using the changes in https://github.com/rustwasm/wasm-bindgen/pull/2863 for a while now and changing it from -> Option<WebGlFramebuffer>
to -> WebGlFramebuffer
has worked fine. We need a good way to override the generated function signature though.
This is still a problem, but can easily be worked around with:
let base_layer: web_sys::XrWebGlLayer = ...;
let framebuffer: web_sys::WebGlFramebuffer = js_sys::Reflect::get(&base_layer, &"framebuffer".into()).unwrap().into();
So the WebXR spec has these 'opaque' framebuffers that you're meant to bind in WebGL:
https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer/framebuffer
It turns out that what 'opaque' means in this context is that the
.framebuffer
property will just straight-up report itself asnull
, yet is still bindable withgl.bindFramebuffer
. This means that theXrWebGlLayer.framebuffer
getter is always going to beNone
.We need to come up with a work-around for this.