Skip to content

Allow storage of pipelines in custom shaders for WASM target #2895

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

svents
Copy link

@svents svents commented Apr 22, 2025

I tried to add a custom shader component to my app (a boardgame with a web client and a local one) and ran into an error similar to this one:

error[E0277]: (dyn FnOnce(std::result::Result<(), BufferAccessError>) + 'static) cannot be sent between threads safely
--> examples/custom_shader/src/scene.rs:141:27
|
141 | storage.store(Pipeline::new(
| ____________________-----^
| | |
| | required by a bound introduced by this call
142 | | device,
143 | | queue,
144 | | format,
145 | | viewport.physical_size(),
146 | | ));

The traits to fix this are already available. To test it, I extended the custom shader example. Rebasing the first commit out will cause the error above.

svents added 2 commits April 22, 2025 20:24
- also increased brightness to emphasize depth difference
- added console hook for debugging in WebGL
- removed second redundant depth write (causes usage conflict in WebGL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant