Jump to content
  • Advertisement
Sign in to follow this  
zqueezy

Very quick question

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

heyhey,
there's nothing against calling IASetVertexBuffers several times? In case I want to skip a (#ifdef-ed) location?
thanks
zqueezy

Share this post


Link to post
Share on other sites
Advertisement

In case I want to skip a (#ifdef-ed) location?


Not sure what you mean by that. But yeah, nothing wrong with calling it several times. What it'll do is just replace the vertex buffers previously in/pointed to by the device. The most recent vertex buffer set by IASetVertexBuffer will be used in the next draw call.

Share this post


Link to post
Share on other sites
Sorry, by location (GLSL) I meant Slot (HLSL)
Let's say according to my INPUT_ELEMENT_DESC positions go to slot 0 and normals to slot 3. Do I have to call IASetVertexBuffers twice? The documentation for the function says "this causes each additional vertex buffer in the array to be implicitly bound to each subsequent input slot". But that means that my normals might end up on slot 2.
Maybe put differently:
1) I call IASetVertexBuffers with startslot = 3 for VertexBuffer "A".
2) I call it again with startslot = 0 for VertexBuffer "B"
After 2) will A still be bound to startslot 3?? Or do I have to make sure via 2 InputSignatures that all buffers are consecutive?<br><br>zqueezy

Share this post


Link to post
Share on other sites
It is not incremental, you specify excplicitely in the call to which slot your buffer is bound. so no risk at calling it multiple times.
you should even call it once and set all your slots at once. since this function excepts an array.

Share this post


Link to post
Share on other sites
yes, but not an array of slots, only the startslot. but if calling it multiple times is fine, then I can do that. thanks

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!