Why can't I bind an asset once in metal?

70 Views Asked by At

It seems I have to call RenderCommandEncoder.setFragmentTexture on every single render pass, even if I will always bind the same texture to index 0. Why does every render pass need to perform the bindings from scratch?

1

There are 1 best solutions below

0
Ken Thomases On

Because that's the way Apple designed it. The texture tables (one for the vertex shader and one for the fragment shader) are part of the render command encoder. You create a new render command encoder for each render pass. So, you have to reassign the texture table entries as desired. Is that really such a big deal?