Closed st0rmbtw closed 3 months ago
Good catch! There needs to be a second branch at MTCommandExecutor.mm:331 for this condition. The rationale behind these branches is to support older versions of Metal. baseInstance
is supported in iOS 9.0 while the other versions are supported since iOS 8.0.
It took me several hours to find out why my sprites are not rendered correctly and why debugger says that
baseInstance
is always zero.After some investigation, I noticed that
baseInstance
is taken into account only wheninstanceCount
> 1. And then I found in the source code this line that checksinstanceCount
to be > 1: https://github.com/LukasBanana/LLGL/blob/47feff890ddf3679c5c1defe457fe3688274a602/sources/Renderer/Metal/Command/MTCommandExecutor.mm#L307Why?
I just completely removed that check and now everything is rendered perfectly fine.