bbosak
bbosak

Reputation: 5529

Why VertexBuffer is faster than DynamicVertexBuffer

I've been doing some XNA programming (DirectX) on Windows Phone 7 and noticed that the VertexBuffer class is 30 times faster than the DynamicVertexBuffer class. What's the difference between them anyways? Why the significant speedup when using VertexBuffer?

Upvotes: 2

Views: 955

Answers (1)

Mitch Wheat
Mitch Wheat

Reputation: 300489

The MSDN entry for the DynamicVertexBuffer Class states:

" Use DynamicVertexBuffer for dynamic vertex arrays and VertexBuffer for non-dynamic vertex arrays...In situations where your game frequently modifies a vertex buffer, it is recommended that the buffer be instantiated or derived from DynamicVertexBuffer instead of the VertexBuffer class. DynamicVertexBuffer is optimized for frequent vertex data modification."

So, its presumably the usual tradeoff of something like a fixed allocated array representation versus a dynamic list.

Upvotes: 3

Related Questions