ID3D11Device::CreateUnorderedAccessView method (d3d11.h)
Creates a view for accessing an unordered access resource.
Syntax
HRESULT CreateUnorderedAccessView(
[in] ID3D11Resource *pResource,
[in, optional] const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc,
[out, optional] ID3D11UnorderedAccessView **ppUAView
);
Parameters
[in] pResource
Type: ID3D11Resource*
Pointer to an ID3D11Resource that represents a resources that will serve as an input to a shader.
[in, optional] pDesc
Type: const D3D11_UNORDERED_ACCESS_VIEW_DESC*
Pointer to an D3D11_UNORDERED_ACCESS_VIEW_DESC that represents a shader-resource view description. Set this parameter to NULL to create a view that accesses the entire resource (using the format the resource was created with).
[out, optional] ppUAView
Type: ID3D11UnorderedAccessView**
Address of a pointer to an ID3D11UnorderedAccessView that represents an unordered-access view. Set this parameter to NULL to validate the other input parameters (the method will return S_FALSE if the other input parameters pass validation).
Return value
Type: HRESULT
This method returns one of the Direct3D 11 Return Codes.
Remarks
The Direct3D 11.1 runtime, which is available starting with Windows 8, allows you to use CreateUnorderedAccessView for the following new purpose.
You can create unordered-access views of video resources so that Direct3D shaders can process those unordered-access views. These video resources are either Texture2D or Texture2DArray. The value in the ViewDimension member of the D3D11_UNORDERED_ACCESS_VIEW_DESC structure for a created unordered-access view must match the type of video resource, D3D11_UAV_DIMENSION_TEXTURE2D for Texture2D and D3D11_UAV_DIMENSION_TEXTURE2DARRAY for Texture2DArray. Additionally, the format of the underlying video resource restricts the formats that the view can use. The video resource format values on the DXGI_FORMAT reference page specify the format values that views are restricted to.
The runtime read+write conflict prevention logic (which stops a resource from being bound as an SRV and RTV or UAV at the same time) treats views of different parts of the same video surface as conflicting for simplicity. Therefore, the runtime does not allow an application to read from luma while the application simultaneously renders to chroma in the same surface even though the hardware might allow these simultaneous operations.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | d3d11.h |
Library | D3D11.lib |