rive-app / rive-app/rive-runtime
Metal assert when using texture with no mip maps
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.2k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
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];
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with RenderContextMetalImpl::makeImageTexture() and TextureMetalImpl::ensureMipmaps() in the Metal backend. Reproduce the path with mipLevelCount = 1 and verify that it no longer triggers the Metal assertion, while textures with multiple mip levels still generate mipmaps as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100