Device Types and Index Processing Requirements
The performance of index processing operations depends heavily on where the index buffer exists in memory and what type of rendering device is being used. Applications control the memory allocation for index buffers when they are created. When the D3DPOOL_SYSTEMMEM memory flag is set, the index buffer is created in system memory. When the D3DPOOL_DEFAULT memory flag is used, the device driver determines where the memory for the index buffer is best allocated, often referred to as driver-optimal memory. Driver-optimal memory can be local video memory, nonlocal video memory, or system memory.
Setting the D3DUSAGE_SOFTWAREPROCESSING behavior flag when calling the IDirect3DDevice8::CreateIndexBuffer method specifies that the index buffer is to be used with software vertex processing. This flag is required in mixed mode vertex processing (D3DCREATE_MIXED_VERTEXPROCESSING) when software vertex processing is used.
The application can directly write indices to a index buffer allocated in driver-optimal memory. This technique prevents a redundant copy operation later. This technique does not work well if your application reads data back from an index buffer, because read operations done by the host from driver-optimal memory can be very slow. Therefore, if your application needs to read during processing or writes data to the buffer erratically, a system-memory index buffer is a better choice.
Note Always use D3DPOOL_DEFAULT, except when you do not want to expend video memory or expand large amounts of page-locked RAM when the driver is putting vertex or index buffers into AGP memory.
See Also
Last updated on Thursday, April 08, 2004
© 1992-2003 Microsoft Corporation. All rights reserved.