Skip to content

Latest commit

 

History

History
179 lines (152 loc) · 7.19 KB

ne-d3d10-d3d10_usage.md

File metadata and controls

179 lines (152 loc) · 7.19 KB
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.
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
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
D3D10_USAGE
d3d10/D3D10_USAGE
c++
APIRef
kbSyntax
HeaderDef
D3D10.h
D3D10_USAGE

D3D10_USAGE enumeration

-description

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

-enum-fields

-field D3D10_USAGE_DEFAULT:0

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

-field D3D10_USAGE_IMMUTABLE:1

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.

-field D3D10_USAGE_DYNAMIC:2

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.

-field D3D10_USAGE_STAGING:3

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 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
 

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 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.

-see-also

Resource Enumerations