aboutsummaryrefslogtreecommitdiff
path: root/tests/cases/compute_push_constant_and_ssbo.vkscript
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cases/compute_push_constant_and_ssbo.vkscript')
-rw-r--r--tests/cases/compute_push_constant_and_ssbo.vkscript61
1 files changed, 61 insertions, 0 deletions
diff --git a/tests/cases/compute_push_constant_and_ssbo.vkscript b/tests/cases/compute_push_constant_and_ssbo.vkscript
new file mode 100644
index 0000000..3d75488
--- /dev/null
+++ b/tests/cases/compute_push_constant_and_ssbo.vkscript
@@ -0,0 +1,61 @@
+# Copyright 2019 The Amber Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+[compute shader]
+#version 430
+
+layout(set = 0, binding = 0) buffer block0 {
+ float data_set0_binding0[];
+};
+
+// push_constant compiled as std430 by glslang
+layout(push_constant) uniform block1 {
+ float constant0[3]; // Offset: 0, array stride: 4
+ uint constant1; // 12
+ vec3 constant2[3]; // 16, array stride: 16
+ uint constant3; // 64
+};
+
+void main() {
+ int offset = 0;
+ for (int i = 0; i < 3; ++i)
+ data_set0_binding0[offset++] = constant0[i];
+
+ data_set0_binding0[offset++] = constant1;
+
+ for (int i = 0; i < 3; ++i)
+ for (int j = 0; j < 3; ++j)
+ data_set0_binding0[offset++] = constant2[i][j];
+
+ data_set0_binding0[offset++] = constant3;
+}
+
+[test]
+ssbo 0:0 128
+
+uniform float 0 1 2 3
+uniform uint 12 4
+uniform float 16 5 6 7 0 \
+ 8 9 10 0 \
+ 11 12 13
+uniform uint 64 14
+
+compute 3 1 1
+
+probe ssbo float 0:0 0 ~= 1 2 3
+probe ssbo float 0:0 12 ~= 4
+probe ssbo float 0:0 16 ~= 5 6 7 \
+ 8 9 10 \
+ 11 12 13
+probe ssbo float 0:0 52 ~= 14