D3D12 Driver issue: disabling color writes through RenderTargetWriteMask crashes.

Hello there,

Ran into a peculiar issue where I need a blend mode that only writes to stencil/depth, and in order to do so I’m setting RenderTargetWriteMask to 0 in the D3D12 pipeline blend state. Unfortunately this seems to destabilize the driver, “spazzing” out for a second or so, before completely crashing the driver. This does not happen on the WARP reference device (have not tested on other hardware yet).

I’ve also tried setting NumRenderTargets to 0, and setting RTVFormats[0] to UNKNOWN, but this has the same effect as setting RenderTargetWriteMask to 0 (even though it seems to incur a slight performance penalty).

My system specs are: Intel Core i7-4790K with a NVIDIA Geforce GTX 770, running driver 364.72 on Windows 10 64-bit.

I have found a workaround by setting RenderTargetWriteMask to 8 (only write to alpha), but it’s not the best solution, and costs ~0.2 ms that isn’t necessary.

Where I think the problem lies is that my shader is still outputting colors, which need to be discarded, and going wrong somehow… Anyway, I’ve assembled a testcase to reproduce this issue. I would be extremely grateful if you could take a quick look at this.

Download URL:
http://interstellarrift.com/nvidia-driver-testcase.rar

Instructions:

  • Visual Studio 2015 solution file can be found in Build/windows-64/CFC.sln
  • Set startup project to “CFC.Project.ExNanoVGDemo”
  • Run in either Debug or Release mode… Issue should be immediately visible.
  • Relevant defines can be found in app.cpp:1 (#define ENABLE_D3D12_WARP) & renderer_nanovg.cpp:3 (#define ENABLE_NVIDIA_WORKAROUND)

Thanks!