What is uav in graphics?
Unordered Access View (UAV) Typed Load is the ability for a shader to read from a UAV with a specific DXGI_FORMAT.
An unordered access view (UAV) is a view of an unordered access resource (which can include buffers, textures, and texture arrays, though without multi-sampling). A UAV allows temporally unordered read/write access from multiple threads. This means that this resource type can be read/written simultaneously by multiple threads without generating memory conflicts. This simultaneous access is handled through the use of Atomic Functions.
D3D12 (and D3D11.3) expands on the list of formats that can be used with typed UAV loads.
Previously, the following three formats supported typed UAV loads, and were required for D3D11.0 hardware. They are supported for all D3D11.3 and D3D12 hardware.
The following formats are supported as a set on D3D12 or D3D11.3 hardware, so if any one is supported, all are supported.
The following formats are optionally and individually supported on D3D12 and D3D11.3 hardware, so a single query would need to be made on each format to test for support.
To determine the support for any additional formats, call CheckFeatureSupport with the D3D12_FEATURE_DATA_D3D12_OPTIONS structure as the first parameter (refer to Capability Querying). The TypedUAVLoadAdditionalFormats field will be set if the "supported as a set" list above is supported. Make a second call to CheckFeatureSupport, using a D3D12_FEATURE_DATA_FORMAT_SUPPORT structure (checking the returned structure against the D3D12_FORMAT_SUPPORT2_UAV_TYPED_LOAD member of the D3D12_FORMAT_SUPPORT2 enum) to determine support in the list of optionally supported formats listed above, for example:
For typed UAVs, the HLSL flag is D3D_SHADER_REQUIRES_TYPED_UAV_LOAD_ADDITIONAL_FORMATS.
Here is example shader code to process a typed UAV load:
When using typed UAV loads to read from a UNORM or SNORM resource, you must properly declare the element type of the HLSL object to be unorm or snorm. It is specified as undefined behavior to mismatch the element type declared in HLSL with the underlying resource data type. For example, if you are using typed UAV loads on a buffer resource with R8_UNORM data, then you must declare the element type as unorm float:
Unordered Access View (UAV) Typed Load is the ability for a shader to read from a UAV with a specific DXGI_FORMAT.