1#!amber 2# Copyright 2020 Google LLC 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# http://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++; 28 ssbo_array[0].data++; 29 ssbo_array[0].data++; 30 31 ssbo_array[1].data++; 32 ssbo_array[1].data++; 33} 34END 35 36BUFFER buf0 DATA_TYPE int32 DATA 370 38END 39 40BUFFER buf1 DATA_TYPE int32 DATA 410 42END 43 44PIPELINE compute pipeline 45 ATTACH compute_shader 46 47 BIND BUFFER_ARRAY buf0 buf1 AS storage DESCRIPTOR_SET 0 BINDING 0 48END 49 50RUN pipeline 1 1 1 51 52EXPECT buf0 IDX 0 EQ 3 53EXPECT buf1 IDX 0 EQ 2 54