hadronized / luminance-rs

Type-safe, type-level and stateless Rust graphics framework
https://phaazon.github.io/learn-luminance/
Other
1.09k stars 59 forks source link

Depth-only framebuffer causes generated binding code to error? #583

Open wg-romank opened 2 years ago

wg-romank commented 2 years ago

Hi,

First of all huge thanks to Phaazon and all contributors to the library! I'm having a blast with it.

Onto the issue, creating Framebuffer without color slot on the web

    let shadow_map = ctxt.new_framebuffer::<Dim2, (), Depth32F>(
      [400, 400], 0, Sampler::default()
    );

seems to cause en error calling drawBuffers API in bindgen code

TypeError: WebGL2RenderingContext.drawBuffers: Argument 1 can't be converted to a sequence.

in

function __wbg_drawBuffers_3e850289094e0ed2(arg0, arg1) {
    getObject(arg0).drawBuffers(getObject(arg1));
};

If I add color slot the issue seems to disappear (actually this function is no longer called), so I'm not sure if I'm missing something and error is caused by my own misconfiguration. I'm quite new to graphics so sorry for vague description.

Thanks!