Version: 2019.3
LanguageEnglish
  • C#

SystemInfo.hasDynamicUniformArrayIndexingInFragmentShaders

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

public static bool hasDynamicUniformArrayIndexingInFragmentShaders;

Description

Returns true when the GPU has native support for indexing uniform arrays in fragment shaders without restrictions.

Some OpenGL ES 2 GPUs do not support indexing uniform arrays in fragment shaders using arbitrary variables. The OpenGL ES 2 GLSL specification requires only indexing by constants, for-loop counters and combinations of those in fragment shaders. Support for indexing using other variables is not guaranteed. The generated shader code handles these differences by providing wrappers for each of the indexed arrays used in the shader. The wrappers provide two code paths, one indexing the array directly, and another emulating indexing using branching. When running on a device, the shader compiler selects the correct code path depending on the device capabilities. This flag provides a possibility to select a simpler shader when running on devices that lack native support for indexing uniform arrays in fragment shaders using arbitrary variables.