Naga IR ArraySize::Dynamic
should be renamed to Runtime
, to match WGSL
#6319
Labels
naga
Shader Translator
Naga IR's terminology for global arrays whose length is determined by the size of the buffer binding should be reconciled with WGSL's.
WGSL syntax for such array types is
array<T>
, instead ofarray<T, N>
for an array of N elements. The spec text calls them runtime-sized arrays.SPIR-V's type is
OpTypeRuntimeArray
, and the spec (somewhat elliptically) calls them "run-time arrays".Naga IR has
ArraySize::Dynamic
, and the comments talk about "dynamically sized arrays".GLSL talks about "run-time sized arrays" and "compile-time sized arrays".
In HLSL we just use the untyped
RWByteAddressBuffer
for anything variable-sized, so there isn't really a language term for this.In Metal, all arrays have no particular length, and we have to pass their sizes to the shader explicitly.
So Naga IR is the odd man out, using the term "dynamic". Simply renaming it to
ArraySize::Runtime
and updating all docs would remove a point of confusion.The text was updated successfully, but these errors were encountered: