?/TD> |
Microsoft DirectX 9.0 |
Options identify how resources are to be used. The table below summarizes the usages that available to each resource type. The second table identifies which usages are available for each resource type.
#define | Description |
---|---|
D3DUSAGE_AUTOGENMIPMAP | The resource will automatically generate mipmaps. See Automatic Generation of Mipmaps. Automatic generation of mipmaps is not supported for volume textures and depth stencil surfaces/textures.
This usage is not valid for a resource in system memory (D3DPOOL_SYSTEMMEM). |
D3DUSAGE_DEPTHSTENCIL | The resource will be a depth stencil buffer. D3DUSAGE_DEPTHSTENCIL can only be used with D3DPOOL_DEFAULT. |
D3DUSAGE_DMAP | The resource will be a displacement map. |
D3DUSAGE_DONOTCLIP | Set to indicate that the vertex buffer content will never require clipping. When rendering with buffers that have this flag set, the D3DRS_CLIPPING render state must be set to false. |
D3DUSAGE_DYNAMIC | Set to indicate that the vertex buffer requires dynamic memory use. This is useful for drivers because it enables them to decide where to place the buffer. In general, static vertex buffers are placed in video memory and dynamic vertex buffers are placed in accelerated graphics port (AGP) memory. Note that there is no separate static use. If you do not specify D3DUSAGE_DYNAMIC, the vertex buffer is made static. D3DUSAGE_DYNAMIC is strictly enforced through the D3DLOCK_DISCARD and D3DLOCK_NOOVERWRITE locking flags. As a result, D3DLOCK_DISCARD and D3DLOCK_NOOVERWRITE are valid only on vertex buffers created with D3DUSAGE_DYNAMIC. They are not valid flags on static vertex buffers. For more information, see Managing Resources. For more information about using dynamic vertex buffers, see Performance Optimizations. D3DUSAGE_DYNAMIC and D3DPOOL_MANAGED are incompatible and should not be used together. See D3DPOOL. Textures can specify D3DUSAGE_DYNAMIC. However, managed textures cannot use D3DUSAGE_DYNAMIC. For more information about dynamic textures, see Using Dynamic Textures. |
D3DUSAGE_NPATCHES | Set to indicate when the vertex buffer is to be used for drawing N-patches. |
D3DUSAGE_POINTS | Set to indicate when the vertex buffer is to be used for drawing points. |
D3DUSAGE_RENDERTARGET | The resource will be a render target. D3DUSAGE_RENDERTARGET can only be used with D3DPOOL_DEFAULT. |
D3DUSAGE_RTPATCHES | Set to indicate when the vertex buffer is to be used for drawing high-order primitives. |
D3DUSAGE_SOFTWAREPROCESSING | If this flag is used, vertex processing is done in software. If this flag is not used, vertex processing is done in hardware.
D3DUSAGE_SOFTWAREPROCESSING is used with IDirect3D9::CheckDeviceFormat to find out if a particular texture format can be used as a vertex texture during software vertex processing. If it can, the texture must be created in D3DPOOL_SCRATCH. |
D3DUSAGE_WRITEONLY | Informs the system that the application writes only to the vertex buffer. Using this flag enables the driver to choose the best memory location for efficient write operations and rendering. Attempts to read from a vertex buffer that is created with this capability will fail. Buffers created with D3DPOOL_DEFAULT that do not specify D3DUAGE_WRITEONLY might suffer a severe performance penalty. |
Certain usages can be used with certain pool types. See D3DPOOL for more information.
Usages are either specified when a resource is created, or specified with CheckDeviceFormat to test the capability of an existing resource. This table identifies which usages can be applied to which resource types.
Usage | Vertex buffer create | Index buffer create | Texture create | Cube texture create | Volume texture create | Surface create | Check device format |
---|---|---|---|---|---|---|---|
D3DUSAGE_AUTOGENMIPMAP | x | x | x | ||||
D3DUSAGE_DEPTHSTENCIL | x | x | x | x | |||
D3DUSAGE_DMAP | x | x | |||||
D3DUSAGE_DONOTCLIP | x | x | |||||
D3DUSAGE_DYNAMIC | x | x | x | x | x | x | |
D3DUSAGE_NPATCHES | x | x | |||||
D3DUSAGE_POINTS | x | x | |||||
D3DUSAGE_RTPATCHES | x | x | |||||
D3DUSAGE_RENDERTARGET | x | x | x | x | |||
D3DUSAGE_SOFTWAREPROCESSING | x | x | x | x | x | x | |
D3DUSAGE_WRITEONLY | x | x |
Use IDirect3D9::CheckDeviceFormat to check hardware support for these usages.
Each of the resource creation methods is listed here.
For more information about pool types, see D3DPOOL.
Header | d3d9types.h |
---|---|
Minimum operating system | Windows 98 |