Compartilhar via


Vertex Buffer Descriptions

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

A vertex buffer is described in terms of its capabilities: if it can exist only in system memory, if it is only used for write operations, and the type and number of vertices it can contain. All these traits are held in a D3DMVERTEXBUFFER_DESC structure.

Vertex buffer descriptions tell your application how an existing buffer was created and if it has been optimized since being created. You provide an empty description structure for the system to fill with the capabilities of a previously created vertex buffer. For more information about this task, see Retrieving Vertex Buffer Descriptions.

The Format member is set to D3DMFMT_VERTEXDATA to indicate that this is a vertex buffer. The Type identifies the resource type of the vertex buffer. The Usage structure member contains general capability flags (see D3DMUSAGE Values). The presence of the D3DMUSAGE_WRITEONLY flag in Usage indicates that the vertex buffer memory is used only for write operations. This frees the driver to place the vertex data in the best memory location to enable fast processing and rendering. If the D3DMUSAGE_WRITEONLY flag is not used, the driver is less likely to put the data in a location that is inefficient for read operations. This sacrifices some processing and rendering speed. If this flag is not specified, it is assumed that applications perform read and write operations on the data within the vertex buffer.

Pool specifies the memory class that is allocated for the vertex buffer. The D3DPOOL_SYSTEMMEM flag indicates that the system created the vertex buffer in system memory.

The Size member simply stores the size, in bytes, of the vertex buffer data. The FVF member contains a combination of flexible vertex format flags (see D3DMFVF Values) that identify the type of vertices that the buffer contains.

See Also

Concepts

Vertex Buffers