• Advertisement
Sign in to follow this  

Trouble assembling vertex shader with DX 9

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

Hi, I have recentley decided to move from directx 8 to directx 9. The only trouble is, I seem now to be having trouble assembling my old vertex shader source file. Here is the code: vs.1.1 dp4 oPos.x, v0, c0 dp4 oPos.y, v0, c1 dp4 oPos.z, v0, c2 dp4 oPos.w, v0, c3 mov oT0, v7 When I try and compile thsi with D3DXAssembleShaderFromFile() it fails and reports back to me with error x5326, saying "read of unitialized components". How do I fix this? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Direct3D 9 requires that you declare your input register before you can use them. Lock for the “dcl_usage input register“ instruction the documentation.

Share this post


Link to post
Share on other sites
Thanks for the tip .I have got it sorted now. Just changed it as below and all is good.

vs.2.0

dcl_texcoord v7
dcl_position v0

dp4 oPos.x, v0, c0
dp4 oPos.y, v0, c1
dp4 oPos.z, v0, c2
dp4 oPos.w, v0, c3
mov oT0.xy, v7

Share this post


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

  • Advertisement