summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/inverse.comp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/inverse.comp')
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/inverse.comp15
1 files changed, 10 insertions, 5 deletions
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/inverse.comp b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/inverse.comp
index a4ef60c4273..33aed468f73 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/inverse.comp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/comp/inverse.comp
@@ -22,20 +22,23 @@ struct MatrixIn
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
// Returns the determinant of a 2x2 matrix.
-inline float spvDet2x2(float a1, float a2, float b1, float b2)
+static inline __attribute__((always_inline))
+float spvDet2x2(float a1, float a2, float b1, float b2)
{
return a1 * b2 - b1 * a2;
}
// Returns the determinant of a 3x3 matrix.
-inline float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
+static inline __attribute__((always_inline))
+float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
{
return a1 * spvDet2x2(b2, b3, c2, c3) - b1 * spvDet2x2(a2, a3, c2, c3) + c1 * spvDet2x2(a2, a3, b2, b3);
}
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
// adjoint and dividing by the determinant. The contents of the matrix are changed.
-inline float4x4 spvInverse4x4(float4x4 m)
+static inline __attribute__((always_inline))
+float4x4 spvInverse4x4(float4x4 m)
{
float4x4 adj; // The adjoint matrix (inverse after dividing by determinant)
@@ -70,7 +73,8 @@ inline float4x4 spvInverse4x4(float4x4 m)
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
// adjoint and dividing by the determinant. The contents of the matrix are changed.
-inline float3x3 spvInverse3x3(float3x3 m)
+static inline __attribute__((always_inline))
+float3x3 spvInverse3x3(float3x3 m)
{
float3x3 adj; // The adjoint matrix (inverse after dividing by determinant)
@@ -97,7 +101,8 @@ inline float3x3 spvInverse3x3(float3x3 m)
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
// adjoint and dividing by the determinant. The contents of the matrix are changed.
-inline float2x2 spvInverse2x2(float2x2 m)
+static inline __attribute__((always_inline))
+float2x2 spvInverse2x2(float2x2 m)
{
float2x2 adj; // The adjoint matrix (inverse after dividing by determinant)