summaryrefslogtreecommitdiff
path: root/tests/diagnostics
diff options
context:
space:
mode:
authorDarren <65404740+fairywreath@users.noreply.github.com>2024-12-10 13:12:19 -0500
committerGitHub <noreply@github.com>2024-12-10 10:12:19 -0800
commit523e9f012e42608df1f7dd91f5625f8171b6ca3d (patch)
treef0ba1940c442ae85e03769047125a1fe73900fb7 /tests/diagnostics
parent34497ae6d779b16b75003c7d9b6ca04e58b4dc70 (diff)
Enable exprs for GLSL binding layout qualifiers (#5807)
* Allow glsl set and binding layout qualifiers to be compile time integer exprs * add new tests * add comments * cleanup on asserts * addressed review comments and cleanup * fix missing set expr in test * fixed tests and cleanup --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests/diagnostics')
-rw-r--r--tests/diagnostics/unrecognized-glsl-layout-modifiers.slang23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/diagnostics/unrecognized-glsl-layout-modifiers.slang b/tests/diagnostics/unrecognized-glsl-layout-modifiers.slang
new file mode 100644
index 000000000..3012a8828
--- /dev/null
+++ b/tests/diagnostics/unrecognized-glsl-layout-modifiers.slang
@@ -0,0 +1,23 @@
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -target spirv -stage vertex -entry main -allow-glsl
+#version 310 es
+layout(location = 0) in highp vec4 a_position;
+layout(location = 1) in highp vec4 a_coords;
+layout(location = 0) out mediump vec3 v_color;
+
+
+// CHECK: error 31216
+layout(std140, not_a_set = 0, binding = 0) uniform buff0 {
+ mediump int ui_zero;
+};
+
+void main()
+{
+ gl_Position = a_position;
+ mediump vec4 coords = a_coords;
+ mediump vec4 res = coords;
+ mediump int i = 0;
+ for (;;) { res = res.yzwx + vec4(1.0); if (i == 1) break; i++; }
+ res -= vec4(2);
+ v_color = res.rgb;
+}
+