Up until now, my project has had a single commandbuffer that it generated once and then used unchanged. However, now I need to change the SetProjectionMatrix calls to different values every frame, which means recreating the commandbuffer every frame.
As a way to make this more performant, I thought I would split my single commandbuffer into several short ones, some of which contain only a single SetProjectionMatrix call; then I can clear and regenerate only those, and leave the rest intact. However, when I tried this, my console got filled with messages like this:
CommandBuffer: temporary render texture combinedBigRT not found while executing layereffectBuffer2 (Blit destination)
Can resources like temporary render textures not be used across different commandbuffers on the same camera in the same frame? I assumed that splitting a single commandbuffer into two would make no difference in terms of what gets executed, but I guess that Unity is actually silently inserting things like ReleaseTemporaryRT calls after each individual commandbuffer?
For now I’m intending to create some non-temporary render textures to use instead of the temporary ones, but my understanding is that this would be less performant (though I’m only about half certain still on the exact reasons why, to be honest)?
Alternately I might try regenerating the entire commandbuffer every frame, although this would be more complicated to write efficiently for a few reasons…