Sign in to follow this  
Razvan1024

DirectX 10 Problem

Recommended Posts

Razvan1024    114
I have a little problem with a DirectX 10 application. I'm switching from DirectX 9.0 to DirectX 10 and I'm trying to learn by following the tutorials in the SDK Documentation. I got to the third tutorial and I can't get my effect file to compile. Can someone tell me what is the difference between my effect and the SDK effect? Here is my code: float4 VS(float4 Pos:POSITION):SV_POSITION { return Pos; } float4 PS(float4 Pos:SV_POSITION):SV_Target { return float4(1.0f,1.0f,0.0f,1.0f); } techinique10 Render { pass P0 { SetVertexShader(CompileShader(vs_4_0,VS())); SetGeometryShader(NULL); SetPixelShader(CompileShader(vs_4_0,PS())); } } and this is the tutorial effect: // // Vertex Shader // float4 VS( float4 Pos : POSITION ) : SV_POSITION { return Pos; } // // Pixel Shader // float4 PS( float4 Pos : SV_POSITION ) : SV_Target { return float4( 1.0f, 1.0f, 0.0f, 1.0f ); // Yellow, with Alpha = 1 } technique10 Render { pass P0 { SetVertexShader( CompileShader( vs_4_0, VS() ) ); SetGeometryShader( NULL ); SetPixelShader( CompileShader( ps_4_0, PS() ) ); } }

Share this post


Link to post
Share on other sites
Razvan1024    114
The error string is :
simple.fx(9,14): error X3000: invalid target or usage string

I had a typo on the technique definition line.

Thanks for the help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this