Using #pragma enable_d3d11_debug_symbols

I have Unity pro 4.3 running in dx11 mode. I have a shader with

#pragma target 4.0
#pragma enable_d3d11_debug_symbols

I have Visual Studio 2013 Ultimate.

How do debug the shader as per the documentation?

Hi,

Graphics Debugger will work incorrectly with Unity Editor, because Unity Editor uses multiple windows, so when you capture a frame, Visual Studio will capture a random window. But it’s still might work, to increase your chances, check Maximize On Play checkbox.

The steps below will work for Unity Editor and Windows Standalone if they’re running on DX11.

  • So I presume you have a shader, where you wrote #pragma enable_d3d11_debug_symbols, and assigned that shader to some model.
  • Now you need for Graphics Debugger to launch the application, to do that you could do this:
  • From Visual Studio->New->Project->Visual C+±>Empty Project
  • Go to Project->Properties->Debugging->Command->Path to your application
  • You could also write -force-d3d11 in Command Arguments
  • And that’s it, now go Debug->Graphics->Start Diagnostics, Capture the frame, and select the pixel of an object which had that shader