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 mat3 test; 20}; 21 22layout(set = 0, binding = 1) uniform block1 { 23 mat3 transform; 24}; 25 26void main() { 27 test = transform * test; 28} 29 30[test] 31# Fill mat3 using float 32# MatrixStride == 16 33ssbo 0:0 subdata float 0 1.0 0.0 0.0 0.0 \ 34 0.0 1.0 0.0 0.0 \ 35 0.0 0.0 1.0 0.0 36# MatrixStride == 16 37uniform ubo 0:1 float 0 1.0 0.0 0.0 0.0 \ 38 0.0 1.0 0.0 0.0 \ 39 0.0 0.0 1.0 0.0 40 41compute 1 1 1 42 43tolerance 0.1% 44 45probe ssbo float 0:0 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