XNA Creators Club Online
Page 1 of 1 (4 items)
Sort Posts: Previous Next

PIX Shader Debugging

Last post 9/13/2009 11:10 AM by tomtech999. 3 replies.
  • 9/6/2009 9:47 AM

    PIX Shader Debugging

    Hi there!

    I am new to this community and from looking around it seems a great place to be! I had a quick look around for a better place to post about PIX but couldn't seem to see anywhere specific for PIX issues so I will post in here.

    Basically, I have followed the tutorial here http://msdn.microsoft.com/en-us/library/bb173118(VS.85).aspx which describes how to debug a vertex or pixel shader (written in HLSL). I have followed the setup steps mentioned and included the following definitions. 

    #define D3D10_SHADER_DEBUG  
    #define D3D10_SHADER_SKIP_OPTIMIZATION 

    When I do a single frame capture in PIX and debug an individual pixel, I can indeed step through the HLSL assembly, but it seems the debug/symbol information has been excluded as I can ONLY step through in the assembly and not through the HLSL source code I wrote myself, as shown here http://i.msdn.microsoft.com/Bb173118.dxsdk_pix_ps_tutorial_Source_Debug(en-us,VS.85).png.

    Is there an important step I am missing here which is preventing me from viewing the HLSL source code within PIX? For now I can step through the assembly and map the registers to my variables but as you can imagine, this is not the ideal.

    Thanks in advance to anyone who can shed any light on this.

    Tom
    Tom
  • 9/8/2009 4:26 AM In reply to

    Re: PIX Shader Debugging

    Answer
    Reply Quote
    Defining those constants likely isn't doing what you want it to do. What you need to do is remove those definitions, and add them to the flags field of the compile function you're using (d3dcompile?). If you're doing offline compilation, then those correspond to the /Od /Zi flags for fxc. This should result in code that lets you step through the HLSL.
  • 9/8/2009 6:13 PM In reply to

    Re: PIX Shader Debugging

    Excellent, that makes sense! I will give it a shot as soon as I get home from work!

    Thanks,

    Tom
    Tom
  • 9/13/2009 11:10 AM In reply to

    Re: PIX Shader Debugging

    Sorry for the delayed reply on this one. I was compiling the effect at runtime so adding those flags to my D3DX10CreateEffectFromFile call did the trick. Now to find the problem in the shader!!

    Thanks again

    Tom 
    Tom
Page 1 of 1 (4 items) Previous Next