SPIRV-Cross/reference/shaders-msl-no-opt/asm/packing/load-packed-no-forwarding.asm.comp
Hans-Kristian Arntzen ebe109d91d Deal correctly with non-forwarded packed loads.
Need to unpack the expression if we're not forwarding.
2019-07-23 16:25:19 +02:00

24 lines
631 B
Plaintext

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
typedef packed_float3 packed_rm_float3x3[3];
struct SSBOScalar
{
packed_float3 a;
packed_rm_float3x3 b;
packed_rm_float3x3 c;
};
kernel void main0(device SSBOScalar& _4 [[buffer(0)]])
{
float3x3 _20 = transpose(float3x3(float3(_4.b[0]), float3(_4.b[1]), float3(_4.b[2])));
_4.b[0] = float3x3(float3(_4.c[0]), float3(_4.c[1]), float3(_4.c[2]))[0];
_4.b[1] = float3x3(float3(_4.c[0]), float3(_4.c[1]), float3(_4.c[2]))[1];
_4.b[2] = float3x3(float3(_4.c[0]), float3(_4.c[1]), float3(_4.c[2]))[2];
_4.a = _20 * float3(_4.a);
}