diff options
author | Bill Hollings <bill.hollings@brenwill.com> | 2021-08-12 16:08:35 +0300 |
---|---|---|
committer | Bill Hollings <bill.hollings@brenwill.com> | 2021-08-12 16:08:35 +0300 |
commit | 9552ca5473a12d87dfdb3e35327816d8648c7db0 (patch) | |
tree | 3f66e3115459164b58c9d1d67df00421708da2f9 /reference/opt/shaders-msl | |
parent | bab4e5911b1bfa5a86bc80006b7301ae48363844 (diff) |
MSL: Support row-major transpose when storing matrix from constant RHS matrix.
Remove test and exception when storing row-major matrix
from RHS that is not a SPIRExpression.
Add test shaders.
Diffstat (limited to 'reference/opt/shaders-msl')
-rw-r--r-- | reference/opt/shaders-msl/comp/mat3-row-maj-read-write-const.comp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/reference/opt/shaders-msl/comp/mat3-row-maj-read-write-const.comp b/reference/opt/shaders-msl/comp/mat3-row-maj-read-write-const.comp new file mode 100644 index 00000000..47c83afe --- /dev/null +++ b/reference/opt/shaders-msl/comp/mat3-row-maj-read-write-const.comp @@ -0,0 +1,21 @@ +#include <metal_stdlib> +#include <simd/simd.h> + +using namespace metal; + +struct model_t +{ + float3x3 mtx_rm; +}; + +constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u); + +kernel void main0(device model_t& model [[buffer(0)]]) +{ + float _38 = (transpose(model.mtx_rm) * float3x3(float3(4.0, -3.0, 1.0), float3(-7.0, 7.0, -7.0), float3(-5.0, 6.0, -8.0)))[0].x; + if ((isunordered(_38, 0.0) || _38 != 0.0)) + { + model.mtx_rm = transpose(float3x3(float3(-5.0, -3.0, -5.0), float3(-2.0, 2.0, -5.0), float3(6.0, 3.0, -8.0))); + } +} + |