msl: Handle buffer variables in transform

This removes a lot of awkward logic from the MSL writer, and means
that we now handle all module-scope variables with the same transform.

Change-Id: I782e36a4b88dafbc3f8364f7caa7f95c6ae3f5f1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67643
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
James Price
2021-10-28 15:00:39 +00:00
parent c6ce5785d0
commit e548db90f6
141 changed files with 1681 additions and 1546 deletions

View File

@@ -18,8 +18,8 @@ struct S {
/* 0x004c */ int8_t tint_pad[4];
};
fragment void tint_symbol_1(constant S& data [[buffer(0)]]) {
float4 const x = (data.vector * data.tint_symbol);
fragment void tint_symbol_1(const constant S* tint_symbol_2 [[buffer(0)]]) {
float4 const x = ((*(tint_symbol_2)).vector * (*(tint_symbol_2)).tint_symbol);
return;
}