Merge pull request #1824 from KhronosGroup/fix-spec-expr-array-check

SPV: Fix #1783: Don't do bounds checking for spec-const-expression size
This commit is contained in:
John Kessenich 2019-07-15 10:55:30 -06:00 committed by GitHub
commit 50dc8c350b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 2 deletions

View file

@ -0,0 +1,6 @@
spv.specConstArrayCheck.vert
ERROR: 0:13: '[' : array index out of range '6'
ERROR: 1 compilation errors. No code generated.
SPIR-V is not generated for failed compile or link

View file

@ -0,0 +1,14 @@
#version 450
layout(constant_id = 0) const uint a = 1;
layout(constant_id = 1) const uint b = 2;
layout(location = 0) out uint o;
void main() {
uint arr1[a+a];
uint arr2[b];
o = arr1[1];
o = arr2[1];
o = arr1[6];
o = arr2[6];
}