Sign in to follow this  
zqueezy

Very quick question

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
[quote name='zqueezy' timestamp='1297992739' post='4775656']
In case I want to skip a (#ifdef-ed) location?
[/quote]

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this