-
Notifications
You must be signed in to change notification settings - Fork 143
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
Disable the async pipeline by default #500
Conversation
src/lib.rs
Outdated
#[cfg(feature = "wgpu-profiler")] | ||
self.profiler.end_frame().unwrap(); | ||
#[cfg(feature = "wgpu-profiler")] | ||
if let Some(result) = self | ||
.profiler | ||
.process_finished_frame(queue.get_timestamp_period()) | ||
{ | ||
self.profile_result = Some(result); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[cfg(feature = "wgpu-profiler")] | |
self.profiler.end_frame().unwrap(); | |
#[cfg(feature = "wgpu-profiler")] | |
if let Some(result) = self | |
.profiler | |
.process_finished_frame(queue.get_timestamp_period()) | |
{ | |
self.profile_result = Some(result); | |
} | |
#[cfg(feature = "wgpu-profiler")] | |
{ | |
self.profiler.end_frame().unwrap(); | |
if let Some(result) = self | |
.profiler | |
.process_finished_frame(queue.get_timestamp_period()) | |
{ | |
self.profile_result = Some(result); | |
} | |
} |
examples/with_winit/src/lib.rs
Outdated
#[cfg(not(target_arch = "wasm32"))] | ||
{ | ||
// Note: we don't run the async/"robust" pipeline, as | ||
// it requires more async wiring for the readback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we get more detail here? What is meant by "async wiring" - Is this a limitation of !Send futures, single-threaded wasm, etc. - What exactly is the issue on WASM that we aren't doing async pipelines there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thread is #gpu > async on wasm. Broadly, the issue is: if we spawn a future, that needs to keep hold of the scene
. But that's incompatible with lifetimes of keeping the scene around (to reuse allocations, etc.)
In theory, we should do this much more carefully, but we haven't yet. That might also be useful in contexts outside of browsers too, allowing multi-threaded scene rendering
Co-Authored-By: "Spencer C. Imbleau" <spencer@imbleau.com>
The async pipeline is not wired up to do robust readback, so it has few advantages (see #366)
This PR also enables the non-async pipeline's interaction with the GPU profiling (which should make it work on wasm)
@simbleau this might also properly fix #494, incidentally.