D3D10_USAGE enumeration

Identifies expected resource use during rendering. The usage directly reflects whether a resource is accessible by the CPU and/or the GPU.

Syntax


typedef enum D3D10_USAGE { 
  D3D10_USAGE_DEFAULT    = 0,
  D3D10_USAGE_IMMUTABLE  = 1,
  D3D10_USAGE_DYNAMIC    = 2,
  D3D10_USAGE_STAGING    = 3
} D3D10_USAGE;

Constants

D3D10_USAGE_DEFAULT

A resource that requires read and write access by the GPU. This is likely to be the most common usage choice.

D3D10_USAGE_IMMUTABLE

A resource that can only be read by the GPU. It cannot be written by the GPU, and cannot be accessed at all by the CPU. This type of resource must be initialized when it is created, since it cannot be changed after creation.

D3D10_USAGE_DYNAMIC

A resource that is accessible by both the GPU and the CPU (write only). A dynamic resource is a good choice for a resource that will be updated by the CPU at least once per frame. To write to a dynamic resource on the CPU, use a Map method. You can write to a dynamic resource on the GPU using CopyResource or CopySubresourceRegion.

D3D10_USAGE_STAGING

A resource that supports data transfer (copy) from the GPU to the CPU.

Remarks

An application identifies the way a resource is intended to be used (its usage) in a resource description. There are several structures for creating resources including: D3D10_TEXTURE1D_DESC, D3D10_TEXTURE2D_DESC, D3D10_TEXTURE3D_DESC, D3D10_BUFFER_DESC, and D3DX10_IMAGE_LOAD_INFO.

Differences between Direct3D 9 and Direct3D 10:

In Direct3D 9, you specify the type of memory a resource should be created in at resource creation time (using D3DPOOL). It was an application's job to decide what memory pool would provide the best combination of functionality and performance.

In Direct3D 10, an application no longer specifies what type of memory (the pool) to create a resource in. Instead, you specify the intended usage of the resource, and let the runtime (in concert with the driver and a memory manager) choose the type of memory that will achieve the best performance.

 

Resource Usage Restrictions

Each usage dictates a tradeoff between functionality and performance. In general, resource accessing is accomplished with the following APIs.

Use the following table to choose the usage that best describes how the resource will need to be accessed by the CPU and/or the GPU. Of course, there will be performance tradeoffs.

Resource UsageDefaultDynamicImmutableStaging
GPU-Readyesyes¹yesyes1, 2
GPU-Writeyes¹yes1, 2
CPU-Readyes1, 2
CPU-Writeyesyes1, 2

 

Resource Bind Options

To maximize performance, not all resource usage options can be used as input or output resources to the pipeline. This table identifies these limitations.

Resource Can Be Bound AsDefaultDynamicImmutableStaging
Input to a Stageyes³yes⁴yes
Output from a Stageyes³

 

  • 3 - If bound as an input and an output using different views, each view must use different subresources.
  • 4 - The resource can only be created with a single subresource. The resource cannot be a texture array. The resource cannot be a mipmap chain.

Requirements

Header

D3D10.h

See also

Resource Enumerations

 

 

Show: