var<private>
var<private> declares a mutable variable in the private address-space.
var<private> is almost identical to var<function>, except that
var<private> can only be declared at module-scope (global) and is visible
to all functions in the module.
Like var<function>, a var<private> declaration must have an explicit type,
an initializer, or both type and initializer:
| |
A var<private> with no initializer will be automatically initialized with
the zero value for the variable’s type.
The initializer for var<private> must be a
constant expression.
Each shader invocation will have a unique instance of a var in private address-space.
Uses of a var<private> will always result in a
runtime expression.