-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add Safe GPU Api #41
Add Safe GPU Api #41
Conversation
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.
I'd like to see this expanded on with concise, ergonomic, non-allocating macros as has been done with e.g. span
.
I'm also a bit confused about how this works. There doesn't seem to be much here that could plausibly interact with the GPU.
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.
With the caveat that I don't deal with GPUs much, the overall shape seems quite reasonable to me. Excited to see progress here, and sorry for the delay in reviewing this.
Pardon the delay, most of these should be addressed now. Still haven't done documentation, but will wait until we've settled on api shape. |
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.
Overall this looks good enough to me, just a couple of nits (and docs and tests) before this could be merged.
Sorry for the long delays in review here. Holidays and stuff.
This totally got lost in my history - got this fully back up to date, an improved some of the code to make it more resilient. Needs more documentation and the test causes tracy to crash, which I need to get a debug build of tracy to debug (this was an issue before the fix, the test just makes it trivial to reproduce. |
I would be happy to land this as soon as the doc-comments are filled in. Tracy crashes: unfortunately those usually are an issue in the upstream project. I’m of an opinion that we’re not supposed to work around those in the bindings. The only place where any meaningful amount of complex logic is warranted is in the |
Cool! Will add the doc comments and such and some end-to-end documentation. I want to at least get a culpret for the tracy crash, to make sure we're not somehow misusing the api, as the builtin integrations seem to work okay. Will build a c repro if it happens to be Tracy's fault, thankfully should be pretty simple. |
Traced down the bug, it was actually an assert in tracy that was getting hit. I wasn't using the From looking at the tracy's use of query ids, they have asserts that they are never re-used until the timestamps are written. As such, I'm going to add a freelist for validation and re-use prevention. |
Failures unrelated. |
I think this is good for final reviews |
#[cfg(feature = "enable")] | ||
gpu_start_timestamp: i64, | ||
#[cfg(feature = "enable")] | ||
span_freelist: Arc<Mutex<Vec<u16>>>, |
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.
Are we certain that span IDs are per-context and not global in tracy?
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.
Yes, they make no attempt to globally de-duplicate them in their own bindings.
Merged this in 9ed943b and pushed out a new release. |
The commit on main unfortunately appears to be a fairly old iteration of this PR, missing most of the doc comments and some of the fixes. |
Shows you shouldn't be merging stuff late Sunday night lol :)
Ah, my bad, looks like squash-merging this on a late sunday night was a mistake :) Yanked 0.16.0, merged the rest of the PR, and released a new one. I believe it correctly contains the rest of this PR. |
Depends on #39
Context Wumpf/wgpu-profiler#15
This adds the GPU api to tracy_client. It merely adds safe interfaces. I am putting this up as a draft to get opinions on architecture.
TODO: