dawn-cmake/test/shader_io/shared_struct_storage_buffer.wgsl.expected.msl
James Price 851b18b2f2 writer/msl: Emit field designators for structures
This fixes constructors for structures that contain padding members
due to explicit layout attributes.

Also fix one test that was wrongly using an identity type constructor
for a structure.

Fixed: tint:853
Change-Id: I0a3e84fcd7c6a7f2ad92a4970ed11378e6ce2465
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53240
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2021-06-03 18:12:15 +00:00

26 lines
608 B
Plaintext

#include <metal_stdlib>
using namespace metal;
struct S {
/* 0x0000 */ float f;
/* 0x0004 */ uint u;
/* 0x0008 */ int8_t tint_pad_0[120];
/* 0x0080 */ packed_float4 v;
/* 0x0090 */ int8_t tint_pad_1[112];
};
struct tint_symbol_1 {
float f [[user(locn0)]];
uint u [[user(locn1)]];
float4 v [[position]];
};
fragment void frag_main(tint_symbol_1 tint_symbol [[stage_in]], device S& output [[buffer(0)]]) {
S const input = {.f=tint_symbol.f, .u=tint_symbol.u, .v=tint_symbol.v};
float const f = input.f;
uint const u = input.u;
float4 const v = input.v;
output = input;
return;
}