Forward rendering with MSAA on a Debug build crashes editor in VR Preview

Build Type: Source

Build version: 4.14.0, also checked with latest from Github as of today.

Platform info: Oculus Rift with 1.10 runtime, Windows 10. Let me know if you need further info.

Description:
A debug-only check for SampleCounts on render target and depth buffer doesn’t match and causes a debugger break.

Repro steps:

  1. Compile a Debug Engine configuration
  2. Create a new project and open it up in editor
  3. Enable Forward rendering and MSAA
  4. Close editor
  5. Start editor again with a debugger attached
  6. Start any level in VR preview
  7. Editor breaks on a sample count check in D3D11Commands.cpp - function GetRenderTargetViewDesc.

The check in question:

// enforce color target is <= depth and MSAA settings match
if(RTTDesc.Width > DTTDesc.Width || RTTDesc.Height > DTTDesc.Height || 
	RTTDesc.SampleDesc.Count != DTTDesc.SampleDesc.Count || 
	RTTDesc.SampleDesc.Quality != DTTDesc.SampleDesc.Quality)
{
	UE_LOG(LogD3D11RHI, Fatal,TEXT("RTV(%i,%i c=%i,q=%i) and DSV(%i,%i c=%i,q=%i) have mismatching dimensions and/or MSAA levels!"),
		RTTDesc.Width,RTTDesc.Height,RTTDesc.SampleDesc.Count,RTTDesc.SampleDesc.Quality,
		DTTDesc.Width,DTTDesc.Height,DTTDesc.SampleDesc.Count,DTTDesc.SampleDesc.Quality);
}

Hello ,

I ran a few tests and was unable to get the crash that you are reporting. Could you provide a clean project that reproduces this issue so that I could take a closer look?

Hey,

I was able to repro this both on 4.14.0 and the latest code straight from Github (at the time I filed the report).

Basically just put these lines in the DefaultEngine.ini file of a new empty C++ project:

[/Script/Engine.RendererSettings]
r.ForwardShading=True
r.DefaultFeature.AntiAliasing=3
r.MSAACount=4

Then compile the engine in “Debug Engine” config, start the editor with debugger attached and click the VR Preview button.

I just tried this again now and it breaks on that line.

I have run several tests and I have been unable to reproduce this issue on our end. Could you provide the complete callstack including your machine ID?

Hello ,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Thanks,

Sorry, been a bit swamped trying to finish things off before the holidays.

Yes the issue is still happening.

Full DxDiag of my machine: Dropbox - File Deleted - Simplify your life

Here is a callstack:

UE4Editor-D3D11RHI-Win64-Debug.dll!FD3D11DynamicRHI::RHISetRenderTargets(unsigned int NewNumSimultaneousRenderTargets, const FRHIRenderTargetView * NewRenderTargetsRHI, const FRHIDepthRenderTargetView * NewDepthStencilTargetRHI, unsigned int NewNumUAVs, FRHIUnorderedAccessView * const * UAVs) Line 975 C++
UE4Editor-RHI-Win64-Debug.dll!FRHICommandList::SetRenderTargets(unsigned int NewNumSimultaneousRenderTargets, const FRHIRenderTargetView * NewRenderTargetsRHI, const FRHIDepthRenderTargetView * NewDepthStencilTargetRHI, unsigned int NewNumUAVs, FRHIUnorderedAccessView * const * UAVs) Line 1931 C++
UE4Editor-OculusRift-Win64-Debug.dll!SetRenderTarget(FRHICommandList & RHICmdList, FRHITexture * NewRenderTarget, FRHITexture * NewDepthStencilTarget, bool bWritableBarrier) Line 281 C++
UE4Editor-OculusRift-Win64-Debug.dll!FHMDViewExtension::PostRenderViewFamily_RenderThread(FRHICommandListImmediate & RHICmdList, FSceneViewFamily & InViewFamily) Line 187 C++
UE4Editor-Renderer-Win64-Debug.dll!FSceneRenderer::RenderFinish(FRHICommandListImmediate & RHICmdList) Line 1365 C++
UE4Editor-Renderer-Win64-Debug.dll!FDeferredShadingSceneRenderer::RenderFinish(FRHICommandListImmediate & RHICmdList) Line 373 C++
UE4Editor-Renderer-Win64-Debug.dll!FDeferredShadingSceneRenderer::Render(FRHICommandListImmediate & RHICmdList) Line 1279 C++
UE4Editor-Renderer-Win64-Debug.dll!RenderViewFamily_RenderThread(FRHICommandListImmediate & RHICmdList, FSceneRenderer * SceneRenderer) Line 1649 C++
UE4Editor-Renderer-Win64-Debug.dll!TGraphTask<FRendererModule::BeginRenderingViewFamily'::21’::EURCMacro_FDrawSceneCommand>::ExecuteTask(TArray<FBaseGraphTask *,FDefaultAllocator> & NewTasks, ENamedThreads::Type CurrentThread) Line 868 C++

Callstack (continued):

UE4Editor-Core-Win64-Debug.dll!FNamedTaskThread::ProcessTasksNamedThread(int QueueIndex, bool bAllowStall) Line 932	C++
UE4Editor-Core-Win64-Debug.dll!FNamedTaskThread::ProcessTasksUntilQuit(int QueueIndex) Line 679	C++
UE4Editor-Core-Win64-Debug.dll!FTaskGraphImplementation::ProcessThreadUntilRequestReturn(ENamedThreads::Type CurrentThread) Line 1726	C++
UE4Editor-RenderCore-Win64-Debug.dll!RenderingThreadMain(FEvent * TaskGraphBoundSyncEvent) Line 320	C++
UE4Editor-RenderCore-Win64-Debug.dll!FRenderingThread::Run() Line 473	C++
UE4Editor-Core-Win64-Debug.dll!FRunnableThreadWin::Run() Line 72	C++
UE4Editor-Core-Win64-Debug.dll!FRunnableThreadWin::GuardedRun() Line 23	C++
UE4Editor-Core-Win64-Debug.dll!FRunnableThreadWin::_ThreadProc(void * pThis) Line 67	C++

And the latest in the log:

[2016.12.19-20.50.00:078][154]LogLoad: Game class is ‘GameModeBase’
[2016.12.19-20.50.00:084][154]LogWorld: Bringing World /Temp/UEDPIE_0_Untitled_1.Untitled_1 up for play (max tick rate 0) at 2016.12.19-15.50.00
[2016.12.19-20.50.00:086][154]LogWorld: Bringing up level for play took: 0.003561
[2016.12.19-20.50.00:149][154]LogContentBrowser: Native class hierarchy updated for ‘MovieSceneCapture’ in 0.0033 seconds. Added 11 classes and 0 folders.
[2016.12.19-20.50.00:177][154]PIE: Info Play in editor start time for /Temp/UEDPIE_0_Untitled_1 1.42
[2016.12.19-20.50.00:187][154]LogHMD: Reallocation of eye buffer was requested
[2016.12.19-20.50.00:193][154]LogHMD: Allocated a new swap texture set (size 2696 x 1588, mipcount = 1), 0x000001F6326BA540
[2016.12.19-20.50.00:240][154]LogHMD: Allocated a new mirror texture (size 1280 x 720)
[2016.12.19-20.50.00:241][154]LogRenderer: Reallocating scene render targets to support 2696x1588 NumSamples 4 (Frame:111).
Fatal error: [File:D:_Repos\Temp\Epic_4.14.0\Engine\Source\Runtime\Windows\D3D11RHI\Private\D3D11Commands.cpp] [Line: 977]
RTV(2696,1588 c=1,q=0) and DSV(2696,1588 c=4,q=0) have mismatching dimensions and/or MSAA levels!
The thread 0x549c has exited with code 0 (0x0).
The thread 0x36c8 has exited with code 0 (0x0).
UE4Editor-Win64-Debug.exe has triggered a breakpoint.

After doing a bit more digging I was able to find that this is a known issue. I have provided a link to the public tracker. Please feel free to use the link provided for future updates. Thank you for your time and information.

Link: Unreal Engine Issues and Bug Tracker (UE-39304)

Make it a great day