Custom SRP, can't create a render target and render to it

Good evening, I am trying to implement a gbuffer pass for our custom SRP.
The issues seems to be I can’t create a render target and bind it to perform the needed gbuffer pass.
No matter what I do I keep getting the error:
“Dimension of color surface does not match dimensions of depth surface”

I tried with depth, no depth, depth only, cmd.GetTemporaryRT, RenderTexture.GetTemporary, the code from cat like coding etc. Any sort of combination etc. Same result.

I am using latest unity. Anyone has an Idea in what is going on? In the past with some old code I was able to do an offscreen render.

M.

I might be able to help if you share some code.

Apologies for the original post without code, takes a while to get some code approved for posting, after working with it, it seem like the issue was not coming from me creating a new render buffer, binding it and using it, but from the fact that the last part of the render, rendering on the usual camera render target, I had to explicitly set back the render target as:

cmd.SetRenderTarget(BuiltinRenderTextureType.CameraTarget)

Is there any way to improve upon such error? It was quite misleading, also because the error would point to where I was to trying to set the first render target, not later down in the pipeline.

That’s a little bit tricky. The error message is reporting what actually is, you had color and depth attachments with different sizes somewhere. The proper way to debug it is to get a capture with a GPU debugger tool such as RenderDoc.

Unluckily we cannot use render doc due to some unsupported graphic features we are using. I will try to investigate further, we are able to build and use PIX that might be of help, although having the c# throwing an error will actually prevent the draw call to be submitted so not sure what I will see. I will keep you posted. Apologies for late reply.