GLSL: move entry point handling to CanonicalizeEntryPointIO transform.

Move builtin_to_string() and builtin_type() to
the CanonicalizeEntryPointIO transform. Use the former to
rename entry point IO variables to the gl_ names, and the latter
to cast values to the correct type.

Change-Id: Iddfad574ddd660ff1bfd89a399a001b967b6b67e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/78380
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Stephen White
2022-01-28 22:36:58 +00:00
committed by Tint LUCI CQ
parent f34038b1a0
commit 0b39270e01
1735 changed files with 9397 additions and 30642 deletions

View File

@@ -23,11 +23,7 @@ layout(binding = 0) uniform S_1 {
Inner arr[8];
} s;
struct tint_symbol_2 {
uint idx;
};
void tint_symbol_inner(uint idx) {
void tint_symbol(uint idx) {
ivec3 a = s.arr[idx].a;
int b = s.arr[idx].b;
uvec3 c = s.arr[idx].c;
@@ -42,15 +38,7 @@ void tint_symbol_inner(uint idx) {
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol(tint_symbol_2 tint_symbol_1) {
tint_symbol_inner(tint_symbol_1.idx);
void main() {
tint_symbol(gl_LocalInvocationIndex);
return;
}
void main() {
tint_symbol_2 inputs;
inputs.idx = uint(gl_LocalInvocationIndex);
tint_symbol(inputs);
}

View File

@@ -35,7 +35,6 @@ layout(binding = 0) uniform S_1 {
Inner l[4];
} s;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
ivec3 a = s.a;
int b = s.b;
@@ -49,10 +48,10 @@ void tint_symbol() {
mat3x2 j = s.j;
Inner k = s.k;
Inner l[4] = s.l;
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
vec4 inner[4];
} u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
vec4 x[4] = u.inner;
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
float inner;
} u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
float x = u.inner;
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
int inner;
} u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
int x = u.inner;
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
mat2 inner;
} u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
mat2 x = u.inner;
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
mat2x3 inner;
} u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
mat2x3 x = u.inner;
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
mat3x2 inner;
} u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
mat3x2 x = u.inner;
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
mat4 inner;
} u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
mat4 x = u.inner;
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -15,19 +15,18 @@ layout(binding = 0) uniform S_1 {
Inner inner;
} u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
S x = u;
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}
Error parsing GLSL shader:
ERROR: 0:18: '=' : cannot convert from 'layout( binding=0 column_major shared) uniform block{layout( column_major shared) uniform structure{ global mediump float f} inner}' to ' temp structure{ global structure{ global mediump float f} inner}'
ERROR: 0:18: '' : compilation terminated
ERROR: 0:17: '=' : cannot convert from 'layout( binding=0 column_major shared) uniform block{layout( column_major shared) uniform structure{ global mediump float f} inner}' to ' temp structure{ global structure{ global mediump float f} inner}'
ERROR: 0:17: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
uint inner;
} u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
uint x = u.inner;
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
ivec2 inner;
} u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
ivec2 x = u.inner;
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
uvec3 inner;
} u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
uvec3 x = u.inner;
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}

View File

@@ -9,13 +9,12 @@ layout(binding = 0) uniform u_block_1 {
vec4 inner;
} u;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void tint_symbol() {
vec4 x = u.inner;
return;
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
tint_symbol();
return;
}