• Advertisement
Sign in to follow this  

PIX shader code stepping issue

This topic is 2933 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

So I'm writing a game in XNA and I'm trying to debug one of my vert shaders using PIX. I take a single frame capture and go into the hlsl code for the verts I'm debugging, but when I try to step through the code, pix keeps jumping to random lines of my shader instead of going through them in execution order. I set directx to debug mode and enabled shader debugging. Does anyone have an idea why this would happen? Diginerd

Share this post


Link to post
Share on other sites
Advertisement
By default the DX shader compiler will heavily optimize your code, and this almost always involves re-arranging the order of instructions. To avoid this you can compiled shaders without optimizations. This makes them run slower, but lets you easily step through them.

If you're using the Content Pipeline to compile your effects, the effect processor will attempt to compile your code without optimizations if you compile your Debug build. However it will re-enable optimizations if disabling them causes your shader to go over the instruction limit (which can happen pretty easily in vs_2_0 or ps_2_0). If you're building Debug and your shaders are still getting optimized, you can try bumping them up to vs_3_0 and ps_3_0 since those have much much higher instruction limits.

Share this post


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

  • Advertisement