-
Notifications
You must be signed in to change notification settings - Fork 546
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
Heap-less descriptor sets in Metal #2183
Conversation
I'm thinking about these follow-ups:
|
I've implemented the first two follow-ups here. The code looks much better, subjectively. Performance-wise we don't have hard numbers, just some rough estimation. FPS increased from 65 to 85, which is quite visible but still far from the target. |
That difference of 20fps is for peak fps (with everything still on screen), but the averages differ less.
First, we don't know how dota reacts on an allocation error (but we can ask). Second, the range allocator failure may signify a mistake in our logic. Need to double check that (cc @Xaeroxe ). |
@Xaeroxe nvm, it was my code's fault all along. Fixed now :) |
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.
Looks great 👍 looking forward to the performance improvement!
Dota 2 should have covered/validated most of these changes as well, so it seems safe to proceed.
native::DescriptorPool::count_bindings(layout.ty, layout.count, | ||
&mut sampler_base, &mut texture_base, &mut buffer_base); | ||
|
||
if buffer_base != bf_range.start { |
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.
nit: seems we could collapse this with the other if buffer_base != bf_range.start
below
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 just github view playing tricks on us - the other one has different indentation (so executes at a different frequency)
} | ||
} | ||
|
||
pub fn allocate_range(&mut self, length: T) -> Option<Range<T>> { | ||
assert_ne!(length + length, length); |
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.
What's the purpose of this assertion? Seems it's just checking for zero?
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, but T doesn't have a Zero
bound :)
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.
Thanks for taking a look!
I still suspect something is wonky with the code, but having so much stuff piling in doesn't help, and we'll need to investigate post-merging.
bors r=grovesNL
native::DescriptorPool::count_bindings(layout.ty, layout.count, | ||
&mut sampler_base, &mut texture_base, &mut buffer_base); | ||
|
||
if buffer_base != bf_range.start { |
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 just github view playing tricks on us - the other one has different indentation (so executes at a different frequency)
2183: Heap-less descriptor sets in Metal r=grovesNL a=kvark Fixes the heap allocations in descriptor sets, to help #2161. Edit: the improvement is there, but it's not the one we were looking for. Adds real value semantics for the `DescriptorPool`, which now owns the allocation and has the actual descriptor sets pointing to it. PR checklist: - [x] `make` succeeds (on *nix) - [x] `make reftests` succeeds - [x] tested examples with the following backends: metal ~~Note: it doesn't work correctly yet, but I'd be happy to get the review comments and notes. Perhaps, you can spot the mistake? ;) Sadly, my CTS is non-operational atm, so it's not easy to figure out a test case. Note2: the individual commits are not build-able. Will squash once finished.~~ Co-authored-by: Dzmitry Malyshau <[email protected]>
Fixes the heap allocations in descriptor sets, to help #2161.
Edit: the improvement is there, but it's not the one we were looking for.
Adds real value semantics for the
DescriptorPool
, which now owns the allocation and has the actual descriptor sets pointing to it.PR checklist:
make
succeeds (on *nix)make reftests
succeedsNote: it doesn't work correctly yet, but I'd be happy to get the review comments and notes. Perhaps, you can spot the mistake? ;)Sadly, my CTS is non-operational atm, so it's not easy to figure out a test case.
Note2: the individual commits are not build-able. Will squash once finished.