rive-runtime icon indicating copy to clipboard operation
rive-runtime copied to clipboard

Metal assert when using texture with no mip maps

Open JCash opened this issue 8 months ago • 0 comments

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];

JCash avatar Jun 11 '25 08:06 JCash