Please see: URP 14 Blitter Overview
Edit #2: A lot has changed since I posted this. See this post and others for more recent details about changes for Blitting, the SRP Blitter Class, and other miscellaneous details about RTHandles.
Edit #1: Jump to @ManueleB 's message for a summary of URP blitting as of Unity 2021/URP 12.
I don’t quite understand why there is so little communication or documentation for blitting in SRP?
Recently there was a new section added to the documentation – “How To” – which includes a blit tutorial with example code: How to perform a full screen blit in Single Pass Instanced rendering in XR
Funnily enough, the example code doesn’t use any of Unity’s many different included blit functions.
I recently talked about this on another __ forum post __.
I know there are currently issues with cmd.Blit() and XR but that is no reason for there to be so few examples of using blit outside of internal SRP code and the latest Photomode package.
In the Photomode package the ScriptableRenderPass BlitRenderPass uses Blit(CommandBuffer, source, destination, Material, pass index);.
However, the destination texture (“_AfterPostProcessTexture”) is an existing texture from the SRP pipeline; not a user-created texture. Anecdotally, it feels like I see posts about custom shaders/materials consistently failing with blit, either resulting in gray or black textures being blit to the screen.
There are very few examples where the blit destination is a user-created texture.
One example of this can be found in __ this HDRP post __. In that specific case, the solution was to use the XR macro SAMPLE_TEXTURE2D_X since HDRP uses XR macros for render targets to support stereo rendering.*
*Those macros are defined differently (in Core.hlsl) based on the texture dimension set when the RTHandle system is initialized.