I have a rendering setup where many cameras each render to a different slice of a texture array simultaneously, so I only have to switch to the render target once instead of once per camera. This works by binding to all slices of the texture array:
This works fine on Windows and gives great performance improvements by not having to switch context in between draw calls. However, it appears that it does not work on iOS - all cameras appear to be writing to the first slice. Does anyone have any experience with this, am I missing something that’s specific to Metal?
Thanks for the responses! I’ve checked on a gen 3 iPad Pro which has the A12 chipset, but the problem persists. I have filed a bug report with a sample scene (1198097).
Can anyone confirm this actually does work on Metal? I’m having the same issue in Unity 2022.1.23f1, where on an iPad my shader only draws to the first array element in a 2D RenderTexture array, despite using the SV_RenderTargetArrayIndex semantic, and despite setting depthSlice to -1 in Graphics.SetRenderTarget(). I can see in the compiled shader code that Unity has used “uint mtl_Layer [[ render_target_array_index ]]” and appears to be assigning to that variable correctly, so I assume that it is supposed to be supported in Unity, but I am having no luck finding any actual examples or proper documentation.