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

Fixed: Use VertexOuput instead of FragmentInput in prepass.wgsl #10009

Conversation

idobenamram
Copy link

@idobenamram idobenamram commented Oct 3, 2023

Fix Inconsistency between VertexOutput and FragmentInput in prepass.wgsl

Objective

Fixes #9402 -
Encountered this bug:

2023-08-09T20:52:12.883651Z ERROR wgpu::backend::direct: Handling wgpu errors as fatal by default
thread 'Compute Task Pool (1)' panicked at /home/jlewis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.16.3/src/backend/direct.rs:3019:5:
wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
      note: label = `prepass_pipeline`
    Error matching ShaderStages(FRAGMENT) shader requirements against the pipeline
    Location[2] is provided by the previous stage output but is not consumed as input by this stage.


note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_render::render_resource::pipeline_cache::PipelineCache::process_pipeline_queue_system`!
thread 'Compute Task Pool (0)' panicked at /home/jlewis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_render-0.11.0/src/pipelined_rendering.rs:135:45:
called `Result::unwrap()` on an `Err` value: RecvError

The reason was that the FragmentInput in the prepass.wgsl was missing @location(2) which is the VERTEX_TANGENTS.

Solution

  • Remove FragmentInput in prepass.wgsl use VertexOutput instead
  • Rename VertexOutput to PrepassMeshVertexOutput
  • Rename clip_position to position in PrepassMeshVertexOutput

…ves inconsistency between vertex and fragment shader (bevyengine#9402)
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@IceSentry IceSentry self-requested a review October 3, 2023 18:33
@IceSentry IceSentry added A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior labels Oct 3, 2023
@IceSentry IceSentry added this to the 0.12 milestone Oct 3, 2023
@superdump
Copy link
Contributor

I don't want to merge this until after #9258 as that is a big PR and reworking it would be more painful than possibly reworking this one. That also touches this code and changes it a bit so we'll see how things look after that is merged.

@IceSentry
Copy link
Contributor

The deferred PR partially fixed the original issue and #10105 will apply the same fix as this PR but in the context of the deferred prepass so I think we can close this. Thank you for the PR @thebeastxdxd

@IceSentry IceSentry closed this Oct 13, 2023
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 this pull request may close these issues.

WGPU error on switching materials with normal prepass
4 participants