Custom render pass texture maps with LayerRenderer pipeline

Hi,

Re: WWDC2023-10089, I have a question about creating texture maps during pipeline setup. In traditional MTKView setups, it's easy to query for the view size to know what the dimensions of the texture map should be. But, after digging through all the documentation on the classes, I don't see any way to find this information.

There's the drawable, and querying it, and then maybe getting the info from the default render texture maps – but, I'm trying to set these textures up when I set up the pipelines, and so I don't think that's going to work. (Because the render loop won't have started yet.)

Secondly, I'm wondering w/ foviation if there's even more that needs to be considered regarding creating these types of auxiliary render passes.

Basically, for example's sake, imagine you have a working visionOS Metal pipeline. But, now you want to add a special render pass to do some effects. Typically you'd create a texture map to store that pass, calculate the work in a fragment shader, etc, and then do another pipeline state to mix that with the default rendering pipeline.

Any help appreciated, thanks!

Any Metal engineers at Apple want to take this question?

Right now I'm hard-coding my compute shader texture map sizes, but would prefer not to use such a fragile approach.

Second and most important is – how can we handle foviation when it comes to compute shaders? Like, typically you use threadID etc to look up the 'pixel' in the corresponding map. Are there utility functions / data we can use with Compute shaders to figure out which pixel a threadID should map to in a foviated situation?

Custom render pass texture maps with LayerRenderer pipeline
 
 
Q