mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 00:17:03 +00:00
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:
@@ -36,17 +36,17 @@ struct S {
|
||||
/* 0x00ac */ int8_t tint_pad_1[4];
|
||||
};
|
||||
|
||||
kernel void tint_symbol(const device S& s [[buffer(0)]]) {
|
||||
int3 const a = s.a;
|
||||
int const b = s.b;
|
||||
uint3 const c = s.c;
|
||||
uint const d = s.d;
|
||||
float3 const e = s.e;
|
||||
float const f = s.f;
|
||||
float2x3 const g = s.g;
|
||||
float3x2 const h = s.h;
|
||||
Inner const i = s.i;
|
||||
tint_array_wrapper const j = s.j;
|
||||
kernel void tint_symbol(const device S* tint_symbol_1 [[buffer(0)]]) {
|
||||
int3 const a = (*(tint_symbol_1)).a;
|
||||
int const b = (*(tint_symbol_1)).b;
|
||||
uint3 const c = (*(tint_symbol_1)).c;
|
||||
uint const d = (*(tint_symbol_1)).d;
|
||||
float3 const e = (*(tint_symbol_1)).e;
|
||||
float const f = (*(tint_symbol_1)).f;
|
||||
float2x3 const g = (*(tint_symbol_1)).g;
|
||||
float3x2 const h = (*(tint_symbol_1)).h;
|
||||
Inner const i = (*(tint_symbol_1)).i;
|
||||
tint_array_wrapper const j = (*(tint_symbol_1)).j;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,19 +36,19 @@ struct S {
|
||||
/* 0x00ac */ int8_t tint_pad_1[4];
|
||||
};
|
||||
|
||||
kernel void tint_symbol(device S& s [[buffer(0)]]) {
|
||||
s.a = int3();
|
||||
s.b = int();
|
||||
s.c = uint3();
|
||||
s.d = uint();
|
||||
s.e = float3();
|
||||
s.f = float();
|
||||
s.g = float2x3();
|
||||
s.h = float3x2();
|
||||
kernel void tint_symbol(device S* tint_symbol_3 [[buffer(0)]]) {
|
||||
(*(tint_symbol_3)).a = int3();
|
||||
(*(tint_symbol_3)).b = int();
|
||||
(*(tint_symbol_3)).c = uint3();
|
||||
(*(tint_symbol_3)).d = uint();
|
||||
(*(tint_symbol_3)).e = float3();
|
||||
(*(tint_symbol_3)).f = float();
|
||||
(*(tint_symbol_3)).g = float2x3();
|
||||
(*(tint_symbol_3)).h = float3x2();
|
||||
Inner const tint_symbol_1 = {};
|
||||
s.i = tint_symbol_1;
|
||||
(*(tint_symbol_3)).i = tint_symbol_1;
|
||||
tint_array_wrapper const tint_symbol_2 = {.arr={}};
|
||||
s.j = tint_symbol_2;
|
||||
(*(tint_symbol_3)).j = tint_symbol_2;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user