dawn-cmake/test/shader_io/invariant_struct_member.wgsl.expected.msl
James Price 2c2aa2a76a writer/msl: Implement invariant attribute
Report whether one was generated so that Dawn knows to use the
`-fpreserve-invariance` compiler option.

Bug: tint:772
Change-Id: Ife1eb05265646727dc864f12f983781af4df3777
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57644
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-07-12 16:11:41 +00:00

17 lines
306 B
Plaintext

#include <metal_stdlib>
using namespace metal;
struct Out {
float4 pos;
};
struct tint_symbol_1 {
float4 pos [[position]] [[invariant]];
};
vertex tint_symbol_1 tint_symbol() {
Out const tint_symbol_2 = {};
tint_symbol_1 const tint_symbol_3 = {.pos=tint_symbol_2.pos};
return tint_symbol_3;
}