Jump to content
  • Advertisement
Sign in to follow this  
daVinci

CreateVertexShader fails

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

I have writen a simple vertex shader.
I compiled it with fxc.exe.
Output:

//
// Generated by Microsoft (R) HLSL Shader Compiler 9.26.952.2844
//
// fxc /Vd /T vs_2_0 /E main
//
//
// Parameters:
//
// float4 ambient;
// float4 diffuse;
// float glossiness;
// float3 lightDirection;
// float4 specular;
// float specularPower;
// float3 viewDirection;
// float4x4 world;
// float4x4 worldViewProjection;
//
//
// Registers:
//
// Name Reg Size
// ------------------- ----- ----
// ambient c0 1
// diffuse c1 1
// specular c2 1
// glossiness c4 1
// specularPower c5 1
// worldViewProjection c6 4
// world c10 3
// lightDirection c14 1
// viewDirection c15 1
//

vs_2_0
def c3, 1, 0, 0, 0
dcl_position v0
dcl_normal v1
mul r0, v0.y, c7
mad r0, c6, v0.x, r0
mad r0, c8, v0.z, r0
mad oPos, c9, v0.w, r0
mov r0.xyz, c14
add r0.xyz, r0, c15
nrm r1.xyz, r0
dp3 r0.x, v1, c10
dp3 r0.y, v1, c11
dp3 r0.z, v1, c12
nrm r2.xyz, r0
dp3 r0.x, r2, r1
dp3 r0.y, r2, c14
mov r1.xyz, c1
mad r0.yzw, r1.xxyz, r0.y, c0.xxyz
pow r1.x, r0.x, c4.x
mul r0.x, r1.x, c5.x
mad oD0.xyz, c2, r0.x, r0.yzww
mov oD0.w, c3.x

// approximately 25 instruction slots used

Now I load the object file and send data to CreateVertexShader function.
The function fails, the message is "Direct3D9: Shader Validator: X305: (Instruction Error) (Statement 2) Reserved bit(s) set in instruction parameter token! Aborting validation.";

What's wrong?
:(

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Nik02
I'm guessing that you try to load the object file as text.


It was fast! Are you clairvoyant?
It's exactly as you said! I missed 'b' in fopen.
Many many thanks!

Daniel

Share this post


Link to post
Share on other sites
Quote:
Original post by daVinci
Quote:
Original post by Nik02
I'm guessing that you try to load the object file as text.


It was fast! Are you clairvoyant?
It's exactly as you said! I missed 'b' in fopen.
Many many thanks!

Daniel


Not clairvoyant, just experienced :)

Glad I could help!

-Niko

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!