I found these phrases in xcode debug state:

Hello, I found the following phrases when I was in debug mode in xcode.



I’m creating a UI.
I created several square 2D meshes.

The texture to be applied there was a texture of size 1024 * 1024, and only the uv value was adjusted and attached to each mesh. (It is in the form of an atlas.)

More than 100 2D meshes appear in one scene.
If I use the method above, will there be any special problems such as performance degradation?

Thank you.

You should take notice of any insight, as they are designed to point out performance degradation.

In this case, you are doing ten extra renderEncoder.setFragmentTexture when they aren’t needed. This command doesn’t take a long time to execute, and you will have to refactor your code in some way to take care of it. It’s up to you whether you think that you need that extra (minimal) performance. Some apps need it and some don’t.

For example, in several chapters, I have made redundant bindings of the transparent mesh. Mostly it’s already bound for rendering the non-transparent parts. But it would make the code more complicated for explaining, so I chose to leave it like that. I would normally look at the insights provided and see whether I can get away with them.

Have you thought about setting up your textures at the beginning of the app and putting them in a heap, so you only have to do one binding at the beginning of the render pass?

1 Like

Thanks for pointing that out.
I’ll think about it more.

I always appreciate you answering my questions :smiley:

1 Like