Original Post
I don't know what to quite make of this. Yesterday, Pix had no problem debugging vertex shaders that my current project is using. Today, whenever I click on a vertex to debug, Pix stalls for a few seconds then displays a error dialog with the completely unhelpful message: "An error occurred while preparing to debug the shader." And this is a very basic, minimal vertex shader. Oddly enough, it does still let me debug the pixel shader. I've triple checked all the important items, using debug runtimes, shader validation enabled, shader is compiled with D3DXSHADER_DEBUG flag. The vertex shader itself appears to be working fine, I only accidently discovered this problem when I clicked to debug the vertex shader instead of pixel shader. I setup a different experiment thinking maybe the pix experiment file was corrupt, but got the same odd behavior. Then I directed the experiment to target another program I wrote, and it had no problem debugging the vertex shaders it used. So I'm guessing my vertex shader, however minimal it is, is doing something Pix can't handle. Can you spot it? I compiled it with the VS3.0 profile.
float4x4 World : WORLD;
float4x4 View : VIEW;
float4x4 Projection : PROJECTION;
struct VS_OUTPUT
{
float4 Pos : POSITION;
float4 Diff : COLOR0;
float3 TexCoord0 : TEXCOORD0;
float3 TexCoord1 : TEXCOORD1;
};
VS_OUTPUT VS_LightPass(
float3 InPos : POSITION,
float3 Normal : NORMAL,
float4 Diff : COLOR0,
float2 TexCoord0 : TEXCOORD0 ,
float2 TexCoord1 : TEXCOORD1
)
{
VS_OUTPUT Out = (VS_OUTPUT)0;
float4 PosWorld = mul(float4(InPos, 1), World);
float4 PosView = mul(PosWorld, View);
Out.Pos = mul(PosView, Projection);
Out.Diff = Diff;
Out.TexCoord0 = PosWorld;
Out.TexCoord1 = mul(float4(Normal,0),World);
return Out;
}