Description

We found a d3d debug validation assert in RDG_EVENT_NAME("ShaderDrawDebug"), with the full DLSS integration. It however also reproduces in  (4.25.1-release, dev-rendering and the plugin branch with DLSS off) when running with r.ScreenPercentage 50, r.TemporalAA.Upsampling 1 and r.ShaderDrawDebug 1

 

D3D12 ERROR: ID3D12CommandList::OMSetRenderTargets: The RenderTargetView at slot 0 is not compatible with the DepthStencilView. DepthStencilViews may only be used with RenderTargetViews if the effective dimensions of the Views are equal, as well as the Resource types, multisample count, and multisample quality. One exception is that DepthStencil width and/or height can be larger than RenderTarget width/height.The RenderTargetView at slot 0 has (w:1920,h:1080,as:1), while the Resource is a Texture2D with (mc:1,mq:0). The DepthStencilView has (w:960,h:540,as:1), while the Resource is a Texture2D with (mc:1,mq:0).  [ EXECUTION ERROR #728: SET_RENDER_TARGETS_INVALID]
D3D12: *BREAK* enabled for the previous message, which was: [ ERROR EXECUTION #728: SET_RENDER_TARGETS_INVALID ]The fix the engineer suggested was this, but I think that doesn't work for stock UE4 as well as the plugin branch.

 

ShaderDrawVSPSParameters* PassParameters = GraphBuilder.AllocParameters<ShaderDrawVSPSParameters>();
PassParameters->ShaderDrawPSParameters.RenderTargets[0] = FRenderTargetBinding(OutputTexture, ERenderTargetLoadAction::ELoad);
PassParameters->ShaderDrawPSParameters.RenderTargets.DepthStencil = !GDLSSState.bUseDLSS ? FDepthStencilBinding(DepthTexture, ERenderTargetLoadAction::ELoad, FExclusiveDepthStencil::DepthRead_StencilNop, ERenderTargetMsaaPlane::Resolved) : FDepthStencilBinding(); // fix code

 

What I'd want to do is to compare the sizes of thepth with stencil and only bind stencil if they are the same as the color (or not smaller). Not sure whether that will break functionality, but that should prevent the debug layer assert

PassParameters->ShaderDrawPSParameters.RenderTargets[0] = FRenderTargetBinding(OutputTexture, ERenderTargetLoadAction::ELoad);
PassParameters->ShaderDrawPSParameters.RenderTargets.DepthStencil = FDepthStencilBinding(DepthTexture, ERenderTargetLoadAction::ELoad, FExclusiveDepthStencil::DepthRead_StencilNop, ERenderTargetMsaaPlane::Resolved);

 

PS: ShaderDrawVSPSParameters needs the F prefix [Image Removed]

Steps to Reproduce

r.ScreenPercentage 50, r.TemporalAA.Upsampling 1 and r.ShaderDrawDebug 1 and -d3ddebug and -game

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-94202 in the post.

1
Login to Vote

Fixed
ComponentUE - Graphics Features
Affects Versions4.25
Target Fix4.26
Fix Commit13664042
Main Commit14261872
CreatedJun 9, 2020
ResolvedJun 11, 2020
UpdatedSep 19, 2021
View Jira Issue