Jump to content
  • Advertisement
Sign in to follow this  
jkristia

VS2012 debugging DirectX

This topic is 2127 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I see people refer to PIX if you need to debug your shader code, but it seems like it is no longer available, and instead you have to use the debugger integrated in VS2012.

 

So - I tried to run the graphics debugger from VS2012, but all I see is an empty view with the frame count and elapsed time.

 

[attachment=17935:emptyview.png]

 

If I take some snapshots, then I do see the correct events, and I do the see mesh in the pipeline preview.

But, when I attempt to debug the shader code I only see assembly code, not the C code. I have the debug mode set to mixed mode, but only difference is that I now get a warning that no symbols could be found at startup.

 

Any idea if I'm missing some setting ?

 

Edit: Is there any other tool to use if I want to debug the shader code?

Edited by jkristia

Share this post


Link to post
Share on other sites
Advertisement

Do you compile your shaders by means of VS2012? If you load them from text files at runtime I think debug won't work.

Edited by GuardianX

Share this post


Link to post
Share on other sites

I'm not a fan of the 2012 graphic debugger.

 

If you're not using Windows 8 then (I think) you should still be able to use PIX; correct me if I'm wrong. I'm still running windows 7 (only because I want to keep using PIX).

 

If you are running Windows 8 then there are a couple of viable alternatives to the VS2012 graphic debugger:

Share this post


Link to post
Share on other sites

You need to tell the HLSL compiler to include symbols in your shader code otherwise you will not be able to debug in HLSL as the runtime doesn't know how to translate the bytecode to HLSL.

http://msdn.microsoft.com/en-us/library/windows/desktop/gg615083%28v=vs.85%29.aspx

D3DCOMPILE_DEBUG

Directs the compiler to insert debug file/line/type/symbol information into the output code.

(1 << 0)   

 

Also Pix only doesn't work when using the DX11.1 runtime or higher at the moment that is win8 and up, bear in mind that the graphics debugger has a few errors that PIX didnt have. Like telling you it killed a pixel because it failed the depth test whilst in reality it failed the stencil test, look at the device and it's state in this case to figure this out.

 

GPUPerfStudio 2 is the vendor specific tool for AMD/ATI cards. I believe NSight still has a few support issues but I am not completely sure about this. Also NVidia requires you to run a special driver.

Edited by NightCreature83

Share this post


Link to post
Share on other sites

 

I'm not a fan of the 2012 graphic debugger.

 

If you're not using Windows 8 then (I think) you should still be able to use PIX; correct me if I'm wrong. I'm still running windows 7 (only because I want to keep using PIX).

 

If you are running Windows 8 then there are a couple of viable alternatives to the VS2012 graphic debugger:

 

This, plus:

 

If he doesn't have a NVIDIA GPU (and better then that crap of Intel): AMD GPU PerfStudio 2 http://developer.amd.com/tools-and-sdks/graphics-development/gpu-perfstudio-2/

Edited by Alessio1989

Share this post


Link to post
Share on other sites

 


AMD GPU PerfStudio 2

Oh cool, didn't realise AMD had their own flavor. Thanks for the link.

 

With the NVIdia, Intel and AMD options they only work if you have a video card of that manufacturer!

Share this post


Link to post
Share on other sites

Thank you all for your information. I am running Win7, and I just realized that PIX is part of the SDK. I just read somewhere when I downloaded the SDK that PIX was replaced with the graphical debugger in VS2012 and didn't even think to check if it was included. I will continue playing with this tonight :)

 

Thanks

Share this post


Link to post
Share on other sites

 

 


AMD GPU PerfStudio 2

Oh cool, didn't realise AMD had their own flavor. Thanks for the link.

 

With the NVIdia, Intel and AMD options they only work if you have a video card of that manufacturer!

 

 

most of feature of the AMD tool should work even with  NVIDIA cards and intel iGPs (of course they are not officially supported and features like the generation of gpu assembly code don't work).. It should works "well" even on linux (but personally I didn't test it).. But since I don't have here an nvidia GPU I cannot say much about that (I remember that some publisher had to use AMD GPUPerfstudio2 for porting some games from windows to linux)

Edited by Alessio1989

Share this post


Link to post
Share on other sites

 

 

 


AMD GPU PerfStudio 2

Oh cool, didn't realise AMD had their own flavor. Thanks for the link.

 

With the NVIdia, Intel and AMD options they only work if you have a video card of that manufacturer!

 

 

most of feature of the AMD tool should work even with  NVIDIA cards and intel iGPs (of course they are not officially supported and features like the generation of gpu assembly code don't work).. It should works "well" even on linux (but personally I didn't test it).. But since I don't have here an nvidia GPU I cannot say much about that (I remember that some publisher had to use AMD GPUPerfstudio2 for porting some games from windows to linux)

 

Officially not supported means you shouldn't trust the answers you are getting from it, its the same with trying to run Vtune on an AMD CPU and CodeAnalyst on an Intel CPU, just because you can see the core x86 counters doesn't mean that the data is correct.

 

The reason PIX and the graphics debugger work is because they don't go deeper than the D3D bytecode which is under the control of MS. The rest is using standard readback calls that are also part of D3D.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!