rive-runtime
rive-runtime copied to clipboard
Metal assert when using texture with no mip maps
This is regarding the metal backend, and when debugging the app, at which point we get an assert in XCode.
We create textures using RenderContextMetalImpl::makeImageTexture() with a mipLevelCount = 1.
This however asserts due to the fact that the TextureMetalImpl::ensureMipmaps() will trigger a metal assert, due to the mip level count is 1:
-[MTLDebugBlitCommandEncoder generateMipmapsForTexture:]:1114: failed assertion `Generate Mipmaps For Texture Validation
[tex mipmapLevelCount](1) must be > 1.
The suggested fix is to check the mip level count before calling [mipEncoder generateMipmapsForTexture:m_texture];