mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 16:37:08 +00:00
GLSL: clean up GLSL output whitespace generation.
More line() and less std::endl. More automated indents and less manual spacing. Put a single newline after every struct and function declaration. Note that this does touch every test result, but only affects whitespace. Change-Id: I7506b9029b79b91fb335911dba44369b36f09bbe Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/78300 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
committed by
Tint LUCI CQ
parent
b1d2b84f7d
commit
e2f35ba8e0
@@ -5,12 +5,11 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
unused_entry_point();
|
||||
}
|
||||
|
||||
|
||||
|
||||
struct S {
|
||||
ivec4 arr[4];
|
||||
};
|
||||
@@ -20,10 +19,10 @@ shared ivec4 src_workgroup[4];
|
||||
layout(binding = 0) uniform S_1 {
|
||||
ivec4 arr[4];
|
||||
} src_uniform;
|
||||
|
||||
layout(binding = 1) buffer S_2 {
|
||||
ivec4 arr[4];
|
||||
} src_storage;
|
||||
|
||||
ivec4[4] ret_arr() {
|
||||
ivec4 tint_symbol[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0));
|
||||
return tint_symbol;
|
||||
@@ -53,3 +52,4 @@ void foo(ivec4 src_param[4]) {
|
||||
int src_nested[4][3][2] = int[4][3][2](int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)));
|
||||
dst_nested = src_nested;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,12 +5,11 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
unused_entry_point();
|
||||
}
|
||||
|
||||
|
||||
|
||||
struct S {
|
||||
ivec4 arr[4];
|
||||
};
|
||||
@@ -20,12 +19,12 @@ shared ivec4 src_workgroup[4];
|
||||
layout(binding = 0) uniform S_1 {
|
||||
ivec4 arr[4];
|
||||
} src_uniform;
|
||||
|
||||
layout(binding = 1) buffer S_2 {
|
||||
ivec4 arr[4];
|
||||
} src_storage;
|
||||
ivec4 dst[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0));
|
||||
int dst_nested[4][3][2] = int[4][3][2](int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)));
|
||||
|
||||
ivec4[4] ret_arr() {
|
||||
ivec4 tint_symbol[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0));
|
||||
return tint_symbol;
|
||||
@@ -53,3 +52,4 @@ void foo(ivec4 src_param[4]) {
|
||||
int src_nested[4][3][2] = int[4][3][2](int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)));
|
||||
dst_nested = src_nested;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,15 +5,15 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
unused_entry_point();
|
||||
}
|
||||
|
||||
|
||||
|
||||
struct S {
|
||||
ivec4 arr[4];
|
||||
};
|
||||
|
||||
struct S_nested {
|
||||
int arr[4][3][2];
|
||||
};
|
||||
@@ -23,6 +23,7 @@ shared ivec4 src_workgroup[4];
|
||||
layout(binding = 0) uniform S_1 {
|
||||
ivec4 arr[4];
|
||||
} src_uniform;
|
||||
|
||||
layout(binding = 1) buffer S_2 {
|
||||
ivec4 arr[4];
|
||||
} src_storage;
|
||||
@@ -32,7 +33,6 @@ layout(binding = 2) buffer S_3 {
|
||||
layout(binding = 3) buffer S_nested_1 {
|
||||
int arr[4][3][2];
|
||||
} dst_nested;
|
||||
|
||||
ivec4[4] ret_arr() {
|
||||
ivec4 tint_symbol[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0));
|
||||
return tint_symbol;
|
||||
@@ -60,3 +60,4 @@ void foo(ivec4 src_param[4]) {
|
||||
int src_nested[4][3][2] = int[4][3][2](int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)));
|
||||
dst_nested.arr = src_nested;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,12 +5,11 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
unused_entry_point();
|
||||
}
|
||||
|
||||
|
||||
|
||||
struct S {
|
||||
int arr[4];
|
||||
};
|
||||
@@ -26,3 +25,4 @@ void foo() {
|
||||
dst_struct.arr = src;
|
||||
dst_array[0] = src;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,12 +5,11 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||
void unused_entry_point() {
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
unused_entry_point();
|
||||
}
|
||||
|
||||
|
||||
|
||||
struct S {
|
||||
ivec4 arr[4];
|
||||
};
|
||||
@@ -20,12 +19,12 @@ shared ivec4 src_workgroup[4];
|
||||
layout(binding = 0) uniform S_1 {
|
||||
ivec4 arr[4];
|
||||
} src_uniform;
|
||||
|
||||
layout(binding = 1) buffer S_2 {
|
||||
ivec4 arr[4];
|
||||
} src_storage;
|
||||
shared ivec4 dst[4];
|
||||
shared int dst_nested[4][3][2];
|
||||
|
||||
ivec4[4] ret_arr() {
|
||||
ivec4 tint_symbol[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0));
|
||||
return tint_symbol;
|
||||
@@ -53,3 +52,4 @@ void foo(ivec4 src_param[4]) {
|
||||
int src_nested[4][3][2] = int[4][3][2](int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)), int[3][2](int[2](0, 0), int[2](0, 0), int[2](0, 0)));
|
||||
dst_nested = src_nested;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ void tint_symbol() {
|
||||
float v3 = f3(a3);
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ void tint_symbol() {
|
||||
float a3[2][3][4] = f3();
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ precision mediump float;
|
||||
|
||||
const int slen = 4;
|
||||
const uint ulen = 4u;
|
||||
|
||||
void tint_symbol() {
|
||||
float signed_literal[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f);
|
||||
float unsigned_literal[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f);
|
||||
@@ -13,8 +12,8 @@ void tint_symbol() {
|
||||
signed_constant = unsigned_literal;
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ void tint_symbol() {
|
||||
int subexpr_nested_nonempty_with_expr[4] = tint_symbol_20[1];
|
||||
return;
|
||||
}
|
||||
|
||||
void main() {
|
||||
tint_symbol();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user