rt(mtl): don't make mipmapper for history if not needed
This commit is contained in:
parent
477d0ae67c
commit
856f69113d
|
@ -206,10 +206,11 @@ impl FilterChainMetal {
|
||||||
cmd: &ProtocolObject<dyn MTLCommandBuffer>,
|
cmd: &ProtocolObject<dyn MTLCommandBuffer>,
|
||||||
input: &ProtocolObject<dyn MTLTexture>,
|
input: &ProtocolObject<dyn MTLTexture>,
|
||||||
) -> error::Result<()> {
|
) -> error::Result<()> {
|
||||||
let mipmapper = cmd
|
|
||||||
.blitCommandEncoder()
|
|
||||||
.ok_or(FilterChainError::FailedToCreateCommandBuffer)?;
|
|
||||||
if let Some(mut back) = self.history_framebuffers.pop_back() {
|
if let Some(mut back) = self.history_framebuffers.pop_back() {
|
||||||
|
let mipmapper = cmd
|
||||||
|
.blitCommandEncoder()
|
||||||
|
.ok_or(FilterChainError::FailedToCreateCommandBuffer)?;
|
||||||
if back.texture.height() != input.height()
|
if back.texture.height() != input.height()
|
||||||
|| back.texture.width() != input.width()
|
|| back.texture.width() != input.width()
|
||||||
|| input.pixelFormat() != back.texture.pixelFormat()
|
|| input.pixelFormat() != back.texture.pixelFormat()
|
||||||
|
@ -228,8 +229,6 @@ impl FilterChainMetal {
|
||||||
back.copy_from(&mipmapper, input)?;
|
back.copy_from(&mipmapper, input)?;
|
||||||
mipmapper.endEncoding();
|
mipmapper.endEncoding();
|
||||||
self.history_framebuffers.push_front(back);
|
self.history_framebuffers.push_front(back);
|
||||||
} else {
|
|
||||||
mipmapper.endEncoding();
|
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue