mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-18 04:53:06 +01:00
Updated spirv-cross.
This commit is contained in:
@@ -13,7 +13,7 @@ struct u0_counters
|
||||
};
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ struct u0_counters
|
||||
};
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ struct cb5_struct
|
||||
};
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ struct cb
|
||||
};
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
@@ -19,17 +19,58 @@ struct main0_in
|
||||
int index [[user(locn0)]];
|
||||
};
|
||||
|
||||
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromStack1(thread T (&dst)[N], thread const T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromConstant1(thread T (&dst)[N], constant T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]])
|
||||
@@ -61,7 +102,7 @@ fragment main0_out main0(main0_in in [[stage_in]])
|
||||
}
|
||||
int _37 = in.index & 3;
|
||||
out.FragColor += foobar[_37].z;
|
||||
spvArrayCopyFromConstant1(baz, _90);
|
||||
spvArrayCopyFromConstantToStack1(baz, _90);
|
||||
out.FragColor += baz[_37].z;
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ struct main0_out
|
||||
|
||||
// Implementation of the GLSL mod() function, which is slightly different than Metal fmod()
|
||||
template<typename Tx, typename Ty>
|
||||
Tx mod(Tx x, Ty y)
|
||||
inline Tx mod(Tx x, Ty y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
@@ -33,17 +33,58 @@ struct main0_in
|
||||
float4 gl_Position [[attribute(1)]];
|
||||
};
|
||||
|
||||
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromStack1(thread T (&dst)[N], thread const T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromConstant1(thread T (&dst)[N], constant T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]])
|
||||
@@ -56,7 +97,7 @@ kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_
|
||||
return;
|
||||
VertexOutput _223[3] = { VertexOutput{ gl_in[0].gl_Position, gl_in[0].VertexOutput_uv }, VertexOutput{ gl_in[1].gl_Position, gl_in[1].VertexOutput_uv }, VertexOutput{ gl_in[2].gl_Position, gl_in[2].VertexOutput_uv } };
|
||||
VertexOutput param[3];
|
||||
spvArrayCopyFromStack1(param, _223);
|
||||
spvArrayCopyFromStackToStack1(param, _223);
|
||||
gl_out[gl_InvocationID].gl_Position = param[gl_InvocationID].pos;
|
||||
gl_out[gl_InvocationID]._entryPointOutput.uv = param[gl_InvocationID].uv;
|
||||
threadgroup_barrier(mem_flags::mem_device);
|
||||
|
||||
@@ -29,24 +29,65 @@ constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(2u, 1u, 1u);
|
||||
|
||||
constant Data _25[2] = { Data{ 1.0, 2.0 }, Data{ 3.0, 4.0 } };
|
||||
|
||||
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromStack1(thread T (&dst)[N], thread const T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromConstant1(thread T (&dst)[N], constant T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
kernel void main0(device SSBO& _53 [[buffer(0)]], uint3 gl_WorkGroupID [[threadgroup_position_in_grid]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]])
|
||||
{
|
||||
Data _31[2] = { Data{ X, 2.0 }, Data{ 3.0, 5.0 } };
|
||||
Data data2[2];
|
||||
spvArrayCopyFromStack1(data2, _31);
|
||||
spvArrayCopyFromStackToStack1(data2, _31);
|
||||
_53.outdata[gl_WorkGroupID.x].a = _25[gl_LocalInvocationID.x].a + data2[gl_LocalInvocationID.x].a;
|
||||
_53.outdata[gl_WorkGroupID.x].b = _25[gl_LocalInvocationID.x].b + data2[gl_LocalInvocationID.x].b;
|
||||
}
|
||||
|
||||
@@ -15,24 +15,65 @@ struct SSBO1
|
||||
float4 bs[1];
|
||||
};
|
||||
|
||||
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromStack1(thread T (&dst)[N], thread const T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromConstant1(thread T (&dst)[N], constant T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
kernel void main0(device SSBO0& _16 [[buffer(0)]], device SSBO1& _32 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]])
|
||||
{
|
||||
float4 _37[2] = { _16.as[gl_GlobalInvocationID.x], _32.bs[gl_GlobalInvocationID.x] };
|
||||
float4 values[2];
|
||||
spvArrayCopyFromStack1(values, _37);
|
||||
spvArrayCopyFromStackToStack1(values, _37);
|
||||
_16.as[0] = values[gl_LocalInvocationIndex];
|
||||
_32.bs[1] = float4(40.0);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ struct myBlock
|
||||
|
||||
// Implementation of the GLSL mod() function, which is slightly different than Metal fmod()
|
||||
template<typename Tx, typename Ty>
|
||||
Tx mod(Tx x, Ty y)
|
||||
inline Tx mod(Tx x, Ty y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ struct myBlock
|
||||
|
||||
// Implementation of the GLSL mod() function, which is slightly different than Metal fmod()
|
||||
template<typename Tx, typename Ty>
|
||||
Tx mod(Tx x, Ty y)
|
||||
inline Tx mod(Tx x, Ty y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ inline float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b
|
||||
|
||||
// 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.
|
||||
float4x4 spvInverse4x4(float4x4 m)
|
||||
inline float4x4 spvInverse4x4(float4x4 m)
|
||||
{
|
||||
float4x4 adj; // The adjoint matrix (inverse after dividing by determinant)
|
||||
|
||||
@@ -68,7 +68,7 @@ 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.
|
||||
float3x3 spvInverse3x3(float3x3 m)
|
||||
inline float3x3 spvInverse3x3(float3x3 m)
|
||||
{
|
||||
float3x3 adj; // The adjoint matrix (inverse after dividing by determinant)
|
||||
|
||||
@@ -95,7 +95,7 @@ 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.
|
||||
float2x2 spvInverse2x2(float2x2 m)
|
||||
inline float2x2 spvInverse2x2(float2x2 m)
|
||||
{
|
||||
float2x2 adj; // The adjoint matrix (inverse after dividing by determinant)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ struct myBlock
|
||||
|
||||
// Implementation of the GLSL mod() function, which is slightly different than Metal fmod()
|
||||
template<typename Tx, typename Ty>
|
||||
Tx mod(Tx x, Ty y)
|
||||
inline Tx mod(Tx x, Ty y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ struct myBlock
|
||||
|
||||
// Implementation of the GLSL mod() function, which is slightly different than Metal fmod()
|
||||
template<typename Tx, typename Ty>
|
||||
Tx mod(Tx x, Ty y)
|
||||
inline Tx mod(Tx x, Ty y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ struct SSBO2
|
||||
|
||||
// Implementation of the GLSL mod() function, which is slightly different than Metal fmod()
|
||||
template<typename Tx, typename Ty>
|
||||
Tx mod(Tx x, Ty y)
|
||||
inline Tx mod(Tx x, Ty y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ struct myBlock
|
||||
|
||||
// Implementation of the GLSL mod() function, which is slightly different than Metal fmod()
|
||||
template<typename Tx, typename Ty>
|
||||
Tx mod(Tx x, Ty y)
|
||||
inline Tx mod(Tx x, Ty y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ struct main0_out
|
||||
vertex main0_out main0(uint gl_BaseVertex [[base_vertex]], uint gl_BaseInstance [[base_instance]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.gl_Position = float4(float(gl_BaseVertex), float(gl_BaseInstance), 0.0, 1.0);
|
||||
out.gl_Position = float4(float(int(gl_BaseVertex)), float(int(gl_BaseInstance)), 0.0, 1.0);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ struct main0_out
|
||||
};
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
@@ -19,17 +19,58 @@ struct main0_in
|
||||
int index [[user(locn0)]];
|
||||
};
|
||||
|
||||
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromStack1(thread T (&dst)[N], thread const T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromConstant1(thread T (&dst)[N], constant T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]])
|
||||
|
||||
@@ -21,7 +21,7 @@ struct main0_in
|
||||
|
||||
// Implementation of the GLSL mod() function, which is slightly different than Metal fmod()
|
||||
template<typename Tx, typename Ty>
|
||||
Tx mod(Tx x, Ty y)
|
||||
inline Tx mod(Tx x, Ty y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
@@ -31,28 +31,28 @@ struct main0_in
|
||||
|
||||
// Implementation of the GLSL radians() function
|
||||
template<typename T>
|
||||
T radians(T d)
|
||||
inline T radians(T d)
|
||||
{
|
||||
return d * T(0.01745329251);
|
||||
}
|
||||
|
||||
// Implementation of the GLSL degrees() function
|
||||
template<typename T>
|
||||
T degrees(T r)
|
||||
inline T degrees(T r)
|
||||
{
|
||||
return r * T(57.2957795131);
|
||||
}
|
||||
|
||||
// Implementation of the GLSL findLSB() function
|
||||
template<typename T>
|
||||
T spvFindLSB(T x)
|
||||
inline T spvFindLSB(T x)
|
||||
{
|
||||
return select(ctz(x), T(-1), x == T(0));
|
||||
}
|
||||
|
||||
// Implementation of the signed GLSL findMSB() function
|
||||
template<typename T>
|
||||
T spvFindSMSB(T x)
|
||||
inline T spvFindSMSB(T x)
|
||||
{
|
||||
T v = select(x, T(-1) - x, x < T(0));
|
||||
return select(clz(T(0)) - (clz(v) + T(1)), T(-1), v == T(0));
|
||||
@@ -72,7 +72,7 @@ inline float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b
|
||||
|
||||
// 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.
|
||||
float4x4 spvInverse4x4(float4x4 m)
|
||||
inline float4x4 spvInverse4x4(float4x4 m)
|
||||
{
|
||||
float4x4 adj; // The adjoint matrix (inverse after dividing by determinant)
|
||||
|
||||
|
||||
@@ -15,6 +15,6 @@ struct main0_in
|
||||
|
||||
vertex void main0(main0_in in [[stage_in]], device _10& _12 [[buffer(0)]], uint gl_VertexIndex [[vertex_id]])
|
||||
{
|
||||
_12._m0[gl_VertexIndex] = in.m_19;
|
||||
_12._m0[int(gl_VertexIndex)] = in.m_19;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ vertex main0_out main0(main0_in in [[stage_in]], constant Block& _104 [[buffer(0
|
||||
{
|
||||
main0_out out = {};
|
||||
out.gl_Position = in.a_position;
|
||||
out.v_vtxResult = ((float(abs(float3(_104.var[0][0][0][0], _104.var[0][0][1][0], _104.var[0][0][2][0])[0] - 2.0) < 0.0500000007450580596923828125) * float(abs(float3(_104.var[0][0][0][0], _104.var[0][0][1][0], _104.var[0][0][2][0])[1] - 6.0) < 0.0500000007450580596923828125)) * float(abs(float3(_104.var[0][0][0][0], _104.var[0][0][1][0], _104.var[0][0][2][0])[2] - (-6.0)) < 0.0500000007450580596923828125)) * ((float(abs(float3(_104.var[0][0][0][1], _104.var[0][0][1][1], _104.var[0][0][2][1])[0]) < 0.0500000007450580596923828125) * float(abs(float3(_104.var[0][0][0][1], _104.var[0][0][1][1], _104.var[0][0][2][1])[1] - 5.0) < 0.0500000007450580596923828125)) * float(abs(float3(_104.var[0][0][0][1], _104.var[0][0][1][1], _104.var[0][0][2][1])[2] - 5.0) < 0.0500000007450580596923828125));
|
||||
out.v_vtxResult = ((float(abs(_104.var[0][0][0][0] - 2.0) < 0.0500000007450580596923828125) * float(abs(_104.var[0][0][1][0] - 6.0) < 0.0500000007450580596923828125)) * float(abs(_104.var[0][0][2][0] - (-6.0)) < 0.0500000007450580596923828125)) * ((float(abs(_104.var[0][0][0][1]) < 0.0500000007450580596923828125) * float(abs(_104.var[0][0][1][1] - 5.0) < 0.0500000007450580596923828125)) * float(abs(_104.var[0][0][2][1] - 5.0) < 0.0500000007450580596923828125));
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ struct main0_in
|
||||
|
||||
// Implementation of the GLSL sign() function for integer types
|
||||
template<typename T, typename E = typename enable_if<is_integral<T>::value>::type>
|
||||
T sign(T x)
|
||||
inline T sign(T x)
|
||||
{
|
||||
return select(select(select(x, T(0), x == T(0)), T(1), x > T(0)), T(-1), x < T(0));
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ struct main0_out
|
||||
};
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ struct main0_out
|
||||
vertex main0_out main0(uint gl_VertexIndex [[vertex_id]], uint gl_InstanceIndex [[instance_id]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.gl_Position = float4(1.0, 2.0, 3.0, 4.0) * float(gl_VertexIndex + gl_InstanceIndex);
|
||||
out.gl_Position = float4(1.0, 2.0, 3.0, 4.0) * float(int(gl_VertexIndex) + int(gl_InstanceIndex));
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ void main()
|
||||
{
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
imageStore(outImageTexture, ivec2(gl_GlobalInvocationID.xy), vec4(float(_30 - 1), float(_30), 1.0, 1.0));
|
||||
}
|
||||
|
||||
@@ -11,14 +11,11 @@ void main()
|
||||
if (v0.x == 20.0)
|
||||
{
|
||||
FragColor += vec4(v0[_54 & 3]);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
FragColor += vec4(v0[_54 & 1]);
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ void main()
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,14 +15,11 @@ void main()
|
||||
if ((vA + _57) == 20)
|
||||
{
|
||||
_58 = 50;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
_58 = ((vB + _57) == 40) ? 60 : _60;
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ void main()
|
||||
vec4 _79 = _83;
|
||||
_79.y = _83.y + 0.5;
|
||||
_89 = _79;
|
||||
continue;
|
||||
}
|
||||
fragColor = _82;
|
||||
}
|
||||
|
||||
14
3rdparty/spirv-cross/reference/opt/shaders/frag/post-depth-coverage-es.frag
vendored
Normal file
14
3rdparty/spirv-cross/reference/opt/shaders/frag/post-depth-coverage-es.frag
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
#version 310 es
|
||||
#extension GL_EXT_post_depth_coverage : require
|
||||
#extension GL_OES_sample_variables : require
|
||||
precision mediump float;
|
||||
precision highp int;
|
||||
layout(early_fragment_tests, post_depth_coverage) in;
|
||||
|
||||
layout(location = 0) out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = vec4(float(gl_SampleMaskIn[0]));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#version 450
|
||||
#if defined(GL_ARB_post_depth_coverge)
|
||||
#extension GL_ARB_post_depth_coverage : require
|
||||
#else
|
||||
#extension GL_EXT_post_depth_coverage : require
|
||||
#endif
|
||||
layout(early_fragment_tests, post_depth_coverage) in;
|
||||
|
||||
layout(location = 0) out vec4 FragColor;
|
||||
|
||||
105
3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/comp/bitfield-signed-operations.asm.comp
vendored
Normal file
105
3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/comp/bitfield-signed-operations.asm.comp
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
RWByteAddressBuffer _3 : register(u0);
|
||||
|
||||
uint SPIRV_Cross_bitfieldInsert(uint Base, uint Insert, uint Offset, uint Count)
|
||||
{
|
||||
uint Mask = Count == 32 ? 0xffffffff : (((1u << Count) - 1) << (Offset & 31));
|
||||
return (Base & ~Mask) | ((Insert << Offset) & Mask);
|
||||
}
|
||||
|
||||
uint2 SPIRV_Cross_bitfieldInsert(uint2 Base, uint2 Insert, uint Offset, uint Count)
|
||||
{
|
||||
uint Mask = Count == 32 ? 0xffffffff : (((1u << Count) - 1) << (Offset & 31));
|
||||
return (Base & ~Mask) | ((Insert << Offset) & Mask);
|
||||
}
|
||||
|
||||
uint3 SPIRV_Cross_bitfieldInsert(uint3 Base, uint3 Insert, uint Offset, uint Count)
|
||||
{
|
||||
uint Mask = Count == 32 ? 0xffffffff : (((1u << Count) - 1) << (Offset & 31));
|
||||
return (Base & ~Mask) | ((Insert << Offset) & Mask);
|
||||
}
|
||||
|
||||
uint4 SPIRV_Cross_bitfieldInsert(uint4 Base, uint4 Insert, uint Offset, uint Count)
|
||||
{
|
||||
uint Mask = Count == 32 ? 0xffffffff : (((1u << Count) - 1) << (Offset & 31));
|
||||
return (Base & ~Mask) | ((Insert << Offset) & Mask);
|
||||
}
|
||||
|
||||
uint SPIRV_Cross_bitfieldUExtract(uint Base, uint Offset, uint Count)
|
||||
{
|
||||
uint Mask = Count == 32 ? 0xffffffff : ((1 << Count) - 1);
|
||||
return (Base >> Offset) & Mask;
|
||||
}
|
||||
|
||||
uint2 SPIRV_Cross_bitfieldUExtract(uint2 Base, uint Offset, uint Count)
|
||||
{
|
||||
uint Mask = Count == 32 ? 0xffffffff : ((1 << Count) - 1);
|
||||
return (Base >> Offset) & Mask;
|
||||
}
|
||||
|
||||
uint3 SPIRV_Cross_bitfieldUExtract(uint3 Base, uint Offset, uint Count)
|
||||
{
|
||||
uint Mask = Count == 32 ? 0xffffffff : ((1 << Count) - 1);
|
||||
return (Base >> Offset) & Mask;
|
||||
}
|
||||
|
||||
uint4 SPIRV_Cross_bitfieldUExtract(uint4 Base, uint Offset, uint Count)
|
||||
{
|
||||
uint Mask = Count == 32 ? 0xffffffff : ((1 << Count) - 1);
|
||||
return (Base >> Offset) & Mask;
|
||||
}
|
||||
|
||||
int SPIRV_Cross_bitfieldSExtract(int Base, int Offset, int Count)
|
||||
{
|
||||
int Mask = Count == 32 ? -1 : ((1 << Count) - 1);
|
||||
int Masked = (Base >> Offset) & Mask;
|
||||
int ExtendShift = (32 - Count) & 31;
|
||||
return (Masked << ExtendShift) >> ExtendShift;
|
||||
}
|
||||
|
||||
int2 SPIRV_Cross_bitfieldSExtract(int2 Base, int Offset, int Count)
|
||||
{
|
||||
int Mask = Count == 32 ? -1 : ((1 << Count) - 1);
|
||||
int2 Masked = (Base >> Offset) & Mask;
|
||||
int ExtendShift = (32 - Count) & 31;
|
||||
return (Masked << ExtendShift) >> ExtendShift;
|
||||
}
|
||||
|
||||
int3 SPIRV_Cross_bitfieldSExtract(int3 Base, int Offset, int Count)
|
||||
{
|
||||
int Mask = Count == 32 ? -1 : ((1 << Count) - 1);
|
||||
int3 Masked = (Base >> Offset) & Mask;
|
||||
int ExtendShift = (32 - Count) & 31;
|
||||
return (Masked << ExtendShift) >> ExtendShift;
|
||||
}
|
||||
|
||||
int4 SPIRV_Cross_bitfieldSExtract(int4 Base, int Offset, int Count)
|
||||
{
|
||||
int Mask = Count == 32 ? -1 : ((1 << Count) - 1);
|
||||
int4 Masked = (Base >> Offset) & Mask;
|
||||
int ExtendShift = (32 - Count) & 31;
|
||||
return (Masked << ExtendShift) >> ExtendShift;
|
||||
}
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
int4 _19 = int4(_3.Load4(0));
|
||||
uint4 _20 = _3.Load4(16);
|
||||
_3.Store4(0, uint4(countbits(_19)));
|
||||
_3.Store4(16, uint4(countbits(_19)));
|
||||
_3.Store4(0, uint4(int4(countbits(_20))));
|
||||
_3.Store4(16, countbits(_20));
|
||||
_3.Store4(0, uint4(reversebits(_19)));
|
||||
_3.Store4(16, reversebits(_20));
|
||||
_3.Store4(0, uint4(SPIRV_Cross_bitfieldSExtract(_19, 1, 11u)));
|
||||
_3.Store4(16, SPIRV_Cross_bitfieldSExtract(_20, 11u, 1));
|
||||
_3.Store4(0, uint4(SPIRV_Cross_bitfieldUExtract(_19, 1, 11u)));
|
||||
_3.Store4(16, SPIRV_Cross_bitfieldUExtract(_20, 11u, 1));
|
||||
_3.Store4(0, uint4(int4(SPIRV_Cross_bitfieldInsert(_19, _19.wzyx, 1, 11u))));
|
||||
_3.Store4(16, SPIRV_Cross_bitfieldInsert(_20, _20.wzyx, 11u, 1));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
||||
@@ -90,7 +90,7 @@ void comp_main()
|
||||
u = SPIRV_Cross_bitfieldInsert(u, 60u, 5, 4);
|
||||
u = reversebits(u);
|
||||
s = reversebits(s);
|
||||
int v0 = countbits(u);
|
||||
int v0 = int(countbits(u));
|
||||
int v1 = countbits(s);
|
||||
int v2 = int(firstbithigh(u));
|
||||
int v3 = firstbitlow(s);
|
||||
@@ -100,7 +100,7 @@ void comp_main()
|
||||
u_1 = SPIRV_Cross_bitfieldInsert(u_1, uint3(60u, 60u, 60u), 5, 4);
|
||||
u_1 = reversebits(u_1);
|
||||
s_1 = reversebits(s_1);
|
||||
int3 v0_1 = countbits(u_1);
|
||||
int3 v0_1 = int3(countbits(u_1));
|
||||
int3 v1_1 = countbits(s_1);
|
||||
int3 v2_1 = int3(firstbithigh(u_1));
|
||||
int3 v3_1 = firstbitlow(s_1);
|
||||
|
||||
29
3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/bitfield-signed-operations.asm.comp
vendored
Normal file
29
3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/bitfield-signed-operations.asm.comp
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct SSBO
|
||||
{
|
||||
int4 ints;
|
||||
uint4 uints;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _3 [[buffer(0)]])
|
||||
{
|
||||
int4 _19 = _3.ints;
|
||||
uint4 _20 = _3.uints;
|
||||
_3.ints = popcount(_19);
|
||||
_3.uints = uint4(popcount(_19));
|
||||
_3.ints = int4(popcount(_20));
|
||||
_3.uints = popcount(_20);
|
||||
_3.ints = reverse_bits(_19);
|
||||
_3.uints = reverse_bits(_20);
|
||||
_3.ints = extract_bits(_19, uint(1), 11u);
|
||||
_3.uints = uint4(extract_bits(int4(_20), 11u, uint(1)));
|
||||
_3.ints = int4(extract_bits(uint4(_19), uint(1), 11u));
|
||||
_3.uints = extract_bits(_20, 11u, uint(1));
|
||||
_3.ints = insert_bits(_19, _19.wzyx, uint(1), 11u);
|
||||
_3.uints = insert_bits(_20, _20.wzyx, 11u, uint(1));
|
||||
}
|
||||
|
||||
@@ -13,14 +13,14 @@ struct SSBO
|
||||
|
||||
// Implementation of the GLSL findLSB() function
|
||||
template<typename T>
|
||||
T spvFindLSB(T x)
|
||||
inline T spvFindLSB(T x)
|
||||
{
|
||||
return select(ctz(x), T(-1), x == T(0));
|
||||
}
|
||||
|
||||
// Implementation of the signed GLSL findMSB() function
|
||||
template<typename T>
|
||||
T spvFindSMSB(T x)
|
||||
inline T spvFindSMSB(T x)
|
||||
{
|
||||
T v = select(x, T(-1) - x, x < T(0));
|
||||
return select(clz(T(0)) - (clz(v) + T(1)), T(-1), v == T(0));
|
||||
@@ -28,7 +28,7 @@ T spvFindSMSB(T x)
|
||||
|
||||
// Implementation of the unsigned GLSL findMSB() function
|
||||
template<typename T>
|
||||
T spvFindUMSB(T x)
|
||||
inline T spvFindUMSB(T x)
|
||||
{
|
||||
return select(clz(T(0)) - (clz(x) + T(1)), T(-1), x == T(0));
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ struct SSBO
|
||||
|
||||
// Implementation of the signed GLSL findMSB() function
|
||||
template<typename T>
|
||||
T spvFindSMSB(T x)
|
||||
inline T spvFindSMSB(T x)
|
||||
{
|
||||
T v = select(x, T(-1) - x, x < T(0));
|
||||
return select(clz(T(0)) - (clz(v) + T(1)), T(-1), v == T(0));
|
||||
@@ -21,14 +21,14 @@ T spvFindSMSB(T x)
|
||||
|
||||
// Implementation of the unsigned GLSL findMSB() function
|
||||
template<typename T>
|
||||
T spvFindUMSB(T x)
|
||||
inline T spvFindUMSB(T x)
|
||||
{
|
||||
return select(clz(T(0)) - (clz(x) + T(1)), T(-1), x == T(0));
|
||||
}
|
||||
|
||||
// Implementation of the GLSL sign() function for integer types
|
||||
template<typename T, typename E = typename enable_if<is_integral<T>::value>::type>
|
||||
T sign(T x)
|
||||
inline T sign(T x)
|
||||
{
|
||||
return select(select(select(x, T(0), x == T(0)), T(1), x > T(0)), T(-1), x < T(0));
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ struct SSBORead
|
||||
float b;
|
||||
};
|
||||
|
||||
void copy_out(device float& A, device const float& B)
|
||||
inline void copy_out(device float& A, device const float& B)
|
||||
{
|
||||
A = B;
|
||||
}
|
||||
|
||||
@@ -22,17 +22,17 @@ struct baz
|
||||
int e[128];
|
||||
};
|
||||
|
||||
device int* select_buffer(device foo& buf, device baz& buf2, constant bar& cb)
|
||||
inline device int* select_buffer(device foo& buf, device baz& buf2, constant bar& cb)
|
||||
{
|
||||
return (cb.d != 0) ? &buf.a[0u] : &buf2.e[0u];
|
||||
}
|
||||
|
||||
device int* select_buffer_null(device foo& buf, constant bar& cb)
|
||||
inline device int* select_buffer_null(device foo& buf, constant bar& cb)
|
||||
{
|
||||
return (cb.d != 0) ? &buf.a[0u] : nullptr;
|
||||
}
|
||||
|
||||
threadgroup int* select_tgsm(constant bar& cb, threadgroup int (&tgsm)[128])
|
||||
inline threadgroup int* select_tgsm(constant bar& cb, threadgroup int (&tgsm)[128])
|
||||
{
|
||||
return (cb.d != 0) ? &tgsm[0u] : nullptr;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
using namespace metal;
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,6 @@ struct SSBORow
|
||||
|
||||
kernel void main0(device SSBORow& _4 [[buffer(0)]])
|
||||
{
|
||||
_4.v = float4(_4.row_major0[0][1], _4.row_major0[1][1], _4.row_major0[2][1], _4.row_major0[3][1])[2];
|
||||
_4.v = _4.row_major0[2][1];
|
||||
}
|
||||
|
||||
|
||||
79
3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/array-copy-threadgroup-memory.comp
vendored
Normal file
79
3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/array-copy-threadgroup-memory.comp
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
#pragma clang diagnostic ignored "-Wmissing-prototypes"
|
||||
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(8u, 1u, 1u);
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
kernel void main0(uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]])
|
||||
{
|
||||
threadgroup float shared_group[8][8];
|
||||
threadgroup float shared_group_alt[8][8];
|
||||
float blob[8];
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
blob[i] = float(i);
|
||||
}
|
||||
spvArrayCopyFromStackToThreadGroup1(shared_group[gl_LocalInvocationIndex], blob);
|
||||
threadgroup_barrier(mem_flags::mem_threadgroup);
|
||||
float copied_blob[8];
|
||||
spvArrayCopyFromThreadGroupToStack1(copied_blob, shared_group[gl_LocalInvocationIndex ^ 1u]);
|
||||
spvArrayCopyFromThreadGroupToThreadGroup1(shared_group_alt[gl_LocalInvocationIndex], shared_group[gl_LocalInvocationIndex]);
|
||||
}
|
||||
|
||||
@@ -7,14 +7,14 @@ using namespace metal;
|
||||
|
||||
// Implementation of the GLSL findLSB() function
|
||||
template<typename T>
|
||||
T spvFindLSB(T x)
|
||||
inline T spvFindLSB(T x)
|
||||
{
|
||||
return select(ctz(x), T(-1), x == T(0));
|
||||
}
|
||||
|
||||
// Implementation of the signed GLSL findMSB() function
|
||||
template<typename T>
|
||||
T spvFindSMSB(T x)
|
||||
inline T spvFindSMSB(T x)
|
||||
{
|
||||
T v = select(x, T(-1) - x, x < T(0));
|
||||
return select(clz(T(0)) - (clz(v) + T(1)), T(-1), v == T(0));
|
||||
@@ -22,7 +22,7 @@ T spvFindSMSB(T x)
|
||||
|
||||
// Implementation of the unsigned GLSL findMSB() function
|
||||
template<typename T>
|
||||
T spvFindUMSB(T x)
|
||||
inline T spvFindUMSB(T x)
|
||||
{
|
||||
return select(clz(T(0)) - (clz(x) + T(1)), T(-1), x == T(0));
|
||||
}
|
||||
@@ -31,13 +31,13 @@ kernel void main0()
|
||||
{
|
||||
int signed_value = 0;
|
||||
uint unsigned_value = 0u;
|
||||
int s = extract_bits(signed_value, 5, 20);
|
||||
uint u = extract_bits(unsigned_value, 6, 21);
|
||||
s = insert_bits(s, 40, 5, 4);
|
||||
u = insert_bits(u, 60u, 5, 4);
|
||||
int s = extract_bits(signed_value, uint(5), uint(20));
|
||||
uint u = extract_bits(unsigned_value, uint(6), uint(21));
|
||||
s = insert_bits(s, 40, uint(5), uint(4));
|
||||
u = insert_bits(u, 60u, uint(5), uint(4));
|
||||
u = reverse_bits(u);
|
||||
s = reverse_bits(s);
|
||||
int v0 = popcount(u);
|
||||
int v0 = int(popcount(u));
|
||||
int v1 = popcount(s);
|
||||
int v2 = int(spvFindUMSB(u));
|
||||
int v3 = spvFindSMSB(s);
|
||||
|
||||
@@ -26,28 +26,28 @@ struct ResType
|
||||
|
||||
// Implementation of the GLSL radians() function
|
||||
template<typename T>
|
||||
T radians(T d)
|
||||
inline T radians(T d)
|
||||
{
|
||||
return d * T(0.01745329251);
|
||||
}
|
||||
|
||||
// Implementation of the GLSL degrees() function
|
||||
template<typename T>
|
||||
T degrees(T r)
|
||||
inline T degrees(T r)
|
||||
{
|
||||
return r * T(57.2957795131);
|
||||
}
|
||||
|
||||
// Implementation of the GLSL findLSB() function
|
||||
template<typename T>
|
||||
T spvFindLSB(T x)
|
||||
inline T spvFindLSB(T x)
|
||||
{
|
||||
return select(ctz(x), T(-1), x == T(0));
|
||||
}
|
||||
|
||||
// Implementation of the signed GLSL findMSB() function
|
||||
template<typename T>
|
||||
T spvFindSMSB(T x)
|
||||
inline T spvFindSMSB(T x)
|
||||
{
|
||||
T v = select(x, T(-1) - x, x < T(0));
|
||||
return select(clz(T(0)) - (clz(v) + T(1)), T(-1), v == T(0));
|
||||
@@ -55,14 +55,14 @@ T spvFindSMSB(T x)
|
||||
|
||||
// Implementation of the unsigned GLSL findMSB() function
|
||||
template<typename T>
|
||||
T spvFindUMSB(T x)
|
||||
inline T spvFindUMSB(T x)
|
||||
{
|
||||
return select(clz(T(0)) - (clz(x) + T(1)), T(-1), x == T(0));
|
||||
}
|
||||
|
||||
// Implementation of the GLSL sign() function for integer types
|
||||
template<typename T, typename E = typename enable_if<is_integral<T>::value>::type>
|
||||
T sign(T x)
|
||||
inline T sign(T x)
|
||||
{
|
||||
return select(select(select(x, T(0), x == T(0)), T(1), x > T(0)), T(-1), x < T(0));
|
||||
}
|
||||
@@ -81,7 +81,7 @@ inline float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b
|
||||
|
||||
// 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.
|
||||
float4x4 spvInverse4x4(float4x4 m)
|
||||
inline float4x4 spvInverse4x4(float4x4 m)
|
||||
{
|
||||
float4x4 adj; // The adjoint matrix (inverse after dividing by determinant)
|
||||
|
||||
@@ -116,7 +116,7 @@ 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.
|
||||
float3x3 spvInverse3x3(float3x3 m)
|
||||
inline float3x3 spvInverse3x3(float3x3 m)
|
||||
{
|
||||
float3x3 adj; // The adjoint matrix (inverse after dividing by determinant)
|
||||
|
||||
@@ -143,7 +143,7 @@ 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.
|
||||
float2x2 spvInverse2x2(float2x2 m)
|
||||
inline float2x2 spvInverse2x2(float2x2 m)
|
||||
{
|
||||
float2x2 adj; // The adjoint matrix (inverse after dividing by determinant)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
using namespace metal;
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
using namespace metal;
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
@@ -131,7 +131,7 @@ inline vec<T, 4> spvGatherCompareSwizzle(sampler s, const thread Tex& t, Ts... p
|
||||
return t.gather_compare(s, spvForward<Ts>(params)...);
|
||||
}
|
||||
|
||||
float4 doSwizzle(thread texture1d<float> tex1d, thread const sampler tex1dSmplr, constant uint& tex1dSwzl, thread texture2d<float> tex2d, thread const sampler tex2dSmplr, constant uint& tex2dSwzl, thread texture3d<float> tex3d, thread const sampler tex3dSmplr, constant uint& tex3dSwzl, thread texturecube<float> texCube, thread const sampler texCubeSmplr, constant uint& texCubeSwzl, thread texture2d_array<float> tex2dArray, thread const sampler tex2dArraySmplr, constant uint& tex2dArraySwzl, thread texturecube_array<float> texCubeArray, thread const sampler texCubeArraySmplr, constant uint& texCubeArraySwzl, thread depth2d<float> depth2d, thread const sampler depth2dSmplr, constant uint& depth2dSwzl, thread depthcube<float> depthCube, thread const sampler depthCubeSmplr, constant uint& depthCubeSwzl, thread depth2d_array<float> depth2dArray, thread const sampler depth2dArraySmplr, constant uint& depth2dArraySwzl, thread depthcube_array<float> depthCubeArray, thread const sampler depthCubeArraySmplr, constant uint& depthCubeArraySwzl, thread texture2d<float> texBuffer)
|
||||
inline float4 doSwizzle(thread texture1d<float> tex1d, thread const sampler tex1dSmplr, constant uint& tex1dSwzl, thread texture2d<float> tex2d, thread const sampler tex2dSmplr, constant uint& tex2dSwzl, thread texture3d<float> tex3d, thread const sampler tex3dSmplr, constant uint& tex3dSwzl, thread texturecube<float> texCube, thread const sampler texCubeSmplr, constant uint& texCubeSwzl, thread texture2d_array<float> tex2dArray, thread const sampler tex2dArraySmplr, constant uint& tex2dArraySwzl, thread texturecube_array<float> texCubeArray, thread const sampler texCubeArraySmplr, constant uint& texCubeArraySwzl, thread depth2d<float> depth2d, thread const sampler depth2dSmplr, constant uint& depth2dSwzl, thread depthcube<float> depthCube, thread const sampler depthCubeSmplr, constant uint& depthCubeSwzl, thread depth2d_array<float> depth2dArray, thread const sampler depth2dArraySmplr, constant uint& depth2dArraySwzl, thread depthcube_array<float> depthCubeArray, thread const sampler depthCubeArraySmplr, constant uint& depthCubeArraySwzl, thread texture2d<float> texBuffer)
|
||||
{
|
||||
float4 c = spvTextureSwizzle(tex1d.sample(tex1dSmplr, 0.0), tex1dSwzl);
|
||||
c = spvTextureSwizzle(tex2d.sample(tex2dSmplr, float2(0.0)), tex2dSwzl);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
using namespace metal;
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
using namespace metal;
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
@@ -17,46 +17,46 @@ struct SSBORow
|
||||
float2x2 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float2x2 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float2x2 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
v_41.row_major0[1][1] = v_29.col_major0[1].y;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,52 +17,52 @@ struct SSBORow
|
||||
float2x4 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float2x2 loaded = float2x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy);
|
||||
v_29.col_major1[0].xy = loaded[0];
|
||||
v_29.col_major1[1].xy = loaded[1];
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float2x2 loaded = transpose(float2x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy));
|
||||
v_41.row_major0[0].xy = float2(loaded[0][0], loaded[1][0]);
|
||||
v_41.row_major0[1].xy = float2(loaded[0][1], loaded[1][1]);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0[0].xy = float2x2(v_29.col_major1[0].xy, v_29.col_major1[1].xy)[0];
|
||||
v_29.col_major0[1].xy = float2x2(v_29.col_major1[0].xy, v_29.col_major1[1].xy)[1];
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0[0].xy = float2(float2x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy)[0][0], float2x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy)[1][0]);
|
||||
v_41.row_major0[1].xy = float2(float2x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy)[0][1], float2x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy)[1][1]);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].xy = float2(float2x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy)[0][0], float2x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy)[1][0]);
|
||||
v_29.col_major0[1].xy = float2(float2x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy)[0][1], float2x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy)[1][1]);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0[0].xy = float2x2(v_41.row_major1[0].xy, v_41.row_major1[1].xy)[0];
|
||||
v_41.row_major0[1].xy = float2x2(v_41.row_major1[0].xy, v_41.row_major1[1].xy)[1];
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1].xy = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
v_41.row_major0[1][1] = v_29.col_major0[1].y;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,46 +17,46 @@ struct SSBORow
|
||||
float2x2 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float2x2 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float2x2 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
v_41.row_major0[1][1] = v_29.col_major0[1].y;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -19,42 +19,42 @@ struct SSBORow
|
||||
float3x2 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float2x3 loaded = float2x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]));
|
||||
v_29.col_major1[0] = loaded[0];
|
||||
v_29.col_major1[1] = loaded[1];
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float2x3 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0[0] = float2x3(float3(v_29.col_major1[0]), float3(v_29.col_major1[1]))[0];
|
||||
v_29.col_major0[1] = float2x3(float3(v_29.col_major1[0]), float3(v_29.col_major1[1]))[1];
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(float2x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1])));
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0] = float3(v_41.row_major0[0][0], v_41.row_major0[1][0], v_41.row_major0[2][0]);
|
||||
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1][0];
|
||||
@@ -62,7 +62,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[2][1] = v_29.col_major0[1][2];
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0][1u] = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0][1u];
|
||||
|
||||
@@ -17,13 +17,13 @@ struct SSBORow
|
||||
float3x4 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float2x3 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float2x3 loaded = transpose(float3x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy, v_41.row_major0[2].xy));
|
||||
v_41.row_major0[0].xy = float2(loaded[0][0], loaded[1][0]);
|
||||
@@ -31,31 +31,31 @@ void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
v_41.row_major0[2].xy = float2(loaded[0][2], loaded[1][2]);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0[0].xy = float2(v_29.col_major0[0][0], v_29.col_major0[1][0]);
|
||||
v_41.row_major0[1].xy = float2(v_29.col_major0[0][1], v_29.col_major0[1][1]);
|
||||
v_41.row_major0[2].xy = float2(v_29.col_major0[0][2], v_29.col_major0[1][2]);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(float3x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy, v_41.row_major0[2].xy));
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0[0].xy = float3x2(v_41.row_major1[0].xy, v_41.row_major1[1].xy, v_41.row_major1[2].xy)[0];
|
||||
v_41.row_major0[1].xy = float3x2(v_41.row_major1[0].xy, v_41.row_major1[1].xy, v_41.row_major1[2].xy)[1];
|
||||
v_41.row_major0[2].xy = float3x2(v_41.row_major1[0].xy, v_41.row_major1[1].xy, v_41.row_major1[2].xy)[2];
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
@@ -63,7 +63,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[2][1] = v_29.col_major0[1].z;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,39 +17,39 @@ struct SSBORow
|
||||
float3x2 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float2x3 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float2x3 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
@@ -57,7 +57,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[2][1] = v_29.col_major0[1].z;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,39 +17,39 @@ struct SSBORow
|
||||
float4x2 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float2x4 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float2x4 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
@@ -58,7 +58,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[3][1] = v_29.col_major0[1].w;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,13 +17,13 @@ struct SSBORow
|
||||
float4x4 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float2x4 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float2x4 loaded = transpose(float4x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy, v_41.row_major0[2].xy, v_41.row_major0[3].xy));
|
||||
v_41.row_major0[0].xy = float2(loaded[0][0], loaded[1][0]);
|
||||
@@ -32,12 +32,12 @@ void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
v_41.row_major0[3].xy = float2(loaded[0][3], loaded[1][3]);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0[0].xy = float2(v_29.col_major0[0][0], v_29.col_major0[1][0]);
|
||||
v_41.row_major0[1].xy = float2(v_29.col_major0[0][1], v_29.col_major0[1][1]);
|
||||
@@ -45,12 +45,12 @@ void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[3].xy = float2(v_29.col_major0[0][3], v_29.col_major0[1][3]);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(float4x2(v_41.row_major0[0].xy, v_41.row_major0[1].xy, v_41.row_major0[2].xy, v_41.row_major0[3].xy));
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0[0].xy = float4x2(v_41.row_major1[0].xy, v_41.row_major1[1].xy, v_41.row_major1[2].xy, v_41.row_major1[3].xy)[0];
|
||||
v_41.row_major0[1].xy = float4x2(v_41.row_major1[0].xy, v_41.row_major1[1].xy, v_41.row_major1[2].xy, v_41.row_major1[3].xy)[1];
|
||||
@@ -58,7 +58,7 @@ void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
v_41.row_major0[3].xy = float4x2(v_41.row_major1[0].xy, v_41.row_major1[1].xy, v_41.row_major1[2].xy, v_41.row_major1[3].xy)[3];
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
@@ -67,7 +67,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[3][1] = v_29.col_major0[1].w;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,39 +17,39 @@ struct SSBORow
|
||||
float4x2 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float2x4 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float2x4 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
@@ -58,7 +58,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[3][1] = v_29.col_major0[1].w;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -19,49 +19,49 @@ struct SSBORow
|
||||
packed_rm_float3x2 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float3x2 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float3x2 loaded = transpose(float2x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1])));
|
||||
v_41.row_major0[0] = float3(loaded[0][0], loaded[1][0], loaded[2][0]);
|
||||
v_41.row_major0[1] = float3(loaded[0][1], loaded[1][1], loaded[2][1]);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0[0] = float3(v_29.col_major0[0][0], v_29.col_major0[1][0], v_29.col_major0[2][0]);
|
||||
v_41.row_major0[1] = float3(v_29.col_major0[0][1], v_29.col_major0[1][1], v_29.col_major0[2][1]);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(float2x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1])));
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0[0] = float2x3(float3(v_41.row_major1[0]), float3(v_41.row_major1[1]))[0];
|
||||
v_41.row_major0[1] = float2x3(float3(v_41.row_major1[0]), float3(v_41.row_major1[1]))[1];
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
v_41.row_major0[1][1] = v_29.col_major0[1].y;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,7 +17,7 @@ struct SSBORow
|
||||
float2x3 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float3x2 loaded = float3x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy, v_29.col_major0[2].xy);
|
||||
v_29.col_major1[0].xy = loaded[0];
|
||||
@@ -25,44 +25,44 @@ void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
v_29.col_major1[2].xy = loaded[2];
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float3x2 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0[0].xy = float3x2(v_29.col_major1[0].xy, v_29.col_major1[1].xy, v_29.col_major1[2].xy)[0];
|
||||
v_29.col_major0[1].xy = float3x2(v_29.col_major1[0].xy, v_29.col_major1[1].xy, v_29.col_major1[2].xy)[1];
|
||||
v_29.col_major0[2].xy = float3x2(v_29.col_major1[0].xy, v_29.col_major1[1].xy, v_29.col_major1[2].xy)[2];
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(float3x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy, v_29.col_major0[2].xy));
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].xy = float2(v_41.row_major0[0][0], v_41.row_major0[1][0]);
|
||||
v_29.col_major0[1].xy = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
|
||||
v_29.col_major0[2].xy = float2(v_41.row_major0[0][2], v_41.row_major0[1][2]);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1].xy = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
v_41.row_major0[1][1] = v_29.col_major0[1].y;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,46 +17,46 @@ struct SSBORow
|
||||
float2x3 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float3x2 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float3x2 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
v_41.row_major0[1][1] = v_29.col_major0[1].y;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -20,7 +20,7 @@ struct SSBORow
|
||||
packed_rm_float3x3 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float3x3 loaded = float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]));
|
||||
v_29.col_major1[0] = loaded[0];
|
||||
@@ -28,7 +28,7 @@ void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
v_29.col_major1[2] = loaded[2];
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float3x3 loaded = transpose(float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2])));
|
||||
v_41.row_major0[0] = float3(loaded[0][0], loaded[1][0], loaded[2][0]);
|
||||
@@ -36,35 +36,35 @@ void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
v_41.row_major0[2] = float3(loaded[0][2], loaded[1][2], loaded[2][2]);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0[0] = float3x3(float3(v_29.col_major1[0]), float3(v_29.col_major1[1]), float3(v_29.col_major1[2]))[0];
|
||||
v_29.col_major0[1] = float3x3(float3(v_29.col_major1[0]), float3(v_29.col_major1[1]), float3(v_29.col_major1[2]))[1];
|
||||
v_29.col_major0[2] = float3x3(float3(v_29.col_major1[0]), float3(v_29.col_major1[1]), float3(v_29.col_major1[2]))[2];
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0[0] = float3(float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[0][0], float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[1][0], float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[2][0]);
|
||||
v_41.row_major0[1] = float3(float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[0][1], float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[1][1], float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[2][1]);
|
||||
v_41.row_major0[2] = float3(float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[0][2], float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[1][2], float3x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]))[2][2]);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0] = float3(float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[0][0], float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[1][0], float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[2][0]);
|
||||
v_29.col_major0[1] = float3(float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[0][1], float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[1][1], float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[2][1]);
|
||||
v_29.col_major0[2] = float3(float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[0][2], float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[1][2], float3x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]))[2][2]);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0[0] = float3x3(float3(v_41.row_major1[0]), float3(v_41.row_major1[1]), float3(v_41.row_major1[2]))[0];
|
||||
v_41.row_major0[1] = float3x3(float3(v_41.row_major1[0]), float3(v_41.row_major1[1]), float3(v_41.row_major1[2]))[1];
|
||||
v_41.row_major0[2] = float3x3(float3(v_41.row_major1[0]), float3(v_41.row_major1[1]), float3(v_41.row_major1[2]))[2];
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1][0];
|
||||
@@ -72,7 +72,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[2][1] = v_29.col_major0[1][2];
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0][1u] = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0][1u];
|
||||
|
||||
@@ -17,39 +17,39 @@ struct SSBORow
|
||||
float3x3 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float3x3 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float3x3 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
@@ -57,7 +57,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[2][1] = v_29.col_major0[1].z;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,39 +17,39 @@ struct SSBORow
|
||||
float3x3 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float3x3 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float3x3 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
@@ -57,7 +57,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[2][1] = v_29.col_major0[1].z;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -19,13 +19,13 @@ struct SSBORow
|
||||
packed_rm_float3x4 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float3x4 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float3x4 loaded = transpose(float4x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]), float3(v_41.row_major0[3])));
|
||||
v_41.row_major0[0] = float3(loaded[0][0], loaded[1][0], loaded[2][0]);
|
||||
@@ -34,12 +34,12 @@ void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
v_41.row_major0[3] = float3(loaded[0][3], loaded[1][3], loaded[2][3]);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0[0] = float3(v_29.col_major0[0][0], v_29.col_major0[1][0], v_29.col_major0[2][0]);
|
||||
v_41.row_major0[1] = float3(v_29.col_major0[0][1], v_29.col_major0[1][1], v_29.col_major0[2][1]);
|
||||
@@ -47,12 +47,12 @@ void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[3] = float3(v_29.col_major0[0][3], v_29.col_major0[1][3], v_29.col_major0[2][3]);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(float4x3(float3(v_41.row_major0[0]), float3(v_41.row_major0[1]), float3(v_41.row_major0[2]), float3(v_41.row_major0[3])));
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0[0] = float4x3(float3(v_41.row_major1[0]), float3(v_41.row_major1[1]), float3(v_41.row_major1[2]), float3(v_41.row_major1[3]))[0];
|
||||
v_41.row_major0[1] = float4x3(float3(v_41.row_major1[0]), float3(v_41.row_major1[1]), float3(v_41.row_major1[2]), float3(v_41.row_major1[3]))[1];
|
||||
@@ -60,7 +60,7 @@ void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
v_41.row_major0[3] = float4x3(float3(v_41.row_major1[0]), float3(v_41.row_major1[1]), float3(v_41.row_major1[2]), float3(v_41.row_major1[3]))[3];
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
@@ -69,7 +69,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[3][1] = v_29.col_major0[1].w;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,39 +17,39 @@ struct SSBORow
|
||||
float4x3 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float3x4 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float3x4 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
@@ -58,7 +58,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[3][1] = v_29.col_major0[1].w;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,39 +17,39 @@ struct SSBORow
|
||||
float4x3 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float3x4 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float3x4 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
@@ -58,7 +58,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[3][1] = v_29.col_major0[1].w;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,46 +17,46 @@ struct SSBORow
|
||||
float2x4 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float4x2 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float4x2 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
v_41.row_major0[1][1] = v_29.col_major0[1].y;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,7 +17,7 @@ struct SSBORow
|
||||
float2x4 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float4x2 loaded = float4x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy, v_29.col_major0[2].xy, v_29.col_major0[3].xy);
|
||||
v_29.col_major1[0].xy = loaded[0];
|
||||
@@ -26,13 +26,13 @@ void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
v_29.col_major1[3].xy = loaded[3];
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float4x2 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0[0].xy = float4x2(v_29.col_major1[0].xy, v_29.col_major1[1].xy, v_29.col_major1[2].xy, v_29.col_major1[3].xy)[0];
|
||||
v_29.col_major0[1].xy = float4x2(v_29.col_major1[0].xy, v_29.col_major1[1].xy, v_29.col_major1[2].xy, v_29.col_major1[3].xy)[1];
|
||||
@@ -40,12 +40,12 @@ void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
v_29.col_major0[3].xy = float4x2(v_29.col_major1[0].xy, v_29.col_major1[1].xy, v_29.col_major1[2].xy, v_29.col_major1[3].xy)[3];
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(float4x2(v_29.col_major0[0].xy, v_29.col_major0[1].xy, v_29.col_major0[2].xy, v_29.col_major0[3].xy));
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].xy = float2(v_41.row_major0[0][0], v_41.row_major0[1][0]);
|
||||
v_29.col_major0[1].xy = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
|
||||
@@ -53,19 +53,19 @@ void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_29.col_major0[3].xy = float2(v_41.row_major0[0][3], v_41.row_major0[1][3]);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1].xy = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
v_41.row_major0[1][1] = v_29.col_major0[1].y;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,46 +17,46 @@ struct SSBORow
|
||||
float2x4 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float4x2 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float4x2 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float2(v_41.row_major0[0][1], v_41.row_major0[1][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
v_41.row_major0[1][1] = v_29.col_major0[1].y;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -19,7 +19,7 @@ struct SSBORow
|
||||
float3x4 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float4x3 loaded = float4x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]), float3(v_29.col_major0[3]));
|
||||
v_29.col_major1[0] = loaded[0];
|
||||
@@ -28,13 +28,13 @@ void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
v_29.col_major1[3] = loaded[3];
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float4x3 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0[0] = float4x3(float3(v_29.col_major1[0]), float3(v_29.col_major1[1]), float3(v_29.col_major1[2]), float3(v_29.col_major1[3]))[0];
|
||||
v_29.col_major0[1] = float4x3(float3(v_29.col_major1[0]), float3(v_29.col_major1[1]), float3(v_29.col_major1[2]), float3(v_29.col_major1[3]))[1];
|
||||
@@ -42,12 +42,12 @@ void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
v_29.col_major0[3] = float4x3(float3(v_29.col_major1[0]), float3(v_29.col_major1[1]), float3(v_29.col_major1[2]), float3(v_29.col_major1[3]))[3];
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(float4x3(float3(v_29.col_major0[0]), float3(v_29.col_major0[1]), float3(v_29.col_major0[2]), float3(v_29.col_major0[3])));
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0] = float3(v_41.row_major0[0][0], v_41.row_major0[1][0], v_41.row_major0[2][0]);
|
||||
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
|
||||
@@ -55,12 +55,12 @@ void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_29.col_major0[3] = float3(v_41.row_major0[0][3], v_41.row_major0[1][3], v_41.row_major0[2][3]);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1][0];
|
||||
@@ -68,7 +68,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[2][1] = v_29.col_major0[1][2];
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0][1u] = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0][1u];
|
||||
|
||||
@@ -17,39 +17,39 @@ struct SSBORow
|
||||
float3x4 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float4x3 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float4x3 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
@@ -57,7 +57,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[2][1] = v_29.col_major0[1].z;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,39 +17,39 @@ struct SSBORow
|
||||
float3x4 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float4x3 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float4x3 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float3(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
@@ -57,7 +57,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[2][1] = v_29.col_major0[1].z;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,39 +17,39 @@ struct SSBORow
|
||||
float4x4 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float4x4 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float4x4 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
@@ -58,7 +58,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[3][1] = v_29.col_major0[1].w;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,39 +17,39 @@ struct SSBORow
|
||||
float4x4 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float4x4 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float4x4 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
@@ -58,7 +58,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[3][1] = v_29.col_major0[1].w;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -17,39 +17,39 @@ struct SSBORow
|
||||
float4x4 row_major1;
|
||||
};
|
||||
|
||||
void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
inline void load_store_to_variable_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
float4x4 loaded = v_29.col_major0;
|
||||
v_29.col_major1 = loaded;
|
||||
}
|
||||
|
||||
void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
inline void load_store_to_variable_row_major(device SSBORow& v_41)
|
||||
{
|
||||
float4x4 loaded = transpose(v_41.row_major0);
|
||||
v_41.row_major0 = transpose(loaded);
|
||||
}
|
||||
|
||||
void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
inline void copy_col_major_to_col_major(device SSBOCol& v_29)
|
||||
{
|
||||
v_29.col_major0 = v_29.col_major1;
|
||||
}
|
||||
|
||||
void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_col_major_to_row_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = transpose(v_29.col_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_row_major_to_col_major(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0 = transpose(v_41.row_major0);
|
||||
}
|
||||
|
||||
void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
inline void copy_row_major_to_row_major(device SSBORow& v_41)
|
||||
{
|
||||
v_41.row_major0 = v_41.row_major1;
|
||||
}
|
||||
|
||||
void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[1] = float4(v_41.row_major0[0][1], v_41.row_major0[1][1], v_41.row_major0[2][1], v_41.row_major0[3][1]);
|
||||
v_41.row_major0[0][1] = v_29.col_major0[1].x;
|
||||
@@ -58,7 +58,7 @@ void copy_columns(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
v_41.row_major0[3][1] = v_29.col_major0[1].w;
|
||||
}
|
||||
|
||||
void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
inline void copy_elements(device SSBOCol& v_29, device SSBORow& v_41)
|
||||
{
|
||||
v_29.col_major0[0].y = v_41.row_major0[1u][0];
|
||||
v_41.row_major0[1u][0] = v_29.col_major0[0].y;
|
||||
|
||||
@@ -37,12 +37,12 @@ struct main0_out
|
||||
};
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
attr_desc fetch_desc(thread const int& location, constant VertexBuffer& v_227)
|
||||
inline attr_desc fetch_desc(thread const int& location, constant VertexBuffer& v_227)
|
||||
{
|
||||
int attribute_flags = v_227.input_attributes[location].w;
|
||||
attr_desc result;
|
||||
@@ -55,7 +55,7 @@ attr_desc fetch_desc(thread const int& location, constant VertexBuffer& v_227)
|
||||
return result;
|
||||
}
|
||||
|
||||
uint get_bits(thread const uint4& v, thread const int& swap)
|
||||
inline uint get_bits(thread const uint4& v, thread const int& swap)
|
||||
{
|
||||
if (swap != 0)
|
||||
{
|
||||
@@ -64,7 +64,7 @@ uint get_bits(thread const uint4& v, thread const int& swap)
|
||||
return ((v.x | (v.y << uint(8))) | (v.z << uint(16))) | (v.w << uint(24));
|
||||
}
|
||||
|
||||
float4 fetch_attr(thread const attr_desc& desc, thread const int& vertex_id, thread const texture2d<uint> input_stream)
|
||||
inline float4 fetch_attr(thread const attr_desc& desc, thread const int& vertex_id, thread const texture2d<uint> input_stream)
|
||||
{
|
||||
float4 result = float4(0.0, 0.0, 0.0, 1.0);
|
||||
bool reverse_order = false;
|
||||
@@ -132,11 +132,11 @@ float4 fetch_attr(thread const attr_desc& desc, thread const int& vertex_id, thr
|
||||
return _210;
|
||||
}
|
||||
|
||||
float4 read_location(thread const int& location, constant VertexBuffer& v_227, thread uint& gl_VertexIndex, thread texture2d<uint> buff_in_2, thread texture2d<uint> buff_in_1)
|
||||
inline float4 read_location(thread const int& location, constant VertexBuffer& v_227, thread uint& gl_VertexIndex, thread texture2d<uint> buff_in_2, thread texture2d<uint> buff_in_1)
|
||||
{
|
||||
int param = location;
|
||||
attr_desc desc = fetch_desc(param, v_227);
|
||||
int vertex_id = gl_VertexIndex - int(v_227.vertex_base_index);
|
||||
int vertex_id = int(gl_VertexIndex) - int(v_227.vertex_base_index);
|
||||
if (desc.is_volatile != 0)
|
||||
{
|
||||
attr_desc param_1 = desc;
|
||||
@@ -151,7 +151,7 @@ float4 read_location(thread const int& location, constant VertexBuffer& v_227, t
|
||||
}
|
||||
}
|
||||
|
||||
void vs_adjust(thread float4& dst_reg0, thread float4& dst_reg1, thread float4& dst_reg7, constant VertexBuffer& v_227, thread uint& gl_VertexIndex, thread texture2d<uint> buff_in_2, thread texture2d<uint> buff_in_1, constant VertexConstantsBuffer& v_309)
|
||||
inline void vs_adjust(thread float4& dst_reg0, thread float4& dst_reg1, thread float4& dst_reg7, constant VertexBuffer& v_227, thread uint& gl_VertexIndex, thread texture2d<uint> buff_in_2, thread texture2d<uint> buff_in_1, constant VertexConstantsBuffer& v_309)
|
||||
{
|
||||
int param = 3;
|
||||
float4 in_diff_color = read_location(param, v_227, gl_VertexIndex, buff_in_2, buff_in_1);
|
||||
|
||||
@@ -18,29 +18,70 @@ struct main0_in
|
||||
int Index2 [[attribute(1)]];
|
||||
};
|
||||
|
||||
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromStack1(thread T (&dst)[N], thread const T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromConstant1(thread T (&dst)[N], constant T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
float4 consume_constant_arrays2(thread const float4 (&positions)[4], thread const float4 (&positions2)[4], thread int& Index1, thread int& Index2)
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
inline float4 consume_constant_arrays2(thread const float4 (&positions)[4], thread const float4 (&positions2)[4], thread int& Index1, thread int& Index2)
|
||||
{
|
||||
float4 indexable[4];
|
||||
spvArrayCopyFromStack1(indexable, positions);
|
||||
spvArrayCopyFromStackToStack1(indexable, positions);
|
||||
float4 indexable_1[4];
|
||||
spvArrayCopyFromStack1(indexable_1, positions2);
|
||||
spvArrayCopyFromStackToStack1(indexable_1, positions2);
|
||||
return indexable[Index1] + indexable_1[Index2];
|
||||
}
|
||||
|
||||
float4 consume_constant_arrays(thread const float4 (&positions)[4], thread const float4 (&positions2)[4], thread int& Index1, thread int& Index2)
|
||||
inline float4 consume_constant_arrays(thread const float4 (&positions)[4], thread const float4 (&positions2)[4], thread int& Index1, thread int& Index2)
|
||||
{
|
||||
return consume_constant_arrays2(positions, positions2, Index1, Index2);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ struct main0_out
|
||||
};
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
@@ -136,7 +136,7 @@ inline vec<T, 4> spvGatherCompareSwizzle(sampler s, const thread Tex& t, Ts... p
|
||||
return t.gather_compare(s, spvForward<Ts>(params)...);
|
||||
}
|
||||
|
||||
float4 do_samples(thread const texture1d<float> t1, thread const sampler t1Smplr, constant uint& t1Swzl, thread const texture2d<float> t2, constant uint& t2Swzl, thread const texture3d<float> t3, thread const sampler t3Smplr, constant uint& t3Swzl, thread const texturecube<float> tc, constant uint& tcSwzl, thread const texture2d_array<float> t2a, thread const sampler t2aSmplr, constant uint& t2aSwzl, thread const texturecube_array<float> tca, thread const sampler tcaSmplr, constant uint& tcaSwzl, thread const texture2d<float> tb, thread const depth2d<float> d2, thread const sampler d2Smplr, constant uint& d2Swzl, thread const depthcube<float> dc, thread const sampler dcSmplr, constant uint& dcSwzl, thread const depth2d_array<float> d2a, constant uint& d2aSwzl, thread const depthcube_array<float> dca, thread const sampler dcaSmplr, constant uint& dcaSwzl, thread sampler defaultSampler, thread sampler shadowSampler)
|
||||
inline float4 do_samples(thread const texture1d<float> t1, thread const sampler t1Smplr, constant uint& t1Swzl, thread const texture2d<float> t2, constant uint& t2Swzl, thread const texture3d<float> t3, thread const sampler t3Smplr, constant uint& t3Swzl, thread const texturecube<float> tc, constant uint& tcSwzl, thread const texture2d_array<float> t2a, thread const sampler t2aSmplr, constant uint& t2aSwzl, thread const texturecube_array<float> tca, thread const sampler tcaSmplr, constant uint& tcaSwzl, thread const texture2d<float> tb, thread const depth2d<float> d2, thread const sampler d2Smplr, constant uint& d2Swzl, thread const depthcube<float> dc, thread const sampler dcSmplr, constant uint& dcSwzl, thread const depth2d_array<float> d2a, constant uint& d2aSwzl, thread const depthcube_array<float> dca, thread const sampler dcaSmplr, constant uint& dcaSwzl, thread sampler defaultSampler, thread sampler shadowSampler)
|
||||
{
|
||||
float4 c = spvTextureSwizzle(t1.sample(t1Smplr, 0.0), t1Swzl);
|
||||
c = spvTextureSwizzle(t2.sample(defaultSampler, float2(0.0)), t2Swzl);
|
||||
|
||||
@@ -13,7 +13,7 @@ struct u0_counters
|
||||
};
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ struct u0_counters
|
||||
};
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ struct cb5_struct
|
||||
};
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ struct cb
|
||||
};
|
||||
|
||||
// Returns 2D texture coords corresponding to 1D texel buffer coords
|
||||
uint2 spvTexelBufferCoord(uint tc)
|
||||
inline uint2 spvTexelBufferCoord(uint tc)
|
||||
{
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
@@ -10,13 +10,13 @@ struct ssbo
|
||||
uint _data[1];
|
||||
};
|
||||
|
||||
void Load(thread const uint& size, const device ssbo& ssbo_1)
|
||||
inline void Load(thread const uint& size, const device ssbo& ssbo_1)
|
||||
{
|
||||
int byteAddrTemp = int(size >> uint(2));
|
||||
uint4 data = uint4(ssbo_1._data[byteAddrTemp], ssbo_1._data[byteAddrTemp + 1], ssbo_1._data[byteAddrTemp + 2], ssbo_1._data[byteAddrTemp + 3]);
|
||||
}
|
||||
|
||||
void _main(thread const uint3& id, const device ssbo& ssbo_1)
|
||||
inline void _main(thread const uint3& id, const device ssbo& ssbo_1)
|
||||
{
|
||||
uint param = 4u;
|
||||
Load(param, ssbo_1);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
using namespace metal;
|
||||
|
||||
void _main(thread const uint3& id, thread texture2d<float, access::read_write> TargetTexture)
|
||||
inline void _main(thread const uint3& id, thread texture2d<float, access::read_write> TargetTexture)
|
||||
{
|
||||
float2 loaded = TargetTexture.read(uint2(id.xy)).xy;
|
||||
float2 storeTemp = loaded + float2(1.0);
|
||||
|
||||
@@ -10,7 +10,7 @@ struct bufA
|
||||
uint _data[1];
|
||||
};
|
||||
|
||||
void _main(device bufA& bufA_1, device bufA& bufB)
|
||||
inline void _main(device bufA& bufA_1, device bufA& bufB)
|
||||
{
|
||||
bufA_1._data[0] = 0u;
|
||||
bufB._data[0] = 0u;
|
||||
|
||||
@@ -17,12 +17,12 @@ struct bar
|
||||
int d;
|
||||
};
|
||||
|
||||
device foo* select_buffer(device foo& a, constant bar& cb)
|
||||
inline device foo* select_buffer(device foo& a, constant bar& cb)
|
||||
{
|
||||
return (cb.d != 0) ? &a : nullptr;
|
||||
}
|
||||
|
||||
thread uint3* select_input(thread uint3& gl_GlobalInvocationID, thread uint3& gl_LocalInvocationID, constant bar& cb)
|
||||
inline thread uint3* select_input(thread uint3& gl_GlobalInvocationID, thread uint3& gl_LocalInvocationID, constant bar& cb)
|
||||
{
|
||||
return (cb.d != 0) ? &gl_GlobalInvocationID : &gl_LocalInvocationID;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ struct bar
|
||||
int b;
|
||||
};
|
||||
|
||||
device int* _24(device foo& a, device bar& b, thread uint3& gl_GlobalInvocationID)
|
||||
inline device int* _24(device foo& a, device bar& b, thread uint3& gl_GlobalInvocationID)
|
||||
{
|
||||
return (gl_GlobalInvocationID.x != 0u) ? &a.a : &b.b;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ struct cb1_struct
|
||||
|
||||
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(16u, 16u, 1u);
|
||||
|
||||
int2 get_texcoord(thread const int2& base, thread const int2& index, thread uint3& gl_LocalInvocationID)
|
||||
inline int2 get_texcoord(thread const int2& base, thread const int2& index, thread uint3& gl_LocalInvocationID)
|
||||
{
|
||||
return (base * int3(gl_LocalInvocationID).xy) + index;
|
||||
}
|
||||
|
||||
@@ -10,12 +10,12 @@ struct EmptyStructTest
|
||||
int empty_struct_member;
|
||||
};
|
||||
|
||||
float GetValue(thread const EmptyStructTest& self)
|
||||
inline float GetValue(thread const EmptyStructTest& self)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
float GetValue_1(EmptyStructTest self)
|
||||
inline float GetValue_1(EmptyStructTest self)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ struct main0_out
|
||||
float4 _entryPointOutput [[color(0)]];
|
||||
};
|
||||
|
||||
float4 _main(thread const float4& pos, constant buf& v_11)
|
||||
inline float4 _main(thread const float4& pos, constant buf& v_11)
|
||||
{
|
||||
int _46 = int(pos.x) % 16;
|
||||
Foo foo;
|
||||
|
||||
@@ -10,22 +10,22 @@ struct main0_out
|
||||
float4 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
float4 foo(thread const float4& foo_1)
|
||||
inline float4 foo(thread const float4& foo_1)
|
||||
{
|
||||
return foo_1 + float4(1.0);
|
||||
}
|
||||
|
||||
float4 foo(thread const float3& foo_1)
|
||||
inline float4 foo(thread const float3& foo_1)
|
||||
{
|
||||
return foo_1.xyzz + float4(1.0);
|
||||
}
|
||||
|
||||
float4 foo_1(thread const float4& foo_2)
|
||||
inline float4 foo_1(thread const float4& foo_2)
|
||||
{
|
||||
return foo_2 + float4(2.0);
|
||||
}
|
||||
|
||||
float4 foo(thread const float2& foo_2)
|
||||
inline float4 foo(thread const float2& foo_2)
|
||||
{
|
||||
return foo_2.xyxy + float4(2.0);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ struct main0_in
|
||||
};
|
||||
|
||||
#line 6 "test.frag"
|
||||
void func(thread float& FragColor, thread float& vColor)
|
||||
inline void func(thread float& FragColor, thread float& vColor)
|
||||
{
|
||||
#line 8 "test.frag"
|
||||
FragColor = 1.0;
|
||||
|
||||
@@ -19,17 +19,58 @@ struct main0_in
|
||||
int index [[user(locn0)]];
|
||||
};
|
||||
|
||||
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromStack1(thread T (&dst)[N], thread const T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromConstant1(thread T (&dst)[N], constant T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]])
|
||||
@@ -59,7 +100,7 @@ fragment main0_out main0(main0_in in [[stage_in]])
|
||||
foobar[1].z = 20.0;
|
||||
}
|
||||
out.FragColor += foobar[in.index & 3].z;
|
||||
spvArrayCopyFromConstant1(baz, _90);
|
||||
spvArrayCopyFromConstantToStack1(baz, _90);
|
||||
out.FragColor += baz[in.index & 3].z;
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ struct main0_out
|
||||
float FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
float add_value(float v, float w)
|
||||
inline float add_value(float v, float w)
|
||||
{
|
||||
return v + w;
|
||||
}
|
||||
|
||||
@@ -19,22 +19,63 @@ struct main0_out
|
||||
|
||||
// Implementation of the GLSL mod() function, which is slightly different than Metal fmod()
|
||||
template<typename Tx, typename Ty>
|
||||
Tx mod(Tx x, Ty y)
|
||||
inline Tx mod(Tx x, Ty y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromStack1(thread T (&dst)[N], thread const T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromConstant1(thread T (&dst)[N], constant T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
fragment main0_out main0(float4 gl_FragCoord [[position]])
|
||||
|
||||
@@ -15,12 +15,12 @@ struct main0_in
|
||||
float3 vUV [[user(locn0)]];
|
||||
};
|
||||
|
||||
float sample_combined(thread float3& vUV, thread depth2d<float> uShadow, thread const sampler uShadowSmplr)
|
||||
inline float sample_combined(thread float3& vUV, thread depth2d<float> uShadow, thread const sampler uShadowSmplr)
|
||||
{
|
||||
return uShadow.sample_compare(uShadowSmplr, vUV.xy, vUV.z);
|
||||
}
|
||||
|
||||
float sample_separate(thread float3& vUV, thread depth2d<float> uTexture, thread sampler uSampler)
|
||||
inline float sample_separate(thread float3& vUV, thread depth2d<float> uTexture, thread sampler uSampler)
|
||||
{
|
||||
return uTexture.sample_compare(uSampler, vUV.xy, vUV.z);
|
||||
}
|
||||
|
||||
@@ -45,20 +45,61 @@ struct main0_in
|
||||
float4 gl_Position [[attribute(1)]];
|
||||
};
|
||||
|
||||
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromStack1(thread T (&dst)[N], thread const T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToStack1(thread T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyFromConstant1(thread T (&dst)[N], constant T (&src)[N])
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromConstantToThreadGroup1(threadgroup T (&dst)[A], constant T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
HSOut _hs_main(thread const VertexOutput (&p)[3], thread const uint& i)
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToStack1(thread T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromStackToThreadGroup1(threadgroup T (&dst)[A], thread const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToStack1(thread T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, uint A>
|
||||
inline void spvArrayCopyFromThreadGroupToThreadGroup1(threadgroup T (&dst)[A], threadgroup const T (&src)[A])
|
||||
{
|
||||
for (uint i = 0; i < A; i++)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
inline HSOut _hs_main(thread const VertexOutput (&p)[3], thread const uint& i)
|
||||
{
|
||||
HSOut _output;
|
||||
_output.pos = p[i].pos;
|
||||
@@ -66,7 +107,7 @@ HSOut _hs_main(thread const VertexOutput (&p)[3], thread const uint& i)
|
||||
return _output;
|
||||
}
|
||||
|
||||
HSConstantOut PatchHS(thread const VertexOutput (&_patch)[3])
|
||||
inline HSConstantOut PatchHS(thread const VertexOutput (&_patch)[3])
|
||||
{
|
||||
HSConstantOut _output;
|
||||
_output.EdgeTess[0] = (float2(1.0) + _patch[0].uv).x;
|
||||
@@ -93,7 +134,7 @@ kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_
|
||||
p[2].uv = gl_in[2].VertexOutput_uv;
|
||||
uint i = gl_InvocationID;
|
||||
VertexOutput param[3];
|
||||
spvArrayCopyFromStack1(param, p);
|
||||
spvArrayCopyFromStackToStack1(param, p);
|
||||
uint param_1 = i;
|
||||
HSOut flattenTemp = _hs_main(param, param_1);
|
||||
gl_out[gl_InvocationID].gl_Position = flattenTemp.pos;
|
||||
@@ -102,7 +143,7 @@ kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_
|
||||
if (int(gl_InvocationID) == 0)
|
||||
{
|
||||
VertexOutput param_2[3];
|
||||
spvArrayCopyFromStack1(param_2, p);
|
||||
spvArrayCopyFromStackToStack1(param_2, p);
|
||||
HSConstantOut _patchConstantResult = PatchHS(param_2);
|
||||
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0] = half(_patchConstantResult.EdgeTess[0]);
|
||||
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1] = half(_patchConstantResult.EdgeTess[1]);
|
||||
|
||||
@@ -39,7 +39,7 @@ struct main0_in
|
||||
float3 PosL [[attribute(0)]];
|
||||
};
|
||||
|
||||
V2F _VS(thread const float3& PosL, thread const uint& instanceID, const device gInstanceData& gInstanceData_1)
|
||||
inline V2F _VS(thread const float3& PosL, thread const uint& instanceID, const device gInstanceData& gInstanceData_1)
|
||||
{
|
||||
InstanceData instData;
|
||||
instData.MATRIX_MVP = transpose(gInstanceData_1._data[instanceID].MATRIX_MVP);
|
||||
|
||||
@@ -10,7 +10,7 @@ struct main0_out
|
||||
float4 gl_Position [[position, invariant]];
|
||||
};
|
||||
|
||||
float4 _main()
|
||||
inline float4 _main()
|
||||
{
|
||||
return float4(1.0);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user