Dynamically Uniform Expression: Difference between revisions

From OpenGL Wiki
Jump to navigation Jump to search
Stub for dynamically uniform expressions
 
Line 17: Line 17:
* The array index for [[GLSL Type#Opaque arrays|arrays of opaque types]].
* The array index for [[GLSL Type#Opaque arrays|arrays of opaque types]].
* The index to buffer-backed interface blocks.
* The index to buffer-backed interface blocks.
* In [[Compute Shaders]], the expressions leading to the execution of a {{code|barrier()}} call. So if there is a loop or a conditional statement or somesuch, all of these conditions must be dynamically uniform expressions, so that every compute shader invocation encounters every {{code|barrier()}} statement in the same sequence and the same number of times.
* In [[Compute Shader]]s, the expressions leading to the execution of a {{code|barrier()}} call. So if there is a loop or a conditional statement or somesuch, all of these conditions must be dynamically uniform expressions, so that every compute shader invocation encounters every {{code|barrier()}} statement in the same sequence and the same number of times.


{{stub}}
{{stub}}


[[Category:OpenGL Shading Language]]
[[Category:OpenGL Shading Language]]

Revision as of 18:40, 2 November 2012

Dynamically Uniform Expression
Core in version 4.6
Core since version 4.0

A Dynamically Uniform Expression is a GLSL expression in which all invocations of that shader within a particular rendering command will compute the same value. This concept only matters in GLSL 4.00 and above.

Definition

Examples

Uses

There are places where GLSL requires the expression to be dynamically uniform. All of the following must use a dynamically uniform expression:

  • The array index for arrays of opaque types.
  • The index to buffer-backed interface blocks.
  • In Compute Shaders, the expressions leading to the execution of a barrier() call. So if there is a loop or a conditional statement or somesuch, all of these conditions must be dynamically uniform expressions, so that every compute shader invocation encounters every barrier() statement in the same sequence and the same number of times.