Reputation: 59
I'm writing a directx app and want to overlay a grid on the front of the scene. The grid will possibly update every frame but will be something like 20 horizontal lines and 20 vertical lines (LineList).
I'm trying to understand if this situation (small amount of vertices updated frequently) means a dynamic buffer is more appropriate than a static buffer?
Is anyone able to advise on this? I've not been able to find a low-level explanation of the difference between the two - it sounds like dynamic is 'more accessible' to the CPU and requires some locking semantics whereas static is less accessible.
Cheers
Upvotes: 0
Views: 3752
Reputation: 636
If you are changing the buffer every frame, use Dynamic buffers.
Using static buffers will cause the GPU to stall every time you change the buffer, which will crash performance.
I'm not sure about dynamic buffers in direct3d10, the name seems to come from direct3d9. Direct3D10 has a somewhat more elaborate scheme of creating 'dynamic' buffers but you should not be using Static buffers in any case.
Upvotes: 3
Reputation: 2418
You will likely want to use a dynamic vertex buffer. If you want to update the vertices on a per frame basis then dynamic is the way to go.
See this MSDN article for a more low-level description
Upvotes: 3