rt(mtl): only gen mipmaps if the level count is greater than 1
This commit is contained in:
parent
efdfd56e0e
commit
edca0f1749
2 changed files with 8 additions and 3 deletions
|
@ -79,7 +79,7 @@ impl LutTexture {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.mipmap {
|
if config.mipmap && texture.mipmapLevelCount() > 1 {
|
||||||
mipmapper.generateMipmapsForTexture(&texture);
|
mipmapper.generateMipmapsForTexture(&texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,10 @@ impl OwnedTexture {
|
||||||
unsafe {
|
unsafe {
|
||||||
encoder.copyFromTexture_toTexture(other, &self.texture);
|
encoder.copyFromTexture_toTexture(other, &self.texture);
|
||||||
}
|
}
|
||||||
encoder.generateMipmapsForTexture(&self.texture);
|
|
||||||
|
if self.texture.mipmapLevelCount() > 1 {
|
||||||
|
encoder.generateMipmapsForTexture(&self.texture);
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -142,7 +145,9 @@ impl OwnedTexture {
|
||||||
let mipmapper = cmd
|
let mipmapper = cmd
|
||||||
.blitCommandEncoder()
|
.blitCommandEncoder()
|
||||||
.ok_or(FilterChainError::FailedToCreateCommandBuffer)?;
|
.ok_or(FilterChainError::FailedToCreateCommandBuffer)?;
|
||||||
mipmapper.generateMipmapsForTexture(&self.texture);
|
if self.texture.mipmapLevelCount() > 1 {
|
||||||
|
mipmapper.generateMipmapsForTexture(&self.texture);
|
||||||
|
}
|
||||||
mipmapper.endEncoding();
|
mipmapper.endEncoding();
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue