summaryrefslogtreecommitdiffstats
path: root/tests/glsl
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-01-31 03:28:04 +0800
committerGitHub <noreply@github.com>2024-01-30 11:28:04 -0800
commit2d0912bfe2de7799b32e80722fa5c8dc279a339b (patch)
tree152bfe7c054f035090c84fabd7d9d12e9f5fc362 /tests/glsl
parent470c5a28f5b84353f077c2d871db65cddd5f923a (diff)
Correctly apply glsl local size layout to entry points during lowering (#3528)
* Correctly apply glsl local size layout to entry points during lowering * Test for glsl layout correctness
Diffstat (limited to 'tests/glsl')
-rw-r--r--tests/glsl/compute-shader-layout.slang22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/glsl/compute-shader-layout.slang b/tests/glsl/compute-shader-layout.slang
new file mode 100644
index 000000000..b81a87aed
--- /dev/null
+++ b/tests/glsl/compute-shader-layout.slang
@@ -0,0 +1,22 @@
+//TEST:SIMPLE(filecheck=CHECKGLSLANG): -target spirv -stage compute -entry main -allow-glsl
+//TEST:SIMPLE(filecheck=CHECKDIRECT): -target spirv -stage compute -entry main -allow-glsl -emit-spirv-directly
+#version 430
+precision highp float;
+precision highp int;
+
+layout(binding = 0) buffer MyBlockName
+{
+ vec4 data[];
+} output_data;
+
+// CHECKGLSLANG-DAG: [[x:%[^ ]+]] = OpConstant {{%[^ ]+}} 44
+// CHECKGLSLANG-DAG: [[y:%[^ ]+]] = OpConstant {{%[^ ]+}} 45
+// CHECKGLSLANG-DAG: [[z:%[^ ]+]] = OpConstant {{%[^ ]+}} 46
+// CHECKGLSLANG: %gl_WorkGroupSize = OpConstantComposite {{%[^ ]+}} [[x]] [[y]] [[z]]
+
+// CHECKDIRECT: OpExecutionMode %main LocalSize 44 45 46
+layout(local_size_x = 44, local_size_y = 45, local_size_z = 46) in;
+void main()
+{
+ output_data.data[gl_GlobalInvocationID.x] = vec4(gl_GlobalInvocationID, 1);
+}