kvark / vange-rs

Rusty Vangers clone
https://vange.rs
Apache License 2.0
427 stars 21 forks source link

Support GL backend: vertex storage #150

Closed caiiiycuk closed 2 years ago

caiiiycuk commented 2 years ago

Please add support to GL backend and webgl2 features level set. Currently if you change boilerplate.rs:86 to

        let mut limits = wgpu::Limits::downlevel_webgl2_defaults();

and run game it didn't start with error:

[2021-11-20T04:21:18Z ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In Device::create_bind_group_layout
      note: label = `Shape`
    too many bindings of type StorageBuffers in stage VERTEX, limit is 0, count was 1

', /home/caiiiycuk/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/47fd776/wgpu/src/backend/direct.rs:2211:5

Moreover if you specify GL backend (boilerplate.rs:64)

        let instance = wgpu::Instance::new(wgpu::Backends::GL);

Then backend can't start because COLOR_FORMAT is not supported:

thread 'main' panicked at 'Error in Surface::configure: requested format Bgra8Unorm is not in list of supported formats: [Rgba8UnormSrgb, Bgra8UnormSrgb]', /home/caiiiycuk/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/47fd776/wgpu/src/backend/direct.rs:204:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

When I test it in browser, supported format is only Rgba8UnformSrgb