mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-03 05:01:27 +00:00
Use the sanitizer to add the decoration only to the variables that are vertex outputs and fragment inputs. Bug: dawn:963, tint:746 Change-Id: I1b91cf3550fb3c6f583d69e822444534a576e0cd Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56460 Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: James Price <jrprice@google.com>
40 lines
1.0 KiB
Plaintext
40 lines
1.0 KiB
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
struct Interface {
|
|
int i;
|
|
uint u;
|
|
int4 vi;
|
|
uint4 vu;
|
|
float4 pos;
|
|
};
|
|
struct tint_symbol {
|
|
int i [[user(locn0)]];
|
|
uint u [[user(locn1)]];
|
|
int4 vi [[user(locn2)]];
|
|
uint4 vu [[user(locn3)]];
|
|
float4 pos [[position]];
|
|
};
|
|
struct tint_symbol_4 {
|
|
int i [[user(locn0)]];
|
|
uint u [[user(locn1)]];
|
|
int4 vi [[user(locn2)]];
|
|
uint4 vu [[user(locn3)]];
|
|
};
|
|
struct tint_symbol_5 {
|
|
int value [[color(0)]];
|
|
};
|
|
|
|
vertex tint_symbol vert_main() {
|
|
Interface const tint_symbol_1 = {};
|
|
tint_symbol const tint_symbol_6 = {.i=tint_symbol_1.i, .u=tint_symbol_1.u, .vi=tint_symbol_1.vi, .vu=tint_symbol_1.vu, .pos=tint_symbol_1.pos};
|
|
return tint_symbol_6;
|
|
}
|
|
|
|
fragment tint_symbol_5 frag_main(float4 tint_symbol_3 [[position]], tint_symbol_4 tint_symbol_2 [[stage_in]]) {
|
|
Interface const inputs = {.i=tint_symbol_2.i, .u=tint_symbol_2.u, .vi=tint_symbol_2.vi, .vu=tint_symbol_2.vu, .pos=tint_symbol_3};
|
|
tint_symbol_5 const tint_symbol_7 = {.value=inputs.i};
|
|
return tint_symbol_7;
|
|
}
|
|
|