-
Notifications
You must be signed in to change notification settings - Fork 543
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
Various Metal performance optimizations #2185
Conversation
let index = first_binding as usize + i; | ||
let value = Some((buffer_ptr, b.range.start + offset)); | ||
if index >= self.state.vertex_buffers.len() { | ||
debug_assert_eq!(index, self.state.vertex_buffers.len()); |
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.
How could this assertion fail?
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 shouldn't I'm just being overly careful here (hence, it's a debug assert and not a usual one)
@@ -821,11 +821,11 @@ impl CommandSink { | |||
) where | |||
I: Iterator<Item = soft::RenderCommand<&'a soft::Own>>, | |||
{ | |||
//assert!(AutoReleasePool::is_active()); |
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: remove this?
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.
this is intentional - we need to make sure there is an active autorelease pool set up by the caller here, but I don't know how to code it yet
@@ -1653,6 +1653,8 @@ impl com::RawCommandBuffer<Backend> for CommandBuffer { | |||
T: IntoIterator, | |||
T::Item: Borrow<SubresourceRange>, | |||
{ | |||
let _ap = AutoreleasePool::new(); |
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.
Does this fix the leak?
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.
possible! my motivation was to avoid 2 autorelease pools during a regular begin_render_pass
, so now I removed the inner one and made sure all the callers set up one.
CI looks green |
2185: Various Metal performance optimizations r=grovesNL a=kvark Helps #2161 . I'm now getting 80-85 fps on the test run. Aside from Metal, also changes HAL to avoid heap allocation for vertex buffer binding. PR checklist: - [x] `make` succeeds (on *nix) - [x] `make reftests` succeeds - [x] tested examples with the following backends: metal Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
Helps #2161 . I'm now getting 80-85 fps on the test run.
Aside from Metal, also changes HAL to avoid heap allocation for vertex buffer binding.
PR checklist:
make
succeeds (on *nix)make reftests
succeeds