The DirectX 9 application/game I inherited uses dynamic vertex buffers. Each frame, it:
My question is, is the part with the temporary buffer necessary? Is there a reason why I shouldn't write vertex data directly into the vertex buffer?
I haven't found any evidence of this practice in the official documentation, and I don't trust the previous programmer enough.
Discaimer: I don't know how DirectX vertex buffers work, I might be wrong here.
It would probably be slower: a vertex buffer is allocated to optimize access from the GPU, i.e. preferrably somewhere in the GPU's own memory. That means directly accessing it from the CPU is much slower than accessing ordinary RAM. Copying a whole array on the other hand can be done relatively fast, so it is better to prepare such an array in main memory and copying it to the vertex buffer in one go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With