Don't allow calling Texture:generateMipmaps on depth/stencil textures

This commit is contained in:
Alex Szpakowski
2020-12-21 13:36:29 -04:00
parent 975cadf66b
commit a1861a8ff4
2 changed files with 7 additions and 4 deletions
+1 -4
View File
@@ -717,15 +717,12 @@ void Graphics::endPass()
}
}
// generateMipmaps can't be used for depth/stencil textures.
for (const auto &rt : rts.colors)
{
if (rt.texture->getMipmapsMode() == Texture::MIPMAPS_AUTO && rt.mipmap == 0)
rt.texture->generateMipmaps();
}
int dsmipmap = rts.depthStencil.mipmap;
if (depthstencil != nullptr && depthstencil->getMipmapsMode() == Texture::MIPMAPS_AUTO && dsmipmap == 0)
depthstencil->generateMipmaps();
}
void Graphics::clear(OptionalColorf c, OptionalInt stencil, OptionalDouble depth)