?/TD>
Microsoft DirectX 9.0

D3DUSAGE


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.

Usages

#defineDescription
D3DUSAGE_AUTOGENMIPMAPThe 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_DEPTHSTENCILThe resource will be a depth stencil buffer. D3DUSAGE_DEPTHSTENCIL can only be used with D3DPOOL_DEFAULT.
D3DUSAGE_DMAPThe resource will be a displacement map.
D3DUSAGE_DONOTCLIPSet 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_NPATCHESSet to indicate when the vertex buffer is to be used for drawing N-patches.
D3DUSAGE_POINTSSet to indicate when the vertex buffer is to be used for drawing points.
D3DUSAGE_RENDERTARGETThe resource will be a render target. D3DUSAGE_RENDERTARGET can only be used with D3DPOOL_DEFAULT.
D3DUSAGE_RTPATCHESSet to indicate when the vertex buffer is to be used for drawing high-order primitives.
D3DUSAGE_SOFTWAREPROCESSINGIf 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_WRITEONLYInforms 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.

Usage and Pool Combinations

Certain usages can be used with certain pool types. See D3DPOOL for more information.

Usage and Resource Combinations

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.

UsageVertex buffer createIndex buffer createTexture createCube texture createVolume texture createSurface createCheck device format
D3DUSAGE_AUTOGENMIPMAPxxx
D3DUSAGE_DEPTHSTENCILxxxx
D3DUSAGE_DMAPxx
D3DUSAGE_DONOTCLIPxx
D3DUSAGE_DYNAMICxxxxxx
D3DUSAGE_NPATCHESxx
D3DUSAGE_POINTSxx
D3DUSAGE_RTPATCHESxx
D3DUSAGE_RENDERTARGETxxxx
D3DUSAGE_SOFTWAREPROCESSINGxxxxxx
D3DUSAGE_WRITEONLYxx

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.

Constant Information

Headerd3d9types.h
Minimum operating systemWindows 98

Related Topics



© 2002 Microsoft Corporation. All rights reserved.