HLSL compiled code

I've been using RenderDoc for debugging my shaders, and one thing that struck me as odd is that sometimes, after stepping through the debugger, I notice some vector attributes are interchanged, for example sometimes a float3 variables register has .z interchanged with .y, and I'm positive there is nothing wrong in the shader code part.

Is this some magic optimizations from the compiler? It certainly makes debugging ALOT more frustrating, never being quite sure if it truly is the viewPosition.z or actually the viewPosition.y for example... Is there any good ways around this?

• Can you show an example ? – concept3d Nov 12 '14 at 7:17