Skip to main content
GameDev.net gamedev.net
🔒 Locked

Pix shader debugger error

Started by Mastaba Mar 28, 2007 at 1:59 PM 2 replies 3k views
Original Post
Mastaba
Mastaba
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;
}



Mastaba
Mastaba
Just tried it with the REF device, I get the same behavior.
Asesh
Asesh
Try debugging that code in NVIDIA FX Composer or ATI Render Monkey. They have a much better DE for developing and debugging shaders as opposed to using PIX for doing so.
Mastaba
Mastaba
Ok, just tried a completely different vertex shader with my application, and I get the same behavior. So it isn't the specific vertex shader that is causing the issuse, it is my application. But, I've run out of ideas on what to check.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.