mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-13 08:36:08 +00:00
When `invariant` is enabled on MSL was was incorrectly setting `@invariant` instead of `[[invariant]]`. We test with metal1.2 which does not have invariant, so this only showed up when using metal2.1 or higher. Bug: chromium:1439273 Change-Id: Iab866608195e697b0370d465f350b25277d904a3 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/128880 Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
26 lines
470 B
Plaintext
26 lines
470 B
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
|
|
#if __METAL_VERSION__ >= 210
|
|
#define TINT_INVARIANT [[invariant]]
|
|
#else
|
|
#define TINT_INVARIANT
|
|
#endif
|
|
|
|
struct tint_symbol_1 {
|
|
float4 value [[position]] TINT_INVARIANT;
|
|
};
|
|
|
|
float4 tint_symbol_inner() {
|
|
return float4(0.0f);
|
|
}
|
|
|
|
vertex tint_symbol_1 tint_symbol() {
|
|
float4 const inner_result = tint_symbol_inner();
|
|
tint_symbol_1 wrapper_result = {};
|
|
wrapper_result.value = inner_result;
|
|
return wrapper_result;
|
|
}
|
|
|