-
Notifications
You must be signed in to change notification settings - Fork 27
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 trait extension in addition to raw implementations on scopes #78
base: main
Are you sure you want to change the base?
Conversation
Also, one thing to maybe investigate, there is the wgpu-builtin trait I guess my ultimate goal is to write a generic function over something like Then I could write my encodings agnostic of wether they support profiling and agnostic of wether they are Maybe I'm asking for too much magic xD |
let frame = surface | ||
.get_current_texture() | ||
.expect("Failed to acquire next surface texture"); | ||
let mut frame; |
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.
that's nice but also out of place for this PR
Any reason it does 10x retry without pumping the window loop, has this been observed to be actually getting around issues? (I'm curious!)
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.
It failed to acquire sometimes. 10 retires is arbitrary but fixed it for me - Debian 12, wayland.
Have done it this way in other winit applications I have been working on and it seems to work
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.
very much open to the idea but for putting this in this needs some more docs and a usage example (and ideally a test) with a real custom scope type
I'm intruiged but also not quite following the wishlist above all the way, can you share some more examples?
I'm slowly booting again having been away from keyboards for a while 😄
As a I said this is perhaps not the best way to do what I really wanted - get something that allows recording to both BundleEncoder, CommandEmcoder and RenderPass |
I had a use-case where I wanted to be generic over the different scopes for helper functions and solved it by introducing extension traits in addition to the direct macro implementations you already have.
In general I agree with the docs as you say that it is much nicer to not have to import an extension, but this might be the best of both worlds.
Do what you want with it!
Thanks!