kvark / vange-rs

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

Support for wasm32-unknown-unknown target (WebGL) #149

Open caiiiycuk opened 2 years ago

caiiiycuk commented 2 years ago

I tried to update wgpu to 0.11.0 (in order to support WebGL in future). I fixed some initialization code and now it compiles but render black screen, can you please point me what I did wrong.

Platform: linux Renderer: vulkan

caiiiycuk commented 2 years ago

Also _pad: vec2 in shader seems unused, I renamed it to apad because shader won’t compile

kvark commented 2 years ago

Please rebase!

caiiiycuk commented 2 years ago

Everything looks working, but seems render is not fit for webgl, have this issue:

road.js:1416 panicked at 'wgpu error: Validation Error

Caused by:
    In Device::create_bind_group_layout
      note: label = `Shape`
    binding 0 entry is invalid
    Downlevel flags VERTEX_STORAGE are required but not supported on the device.
This is not an invalid use of WebGPU: the underlying API or device does not support enough features to be a fully compliant implementation. A subset of the features can still be used. If you are running this program on native and not in a browser and wish to work around this issue, call Adapter::downlevel_properties or Device::downlevel_properties to get a listing of the features the current platform supports.
kvark commented 2 years ago

Please file this separately, I'll address it shortly.

caiiiycuk commented 2 years ago

150

caiiiycuk commented 2 years ago

Please comment what to fix, I will update README.md soon