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

Profiler can't be used accross threads or with interleaved scopes #46

Closed
Wumpf opened this issue Sep 24, 2023 · 1 comment · Fixed by #55
Closed

Profiler can't be used accross threads or with interleaved scopes #46

Wumpf opened this issue Sep 24, 2023 · 1 comment · Fixed by #55
Assignees

Comments

@Wumpf
Copy link
Owner

Wumpf commented Sep 24, 2023

By design the user is currently forced to use one profiler per thread. In fact even working with two command encoders on a single thread in an interleaved fashion is not possible right now since every call to end_scope needs its corresponding call to begin_scope to be in correct order.

begin_scope needs to return a handle that end_scope works with instead. Also, both functions need to work with interior mutability, each requiring &GpuProfiler instead of &mut GpuProfiler.
I believe forcing &mut GpuProfiler for all other methods (query resolve, processing frame etc.) still makes sense though since this greatly simplifies things both for implementation and potential error cases

@Wumpf
Copy link
Owner Author

Wumpf commented Oct 26, 2023

(work in progress)

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 a pull request may close this issue.

1 participant