Hi, we were running a game with -d3ddebug and at some point during open an internal UI map got this error from d3d debug layer:
D3D12 ERROR: ID3D12CommandList::OMSetDepthBounds: Min=0.00 is greater than Max=-7.39. [ STATE_SETTING ERROR #1043: SETDEPTHBOUNDS_INVALIDARGS] LogD3D12RHI: Error: ID3D12CommandList::OMSetDepthBounds: Min=0.00 is greater than Max=-7.39. (ID 1043)
Running then same scenario with -rdgimmediate -forcerhibypass -onethread gave us following callstack:
FD3D12CommandContext::SetDepthBounds(float MinDepth, float MaxDepth) Line 1996 C++ FD3D12StateCache::ApplyState(ED3D12PipelineType PipelineType) Line 548 C++ FD3D12CommandContext::RHIDrawPrimitive(unsigned int BaseVertexIndex, unsigned int NumPrimitives, unsigned int NumInstances) Line 1582 C++ FRHICommandList::DrawPrimitive(unsigned int) Line 3738 C++ DrawClearQuadMRT(FRHICommandList & RHICmdList, bool bClearColor, int NumClearColors, const FLinearColor * ClearColorArray, bool bClearDepth, float Depth, bool bClearStencil, unsigned int Stencil, FClearQuadCallbacks ClearQuadCallbacks) Line 125 C++ DrawClearQuad(FRHICommandList &) Line 77 C++ AddAmbientOcclusionPass::__l20::<lambda>(FRHICommandList & RHICmdList) Line 916 C++
It seems the issue came from the line where it calculates DepthFar = FMath::Min(1.0f, Far.Z / Far.W); producing -7.39f. Should it be clamped instead? Or there is another way to fix the issue for this specific code?