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

shader_prepass example is broken #7375

Closed
rparrett opened this issue Jan 26, 2023 · 3 comments
Closed

shader_prepass example is broken #7375

rparrett opened this issue Jan 26, 2023 · 3 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Milestone

Comments

@rparrett
Copy link
Contributor

rparrett commented Jan 26, 2023

Bevy version

first bad commit is c3a4682

Relevant system information

AdapterInfo { name: "Apple M1 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
SystemInfo { os: "MacOS 13.1 ", kernel: "22.2.0", cpu: "Apple M1 Max", core_count: "10", memory: "64.0 GiB" }

What you did

  • cargo run --example shader_prepass
  • press space bar

What went wrong

Depth information in grayscale should be shown, but it's just a black screen.

There's some error output:

2023-01-26T21:15:17.623605Z ERROR bevy_render::render_resource::pipeline_cache: failed to process shader:
error: expected constant, found '#'
   ┌─ wgsl:38:41
   │
38 │     cascades: array<DirectionalCascade, #{MAX_CASCADES_PER_LIGHT}>,
   │                                         ^ expected constant


2023-01-26T21:15:17.842460Z ERROR bevy_render::render_resource::pipeline_cache: failed to process shader:
error: expected constant, found '#'
   ┌─ wgsl:38:41
   │
38 │     cascades: array<DirectionalCascade, #{MAX_CASCADES_PER_LIGHT}>,
   │                                         ^ expected constant

@rparrett rparrett added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jan 26, 2023
@JMS55
Copy link
Contributor

JMS55 commented Jan 26, 2023

CC @IceSentry

@JMS55 JMS55 added A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Jan 26, 2023
@Elabajaba
Copy link
Contributor

Elabajaba commented Jan 26, 2023

Copying my answer from the wgpu 0.15 pr

Looks like the cascaded shadow maps (CSM) PR probably broke both of them, as I'm now getting failures when running those examples after rebasing on main with CSM.

#6997 is a bit of a bodge and needs to be updated for CSM, but should fix them. #5703 is probably the better fix, but might not land in time for the next bevy release?

@hymm hymm added this to the 0.10 milestone Jan 28, 2023
@hymm
Copy link
Contributor

hymm commented Jan 28, 2023

the post_processing example is broken too with the same error.

bors bot pushed a commit that referenced this issue Jan 30, 2023
# Objective

- Fix `post_processing` and `shader_prepass` examples as they fail when compiling shaders due to missing shader defs
- Fixes #6799
- Fixes #6996
- Fixes #7375 
- Supercedes #6997
- Supercedes #7380 

## Solution

- The prepass was broken due to a missing `MAX_CASCADES_PER_LIGHT` shader def. Add it.
- The shader used in the `post_processing` example is applied to a 2D mesh, so use the correct mesh2d_view_bindings shader import.
bors bot pushed a commit that referenced this issue Jan 30, 2023
# Objective

- Fix `post_processing` and `shader_prepass` examples as they fail when compiling shaders due to missing shader defs
- Fixes #6799
- Fixes #6996
- Fixes #7375 
- Supercedes #6997
- Supercedes #7380 

## Solution

- The prepass was broken due to a missing `MAX_CASCADES_PER_LIGHT` shader def. Add it.
- The shader used in the `post_processing` example is applied to a 2D mesh, so use the correct mesh2d_view_bindings shader import.
bors bot pushed a commit that referenced this issue Jan 30, 2023
# Objective

- Fix `post_processing` and `shader_prepass` examples as they fail when compiling shaders due to missing shader defs
- Fixes #6799
- Fixes #6996
- Fixes #7375 
- Supercedes #6997
- Supercedes #7380 

## Solution

- The prepass was broken due to a missing `MAX_CASCADES_PER_LIGHT` shader def. Add it.
- The shader used in the `post_processing` example is applied to a 2D mesh, so use the correct mesh2d_view_bindings shader import.
bors bot pushed a commit that referenced this issue Jan 30, 2023
# Objective

- Fix `post_processing` and `shader_prepass` examples as they fail when compiling shaders due to missing shader defs
- Fixes #6799
- Fixes #6996
- Fixes #7375 
- Supercedes #6997
- Supercedes #7380 

## Solution

- The prepass was broken due to a missing `MAX_CASCADES_PER_LIGHT` shader def. Add it.
- The shader used in the `post_processing` example is applied to a 2D mesh, so use the correct mesh2d_view_bindings shader import.
bors bot pushed a commit that referenced this issue Jan 30, 2023
# Objective

- Fix `post_processing` and `shader_prepass` examples as they fail when compiling shaders due to missing shader defs
- Fixes #6799
- Fixes #6996
- Fixes #7375 
- Supercedes #6997
- Supercedes #7380 

## Solution

- The prepass was broken due to a missing `MAX_CASCADES_PER_LIGHT` shader def. Add it.
- The shader used in the `post_processing` example is applied to a 2D mesh, so use the correct mesh2d_view_bindings shader import.
@bors bors bot closed this as completed in 8b7ebe1 Jan 30, 2023
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

- Fix `post_processing` and `shader_prepass` examples as they fail when compiling shaders due to missing shader defs
- Fixes bevyengine#6799
- Fixes bevyengine#6996
- Fixes bevyengine#7375 
- Supercedes bevyengine#6997
- Supercedes bevyengine#7380 

## Solution

- The prepass was broken due to a missing `MAX_CASCADES_PER_LIGHT` shader def. Add it.
- The shader used in the `post_processing` example is applied to a 2D mesh, so use the correct mesh2d_view_bindings shader import.
ChristopherBiscardi added a commit to rust-adventure/bevy-examples that referenced this issue Mar 27, 2023
closes #6

Apply fix from bevyengine/bevy#7375 to the
voronoise example.

* Also introduce a shield demo I'm still working on that uses depth
  prepass
* add a temporary debug fresnel function that is not really that
  different from the current
horttanainen pushed a commit to horttanainen/bevy-examples that referenced this issue Apr 1, 2023
closes rust-adventure#6

Apply fix from bevyengine/bevy#7375 to the
voronoise example.

* Also introduce a shield demo I'm still working on that uses depth
  prepass
* add a temporary debug fresnel function that is not really that
  different from the current
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants