SPV 1.4: Lookup tables: Use variable initializer and NonWritable...

...when doing a variable lookup on an array of constants.
This commit is contained in:
John Kessenich
2019-02-07 08:04:12 -07:00
parent fbb6bdf046
commit 61a5ce190a
6 changed files with 102 additions and 11 deletions

13
Test/spv.1.4.NonWritable.frag Executable file
View File

@@ -0,0 +1,13 @@
#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];
}