dawn-cmake/test/shader_io/shared_struct_storage_buffer.wgsl.expected.msl
James Price 7697c31e84 writer/msl: Emit builtins as parameters
Add a config parameter for the CanonicalizeEntryPoint transform that
selects between emitting builtins as parameters (for MSL) or struct
members (for HLSL).

This fixes all of the shader IO issues in Tint's E2E tests for MSL.

Fixed: tint:817
Change-Id: Ieb31cdbd2e4d96ac41f8d8515fd07ead8241d770
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53282
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
2021-06-04 14:40:28 +00:00

25 lines
618 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_2 {
float f [[user(locn0)]];
uint u [[user(locn1)]];
};
fragment void frag_main(float4 tint_symbol_1 [[position]], tint_symbol_2 tint_symbol [[stage_in]], device S& output [[buffer(0)]]) {
S const input = {.f=tint_symbol.f, .u=tint_symbol.u, .v=tint_symbol_1};
float const f = input.f;
uint const u = input.u;
float4 const v = input.v;
output = input;
return;
}