Metal grab texture behind node

Metal grab texture behind node
0

Hi,

i have this functionality that uses glCopyTexImage2d to get the background texture in between renders (based on z order), to apply some blur shader to the final output image within a rectangle.
This is working well on opengl, but when porting over to metal, i am not able to get it to work.
I have found out the function for metal is to use MTLBlitCommandEncoder to copy from the drawable texture (where all the render queues will render) to the output texture.

The thing is, I realise that the rendering pipeline implementation for metal differs from opengl in that for every opengl draw call, for metal it only encodes the command to the command buffer. And only until the endFrame function that the actual rendering will perform. This pose as a hurdle to my implementation of grabbing the ‘already rendered’ texture of what’s behind my node, because it has not yet been rendered…

Would like to know what is the best practise to perform such post processing in-between renders?