glslang
glslang copied to clipboard
uint64_t not supported as array index type in GLSL
This seems like it may be a specification issue more than anything else.
Currently, only uint/uint32_t is supported for array indexing.
uint64_t or uint16_t throw a "p.glsl:73: error: '[]' : scalar integer expression required" error (which, to be fair, is kind of a crummy error message and doesn't explain what is going on).
Currently, only uint/uint32_t is supported for array indexing.
Array indices start at zero. Array elements are accessed using an expression whose type is int or
uint.
This would have to be addressed in the GLSL specification before any changes could be made here.
FWIW, you can explicitly cast the index.
int64_t i = 0;
values[int(i)] = 1.0f;
I'll label this issue with enhancement regarding the "crummy error message."
Closing. Moved to slang.