Problem setting RenderTarget on a Camera using SetTargetBuffers vs targetTexture

If cam is the Camera component of a camera GameObject and rt is a RenderTexture created with:

RenderTexture rt = RenderTexture.GetTemporary(width, height, 24, RenderTextureFormat.ARGB32);

Then, are these three lines all exactly equivalent?

cam.targetTexture = rt;
cam.SetTargetBuffers(rt.colorBuffer, rt.depthBuffer);
cam.SetTargetBuffers(new RenderBuffer[] { rt.colorBuffer }, rt.depthBuffer);

If not, what is the difference?

My code works fine, but when I try to to change the first of these to use SetTargetBuffers my code stops working.

I’m just refactoring code that will shortly be needing MRT (multiple render targets) and I thought I’d test that it still works with one color buffer.

Any suggestions as to why this would be?

Thanks

Jules

I face the same issue in Unity 2022.3.19f1, cam.targetTexture = rt
works, while cam.SetTargetBuffers(rt.colorBuffer, rt.depthBuffer); results in a black screen. I also use temporary RenderTextures. Calling Create() on the texture before setting the target buffers doesn’t work either