mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-10 04:20:06 +00:00
61a5ce190a
...when doing a variable lookup on an array of constants.
14 lines
236 B
GLSL
Executable File
14 lines
236 B
GLSL
Executable File
#version 450
|
|
|
|
layout(location = 0) flat in int index;
|
|
|
|
layout(location = 0) out float color;
|
|
|
|
// lookup table
|
|
const float table[16] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
|
|
|
|
void main()
|
|
{
|
|
color = table[index];
|
|
}
|