Trouble assembling vertex shader with DX 9

Started by
1 comment, last by mrman102938 17 years, 10 months ago
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.
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.
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

This topic is closed to new replies.

Advertisement