writers: Use the new sem::Module::DependencyOrderedDeclarations

As the resolver currently enforces in-order declarations, this does not
change the declaration order from iterating over the
ast::Module::GlobalDeclarations.

The MSL backend has been changed to use the
sem::Module::DependencyOrderedDeclarations list instead of looping over
different declaration types separately.

Bug: tint:1266
Change-Id: I698d612032285311017bfceab3c42adae1928a0e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/79767
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Ben Clayton
2022-02-09 23:55:51 +00:00
parent a52be6c9ec
commit 8ec32a6ec9
841 changed files with 3258 additions and 2784 deletions

View File

@@ -4,18 +4,10 @@ using namespace metal;
struct tint_array_wrapper {
/* 0x0000 */ int4 arr[4];
};
struct S {
/* 0x0000 */ tint_array_wrapper arr;
};
struct tint_array_wrapper_3 {
int arr[2];
};
struct tint_array_wrapper_2 {
tint_array_wrapper_3 arr[3];
};
struct tint_array_wrapper_1 {
tint_array_wrapper_2 arr[4];
};
tint_array_wrapper ret_arr() {
tint_array_wrapper const tint_symbol = {.arr={}};
@@ -27,6 +19,18 @@ S ret_struct_arr() {
return tint_symbol_1;
}
struct tint_array_wrapper_3 {
int arr[2];
};
struct tint_array_wrapper_2 {
tint_array_wrapper_3 arr[3];
};
struct tint_array_wrapper_1 {
tint_array_wrapper_2 arr[4];
};
void foo(tint_array_wrapper src_param, thread tint_array_wrapper* const tint_symbol_3, threadgroup tint_array_wrapper* const tint_symbol_4, const constant S* const tint_symbol_5, device S* const tint_symbol_6) {
tint_array_wrapper src_function = {};
tint_array_wrapper dst = {};

View File

@@ -4,15 +4,19 @@ using namespace metal;
struct tint_array_wrapper {
/* 0x0000 */ int4 arr[4];
};
struct S {
/* 0x0000 */ tint_array_wrapper arr;
};
struct tint_array_wrapper_3 {
int arr[2];
};
struct tint_array_wrapper_2 {
tint_array_wrapper_3 arr[3];
};
struct tint_array_wrapper_1 {
tint_array_wrapper_2 arr[4];
};

View File

@@ -4,18 +4,23 @@ using namespace metal;
struct tint_array_wrapper {
/* 0x0000 */ int4 arr[4];
};
struct S {
/* 0x0000 */ tint_array_wrapper arr;
};
struct tint_array_wrapper_3 {
/* 0x0000 */ int arr[2];
};
struct tint_array_wrapper_2 {
/* 0x0000 */ tint_array_wrapper_3 arr[3];
};
struct tint_array_wrapper_1 {
/* 0x0000 */ tint_array_wrapper_2 arr[4];
};
struct S_nested {
/* 0x0000 */ tint_array_wrapper_1 arr;
};

View File

@@ -4,9 +4,11 @@ using namespace metal;
struct tint_array_wrapper {
int arr[4];
};
struct S {
tint_array_wrapper arr;
};
struct tint_array_wrapper_1 {
tint_array_wrapper arr[2];
};

View File

@@ -4,15 +4,19 @@ using namespace metal;
struct tint_array_wrapper {
/* 0x0000 */ int4 arr[4];
};
struct S {
/* 0x0000 */ tint_array_wrapper arr;
};
struct tint_array_wrapper_3 {
int arr[2];
};
struct tint_array_wrapper_2 {
tint_array_wrapper_3 arr[3];
};
struct tint_array_wrapper_1 {
tint_array_wrapper_2 arr[4];
};

View File

@@ -4,21 +4,23 @@ using namespace metal;
struct tint_array_wrapper {
float arr[4];
};
struct tint_array_wrapper_1 {
tint_array_wrapper arr[3];
};
struct tint_array_wrapper_2 {
tint_array_wrapper_1 arr[2];
};
float f1(tint_array_wrapper a) {
return a.arr[3];
}
struct tint_array_wrapper_1 {
tint_array_wrapper arr[3];
};
float f2(tint_array_wrapper_1 a) {
return a.arr[2].arr[3];
}
struct tint_array_wrapper_2 {
tint_array_wrapper_1 arr[2];
};
float f3(tint_array_wrapper_2 a) {
return a.arr[1].arr[2].arr[3];
}

View File

@@ -4,23 +4,25 @@ using namespace metal;
struct tint_array_wrapper {
float arr[4];
};
struct tint_array_wrapper_1 {
tint_array_wrapper arr[3];
};
struct tint_array_wrapper_2 {
tint_array_wrapper_1 arr[2];
};
tint_array_wrapper f1() {
tint_array_wrapper const tint_symbol_1 = {.arr={}};
return tint_symbol_1;
}
struct tint_array_wrapper_1 {
tint_array_wrapper arr[3];
};
tint_array_wrapper_1 f2() {
tint_array_wrapper_1 const tint_symbol_2 = {.arr={f1(), f1(), f1()}};
return tint_symbol_2;
}
struct tint_array_wrapper_2 {
tint_array_wrapper_1 arr[2];
};
tint_array_wrapper_2 f3() {
tint_array_wrapper_2 const tint_symbol_3 = {.arr={f2(), f2()}};
return tint_symbol_3;

View File

@@ -1,12 +1,14 @@
#include <metal_stdlib>
using namespace metal;
constant int slen = 4;
constant uint ulen = 4u;
struct tint_array_wrapper {
float arr[4];
};
constant int slen = 4;
constant uint ulen = 4u;
fragment void tint_symbol() {
tint_array_wrapper signed_literal = {};
tint_array_wrapper unsigned_literal = {};

View File

@@ -5,19 +5,24 @@ struct strided_arr {
/* 0x0000 */ float el;
/* 0x0004 */ int8_t tint_pad[4];
};
struct tint_array_wrapper {
/* 0x0000 */ strided_arr arr[2];
};
struct tint_array_wrapper_1 {
/* 0x0000 */ tint_array_wrapper arr[3];
};
struct strided_arr_1 {
/* 0x0000 */ tint_array_wrapper_1 el;
/* 0x0030 */ int8_t tint_pad_1[80];
};
struct tint_array_wrapper_2 {
/* 0x0000 */ strided_arr_1 arr[4];
};
struct S {
/* 0x0000 */ tint_array_wrapper_2 a;
};

View File

@@ -4,12 +4,15 @@ using namespace metal;
struct tint_array_wrapper {
int arr[4];
};
struct tint_array_wrapper_2 {
tint_array_wrapper arr[3];
};
struct tint_array_wrapper_1 {
tint_array_wrapper_2 arr[2];
};
struct tint_array_wrapper_3 {
tint_array_wrapper arr[2];
};