What does this warning mean, (It acts more like an error in the background)

I have these two DIFFERENT post processing materials that when i disable one OR the other in the PostFxVolume the “warning” goes away. I’ve googled the error but … I don’t know

This warning occurs when the same resource is bound as both a render target (RTV) and a shader resource (SRV) simultaneously in the Direct3D 11 pipeline, which is not allowed. The GPU driver detects this conflict and issues a warning to alert the developer. Specifically, the resource intended for output (render target) is still bound as an input (e.g., in the pixel shader) when attempting to rebind it for rendering.

To resolve this issue, the resource must be explicitly unbound from the pixel shader stage before being set as a render target. This is typically done by setting the shader resource view (SRV) to null using PSSetShaderResources with a valid count, even if the pointer is null. For example, calling PSSetShaderResources(0, 1, &nullSRV) where nullSRV is a pointer to nullptr will clear the SRV slot.

Additionally, if the resource is bound to multiple shader resource slots, all relevant slots should be cleared. It is also recommended to unbind the render target before setting a new one, even if the pipeline will eventually resolve the conflict automatically. This can be done by calling OMSetRenderTargets with a null render target view array.

The warning may also appear if the resource is bound as an SRV in a previous frame and not properly unbound before being used as an RTV in the current frame, even if the state appears valid at draw time. Therefore, proper state management between frames is essential to avoid these warnings and ensure predictable rendering behavior

The error:
[ 00:00:05.280 ]: [Warning] ID3D11DeviceContext::OMSetRenderTargets: Resource being set to OM RenderTarget slot 0 is still bound on input!
[ 00:00:05.280 ]: [Warning] ID3D11DeviceContext::OMSetRenderTargets[AndUnorderedAccessViews]: Forcing VS shader resource slot 1 to NULL.
[ 00:00:05.280 ]: [Warning] ID3D11DeviceContext::OMSetRenderTargets[AndUnorderedAccessViews]: Forcing PS shader resource slot 1 to NULL.

Here are the materials:



For the outline I there are two cameras, the second camera has the script from Here and made so that it matched the main camera in setup, and removed most of the ViewFlags for better performance.

This means that some resources were bound for both read and write. It’s kind of biug in our DX11 backend tbh but you could handle it by calling ResetSR() between draw passes (eg. when changing render target or depth target from output to be used as shader parameter).

1 Like

Ah, okay, that makes sense, even if i don’t know which resource is double bound.

What doesn’t make sense now (to me at least) is in trying to find where to place ResetSR() I changed the order of the post materials in the PostFXVolume and… now it’s just gone.

So… maybe it had to be ordered in my case? since one used the camera depth while the other used a render texture? so if it was trying to get… the GPUTex/depth before it was available? I don’t even know, i’m at a loss lol. If it works it works, if not i’ll put the ResetSR() In there