1# Copyright 2019 The Amber Authors. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15[compute shader] 16#version 430 17 18layout(set = 0, binding = 0) buffer block0 { 19 mat4x3 transform0; 20}; 21 22layout(push_constant) uniform block1 { 23 mat4x3 transform1; 24}; 25 26layout(set = 0, binding = 2) buffer block3 { 27 vec4 test0; 28 vec4 test1; 29}; 30 31void main() { 32 test0 = vec4(transform0 * test0, 0); 33 test1 = vec4(transform1 * test1, 0); 34} 35 36[test] 37 38# Fill mat4x3 using float 39# MatrixStride == 16 40ssbo 0:0 subdata float 0 1.0 0.0 0.0 0.0 \ 41 0.0 1.0 0.0 0.0 \ 42 0.0 0.0 1.0 0.0 \ 43 0.0 0.0 1.0 44# MatrixStride == 16 45uniform float 0 1.0 0.0 0.0 0.0 \ 46 0.0 1.0 0.0 0.0 \ 47 0.0 0.0 1.0 0.0 \ 48 0.0 0.0 1.0 49 50ssbo 0:2 subdata vec4 0 7.3 9.4 -5.8 -0.2 51ssbo 0:2 subdata vec4 16 4.5 6.1 -3.8 -0.7 52 53compute 1 1 1 54 55tolerance 0.1% 56 57probe ssbo vec4 0:2 0 ~= 7.3 9.4 -6.0 0 58probe ssbo vec4 0:2 16 ~= 4.5 6.1 -4.5 0 59