Jump to content
  • Advertisement
Sign in to follow this  
SlasherX

VertexShader is not working with drawIndexedPrimitiveUP! Help!

This topic is 4828 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've written a bumpmapping vertex shader that uses the vertex declaration like this: { { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, { 0,12, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, { 0,20, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL , 0 }, { 0,32, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TANGENT , 0 }, D3DDECL_END() }, The problem is, when I tried the shader with a system memory vertex buffer (a drawIndexedPrimitiveUP call), I see a polygon soup. But when I used the same vertex array with in a D3DVERTEXBUFFER9 I see my mesh is ok. What can be wrong? But drawIndexedPrimitiveUP call works with this declaration: { { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, { 0,12, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, { 0,20, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL , 0 }, D3DDECL_END() }, I set the declaration before the drawIndexedPrimitiveUP call but it doesn't work... Any help is appreciated, Galip

Share this post


Link to post
Share on other sites
Advertisement
The only thing I can think of, which is a complete long-shot (not sure it's even possible), is some sort of struct alignment in your sysmem array. SiCrane wrote an article on it here.

My only other suggestion is to try the debug runtimes set to maximum output and maximum validation (See the link in my signiture below for details if needed) and check to see if you've made a mistake that it's moaning about [smile]

hth
Jack

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!