Share via


Application-Managed Resources and Allocation Strategies (Windows Embedded CE 6.0)

1/6/2010

Managed vertex-buffer or index-buffer resources cannot be declared dynamic by specifying D3DMUSAGE_DYNAMIC (see D3DMUSAGE Values) at creation time. This would require an additional copy for every modification to the vertex buffer contents. Dynamic vertex buffers are intended for rendering dynamic geometry as well as data pulled in from BSP trees or other visibility data structures. This can be accomplished by pre-allocating buffers of the desired format. 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 the application's performance.

When simultaneously using both Direct3D Mobile-managed and application-managed resources, all application managed resources should be allocated in D3DMPOOL_VIDEOMEM memory (see D3DMPOOL) prior to creating any managed resources. Allocating resources in D3DMPOOL_VIDEOMEM memory after allocating resources in D3DMPOOL_MANAGED memory will give the D3D memory manager an inaccurate account of available memory.

See Also

Concepts

Common Details for Direct3D Mobile Resources