You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi folks, I'm updating this PR (implementing ISF) to wgpu 0.8 and running into some parser errors with the shader code generated via the generated GLSL.
Here's an example of an ISF-generated GLSL shader that, when compiled to SPIR-V (via the glsl-to-spirv crate) results in a WGSL parser error when loading the shader module (please disregard the odd formatting, this is generated from one of the original ISF test shaders):
wgpu error: Validation Error
Caused by:
In Device::create_shader_module
note: label = `nannou_shader_module`
Failed to parse WGSL
thread 'main' panicked at 'Handling wgpu errors as fatal by default', /home/mindtree/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.8.1/src/backend/direct.rs:1955:5
stack backtrace:
0: std::panicking::begin_panic
at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/panicking.rs:519:12
1: wgpu::backend::direct::default_error_handler
at /home/mindtree/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.8.1/src/backend/direct.rs:1955:5
2: core::ops::function::Fn::call
at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/core/src/ops/function.rs:70:5
3: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/alloc/src/boxed.rs:1535:9
4: wgpu::backend::direct::ErrorSinkRaw::handle_error
at /home/mindtree/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.8.1/src/backend/direct.rs:1942:9
5: wgpu::backend::direct::Context::handle_error
at /home/mindtree/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.8.1/src/backend/direct.rs:93:9
6: <wgpu::backend::direct::Context as wgpu::Context>::device_create_shader_module
at /home/mindtree/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.8.1/src/backend/direct.rs:819:13
7: wgpu::Device::create_shader_module
at /home/mindtree/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.8.1/src/lib.rs:1537:17
8: nannou::wgpu::shader_from_spirv_bytes
at /home/mindtree/programming/rust/nannou/nannou/src/wgpu/mod.rs:95:5
9: nannou_isf::pipeline::compile_isf_shader::{{closure}}
at /home/mindtree/programming/rust/nannou/nannou_isf/src/pipeline.rs:440:32
10: core::option::Option<T>::map
at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/core/src/option.rs:487:29
11: nannou_isf::pipeline::compile_isf_shader
at /home/mindtree/programming/rust/nannou/nannou_isf/src/pipeline.rs:440:18
12: nannou_isf::pipeline::Shader::fragment_from_path
at /home/mindtree/programming/rust/nannou/nannou_isf/src/pipeline.rs:459:31
13: nannou_isf::pipeline::IsfPipeline::new
at /home/mindtree/programming/rust/nannou/nannou_isf/src/pipeline.rs:519:18
14: isf_demo::create_isf_state
at /home/mindtree/programming/rust/nannou/examples/isf/isf_demo.rs:471:20
15: isf_demo::model::{{closure}}
at /home/mindtree/programming/rust/nannou/examples/isf/isf_demo.rs:101:24
16: core::option::Option<T>::map
at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/core/src/option.rs:487:29
17: isf_demo::model
at /home/mindtree/programming/rust/nannou/examples/isf/isf_demo.rs:98:15
18: nannou::app::Builder<M,E>::run
at /home/mindtree/programming/rust/nannou/nannou/src/app.rs:484:21
19: isf_demo::main
at /home/mindtree/programming/rust/nannou/examples/isf/isf_demo.rs:10:5
20: core::ops::function::FnOnce::call_once
at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/core/src/ops/function.rs:227:5
The source of the issue appears to be this line:
vec4 srcPixel = IMG_THIS_PIXEL(inputImage);
If I replace this with something like
vec4 srcPixel =vec4(0);
the shader appears to compile successfully. If I inline the IMG_THIS_PIXEL function as follows:
That said, I do run into the following validation error, though I'm not yet sure if this is related to the parser error - investigating now.
wgpu error: Validation Error
Caused by:
In Device::create_render_pipeline
note: label = `nannou render pipeline`
error matching FRAGMENT shader requirements against the pipeline
shader global ResourceBinding { group: 2, binding: 1 } is not available in the layout pipeline layout
binding is missing from the pipeline layout
thread 'main' panicked at 'Handling wgpu errors as fatal by default', /home/mindtree/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.8.1/src/backend/direct.rs:1955:5
stack backtrace:
0: std::panicking::begin_panic
at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/panicking.rs:519:12
1: wgpu::backend::direct::default_error_handler
at /home/mindtree/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.8.1/src/backend/direct.rs:1955:5
2: core::ops::function::Fn::call
at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/core/src/ops/function.rs:70:5
3: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/alloc/src/boxed.rs:1535:9
4: wgpu::backend::direct::ErrorSinkRaw::handle_error
at /home/mindtree/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.8.1/src/backend/direct.rs:1942:9
5: wgpu::backend::direct::Context::handle_error
at /home/mindtree/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.8.1/src/backend/direct.rs:93:9
6: <wgpu::backend::direct::Context as wgpu::Context>::device_create_render_pipeline
at /home/mindtree/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.8.1/src/backend/direct.rs:1052:13
7: wgpu::Device::create_render_pipeline
at /home/mindtree/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.8.1/src/lib.rs:1595:17
8: nannou::wgpu::render_pipeline_builder::build
at /home/mindtree/programming/rust/nannou/nannou/src/wgpu/render_pipeline_builder.rs:564:5
9: nannou::wgpu::render_pipeline_builder::RenderPipelineBuilder::build
at /home/mindtree/programming/rust/nannou/nannou/src/wgpu/render_pipeline_builder.rs:484:40
10: nannou_isf::pipeline::create_render_pipeline
at /home/mindtree/programming/rust/nannou/nannou_isf/src/pipeline.rs:947:5
11: nannou_isf::pipeline::IsfPipeline::new
at /home/mindtree/programming/rust/nannou/nannou_isf/src/pipeline.rs:607:50
12: isf_demo::create_isf_state
at /home/mindtree/programming/rust/nannou/examples/isf/isf_demo.rs:471:20
13: isf_demo::model::{{closure}}
at /home/mindtree/programming/rust/nannou/examples/isf/isf_demo.rs:101:24
14: core::option::Option<T>::map
at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/core/src/option.rs:487:29
15: isf_demo::model
at /home/mindtree/programming/rust/nannou/examples/isf/isf_demo.rs:98:15
16: nannou::app::Builder<M,E>::run
at /home/mindtree/programming/rust/nannou/nannou/src/app.rs:484:21
17: isf_demo::main
at /home/mindtree/programming/rust/nannou/examples/isf/isf_demo.rs:10:5
18: core::ops::function::FnOnce::call_once
at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/core/src/ops/function.rs:227:5
Fwiw, this test example did kind of "work" prior to wgpu 0.8, however
Tested with wgpu 0.8.1 on NixOS 21.05.
The text was updated successfully, but these errors were encountered:
Thank you for filing!
The first error is gfx-rs/naga#950. Sorry for it being totally unclear!
You are passing a texture in a function, and we don't like that yet. But we want to like it :)
The way we generally debug this is - doing RUST_LOG=warn cargo run separately with naga on the shader. It often tells what's going on. But really, the errors need to be reported better. The current state of it is not acceptable by any means.
Hi folks, I'm updating this PR (implementing ISF) to wgpu 0.8 and running into some parser errors with the shader code generated via the generated GLSL.
Here's an example of an ISF-generated GLSL shader that, when compiled to SPIR-V (via the
glsl-to-spirv
crate) results in a WGSL parser error when loading the shader module (please disregard the odd formatting, this is generated from one of the original ISF test shaders):And the resulting error:
The source of the issue appears to be this line:
If I replace this with something like
the shader appears to compile successfully. If I inline the
IMG_THIS_PIXEL
function as follows:I no longer run into a WGSL parser error.
That said, I do run into the following validation error, though I'm not yet sure if this is related to the parser error - investigating now.
Fwiw, this test example did kind of "work" prior to wgpu 0.8, however
Tested with wgpu 0.8.1 on NixOS 21.05.
The text was updated successfully, but these errors were encountered: