-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -821,11 +821,11 @@ impl CommandSink { | |
) where | ||
I: Iterator<Item = soft::RenderCommand<&'a soft::Own>>, | ||
{ | ||
//assert!(AutoReleasePool::is_active()); | ||
self.stop_encoding(); | ||
|
||
match *self { | ||
CommandSink::Immediate { ref cmd_buffer, ref mut encoder_state, .. } => { | ||
let _ap = AutoreleasePool::new(); | ||
let encoder = cmd_buffer.new_render_command_encoder(descriptor); | ||
for command in init_commands { | ||
exec_render(encoder, command); | ||
|
@@ -1446,7 +1446,7 @@ impl pool::RawCommandPool<Backend> for CommandPool { | |
framebuffer_inner: native::FramebufferInner { | ||
extent: Extent::default(), | ||
aspects: Aspects::empty(), | ||
colors: Vec::new(), | ||
colors: SmallVec::new(), | ||
depth_stencil: None, | ||
} | ||
}, | ||
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. possible! my motivation was to avoid 2 autorelease pools during a regular |
||
|
||
let CommandBufferInner { | ||
ref mut retained_textures, | ||
ref mut sink, | ||
|
@@ -2017,6 +2019,8 @@ impl com::RawCommandBuffer<Backend> for CommandBuffer { | |
T: IntoIterator, | ||
T::Item: Borrow<com::ImageBlit> | ||
{ | ||
let _ap = AutoreleasePool::new(); | ||
|
||
let vertices = &mut self.temp.blit_vertices; | ||
vertices.clear(); | ||
|
||
|
@@ -2220,7 +2224,9 @@ impl com::RawCommandBuffer<Backend> for CommandBuffer { | |
.chain(&extra) | ||
.cloned(); | ||
|
||
inner.sink().begin_render_pass(false, &descriptor, commands); | ||
inner | ||
.sink() | ||
.begin_render_pass(false, &descriptor, commands); | ||
} | ||
} | ||
|
||
|
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