17ad62eea4
DX may emit ArrayStride and MatrixStride of 16, but the size of the object does not align with that and expect to pack other members inside its last member. The workaround is to emit array size/col/row one less than we expect and rely on padding to carve out a "dead zone" for the last member.
25 lines
396 B
GLSL
25 lines
396 B
GLSL
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
using namespace metal;
|
|
|
|
struct type_Foo
|
|
{
|
|
float2x4 a;
|
|
char _m1_pad[12];
|
|
float b;
|
|
};
|
|
|
|
struct main0_out
|
|
{
|
|
float3 out_var_SV_Target [[color(0)]];
|
|
};
|
|
|
|
fragment main0_out main0(constant type_Foo& Foo [[buffer(0)]])
|
|
{
|
|
main0_out out = {};
|
|
out.out_var_SV_Target = (Foo.a[0u].xyz + Foo.a[1u].xyz) + float3(Foo.b);
|
|
return out;
|
|
}
|
|
|