Microsoft Docs

D3D11_CPU_ACCESS_FLAG enumeration

Defined in: d3d11.h
Namespace: Microsoft::WRL::Details (though typically used directly in C/C++ code)
Platform: Windows

The D3D11_CPU_ACCESS_FLAG enumeration specifies CPU access for a resource.

These flags are used in the D3D11_RESOURCE_MISC_FLAG member of the D3D11_BUFFER_DESC and D3D11_TEXTURE1D_DESC, D3D11_TEXTURE2D_DESC, D3D11_TEXTURE3D_DESC structures.

Syntax

enum D3D11_CPU_ACCESS_FLAG : unsigned int { D3D11_CPU_ACCESS_WRITE = 0, D3D11_CPU_ACCESS_READ = 1, D3D11_CPU_ACCESS_READ_WRITE = 2 };

Members

D3D11_CPU_ACCESS_WRITE

D3D11_CPU_ACCESS_WRITE
0
The resource can be written to by the CPU.

D3D11_CPU_ACCESS_READ

D3D11_CPU_ACCESS_READ
1
The resource can be read from by the CPU.

D3D11_CPU_ACCESS_READ_WRITE

D3D11_CPU_ACCESS_READ_WRITE
2
The resource can be read from and written to by the CPU.

Remarks

Resources that are accessible by the CPU are typically placed in system memory rather than video memory. This can lead to performance implications due to potential data transfers between system and video memory.

For optimal performance, minimize CPU access to resources and favor GPU access.

Requirements

Component Version
Minimum supported client Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2 [desktop apps | UWP apps]
Header d3d11.h