Application-Managed Resources and Allocation Strategies |
Dynamic vertex buffers are intended for rendering dynamic geometry and data pulled in from binary space partitioned (BSP) trees or other visibility data structures. This type of rendering can be accomplished by pre-allocating buffers of the desired format with the Dynamic constant of the Usage enumeration. These resources are then parceled out to support application needs by a resource manager within the application.
Because there are only a few different vertex strides that an application will use simultaneously, and a different vertex buffer is required only for each unique stride, the total number of dynamic vertex buffers is small. When managing dynamic resources in this way, it is important to ensure that high-frequency demands on the resources do not significantly decrease application performance.
Managed vertex-buffer or index-buffer resources cannot be declared dynamic by setting Dynamic at creation time. This would require an additional copy for every modification to the vertex buffer contents.
When using resources managed by both Microsoft Direct3D and applications, allocate application-managed resources in Pool.Default memory prior to creating Direct3D-managed resources. This enables the memory manager to maintain an accurate count of available memory.
Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center