Files
wgpu/tests/out/msl/padding.msl
T
Teodor Tanasoaia bd62887a13 [hlsl-out] Add more padding when necessary (#1814)
* [hlsl-out] add padding at the end of structs and after struct members of type matrix and array (when necessary)

* use wrapped constructor fn for constants

* add array as fn arg test

* fix glsl array fn arg

* add wrapped constructor for arrays

* [glsl-out] support multidimensional arrays

* address comments
2022-04-11 20:34:06 -07:00

39 lines
685 B
Plaintext

// language: metal2.0
#include <metal_stdlib>
#include <simd/simd.h>
using metal::uint;
struct S {
metal::float3 a;
};
struct Test {
S a;
float b;
};
struct type_2 {
metal::float3 inner[2];
};
struct Test2_ {
type_2 a;
float b;
};
struct Test3_ {
metal::float4x3 a;
float b;
};
struct vertex_Output {
metal::float4 member [[position]];
};
vertex vertex_Output vertex_(
constant Test& input [[buffer(0)]]
, constant Test2_& input2_ [[buffer(1)]]
, constant Test3_& input3_ [[buffer(2)]]
) {
float _e6 = input.b;
float _e9 = input2_.b;
float _e12 = input3_.b;
return vertex_Output { ((metal::float4(1.0) * _e6) * _e9) * _e12 };
}