Version: Unity 6.0 (6000.0)
LanguageEnglish
  • C#

SystemInfo.SupportsTypedUAVShaderLoadStoreOnGraphicsFormat

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static bool SupportsTypedUAVShaderLoadStoreOnGraphicsFormat(Experimental.Rendering.GraphicsFormat graphicsFormat, bool isLoad);

Parameters

Parameter Description
graphicsFormat The format to look up.
isLoad True for "load" operation check, false for "store" operation check. Some formats on some hardware can support one but not another.

Returns

bool True if the hardware supports the format for typed UAV load/store.

Description

Tests if a GraphicsFormat can be used for typed UAV shader load/store on current hardware.

D3D11/D3D12 are more restrictive (https://learn.microsoft.com/en-us/windows/win32/direct3d12/typed-unordered-access-view-loads#supported-formats-and-api-calls) than other APIs for typed UAV load/store operations. When a user wants to read/write to a RWTexture of a specific format, such as GraphicsFormat.R32G32_SFloat, in a shader, D3D can silently produce incorrect results on some hardware (i.e., integrated Intel GPUs). This function can be used to prevent such behavior on D3D. Other APIs are either less restrictive or do not have typed shader syntax for RW textures; this function just returns true on those APIs if the format supports GraphicsFormatUsage.LoadStore.