Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Graphics Debugger omits working pixel shader

I'm programming in C#, Visual Studio 2013 Update 5 RC, and using Direct3D 11 (via SlimDX) to render an animated scene. I was experimenting with unordered access textures in the pixel shader and it works nicely. I.e., my pixel shader has an RWTexture2D<float> bound to register(u1) which I set along with the render target view. When I run my application, the rendering works fine, and I get no warnings or errors from the D3D debug layer.

Although this is all working, I cannot seem to analyze single frames with the Visual Studio Graphics Debugger. The (correct) output image is currently some shade of grey, as can be seen in the following image:

Screenshot from the rendered output

Although the FPS measurements work fine, when I capture a frame, it is always shown as completely white (or whatever color I used to clear the render target) in the VSG log:

Captured frames

When I open the Visual Studio Graphics Analyzer for one of the frames, I see a problem in the graphics pipeline. The input assembler and vertex shader are working as intended, but the pixel shader is missing and there is "no mesh available" in the output merger stage:

enter image description here

The object table clearly states that the pixel shader (obj:7) is set. Do you have any ideas or suggestions on why it does not appear in the graphics pipeline or why the captured frames are empty, although they work in my program? I can exclude that it plays a role from where the shader code is loaded, i.e., whether I use Compile or CompileFromFile. One thing I still suspect but could not so far verify is that the unordered access resource in the pixel shader confuses the Visual Studio Graphics Debugger. Any hints? Thank you in advance.

Edit: This is not related to the MSDN walkthrough on misconfigured pipelines, as the Graphics Analyzer shows the pixel shader is set in the device context. Also, constant buffers are correctly set in the pixel shader.

like image 652
hschmauder Avatar asked May 08 '15 14:05

hschmauder


1 Answers

You need to force it use warp debugging. Please follow below steps. 1. Open DirectX Properties by Debug -> Graphics-> DirectX Control Panel. enter image description here

  1. Click Edit List, search vsgraphicsdesktopengine.exe and add it to the list.
  2. Choose the Force On for Debug Layer and check the Force WARP option in the DirectX Properties, then apply it. enter image description here
  3. Run the graphics debugging and capture frames and view the pipeline again.

Hope this can help you!

Sincerely, Visual Studio Graphics Team

like image 197
Cloud Wu Avatar answered Oct 14 '22 12:10

Cloud Wu