D3DUSAGE
Usage options that identify how resources are to be used.
The following table summarizes the available usage options.
Constant | Description |
---|---|
|
The resource will automatically generate mipmaps. See Automatic Generation of Mipmaps (Direct3D 9). 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). |
|
The resource will be a depth stencil buffer. D3DUSAGE_DEPTHSTENCIL can only be used with D3DPOOL_DEFAULT. |
|
The resource will be a displacement map. |
|
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. |
|
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 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 (Direct3D 9). For more information about using dynamic vertex buffers, see Performance Optimizations (Direct3D 9). 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. |
|
Allow a shared surface created by a secure application to be opened by a non-secure application that has the shared handle. Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only. |
|
Set to indicate that the vertex buffer is to be used for drawing N-patches. |
|
Set to indicate that the vertex or index buffer will be used for drawing point sprites. The buffer will be loaded in system memory if software vertex processing is needed to emulate point sprites. |
|
The resource will be a render target. D3DUSAGE_RENDERTARGET can only be used with D3DPOOL_DEFAULT. |
|
Set to indicate that the vertex buffer is to be used for drawing high-order primitives. |
|
If this flag is used, vertex processing is done in software. If this flag is not used, vertex processing is done in hardware. The D3DUSAGE_SOFTWAREPROCESSING flag can be set when mixed-mode or software vertex processing (D3DCREATE_MIXED_VERTEXPROCESSING / D3DCREATE_SOFTWARE_VERTEXPROCESSING) is enabled for that device. D3DUSAGE_SOFTWAREPROCESSING must be set for buffers to be used with software vertex processing in mixed mode, but it should not be set for the best possible performance when using hardware index processing in mixed mode (D3DCREATE_HARDWARE_VERTEXPROCESSING). However, setting D3DUSAGE_SOFTWAREPROCESSING is the only option when a single buffer is used with both hardware and software vertex processing. D3DUSAGE_SOFTWAREPROCESSING is allowed for mixed and software devices. D3DUSAGE_SOFTWAREPROCESSING is used with 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. |
|
This usage flag must be specified for vertex buffers and source surfaces, used in calls to ComposeRects. T extures created with this usage flag cannot be used for texture filtering. Vertex buffers, created with this usage flag, cannot be used as input stream sources. Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only. |
|
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 D3DUSAGE_WRITEONLY may suffer a severe performance penalty. D3DUSAGE_WRITEONLY only affects the performance of D3DPOOL_DEFAULT buffers. |
|
Setting this flag indicates that the resource might contain protected content. Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only. |
|
Setting this flag indicates that access to the shared resource should be restricted. Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only. |
|
Setting this flag indicates that the driver should restrict access to the shared resource. The caller must create an authenticated channel with the driver. The driver should then allow access to processes that attempt to open that shared resource. Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only. |
Usages are either specified when a resource is created, or specified with CheckDeviceType to test the capability of an existing resource. The following 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 | yes yes | yes | |||||
D3DUSAGE_DEPTHSTENCIL | yes yes | yes yes | |||||
D3DUSAGE_DMAP | yes | yes | |||||
D3DUSAGE_DONOTCLIP yes yes | |||||||
D3DUSAGE_DYNAMIC yes yes yes yes yes | yes | ||||||
D3DUSAGE_NONSECURE yes yes yes yes yes yes yes | |||||||
D3DUSAGE_NPATCHES yes yes | |||||||
D3DUSAGE_POINTS yes yes | |||||||
D3DUSAGE_RTPATCHES yes yes | |||||||
D3DUSAGE_RENDERTARGET | yes yes | yes yes | |||||
D3DUSAGE_SOFTWAREPROCESSING yes yes yes yes yes | yes | ||||||
D3DUSAGE_TEXTAPI yes | yes | ||||||
D3DUSAGE_WRITEONLY yes yes |
Use CheckDeviceFormat to check hardware support for these usages.
Each of the resource creation methods is listed here.
- CreateCubeTexture
- CreateDepthStencilSurface
- CreateIndexBuffer
- CreateOffscreenPlainSurface
- CreateRenderTarget
- CreateTexture
- CreateVertexBuffer
- CreateVolumeTexture
The D3DXCreatexxx texturing functions also use some of these constant values for resource creation.
For more information about pool types and their restrictions with certain usages, see D3DPOOL.
Requirement | Value |
---|---|
Header |
|