UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NE:d3d10.D3D10_USAGE |
D3D10_USAGE (d3d10.h) |
Identifies expected resource use during rendering. The usage directly reflects whether a resource is accessible by the CPU and/or the GPU. |
|
direct3d10\d3d10_usage.htm |
direct3d10 |
VS|directx_sdk|~\d3d10_usage.htm |
12/05/2018 |
D3D10_USAGE, D3D10_USAGE enumeration [Direct3D 10], D3D10_USAGE_DEFAULT, D3D10_USAGE_DYNAMIC, D3D10_USAGE_IMMUTABLE, D3D10_USAGE_STAGING, ce388aa8-48f6-b43d-c978-e00f781ef68c, d3d10/D3D10_USAGE, d3d10/D3D10_USAGE_DEFAULT, d3d10/D3D10_USAGE_DYNAMIC, d3d10/D3D10_USAGE_IMMUTABLE, d3d10/D3D10_USAGE_STAGING, direct3d10.d3d10_usage |
d3d10.h |
Windows |
Windows |
D3D10_USAGE |
19H1 |
|
|
|
|
|
|
Identifies expected resource use during rendering. The usage directly reflects whether a resource is accessible by the CPU and/or the GPU.
A resource that requires read and write access by the GPU. This is likely to be the most common usage choice.
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.
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.
A resource that supports data transfer (copy) from the GPU to the CPU.
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. |
- CPU access is done with ID3D10Buffer::Map, ID3D10Texture1D::Map, ID3D10Texture2D::Map, or ID3D10Texture3D::Map
- GPU access is done with CopySubresourceRegion, CopyResource, or UpdateSubresource.
Resource Usage | Default | Dynamic | Immutable | Staging |
---|---|---|---|---|
GPU-Read | yes | yes¹ | yes | yes1, 2 |
GPU-Write | yes¹ | yes1, 2 | ||
CPU-Read | yes1, 2 | |||
CPU-Write | yes | yes1, 2 |
- 1 - This is restricted to CopySubresourceRegion, CopyResource, and UpdateSubresource.
- 2 - Cannot be a depth-stencil buffer or a multisampled render target.
Resource Can Be Bound As | Default | Dynamic | Immutable | Staging |
---|---|---|---|---|
Input to a Stage | yes³ | yes⁴ | yes | |
Output from a Stage | yes³ |
- 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.