DXGI_USAGE

Flags for surface and resource creation options.

Constant/value Description
DXGI_USAGE_BACK_BUFFER
1L << (2 + 4)
The surface or resource is used as a back buffer. You don’t need to pass DXGI_USAGE_BACK_BUFFER when you create a swap chain. But you can determine whether a resource belongs to a swap chain when you call IDXGIResource::GetUsage and get DXGI_USAGE_BACK_BUFFER.
DXGI_USAGE_DISCARD_ON_PRESENT
1L << (5 + 4)
This flag is for internal use only.
DXGI_USAGE_READ_ONLY
1L << (4 + 4)
Use the surface or resource for reading only.
DXGI_USAGE_RENDER_TARGET_OUTPUT
1L << (1 + 4)
Use the surface or resource as an output render target.
DXGI_USAGE_SHADER_INPUT
1L << (0 + 4)
Use the surface or resource as an input to a shader.
DXGI_USAGE_SHARED
1L << (3 + 4)
Share the surface or resource.
DXGI_USAGE_UNORDERED_ACCESS
1L << (6 + 4)
Use the surface or resource for unordered access.

Remarks

Each flag is defined as an unsigned integer.

#define DXGI_CPU_ACCESS_NONE    ( 0 )
#define DXGI_CPU_ACCESS_DYNAMIC    ( 1 )
#define DXGI_CPU_ACCESS_READ_WRITE    ( 2 )
#define DXGI_CPU_ACCESS_SCRATCH    ( 3 )
#define DXGI_CPU_ACCESS_FIELD        15
#define DXGI_USAGE_SHADER_INPUT             ( 1L << (0 + 4) )
#define DXGI_USAGE_RENDER_TARGET_OUTPUT     ( 1L << (1 + 4) )
#define DXGI_USAGE_BACK_BUFFER              ( 1L << (2 + 4) )
#define DXGI_USAGE_SHARED                   ( 1L << (3 + 4) )
#define DXGI_USAGE_READ_ONLY                ( 1L << (4 + 4) )
#define DXGI_USAGE_DISCARD_ON_PRESENT       ( 1L << (5 + 4) )
#define DXGI_USAGE_UNORDERED_ACCESS         ( 1L << (6 + 4) )
typedef UINT DXGI_USAGE;

These flag options are used in a call to the IDXGIFactory::CreateSwapChain, IDXGIFactory2::CreateSwapChainForHwnd, IDXGIFactory2::CreateSwapChainForCoreWindow, or IDXGIFactory2::CreateSwapChainForComposition method to describe the surface usage and CPU access options for the back buffer of a swap chain. You can't use the DXGI_USAGE_SHARED, DXGI_USAGE_DISCARD_ON_PRESENT, and DXGI_USAGE_READ_ONLY values as input to create a swap chain. However, DXGI can set DXGI_USAGE_DISCARD_ON_PRESENT and DXGI_USAGE_READ_ONLY for some of the swap chain's back buffers on the application's behalf. You can call the IDXGIResource::GetUsage method to retrieve the usage of these back buffers. Swap chain's only support the DXGI_CPU_ACCESS_NONE value in the DXGI_CPU_ACCESS_FIELD part of DXGI_USAGE.

These flag options are also used by the IDXGIDevice::CreateSurface method.

Requirements

Requirement Value
Header
DXGI.h

See also

DXGI Constants