Very quick question

Started by
3 comments, last by zqueezy 13 years, 2 months ago
heyhey,
there's nothing against calling IASetVertexBuffers several times? In case I want to skip a (#ifdef-ed) location?
thanks
zqueezy
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.
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
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.
yes, but not an array of slots, only the startslot. but if calling it multiple times is fine, then I can do that. thanks

This topic is closed to new replies.

Advertisement