blob: 3732ac68d4e410e3ff4ad6c4d51b884562360798 [file] [log] [blame]
#!amber
# Copyright 2021 Google LLC.
# Copyright 2021 The Khronos Group Inc.
#
# 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
#
# http://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.
# Matrix 4x4 inverse precision test 64bit
DEVICE_FEATURE shaderFloat64
SHADER compute compute_shader GLSL
#version 450
const int NUMMATRICES = 10;
layout(set = 0, binding = 0) buffer block0
{
dmat4 matIns[NUMMATRICES];
};
layout(set = 0, binding = 1) buffer block1
{
dmat4 invOutM[NUMMATRICES];
};
void main()
{
for (int ndx = 0; ndx < NUMMATRICES; ndx++)
{
dmat4 matIn = matIns[ndx];
invOutM[ndx] = inverse(matIn);
}
}
END
BUFFER bufIn DATA_TYPE mat4x4<double> DATA
-1.0 1.0 4.0 2.0
2.0 -1.0 2.0 5.0
1.0 2.0 3.0 4.0
3.0 4.0 -1.0 2.0
1.0 0.0 0.0 0.0
0.0 0.0 1.0 0.0
0.0 1.0 0.0 0.0
0.0 0.0 0.0 1.0
-0.0883788988 0.156982005 0.00129985996 0.245116994
0.0380859002 0.712401986 -0.00320053007 0.911132991
0.0759887993 0.097778298 -1.06054997 1.90429997
-0.496825993 1.59570003 0.0130997002 -2.69531012
42.0 0.300049007 -0.0480041988 -270.0
15.0 4.80077982 -4.89843988 -41.0
-0.180053994 -0.700195014 -0.0229950007 0.370117009
-0.000500202004 -0.00279998989 -0.799804986 -0.290039003
500.0 -3.5999999 -15.0 37.0
2.9000001 -0.469999999 3.20000005 4.69999981
0.100000001 0.0439999998 0.00499999989 -0.0280000009
-48.0 19.0 -1.10000002 0.0379999988
-17.0 -1100.0 -100.0 -0.0180054009
6.0 43.0 -3.09961009 20.0
-2.30078006 0.00270081009 -0.000500202004 -1.90039003
0.360107005 0.310059011 -0.00479889009 0.026992799
19.623375 16.39533 23.824263 16.653233
-28.074343 -23.819447 24.132942 52.970188
-19.421518 -22.75626 -17.654331 -18.975327
16.584002 19.627544 18.86456 20.070559
-0.00622151 -0.006746047 -0.002207905 -0.02056567
-0.030076593 -0.0267689 0.01095024 -0.09132
-0.01297636 0.04533594 -0.01379582 -0.01475323
-0.004602736 -0.01200175 0.01090538 0.02836178
-0.0119948 -0.03789127 -0.00611719 0.0448515
0.04644695 -0.02320256 -0.03514489 -1.3571429
-0.03181969 0.008329804 0.13061533 0.287190083
-0.0098646 -0.587016575 0.040482634 -0.66131907
-49.9153838 -21.0593973 -46.518005 59.6618775
-32.0837048 -15.4093261 22.1520919 32.4487472
-18.0335364 19.6343962 40.2818031 -16.6847517
30.3650256 430.773516 335.057641 84.5618449
END
BUFFER bufOut DATA_TYPE mat4x4<double> SIZE 10 FILL 0.0
PIPELINE compute pipeline
ATTACH compute_shader
BIND BUFFER bufIn AS storage DESCRIPTOR_SET 0 BINDING 0
BIND BUFFER bufOut AS storage DESCRIPTOR_SET 0 BINDING 1
END
RUN pipeline 1 1 1
# Decimals between 2 and 4: 4.440892099e-16
EXPECT bufOut IDX 0 TOLERANCE 0.00000000000000710542735760100186 EQ 2.15384615384615 1.15384615384615 -3.19230769230769 1.34615384615385 -0.384615384615385 -0.384615384615385 0.730769230769231 -0.115384615384615 1.69230769230769 0.692307692307692 -2.11538461538462 0.807692307692308 -1.61538461538462 -0.615384615384615 2.26923076923077 -0.884615384615385
# Decimals between 0.5 and 1.0: 0.0000000000000002220446
EXPECT bufOut IDX 128 TOLERANCE 0.0000000000000002220446 EQ 1.0 0.0 -0.0 0.0 -0.0 -0.0 1.0 -0.0 -0.0 1.0 -0.0 0.0 0.0 -0.0 0.0 1.0
# Decimals between 8 and 16: 1.776356839e-15
EXPECT bufOut IDX 256 TOLERANCE 0.000000007450580596923828125 EQ -9.75322042297396 2.37362669506961 -0.0203394530868922 -0.0989581486481695 -1.0131389710321 1.04449191609472 -0.0011809602441171 0.260112762891842 1.37084022691543 0.596282636661557 -0.947263307771321 -0.34302712111187 1.20466476455649 0.183736729275728 -0.0015538674496792 -0.200446926096048
# Decimals between 1 and 2: 2.220446049e-16
EXPECT bufOut IDX 384 TOLERANCE 0.00000000000181898940354585647583 EQ -0.0168082262776781 0.123847447583787 0.845064654490972 -0.781796418016029 0.000907236655202418 -0.0214464697685848 -1.57553538794179 0.176593208909395 0.00229837480280809 -0.0069804435848272 -0.0420508721648504 -1.20648171174332 -0.00631771711054083 0.0192425662857938 0.129711097327777 -0.121202025006464
# Decimals between 16 and 32: 3.5527136788005e-15
EXPECT bufOut IDX 512 TOLERANCE 0.0000000004656612873077392578125 EQ 0.00122987857225808 0.00145957456303611 1.86470139545162 -0.00404912096004867 0.00249933594563608 0.0158962240900459 6.02465865825882 0.0395465186691528 -0.0102730364056489 0.213239063972644 22.1535058435922 -0.0479744643638987 0.00648548045816656 0.068270948196751 -15.6313334993716 0.0391165129190096
# Decimals between 4 and 8: 8.88178419700125e-16
EXPECT bufOut IDX 640 TOLERANCE 0.00000000000011368683772161602974 EQ 0.000238085731463758 -0.0114304516192027 -0.0857740260025005 2.4306191945853 -0.000347720953516649 0.0103370417145577 0.11670327707534 0.55698740526991 -0.00621549239111256 -0.111766781742911 -1.26907850541629 -6.53953732454563 -0.000287105815868867 0.013882823578604 -0.421862264930753 -2.94020947346056
# Decimals between 1 and 2: 2.22044604925031e-16
EXPECT bufOut IDX 768 TOLERANCE 0.00000011920928955078125 EQ 0.22197487066158 0.0627796669270416 -1.12460329782432 -1.41310290500685 -0.199278624919562 -0.0578498036488017 0.7983216215877 1.07278337806842 -0.0342149904508372 -0.0442669501414111 0.796169929879291 0.897942286097494 0.0436245457899835 0.0463060337079045 -0.599787221967382 -0.67564075745427
# Decimals between 128 and 256: 2.8421709430404e-14
EXPECT bufOut IDX 896 TOLERANCE 0.0000152587890625 EQ -97.8582306683738 7.50313409032798 -26.117002447926 -60.3856322136104 -82.695723129405 12.7396454583607 14.2170727020725 -11.5493732825903 -212.810493696114 47.1129797451719 -5.26643151068638 -5.35685515626948 30.9525814487582 -11.5067517547609 3.8027416400152 22.6313978536399
# Decimals between 64 and 128: 1.4210854715202e-14
EXPECT bufOut IDX 1024 TOLERANCE 0.000030517578125 EQ -97.2800533563974 -8.23035776027672 -8.77895032397699 6.48006076837222 3.74299952199471 1.33217195402097 1.1478907969006 -1.98150298411366 -17.4712271583937 0.21160530699481 6.51915413939454 1.21189159726794 -2.9408727618766 -1.04677382190551 -0.488897983374369 0.224267616554392
# Decimals between 0.015625 and 0.03125: 6.93889390390723e-18
EXPECT bufOut IDX 1152 TOLERANCE 0.0000000004656612873077392578125 EQ -0.0144786923213069 0.00890167299753732 -0.0295976160434387 0.000959640183872229 0.0106194358175128 -0.0196777493008321 0.00855626441807592 0.00174667416324874 -0.0120823932867626 0.0203594452563112 -0.00236542194194121 0.000245421422141454 -0.00102442951500001 0.0163757783054787 -0.0235866074689415 0.00161076438254641