• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!amber
2# Copyright 2020 The Amber Authors.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     https://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16SHADER compute compute_shader GLSL
17#version 450
18layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
19
20layout(binding = 0) buffer block0
21{
22    int data;
23} ssbo_array[2];
24
25void main()
26{
27    ssbo_array[0].data = 1;
28    ssbo_array[1].data = 2;
29}
30END
31
32BUFFER buf0 DATA_TYPE int32 DATA
330
34END
35
36BUFFER buf1 DATA_TYPE int32 DATA
370
38END
39
40PIPELINE compute pipeline
41  ATTACH compute_shader
42
43  BIND BUFFER_ARRAY buf0 buf1 AS storage DESCRIPTOR_SET 0 BINDING 0
44END
45
46RUN pipeline 1 1 1
47
48EXPECT buf0 IDX 0 EQ 1
49EXPECT buf1 IDX 0 EQ 2
50