mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-13 10:51:35 +00:00
GLSL: add .expected.glsl files for all tests.
Bug: tint:1301 Change-Id: Id3a591a2fa0dfdb112046d5c57defbae07483e0d Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/69480 Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
parent
2551458aef
commit
2fe0f4b42b
18
test/access/let/matrix.spvasm.expected.glsl
Normal file
18
test/access/let/matrix.spvasm.expected.glsl
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
void main_1() {
|
||||||
|
float x_24 = mat3(vec3(1.0f, 2.0f, 3.0f), vec3(4.0f, 5.0f, 6.0f), vec3(7.0f, 8.0f, 9.0f))[1u].y;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
main_1();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
15
test/access/let/matrix.wgsl.expected.glsl
Normal file
15
test/access/let/matrix.wgsl.expected.glsl
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
mat3 m = mat3(vec3(1.0f, 2.0f, 3.0f), vec3(4.0f, 5.0f, 6.0f), vec3(7.0f, 8.0f, 9.0f));
|
||||||
|
vec3 v = m[1];
|
||||||
|
float f = v[1];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
20
test/access/let/vector.spvasm.expected.glsl
Normal file
20
test/access/let/vector.spvasm.expected.glsl
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
void main_1() {
|
||||||
|
float x_11 = vec3(1.0f, 2.0f, 3.0f).y;
|
||||||
|
vec2 x_13 = vec2(vec3(1.0f, 2.0f, 3.0f).x, vec3(1.0f, 2.0f, 3.0f).z);
|
||||||
|
vec3 x_14 = vec3(vec3(1.0f, 2.0f, 3.0f).x, vec3(1.0f, 2.0f, 3.0f).z, vec3(1.0f, 2.0f, 3.0f).y);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
main_1();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
16
test/access/let/vector.wgsl.expected.glsl
Normal file
16
test/access/let/vector.wgsl.expected.glsl
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
vec3 v = vec3(1.0f, 2.0f, 3.0f);
|
||||||
|
float scalar = v.y;
|
||||||
|
vec2 swizzle2 = v.xz;
|
||||||
|
vec3 swizzle3 = v.xzy;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
20
test/access/var/matrix.spvasm.expected.glsl
Normal file
20
test/access/var/matrix.spvasm.expected.glsl
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
void main_1() {
|
||||||
|
mat3 m = mat3(vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f));
|
||||||
|
vec3 x_15 = m[1];
|
||||||
|
float x_16 = x_15.y;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
main_1();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
15
test/access/var/matrix.wgsl.expected.glsl
Normal file
15
test/access/var/matrix.wgsl.expected.glsl
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
mat3 m = mat3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 v = m[1];
|
||||||
|
float f = v[1];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
23
test/access/var/vector.spvasm.expected.glsl
Normal file
23
test/access/var/vector.spvasm.expected.glsl
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
void main_1() {
|
||||||
|
vec3 v = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
float x_14 = v.y;
|
||||||
|
vec3 x_16 = v;
|
||||||
|
vec2 x_17 = vec2(x_16.x, x_16.z);
|
||||||
|
vec3 x_18 = v;
|
||||||
|
vec3 x_19 = vec3(x_18.x, x_18.z, x_18.y);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
main_1();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
16
test/access/var/vector.wgsl.expected.glsl
Normal file
16
test/access/var/vector.wgsl.expected.glsl
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
vec3 v = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
float scalar = v.y;
|
||||||
|
vec2 swizzle2 = v.xz;
|
||||||
|
vec3 swizzle3 = v.xzy;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
0
test/array/assign_to_private_var.wgsl.expected.glsl
Normal file
0
test/array/assign_to_private_var.wgsl.expected.glsl
Normal file
0
test/array/assign_to_storage_var.wgsl.expected.glsl
Normal file
0
test/array/assign_to_storage_var.wgsl.expected.glsl
Normal file
0
test/array/assign_to_subexpr.wgsl.expected.glsl
Normal file
0
test/array/assign_to_subexpr.wgsl.expected.glsl
Normal file
30
test/array/function_parameter.wgsl.expected.glsl
Normal file
30
test/array/function_parameter.wgsl.expected.glsl
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
float f1(float a[4]) {
|
||||||
|
return a[3];
|
||||||
|
}
|
||||||
|
|
||||||
|
float f2(float a[3][4]) {
|
||||||
|
return a[2][3];
|
||||||
|
}
|
||||||
|
|
||||||
|
float f3(float a[2][3][4]) {
|
||||||
|
return a[1][2][3];
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
float a1[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
float a2[3][4] = float[3][4](float[4](0.0f, 0.0f, 0.0f, 0.0f), float[4](0.0f, 0.0f, 0.0f, 0.0f), float[4](0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
float a3[2][3][4] = float[2][3][4](float[3][4](float[4](0.0f, 0.0f, 0.0f, 0.0f), float[4](0.0f, 0.0f, 0.0f, 0.0f), float[4](0.0f, 0.0f, 0.0f, 0.0f)), float[3][4](float[4](0.0f, 0.0f, 0.0f, 0.0f), float[4](0.0f, 0.0f, 0.0f, 0.0f), float[4](0.0f, 0.0f, 0.0f, 0.0f)));
|
||||||
|
float v1 = f1(a1);
|
||||||
|
float v2 = f2(a2);
|
||||||
|
float v3 = f3(a3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
30
test/array/function_return_type.wgsl.expected.glsl
Normal file
30
test/array/function_return_type.wgsl.expected.glsl
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
float[4] f1() {
|
||||||
|
float tint_symbol_1[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
return tint_symbol_1;
|
||||||
|
}
|
||||||
|
|
||||||
|
float[3][4] f2() {
|
||||||
|
float tint_symbol_2[3][4] = float[3][4](f1(), f1(), f1());
|
||||||
|
return tint_symbol_2;
|
||||||
|
}
|
||||||
|
|
||||||
|
float[2][3][4] f3() {
|
||||||
|
float tint_symbol_3[2][3][4] = float[2][3][4](f2(), f2());
|
||||||
|
return tint_symbol_3;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
float a1[4] = f1();
|
||||||
|
float a2[3][4] = f2();
|
||||||
|
float a3[2][3][4] = f3();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
20
test/array/size.wgsl.expected.glsl
Normal file
20
test/array/size.wgsl.expected.glsl
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#version 310 es
|
||||||
|
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);
|
||||||
|
float signed_constant[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
float unsigned_constant[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
signed_literal = unsigned_constant;
|
||||||
|
signed_constant = unsigned_literal;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
45
test/array/type_constructor.wgsl.expected.glsl
Normal file
45
test/array/type_constructor.wgsl.expected.glsl
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
int x = 42;
|
||||||
|
int empty[4] = int[4](0, 0, 0, 0);
|
||||||
|
int nonempty[4] = int[4](1, 2, 3, 4);
|
||||||
|
int nonempty_with_expr[4] = int[4](1, x, (x + 1), nonempty[3]);
|
||||||
|
int nested_empty[2][3][4] = int[2][3][4](int[3][4](int[4](0, 0, 0, 0), int[4](0, 0, 0, 0), int[4](0, 0, 0, 0)), int[3][4](int[4](0, 0, 0, 0), int[4](0, 0, 0, 0), int[4](0, 0, 0, 0)));
|
||||||
|
int tint_symbol_1[4] = int[4](1, 2, 3, 4);
|
||||||
|
int tint_symbol_2[4] = int[4](5, 6, 7, 8);
|
||||||
|
int tint_symbol_3[4] = int[4](9, 10, 11, 12);
|
||||||
|
int tint_symbol_4[3][4] = int[3][4](tint_symbol_1, tint_symbol_2, tint_symbol_3);
|
||||||
|
int tint_symbol_5[4] = int[4](13, 14, 15, 16);
|
||||||
|
int tint_symbol_6[4] = int[4](17, 18, 19, 20);
|
||||||
|
int tint_symbol_7[4] = int[4](21, 22, 23, 24);
|
||||||
|
int tint_symbol_8[3][4] = int[3][4](tint_symbol_5, tint_symbol_6, tint_symbol_7);
|
||||||
|
int nested_nonempty[2][3][4] = int[2][3][4](tint_symbol_4, tint_symbol_8);
|
||||||
|
int tint_symbol_9[4] = int[4](1, 2, x, (x + 1));
|
||||||
|
int tint_symbol_10[4] = int[4](5, 6, nonempty[2], (nonempty[3] + 1));
|
||||||
|
int tint_symbol_11[3][4] = int[3][4](tint_symbol_9, tint_symbol_10, nonempty);
|
||||||
|
int nested_nonempty_with_expr[2][3][4] = int[2][3][4](tint_symbol_11, nested_nonempty[1]);
|
||||||
|
int tint_symbol_12[4] = int[4](0, 0, 0, 0);
|
||||||
|
int subexpr_empty = tint_symbol_12[1];
|
||||||
|
int tint_symbol_13[4] = int[4](1, 2, 3, 4);
|
||||||
|
int subexpr_nonempty = tint_symbol_13[2];
|
||||||
|
int tint_symbol_14[4] = int[4](1, x, (x + 1), nonempty[3]);
|
||||||
|
int subexpr_nonempty_with_expr = tint_symbol_14[2];
|
||||||
|
int tint_symbol_15[2][4] = int[2][4](int[4](0, 0, 0, 0), int[4](0, 0, 0, 0));
|
||||||
|
int subexpr_nested_empty[4] = tint_symbol_15[1];
|
||||||
|
int tint_symbol_16[4] = int[4](1, 2, 3, 4);
|
||||||
|
int tint_symbol_17[4] = int[4](5, 6, 7, 8);
|
||||||
|
int tint_symbol_18[2][4] = int[2][4](tint_symbol_16, tint_symbol_17);
|
||||||
|
int subexpr_nested_nonempty[4] = tint_symbol_18[1];
|
||||||
|
int tint_symbol_19[4] = int[4](1, x, (x + 1), nonempty[3]);
|
||||||
|
int tint_symbol_20[2][4] = int[2][4](tint_symbol_19, nested_nonempty[1][2]);
|
||||||
|
int subexpr_nested_nonempty_with_expr[4] = tint_symbol_20[1];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
47
test/buffer/storage/dynamic_index/read.wgsl.expected.glsl
Normal file
47
test/buffer/storage/dynamic_index/read.wgsl.expected.glsl
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct Inner {
|
||||||
|
ivec3 a;
|
||||||
|
int b;
|
||||||
|
uvec3 c;
|
||||||
|
uint d;
|
||||||
|
vec3 e;
|
||||||
|
float f;
|
||||||
|
mat2x3 g;
|
||||||
|
mat3x2 h;
|
||||||
|
ivec4 i[4];
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 0) buffer S_1 {
|
||||||
|
Inner arr[];
|
||||||
|
} s;
|
||||||
|
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
uint idx;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tint_symbol_inner(uint idx) {
|
||||||
|
ivec3 a = s.arr[idx].a;
|
||||||
|
int b = s.arr[idx].b;
|
||||||
|
uvec3 c = s.arr[idx].c;
|
||||||
|
uint d = s.arr[idx].d;
|
||||||
|
vec3 e = s.arr[idx].e;
|
||||||
|
float f = s.arr[idx].f;
|
||||||
|
mat2x3 g = s.arr[idx].g;
|
||||||
|
mat3x2 h = s.arr[idx].h;
|
||||||
|
ivec4 i[4] = s.arr[idx].i;
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_2 inputs;
|
||||||
|
inputs.idx = uint(gl_LocalInvocationIndex);
|
||||||
|
tint_symbol(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
48
test/buffer/storage/dynamic_index/write.wgsl.expected.glsl
Normal file
48
test/buffer/storage/dynamic_index/write.wgsl.expected.glsl
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct Inner {
|
||||||
|
ivec3 a;
|
||||||
|
int b;
|
||||||
|
uvec3 c;
|
||||||
|
uint d;
|
||||||
|
vec3 e;
|
||||||
|
float f;
|
||||||
|
mat2x3 g;
|
||||||
|
mat3x2 h;
|
||||||
|
ivec4 i[4];
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 0) buffer S_1 {
|
||||||
|
Inner arr[];
|
||||||
|
} s;
|
||||||
|
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
uint idx;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tint_symbol_inner(uint idx) {
|
||||||
|
s.arr[idx].a = ivec3(0, 0, 0);
|
||||||
|
s.arr[idx].b = 0;
|
||||||
|
s.arr[idx].c = uvec3(0u, 0u, 0u);
|
||||||
|
s.arr[idx].d = 0u;
|
||||||
|
s.arr[idx].e = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
s.arr[idx].f = 0.0f;
|
||||||
|
s.arr[idx].g = mat2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
s.arr[idx].h = mat3x2(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
ivec4 tint_symbol_3[4] = ivec4[4](ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0), ivec4(0, 0, 0, 0));
|
||||||
|
s.arr[idx].i = tint_symbol_3;
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_2 inputs;
|
||||||
|
inputs.idx = uint(gl_LocalInvocationIndex);
|
||||||
|
tint_symbol(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
42
test/buffer/storage/static_index/read.wgsl.expected.glsl
Normal file
42
test/buffer/storage/static_index/read.wgsl.expected.glsl
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct Inner {
|
||||||
|
int x;
|
||||||
|
};
|
||||||
|
struct tint_padded_array_element {
|
||||||
|
Inner el;
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 0) buffer S_1 {
|
||||||
|
ivec3 a;
|
||||||
|
int b;
|
||||||
|
uvec3 c;
|
||||||
|
uint d;
|
||||||
|
vec3 e;
|
||||||
|
float f;
|
||||||
|
mat2x3 g;
|
||||||
|
mat3x2 h;
|
||||||
|
Inner i;
|
||||||
|
tint_padded_array_element j[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;
|
||||||
|
uvec3 c = s.c;
|
||||||
|
uint d = s.d;
|
||||||
|
vec3 e = s.e;
|
||||||
|
float f = s.f;
|
||||||
|
mat2x3 g = s.g;
|
||||||
|
mat3x2 h = s.h;
|
||||||
|
Inner i = s.i;
|
||||||
|
tint_padded_array_element j[4] = s.j;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
44
test/buffer/storage/static_index/write.wgsl.expected.glsl
Normal file
44
test/buffer/storage/static_index/write.wgsl.expected.glsl
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct Inner {
|
||||||
|
int x;
|
||||||
|
};
|
||||||
|
struct tint_padded_array_element {
|
||||||
|
Inner el;
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 0) buffer S_1 {
|
||||||
|
ivec3 a;
|
||||||
|
int b;
|
||||||
|
uvec3 c;
|
||||||
|
uint d;
|
||||||
|
vec3 e;
|
||||||
|
float f;
|
||||||
|
mat2x3 g;
|
||||||
|
mat3x2 h;
|
||||||
|
Inner i;
|
||||||
|
tint_padded_array_element j[4];
|
||||||
|
} s;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
s.a = ivec3(0, 0, 0);
|
||||||
|
s.b = 0;
|
||||||
|
s.c = uvec3(0u, 0u, 0u);
|
||||||
|
s.d = 0u;
|
||||||
|
s.e = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
s.f = 0.0f;
|
||||||
|
s.g = mat2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
s.h = mat3x2(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
Inner tint_symbol_1 = Inner(0);
|
||||||
|
s.i = tint_symbol_1;
|
||||||
|
tint_padded_array_element tint_symbol_2[4] = tint_padded_array_element[4](tint_padded_array_element(Inner(0)), tint_padded_array_element(Inner(0)), tint_padded_array_element(Inner(0)), tint_padded_array_element(Inner(0)));
|
||||||
|
s.j = tint_symbol_2;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
49
test/buffer/uniform/dynamic_index/read.wgsl.expected.glsl
Normal file
49
test/buffer/uniform/dynamic_index/read.wgsl.expected.glsl
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct Inner {
|
||||||
|
ivec3 a;
|
||||||
|
int b;
|
||||||
|
uvec3 c;
|
||||||
|
uint d;
|
||||||
|
vec3 e;
|
||||||
|
float f;
|
||||||
|
ivec2 g;
|
||||||
|
ivec2 h;
|
||||||
|
mat2x3 i;
|
||||||
|
mat3x2 j;
|
||||||
|
ivec4 k[4];
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 0) uniform S_1 {
|
||||||
|
Inner arr[8];
|
||||||
|
} s;
|
||||||
|
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
uint idx;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tint_symbol_inner(uint idx) {
|
||||||
|
ivec3 a = s.arr[idx].a;
|
||||||
|
int b = s.arr[idx].b;
|
||||||
|
uvec3 c = s.arr[idx].c;
|
||||||
|
uint d = s.arr[idx].d;
|
||||||
|
vec3 e = s.arr[idx].e;
|
||||||
|
float f = s.arr[idx].f;
|
||||||
|
ivec2 g = s.arr[idx].g;
|
||||||
|
ivec2 h = s.arr[idx].h;
|
||||||
|
mat2x3 i = s.arr[idx].i;
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_2 inputs;
|
||||||
|
inputs.idx = uint(gl_LocalInvocationIndex);
|
||||||
|
tint_symbol(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
46
test/buffer/uniform/static_index/read.wgsl.expected.glsl
Normal file
46
test/buffer/uniform/static_index/read.wgsl.expected.glsl
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct Inner {
|
||||||
|
int x;
|
||||||
|
};
|
||||||
|
struct tint_padded_array_element {
|
||||||
|
Inner el;
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 0) uniform S_1 {
|
||||||
|
ivec3 a;
|
||||||
|
int b;
|
||||||
|
uvec3 c;
|
||||||
|
uint d;
|
||||||
|
vec3 e;
|
||||||
|
float f;
|
||||||
|
ivec2 g;
|
||||||
|
ivec2 h;
|
||||||
|
mat2x3 i;
|
||||||
|
mat3x2 j;
|
||||||
|
Inner k;
|
||||||
|
tint_padded_array_element 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;
|
||||||
|
uvec3 c = s.c;
|
||||||
|
uint d = s.d;
|
||||||
|
vec3 e = s.e;
|
||||||
|
float f = s.f;
|
||||||
|
ivec2 g = s.g;
|
||||||
|
ivec2 h = s.h;
|
||||||
|
mat2x3 i = s.i;
|
||||||
|
mat3x2 j = s.j;
|
||||||
|
Inner k = s.k;
|
||||||
|
tint_padded_array_element l[4] = s.l;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
0
test/bug/chromium/1221120.wgsl.expected.glsl
Normal file
0
test/bug/chromium/1221120.wgsl.expected.glsl
Normal file
0
test/bug/chromium/1236161.wgsl.expected.glsl
Normal file
0
test/bug/chromium/1236161.wgsl.expected.glsl
Normal file
55
test/bug/chromium/1251009.wgsl.expected.glsl
Normal file
55
test/bug/chromium/1251009.wgsl.expected.glsl
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct VertexInputs0 {
|
||||||
|
uint vertex_index;
|
||||||
|
int loc0;
|
||||||
|
};
|
||||||
|
struct VertexInputs1 {
|
||||||
|
uint loc1;
|
||||||
|
vec4 loc3;
|
||||||
|
};
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
int loc0;
|
||||||
|
uint loc1;
|
||||||
|
uint loc1_1;
|
||||||
|
vec4 loc3;
|
||||||
|
uint vertex_index;
|
||||||
|
uint instance_index;
|
||||||
|
};
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
vec4 value;
|
||||||
|
};
|
||||||
|
|
||||||
|
vec4 tint_symbol_inner(VertexInputs0 inputs0, uint loc1, uint instance_index, VertexInputs1 inputs1) {
|
||||||
|
uint foo = (inputs0.vertex_index + instance_index);
|
||||||
|
return vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) {
|
||||||
|
VertexInputs0 tint_symbol_4 = VertexInputs0(tint_symbol_1.vertex_index, tint_symbol_1.loc0);
|
||||||
|
VertexInputs1 tint_symbol_5 = VertexInputs1(tint_symbol_1.loc1_1, tint_symbol_1.loc3);
|
||||||
|
vec4 inner_result = tint_symbol_inner(tint_symbol_4, tint_symbol_1.loc1, tint_symbol_1.instance_index, tint_symbol_5);
|
||||||
|
tint_symbol_3 wrapper_result = tint_symbol_3(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
wrapper_result.value = inner_result;
|
||||||
|
return wrapper_result;
|
||||||
|
}
|
||||||
|
in int loc0;
|
||||||
|
in uint loc1;
|
||||||
|
in uint loc1_1;
|
||||||
|
in vec4 loc3;
|
||||||
|
void main() {
|
||||||
|
tint_symbol_2 inputs;
|
||||||
|
inputs.loc0 = loc0;
|
||||||
|
inputs.loc1 = loc1;
|
||||||
|
inputs.loc1_1 = loc1_1;
|
||||||
|
inputs.loc3 = loc3;
|
||||||
|
inputs.vertex_index = uint(gl_VertexID);
|
||||||
|
inputs.instance_index = uint(gl_InstanceID);
|
||||||
|
tint_symbol_3 outputs;
|
||||||
|
outputs = tint_symbol(inputs);
|
||||||
|
gl_Position = outputs.value;
|
||||||
|
gl_Position.y = -gl_Position.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
120
test/bug/dawn/947.wgsl.expected.glsl
Normal file
120
test/bug/dawn/947.wgsl.expected.glsl
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform Uniforms_1 {
|
||||||
|
vec2 u_scale;
|
||||||
|
vec2 u_offset;
|
||||||
|
} uniforms;
|
||||||
|
|
||||||
|
struct VertexOutputs {
|
||||||
|
vec2 texcoords;
|
||||||
|
vec4 position;
|
||||||
|
};
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
uint VertexIndex;
|
||||||
|
};
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
vec2 texcoords;
|
||||||
|
vec4 position;
|
||||||
|
};
|
||||||
|
|
||||||
|
VertexOutputs vs_main_inner(uint VertexIndex) {
|
||||||
|
vec2 texcoord[3] = vec2[3](vec2(-0.5f, 0.0f), vec2(1.5f, 0.0f), vec2(0.5f, 2.0f));
|
||||||
|
VertexOutputs tint_symbol = VertexOutputs(vec2(0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
tint_symbol.position = vec4(((texcoord[VertexIndex] * 2.0f) - vec2(1.0f, 1.0f)), 0.0f, 1.0f);
|
||||||
|
bool flipY = (uniforms.u_scale.y < 0.0f);
|
||||||
|
if (flipY) {
|
||||||
|
tint_symbol.texcoords = ((((texcoord[VertexIndex] * uniforms.u_scale) + uniforms.u_offset) * vec2(1.0f, -1.0f)) + vec2(0.0f, 1.0f));
|
||||||
|
} else {
|
||||||
|
tint_symbol.texcoords = ((((texcoord[VertexIndex] * vec2(1.0f, -1.0f)) + vec2(0.0f, 1.0f)) * uniforms.u_scale) + uniforms.u_offset);
|
||||||
|
}
|
||||||
|
return tint_symbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct tint_symbol_5 {
|
||||||
|
vec2 texcoord;
|
||||||
|
};
|
||||||
|
struct tint_symbol_6 {
|
||||||
|
vec4 value;
|
||||||
|
};
|
||||||
|
|
||||||
|
tint_symbol_3 vs_main(tint_symbol_2 tint_symbol_1) {
|
||||||
|
VertexOutputs inner_result = vs_main_inner(tint_symbol_1.VertexIndex);
|
||||||
|
tint_symbol_3 wrapper_result = tint_symbol_3(vec2(0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
wrapper_result.texcoords = inner_result.texcoords;
|
||||||
|
wrapper_result.position = inner_result.position;
|
||||||
|
return wrapper_result;
|
||||||
|
}
|
||||||
|
out vec2 texcoords;
|
||||||
|
void main() {
|
||||||
|
tint_symbol_2 inputs;
|
||||||
|
inputs.VertexIndex = uint(gl_VertexID);
|
||||||
|
tint_symbol_3 outputs;
|
||||||
|
outputs = vs_main(inputs);
|
||||||
|
texcoords = outputs.texcoords;
|
||||||
|
gl_Position = outputs.position;
|
||||||
|
gl_Position.y = -gl_Position.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct VertexOutputs {
|
||||||
|
vec2 texcoords;
|
||||||
|
vec4 position;
|
||||||
|
};
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
uint VertexIndex;
|
||||||
|
};
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
vec2 texcoords;
|
||||||
|
vec4 position;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
uniform highp sampler2D myTexture;
|
||||||
|
|
||||||
|
struct tint_symbol_5 {
|
||||||
|
vec2 texcoord;
|
||||||
|
};
|
||||||
|
struct tint_symbol_6 {
|
||||||
|
vec4 value;
|
||||||
|
};
|
||||||
|
|
||||||
|
vec4 fs_main_inner(vec2 texcoord) {
|
||||||
|
vec2 clampedTexcoord = clamp(texcoord, vec2(0.0f, 0.0f), vec2(1.0f, 1.0f));
|
||||||
|
if (!(all((clampedTexcoord == texcoord)))) {
|
||||||
|
discard;
|
||||||
|
}
|
||||||
|
vec4 srcColor = texture(myTexture, texcoord);
|
||||||
|
return srcColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
tint_symbol_6 fs_main(tint_symbol_5 tint_symbol_4) {
|
||||||
|
vec4 inner_result_1 = fs_main_inner(tint_symbol_4.texcoord);
|
||||||
|
tint_symbol_6 wrapper_result_1 = tint_symbol_6(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
wrapper_result_1.value = inner_result_1;
|
||||||
|
return wrapper_result_1;
|
||||||
|
}
|
||||||
|
in vec2 texcoord;
|
||||||
|
out vec4 value;
|
||||||
|
void main() {
|
||||||
|
tint_symbol_5 inputs;
|
||||||
|
inputs.texcoord = texcoord;
|
||||||
|
tint_symbol_6 outputs;
|
||||||
|
outputs = fs_main(inputs);
|
||||||
|
value = outputs.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:28: 'all' : no matching overloaded function found
|
||||||
|
ERROR: 0:28: '' : compilation terminated
|
||||||
|
ERROR: 2 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
27
test/bug/fxc/dyn_array_idx/read/function.wgsl.expected.glsl
Normal file
27
test/bug/fxc/dyn_array_idx/read/function.wgsl.expected.glsl
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform UBO_1 {
|
||||||
|
int dynamic_idx;
|
||||||
|
} ubo;
|
||||||
|
|
||||||
|
struct S {
|
||||||
|
int data[64];
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 1) buffer Result_1 {
|
||||||
|
int tint_symbol;
|
||||||
|
} result;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
|
||||||
|
result.tint_symbol = s.data[ubo.dynamic_idx];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
27
test/bug/fxc/dyn_array_idx/read/private.wgsl.expected.glsl
Normal file
27
test/bug/fxc/dyn_array_idx/read/private.wgsl.expected.glsl
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform UBO_1 {
|
||||||
|
int dynamic_idx;
|
||||||
|
} ubo;
|
||||||
|
|
||||||
|
struct S {
|
||||||
|
int data[64];
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 1) buffer Result_1 {
|
||||||
|
int tint_symbol;
|
||||||
|
} result;
|
||||||
|
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
result.tint_symbol = s.data[ubo.dynamic_idx];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
26
test/bug/fxc/dyn_array_idx/read/storage.wgsl.expected.glsl
Normal file
26
test/bug/fxc/dyn_array_idx/read/storage.wgsl.expected.glsl
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform UBO_1 {
|
||||||
|
int dynamic_idx;
|
||||||
|
} ubo;
|
||||||
|
|
||||||
|
layout (binding = 2) buffer Result_1 {
|
||||||
|
int tint_symbol;
|
||||||
|
} result;
|
||||||
|
|
||||||
|
layout (binding = 1) buffer SSBO_1 {
|
||||||
|
int data[4];
|
||||||
|
} ssbo;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
result.tint_symbol = ssbo.data[ubo.dynamic_idx];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
26
test/bug/fxc/dyn_array_idx/read/uniform.wgsl.expected.glsl
Normal file
26
test/bug/fxc/dyn_array_idx/read/uniform.wgsl.expected.glsl
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct tint_padded_array_element {
|
||||||
|
int el;
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 0) uniform UBO_1 {
|
||||||
|
tint_padded_array_element data[4];
|
||||||
|
int dynamic_idx;
|
||||||
|
} ubo;
|
||||||
|
|
||||||
|
layout (binding = 2) buffer Result_1 {
|
||||||
|
int tint_symbol;
|
||||||
|
} result;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
result.tint_symbol = ubo.data[ubo.dynamic_idx].el;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
52
test/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.glsl
Normal file
52
test/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.glsl
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform UBO_1 {
|
||||||
|
int dynamic_idx;
|
||||||
|
} ubo;
|
||||||
|
|
||||||
|
struct S {
|
||||||
|
int data[64];
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 1) buffer Result_1 {
|
||||||
|
int tint_symbol;
|
||||||
|
} result;
|
||||||
|
groupshared S s;
|
||||||
|
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
uint local_invocation_index;
|
||||||
|
};
|
||||||
|
|
||||||
|
void f_inner(uint local_invocation_index) {
|
||||||
|
{
|
||||||
|
for(uint idx = local_invocation_index; (idx < 64u); idx = (idx + 1u)) {
|
||||||
|
uint i = idx;
|
||||||
|
s.data[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GroupMemoryBarrierWithGroupSync();
|
||||||
|
result.tint_symbol = s.data[ubo.dynamic_idx];
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f(tint_symbol_2 tint_symbol_1) {
|
||||||
|
f_inner(tint_symbol_1.local_invocation_index);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_2 inputs;
|
||||||
|
inputs.local_invocation_index = uint(gl_LocalInvocationIndex);
|
||||||
|
f(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:16: '' : syntax error, unexpected IDENTIFIER
|
||||||
|
ERROR: 1 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
28
test/bug/fxc/dyn_array_idx/write/function.wgsl.expected.glsl
Normal file
28
test/bug/fxc/dyn_array_idx/write/function.wgsl.expected.glsl
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform UBO_1 {
|
||||||
|
int dynamic_idx;
|
||||||
|
} ubo;
|
||||||
|
|
||||||
|
struct S {
|
||||||
|
int data[64];
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 1) buffer Result_1 {
|
||||||
|
int tint_symbol;
|
||||||
|
} result;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
|
||||||
|
s.data[ubo.dynamic_idx] = 1;
|
||||||
|
result.tint_symbol = s.data[3];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform UBO_1 {
|
||||||
|
int dynamic_idx;
|
||||||
|
} ubo;
|
||||||
|
|
||||||
|
struct S {
|
||||||
|
int data[64];
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 1) buffer Result_1 {
|
||||||
|
int tint_symbol;
|
||||||
|
} result;
|
||||||
|
|
||||||
|
void x(inout S p) {
|
||||||
|
p.data[ubo.dynamic_idx] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
|
||||||
|
x(s);
|
||||||
|
result.tint_symbol = s.data[3];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
28
test/bug/fxc/dyn_array_idx/write/private.wgsl.expected.glsl
Normal file
28
test/bug/fxc/dyn_array_idx/write/private.wgsl.expected.glsl
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform UBO_1 {
|
||||||
|
int dynamic_idx;
|
||||||
|
} ubo;
|
||||||
|
|
||||||
|
struct S {
|
||||||
|
int data[64];
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 1) buffer Result_1 {
|
||||||
|
int tint_symbol;
|
||||||
|
} result;
|
||||||
|
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
s.data[ubo.dynamic_idx] = 1;
|
||||||
|
result.tint_symbol = s.data[3];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform UBO_1 {
|
||||||
|
int dynamic_idx;
|
||||||
|
} ubo;
|
||||||
|
|
||||||
|
struct S {
|
||||||
|
int data[64];
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 1) buffer Result_1 {
|
||||||
|
int tint_symbol;
|
||||||
|
} result;
|
||||||
|
S s = S(int[64](0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
|
||||||
|
|
||||||
|
void x(inout S p) {
|
||||||
|
p.data[ubo.dynamic_idx] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
x(s);
|
||||||
|
result.tint_symbol = s.data[3];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
27
test/bug/fxc/dyn_array_idx/write/storage.wgsl.expected.glsl
Normal file
27
test/bug/fxc/dyn_array_idx/write/storage.wgsl.expected.glsl
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform UBO_1 {
|
||||||
|
int dynamic_idx;
|
||||||
|
} ubo;
|
||||||
|
|
||||||
|
layout (binding = 2) buffer Result_1 {
|
||||||
|
int tint_symbol;
|
||||||
|
} result;
|
||||||
|
|
||||||
|
layout (binding = 1) buffer SSBO_1 {
|
||||||
|
int data[4];
|
||||||
|
} ssbo;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
ssbo.data[ubo.dynamic_idx] = 1;
|
||||||
|
result.tint_symbol = ssbo.data[3];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,53 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform UBO_1 {
|
||||||
|
int dynamic_idx;
|
||||||
|
} ubo;
|
||||||
|
|
||||||
|
struct S {
|
||||||
|
int data[64];
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 1) buffer Result_1 {
|
||||||
|
int tint_symbol;
|
||||||
|
} result;
|
||||||
|
groupshared S s;
|
||||||
|
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
uint local_invocation_index;
|
||||||
|
};
|
||||||
|
|
||||||
|
void f_inner(uint local_invocation_index) {
|
||||||
|
{
|
||||||
|
for(uint idx = local_invocation_index; (idx < 64u); idx = (idx + 1u)) {
|
||||||
|
uint i = idx;
|
||||||
|
s.data[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GroupMemoryBarrierWithGroupSync();
|
||||||
|
s.data[ubo.dynamic_idx] = 1;
|
||||||
|
result.tint_symbol = s.data[3];
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f(tint_symbol_2 tint_symbol_1) {
|
||||||
|
f_inner(tint_symbol_1.local_invocation_index);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_2 inputs;
|
||||||
|
inputs.local_invocation_index = uint(gl_LocalInvocationIndex);
|
||||||
|
f(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:16: '' : syntax error, unexpected IDENTIFIER
|
||||||
|
ERROR: 1 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
vec2 v2f = vec2(0.0f, 0.0f);
|
||||||
|
ivec3 v3i = ivec3(0, 0, 0);
|
||||||
|
uvec4 v4u = uvec4(0u, 0u, 0u, 0u);
|
||||||
|
bvec2 v2b = bvec2(false, false);
|
||||||
|
|
||||||
|
void foo() {
|
||||||
|
{
|
||||||
|
for(int i = 0; (i < 2); i = (i + 1)) {
|
||||||
|
v2f[i] = 1.0f;
|
||||||
|
v3i[i] = 1;
|
||||||
|
v4u[i] = 1u;
|
||||||
|
v2b[i] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
{
|
||||||
|
for(int i = 0; (i < 2); i = (i + 1)) {
|
||||||
|
foo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
vec2 v2f = vec2(0.0f, 0.0f);
|
||||||
|
ivec3 v3i = ivec3(0, 0, 0);
|
||||||
|
uvec4 v4u = uvec4(0u, 0u, 0u, 0u);
|
||||||
|
bvec2 v2b = bvec2(false, false);
|
||||||
|
|
||||||
|
void foo() {
|
||||||
|
int i = 0;
|
||||||
|
v2f[i] = 1.0f;
|
||||||
|
v3i[i] = 1;
|
||||||
|
v4u[i] = 1u;
|
||||||
|
v2b[i] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
{
|
||||||
|
for(int i = 0; (i < 2); i = (i + 1)) {
|
||||||
|
foo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
vec2 v2f = vec2(0.0f, 0.0f);
|
||||||
|
vec3 v3f = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec4 v4f = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
ivec2 v2i = ivec2(0, 0);
|
||||||
|
ivec3 v3i = ivec3(0, 0, 0);
|
||||||
|
ivec4 v4i = ivec4(0, 0, 0, 0);
|
||||||
|
uvec2 v2u = uvec2(0u, 0u);
|
||||||
|
uvec3 v3u = uvec3(0u, 0u, 0u);
|
||||||
|
uvec4 v4u = uvec4(0u, 0u, 0u, 0u);
|
||||||
|
bvec2 v2b = bvec2(false, false);
|
||||||
|
bvec3 v3b = bvec3(false, false, false);
|
||||||
|
bvec4 v4b = bvec4(false, false, false, false);
|
||||||
|
{
|
||||||
|
for(int i = 0; (i < 2); i = (i + 1)) {
|
||||||
|
v2f[i] = 1.0f;
|
||||||
|
v3f[i] = 1.0f;
|
||||||
|
v4f[i] = 1.0f;
|
||||||
|
v2i[i] = 1;
|
||||||
|
v3i[i] = 1;
|
||||||
|
v4i[i] = 1;
|
||||||
|
v2u[i] = 1u;
|
||||||
|
v3u[i] = 1u;
|
||||||
|
v4u[i] = 1u;
|
||||||
|
v2b[i] = true;
|
||||||
|
v3b[i] = true;
|
||||||
|
v4b[i] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
vec2 v2f = vec2(0.0f, 0.0f);
|
||||||
|
vec2 v2f_2 = vec2(0.0f, 0.0f);
|
||||||
|
ivec3 v3i = ivec3(0, 0, 0);
|
||||||
|
ivec3 v3i_2 = ivec3(0, 0, 0);
|
||||||
|
uvec4 v4u = uvec4(0u, 0u, 0u, 0u);
|
||||||
|
uvec4 v4u_2 = uvec4(0u, 0u, 0u, 0u);
|
||||||
|
bvec2 v2b = bvec2(false, false);
|
||||||
|
bvec2 v2b_2 = bvec2(false, false);
|
||||||
|
{
|
||||||
|
for(int i = 0; (i < 2); i = (i + 1)) {
|
||||||
|
v2f[i] = 1.0f;
|
||||||
|
v3i[i] = 1;
|
||||||
|
v4u[i] = 1u;
|
||||||
|
v2b[i] = true;
|
||||||
|
v2f_2[i] = 1.0f;
|
||||||
|
v3i_2[i] = 1;
|
||||||
|
v4u_2[i] = 1u;
|
||||||
|
v2b_2[i] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
vec2 v2f = vec2(0.0f, 0.0f);
|
||||||
|
vec3 v3f = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec4 v4f = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
ivec2 v2i = ivec2(0, 0);
|
||||||
|
ivec3 v3i = ivec3(0, 0, 0);
|
||||||
|
ivec4 v4i = ivec4(0, 0, 0, 0);
|
||||||
|
uvec2 v2u = uvec2(0u, 0u);
|
||||||
|
uvec3 v3u = uvec3(0u, 0u, 0u);
|
||||||
|
uvec4 v4u = uvec4(0u, 0u, 0u, 0u);
|
||||||
|
bvec2 v2b = bvec2(false, false);
|
||||||
|
bvec3 v3b = bvec3(false, false, false);
|
||||||
|
bvec4 v4b = bvec4(false, false, false, false);
|
||||||
|
{
|
||||||
|
for(int i = 0; (i < 2); i = (i + 1)) {
|
||||||
|
v2f[i] = 1.0f;
|
||||||
|
v2i[i] = 1;
|
||||||
|
v2u[i] = 1u;
|
||||||
|
v2b[i] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int i = 0;
|
||||||
|
v3f[i] = 1.0f;
|
||||||
|
v4f[i] = 1.0f;
|
||||||
|
v3i[i] = 1;
|
||||||
|
v4i[i] = 1;
|
||||||
|
v3u[i] = 1u;
|
||||||
|
v4u[i] = 1u;
|
||||||
|
v3b[i] = true;
|
||||||
|
v4b[i] = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
vec2 v2f = vec2(0.0f, 0.0f);
|
||||||
|
vec3 v3f = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec4 v4f = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
ivec2 v2i = ivec2(0, 0);
|
||||||
|
ivec3 v3i = ivec3(0, 0, 0);
|
||||||
|
ivec4 v4i = ivec4(0, 0, 0, 0);
|
||||||
|
uvec2 v2u = uvec2(0u, 0u);
|
||||||
|
uvec3 v3u = uvec3(0u, 0u, 0u);
|
||||||
|
uvec4 v4u = uvec4(0u, 0u, 0u, 0u);
|
||||||
|
bvec2 v2b = bvec2(false, false);
|
||||||
|
bvec3 v3b = bvec3(false, false, false);
|
||||||
|
bvec4 v4b = bvec4(false, false, false, false);
|
||||||
|
int i = 0;
|
||||||
|
v2f[i] = 1.0f;
|
||||||
|
v3f[i] = 1.0f;
|
||||||
|
v4f[i] = 1.0f;
|
||||||
|
v2i[i] = 1;
|
||||||
|
v3i[i] = 1;
|
||||||
|
v4i[i] = 1;
|
||||||
|
v2u[i] = 1u;
|
||||||
|
v3u[i] = 1u;
|
||||||
|
v4u[i] = 1u;
|
||||||
|
v2b[i] = true;
|
||||||
|
v3b[i] = true;
|
||||||
|
v4b[i] = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
80
test/bug/tint/1046.wgsl.expected.glsl
Normal file
80
test/bug/tint/1046.wgsl.expected.glsl
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct PointLight {
|
||||||
|
vec4 position;
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 0) uniform Uniforms_1 {
|
||||||
|
mat4 worldView;
|
||||||
|
mat4 proj;
|
||||||
|
uint numPointLights;
|
||||||
|
uint color_source;
|
||||||
|
vec4 color;
|
||||||
|
} uniforms;
|
||||||
|
layout (binding = 1) buffer PointLights_1 {
|
||||||
|
PointLight values[];
|
||||||
|
} pointLights;
|
||||||
|
|
||||||
|
uniform highp sampler2D myTexture;
|
||||||
|
|
||||||
|
struct FragmentInput {
|
||||||
|
vec4 position;
|
||||||
|
vec4 view_position;
|
||||||
|
vec4 normal;
|
||||||
|
vec2 uv;
|
||||||
|
vec4 color;
|
||||||
|
};
|
||||||
|
struct FragmentOutput {
|
||||||
|
vec4 color;
|
||||||
|
};
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
vec4 view_position;
|
||||||
|
vec4 normal;
|
||||||
|
vec2 uv;
|
||||||
|
vec4 color;
|
||||||
|
vec4 position;
|
||||||
|
};
|
||||||
|
struct tint_symbol_4 {
|
||||||
|
vec4 color;
|
||||||
|
};
|
||||||
|
|
||||||
|
FragmentOutput tint_symbol_inner(FragmentInput fragment) {
|
||||||
|
FragmentOutput tint_symbol_1 = FragmentOutput(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
tint_symbol_1.color = vec4(1.0f, 0.0f, 0.0f, 1.0f);
|
||||||
|
return tint_symbol_1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tint_symbol_4 tint_symbol(tint_symbol_3 tint_symbol_2) {
|
||||||
|
FragmentInput tint_symbol_5 = FragmentInput(tint_symbol_2.position, tint_symbol_2.view_position, tint_symbol_2.normal, tint_symbol_2.uv, tint_symbol_2.color);
|
||||||
|
FragmentOutput inner_result = tint_symbol_inner(tint_symbol_5);
|
||||||
|
tint_symbol_4 wrapper_result = tint_symbol_4(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
wrapper_result.color = inner_result.color;
|
||||||
|
return wrapper_result;
|
||||||
|
}
|
||||||
|
in vec4 view_position;
|
||||||
|
in vec4 normal;
|
||||||
|
in vec2 uv;
|
||||||
|
in vec4 color;
|
||||||
|
out vec4 color;
|
||||||
|
void main() {
|
||||||
|
tint_symbol_3 inputs;
|
||||||
|
inputs.view_position = view_position;
|
||||||
|
inputs.normal = normal;
|
||||||
|
inputs.uv = uv;
|
||||||
|
inputs.color = color;
|
||||||
|
inputs.position = gl_FragCoord;
|
||||||
|
tint_symbol_4 outputs;
|
||||||
|
outputs = tint_symbol(inputs);
|
||||||
|
color = outputs.color;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:59: 'color' : redefinition
|
||||||
|
ERROR: 1 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
23
test/bug/tint/1064.wgsl.expected.glsl
Normal file
23
test/bug/tint/1064.wgsl.expected.glsl
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
void tint_symbol() {
|
||||||
|
while (true) {
|
||||||
|
if (false) {
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if (true) {
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
56
test/bug/tint/1076.wgsl.expected.glsl
Normal file
56
test/bug/tint/1076.wgsl.expected.glsl
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct FragIn {
|
||||||
|
float a;
|
||||||
|
uint mask;
|
||||||
|
};
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
float a;
|
||||||
|
float b;
|
||||||
|
uint mask;
|
||||||
|
};
|
||||||
|
struct tint_symbol_4 {
|
||||||
|
float a;
|
||||||
|
uint mask;
|
||||||
|
};
|
||||||
|
|
||||||
|
FragIn tint_symbol_inner(FragIn tint_symbol_1, float b) {
|
||||||
|
if ((tint_symbol_1.mask == 0u)) {
|
||||||
|
return tint_symbol_1;
|
||||||
|
}
|
||||||
|
FragIn tint_symbol_5 = FragIn(b, 1u);
|
||||||
|
return tint_symbol_5;
|
||||||
|
}
|
||||||
|
|
||||||
|
tint_symbol_4 tint_symbol(tint_symbol_3 tint_symbol_2) {
|
||||||
|
FragIn tint_symbol_6 = FragIn(tint_symbol_2.a, tint_symbol_2.mask);
|
||||||
|
FragIn inner_result = tint_symbol_inner(tint_symbol_6, tint_symbol_2.b);
|
||||||
|
tint_symbol_4 wrapper_result = tint_symbol_4(0.0f, 0u);
|
||||||
|
wrapper_result.a = inner_result.a;
|
||||||
|
wrapper_result.mask = inner_result.mask;
|
||||||
|
return wrapper_result;
|
||||||
|
}
|
||||||
|
in float a;
|
||||||
|
in float b;
|
||||||
|
out float a;
|
||||||
|
void main() {
|
||||||
|
tint_symbol_3 inputs;
|
||||||
|
inputs.a = a;
|
||||||
|
inputs.b = b;
|
||||||
|
inputs.mask = uint(gl_SampleMask);
|
||||||
|
tint_symbol_4 outputs;
|
||||||
|
outputs = tint_symbol(inputs);
|
||||||
|
a = outputs.a;
|
||||||
|
gl_SampleMask = outputs.mask;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:36: 'a' : redefinition
|
||||||
|
ERROR: 1 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
58
test/bug/tint/1081.wgsl.expected.glsl
Normal file
58
test/bug/tint/1081.wgsl.expected.glsl
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
bug/tint/1081.wgsl:9:25 warning: integral user-defined fragment inputs must have a flat interpolation attribute
|
||||||
|
fn main([[location(1)]] x: vec3<i32>) -> [[location(2)]] i32 {
|
||||||
|
^
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
int f(int x) {
|
||||||
|
if ((x == 10)) {
|
||||||
|
discard;
|
||||||
|
}
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
ivec3 x;
|
||||||
|
};
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
int value;
|
||||||
|
};
|
||||||
|
|
||||||
|
int tint_symbol_inner(ivec3 x) {
|
||||||
|
int y = x.x;
|
||||||
|
while (true) {
|
||||||
|
int r = f(y);
|
||||||
|
if ((r == 0)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
|
||||||
|
tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) {
|
||||||
|
int inner_result = tint_symbol_inner(tint_symbol_1.x);
|
||||||
|
tint_symbol_3 wrapper_result = tint_symbol_3(0);
|
||||||
|
wrapper_result.value = inner_result;
|
||||||
|
return wrapper_result;
|
||||||
|
}
|
||||||
|
in ivec3 x;
|
||||||
|
out int value;
|
||||||
|
void main() {
|
||||||
|
tint_symbol_2 inputs;
|
||||||
|
inputs.x = x;
|
||||||
|
tint_symbol_3 outputs;
|
||||||
|
outputs = tint_symbol(inputs);
|
||||||
|
value = outputs.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:35: 'int' : must be qualified as flat in
|
||||||
|
ERROR: 0:35: '' : compilation terminated
|
||||||
|
ERROR: 2 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
13
test/bug/tint/1083.wgsl.expected.glsl
Normal file
13
test/bug/tint/1083.wgsl.expected.glsl
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
int c = (1 / 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
22
test/bug/tint/1086.wgsl.expected.glsl
Normal file
22
test/bug/tint/1086.wgsl.expected.glsl
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
float v = 0.0f;
|
||||||
|
|
||||||
|
void x(inout float p) {
|
||||||
|
p = 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
void g() {
|
||||||
|
x(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
void f() {
|
||||||
|
g();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
90
test/bug/tint/1088.spvasm.expected.glsl
Normal file
90
test/bug/tint/1088.spvasm.expected.glsl
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct tint_padded_array_element {
|
||||||
|
float el;
|
||||||
|
};
|
||||||
|
|
||||||
|
vec3 position = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
layout (binding = 2) uniform LeftOver_1 {
|
||||||
|
mat4 worldViewProjection;
|
||||||
|
float time;
|
||||||
|
mat4 test2[2];
|
||||||
|
tint_padded_array_element test[4];
|
||||||
|
} x_14;
|
||||||
|
vec2 vUV = vec2(0.0f, 0.0f);
|
||||||
|
vec2 uv = vec2(0.0f, 0.0f);
|
||||||
|
vec3 normal = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec4 tint_symbol = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
|
void main_1() {
|
||||||
|
vec4 q = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 p = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 x_13 = position;
|
||||||
|
q = vec4(x_13.x, x_13.y, x_13.z, 1.0f);
|
||||||
|
vec4 x_21 = q;
|
||||||
|
p = vec3(x_21.x, x_21.y, x_21.z);
|
||||||
|
float x_27 = p.x;
|
||||||
|
float x_41 = x_14.test[0].el;
|
||||||
|
float x_45 = position.y;
|
||||||
|
float x_49 = x_14.time;
|
||||||
|
p.x = (x_27 + sin(((x_41 * x_45) + x_49)));
|
||||||
|
float x_55 = p.y;
|
||||||
|
float x_57 = x_14.time;
|
||||||
|
p.y = (x_55 + sin((x_57 + 4.0f)));
|
||||||
|
mat4 x_69 = x_14.worldViewProjection;
|
||||||
|
vec3 x_70 = p;
|
||||||
|
tint_symbol = (x_69 * vec4(x_70.x, x_70.y, x_70.z, 1.0f));
|
||||||
|
vUV = uv;
|
||||||
|
float x_87 = tint_symbol.y;
|
||||||
|
tint_symbol.y = (x_87 * -1.0f);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct main_out {
|
||||||
|
vec4 tint_symbol;
|
||||||
|
vec2 vUV_1;
|
||||||
|
};
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
vec3 position_param;
|
||||||
|
vec3 normal_param;
|
||||||
|
vec2 uv_param;
|
||||||
|
};
|
||||||
|
struct tint_symbol_4 {
|
||||||
|
vec2 vUV_1;
|
||||||
|
vec4 tint_symbol;
|
||||||
|
};
|
||||||
|
|
||||||
|
main_out tint_symbol_1_inner(vec3 position_param, vec2 uv_param, vec3 normal_param) {
|
||||||
|
position = position_param;
|
||||||
|
uv = uv_param;
|
||||||
|
normal = normal_param;
|
||||||
|
main_1();
|
||||||
|
main_out tint_symbol_5 = main_out(tint_symbol, vUV);
|
||||||
|
return tint_symbol_5;
|
||||||
|
}
|
||||||
|
|
||||||
|
tint_symbol_4 tint_symbol_1(tint_symbol_3 tint_symbol_2) {
|
||||||
|
main_out inner_result = tint_symbol_1_inner(tint_symbol_2.position_param, tint_symbol_2.uv_param, tint_symbol_2.normal_param);
|
||||||
|
tint_symbol_4 wrapper_result = tint_symbol_4(vec2(0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
wrapper_result.tint_symbol = inner_result.tint_symbol;
|
||||||
|
wrapper_result.vUV_1 = inner_result.vUV_1;
|
||||||
|
return wrapper_result;
|
||||||
|
}
|
||||||
|
in vec3 position_param;
|
||||||
|
in vec3 normal_param;
|
||||||
|
in vec2 uv_param;
|
||||||
|
out vec2 vUV_1;
|
||||||
|
void main() {
|
||||||
|
tint_symbol_3 inputs;
|
||||||
|
inputs.position_param = position_param;
|
||||||
|
inputs.normal_param = normal_param;
|
||||||
|
inputs.uv_param = uv_param;
|
||||||
|
tint_symbol_4 outputs;
|
||||||
|
outputs = tint_symbol_1(inputs);
|
||||||
|
vUV_1 = outputs.vUV_1;
|
||||||
|
gl_Position = outputs.tint_symbol;
|
||||||
|
gl_Position.y = -gl_Position.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
357
test/bug/tint/1113.wgsl.expected.glsl
Normal file
357
test/bug/tint/1113.wgsl.expected.glsl
Normal file
@ -0,0 +1,357 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform Uniforms_1 {
|
||||||
|
uint numTriangles;
|
||||||
|
uint gridSize;
|
||||||
|
uint pad1;
|
||||||
|
uint pad2;
|
||||||
|
vec3 bbMin;
|
||||||
|
vec3 bbMax;
|
||||||
|
} uniforms;
|
||||||
|
layout (binding = 10) buffer U32s_1 {
|
||||||
|
uint values[];
|
||||||
|
} indices;
|
||||||
|
layout (binding = 11) buffer F32s_1 {
|
||||||
|
float values[];
|
||||||
|
} positions;
|
||||||
|
layout (binding = 20) buffer AU32s_1 {
|
||||||
|
uint values[];
|
||||||
|
} counters;
|
||||||
|
layout (binding = 21) buffer AI32s_1 {
|
||||||
|
int values[];
|
||||||
|
} LUT;
|
||||||
|
layout (binding = 50) buffer Dbg_1 {
|
||||||
|
uint offsetCounter;
|
||||||
|
uint pad0;
|
||||||
|
uint pad1;
|
||||||
|
uint pad2;
|
||||||
|
uint value0;
|
||||||
|
uint value1;
|
||||||
|
uint value2;
|
||||||
|
uint value3;
|
||||||
|
float value_f32_0;
|
||||||
|
float value_f32_1;
|
||||||
|
float value_f32_2;
|
||||||
|
float value_f32_3;
|
||||||
|
} dbg;
|
||||||
|
|
||||||
|
vec3 toVoxelPos(vec3 position) {
|
||||||
|
vec3 bbMin = vec3(uniforms.bbMin.x, uniforms.bbMin.y, uniforms.bbMin.z);
|
||||||
|
vec3 bbMax = vec3(uniforms.bbMax.x, uniforms.bbMax.y, uniforms.bbMax.z);
|
||||||
|
vec3 bbSize = (bbMax - bbMin);
|
||||||
|
float cubeSize = max(max(bbSize.x, bbSize.y), bbSize.z);
|
||||||
|
float gridSize = float(uniforms.gridSize);
|
||||||
|
float gx = ((gridSize * (position.x - uniforms.bbMin.x)) / cubeSize);
|
||||||
|
float gy = ((gridSize * (position.y - uniforms.bbMin.y)) / cubeSize);
|
||||||
|
float gz = ((gridSize * (position.z - uniforms.bbMin.z)) / cubeSize);
|
||||||
|
return vec3(gx, gy, gz);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint toIndex1D(uint gridSize, vec3 voxelPos) {
|
||||||
|
uvec3 icoord = uvec3(voxelPos);
|
||||||
|
return ((icoord.x + (gridSize * icoord.y)) + ((gridSize * gridSize) * icoord.z));
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 loadPosition(uint vertexIndex) {
|
||||||
|
vec3 position = vec3(positions.values[((3u * vertexIndex) + 0u)], positions.values[((3u * vertexIndex) + 1u)], positions.values[((3u * vertexIndex) + 2u)]);
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
void doIgnore() {
|
||||||
|
uint g42 = uniforms.numTriangles;
|
||||||
|
uint kj6 = dbg.value1;
|
||||||
|
uint atomic_result = 0u;
|
||||||
|
InterlockedOr(counters.values[0], 0, atomic_result);
|
||||||
|
uint b53 = atomic_result;
|
||||||
|
uint rwg = indices.values[0];
|
||||||
|
float rb5 = positions.values[0];
|
||||||
|
int atomic_result_1 = 0;
|
||||||
|
InterlockedOr(LUT.values[0], 0, atomic_result_1);
|
||||||
|
int g55 = atomic_result_1;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct tint_symbol_1 {
|
||||||
|
uvec3 GlobalInvocationID;
|
||||||
|
};
|
||||||
|
|
||||||
|
void main_count_inner(uvec3 GlobalInvocationID) {
|
||||||
|
uint triangleIndex = GlobalInvocationID.x;
|
||||||
|
if ((triangleIndex >= uniforms.numTriangles)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
doIgnore();
|
||||||
|
uint i0 = indices.values[((3u * triangleIndex) + 0u)];
|
||||||
|
uint i1 = indices.values[((3u * triangleIndex) + 1u)];
|
||||||
|
uint i2 = indices.values[((3u * triangleIndex) + 2u)];
|
||||||
|
vec3 p0 = loadPosition(i0);
|
||||||
|
vec3 p1 = loadPosition(i1);
|
||||||
|
vec3 p2 = loadPosition(i2);
|
||||||
|
vec3 center = (((p0 + p1) + p2) / 3.0f);
|
||||||
|
vec3 voxelPos = toVoxelPos(center);
|
||||||
|
uint voxelIndex = toIndex1D(uniforms.gridSize, voxelPos);
|
||||||
|
uint atomic_result_2 = 0u;
|
||||||
|
InterlockedAdd(counters.values[voxelIndex], 1u, atomic_result_2);
|
||||||
|
uint acefg = atomic_result_2;
|
||||||
|
if ((triangleIndex == 0u)) {
|
||||||
|
dbg.value0 = uniforms.gridSize;
|
||||||
|
dbg.value_f32_0 = center.x;
|
||||||
|
dbg.value_f32_1 = center.y;
|
||||||
|
dbg.value_f32_2 = center.z;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
uvec3 GlobalInvocationID;
|
||||||
|
};
|
||||||
|
struct tint_symbol_5 {
|
||||||
|
uvec3 GlobalInvocationID;
|
||||||
|
};
|
||||||
|
|
||||||
|
layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void main_count(tint_symbol_1 tint_symbol) {
|
||||||
|
main_count_inner(tint_symbol.GlobalInvocationID);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_1 inputs;
|
||||||
|
inputs.GlobalInvocationID = gl_GlobalInvocationID;
|
||||||
|
main_count(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:66: 'InterlockedOr' : no matching overloaded function found
|
||||||
|
ERROR: 0:66: '' : compilation terminated
|
||||||
|
ERROR: 2 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform Uniforms_1 {
|
||||||
|
uint numTriangles;
|
||||||
|
uint gridSize;
|
||||||
|
uint pad1;
|
||||||
|
uint pad2;
|
||||||
|
vec3 bbMin;
|
||||||
|
vec3 bbMax;
|
||||||
|
} uniforms;
|
||||||
|
layout (binding = 10) buffer U32s_1 {
|
||||||
|
uint values[];
|
||||||
|
} indices;
|
||||||
|
layout (binding = 11) buffer F32s_1 {
|
||||||
|
float values[];
|
||||||
|
} positions;
|
||||||
|
layout (binding = 20) buffer AU32s_1 {
|
||||||
|
uint values[];
|
||||||
|
} counters;
|
||||||
|
layout (binding = 21) buffer AI32s_1 {
|
||||||
|
int values[];
|
||||||
|
} LUT;
|
||||||
|
layout (binding = 50) buffer Dbg_1 {
|
||||||
|
uint offsetCounter;
|
||||||
|
uint pad0;
|
||||||
|
uint pad1;
|
||||||
|
uint pad2;
|
||||||
|
uint value0;
|
||||||
|
uint value1;
|
||||||
|
uint value2;
|
||||||
|
uint value3;
|
||||||
|
float value_f32_0;
|
||||||
|
float value_f32_1;
|
||||||
|
float value_f32_2;
|
||||||
|
float value_f32_3;
|
||||||
|
} dbg;
|
||||||
|
|
||||||
|
void doIgnore() {
|
||||||
|
uint g42 = uniforms.numTriangles;
|
||||||
|
uint kj6 = dbg.value1;
|
||||||
|
uint atomic_result = 0u;
|
||||||
|
InterlockedOr(counters.values[0], 0, atomic_result);
|
||||||
|
uint b53 = atomic_result;
|
||||||
|
uint rwg = indices.values[0];
|
||||||
|
float rb5 = positions.values[0];
|
||||||
|
int atomic_result_1 = 0;
|
||||||
|
InterlockedOr(LUT.values[0], 0, atomic_result_1);
|
||||||
|
int g55 = atomic_result_1;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct tint_symbol_1 {
|
||||||
|
uvec3 GlobalInvocationID;
|
||||||
|
};
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
uvec3 GlobalInvocationID;
|
||||||
|
};
|
||||||
|
|
||||||
|
void main_create_lut_inner(uvec3 GlobalInvocationID) {
|
||||||
|
uint voxelIndex = GlobalInvocationID.x;
|
||||||
|
doIgnore();
|
||||||
|
uint maxVoxels = ((uniforms.gridSize * uniforms.gridSize) * uniforms.gridSize);
|
||||||
|
if ((voxelIndex >= maxVoxels)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uint atomic_result_2 = 0u;
|
||||||
|
InterlockedOr(counters.values[voxelIndex], 0, atomic_result_2);
|
||||||
|
uint numTriangles = atomic_result_2;
|
||||||
|
int offset = -1;
|
||||||
|
if ((numTriangles > 0u)) {
|
||||||
|
uint atomic_result_3 = 0u;
|
||||||
|
InterlockedAdd(dbg.offsetCounter, numTriangles, atomic_result_3);
|
||||||
|
offset = int(atomic_result_3);
|
||||||
|
}
|
||||||
|
int atomic_result_4 = 0;
|
||||||
|
InterlockedExchange(LUT.values[voxelIndex], offset, atomic_result_4);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct tint_symbol_5 {
|
||||||
|
uvec3 GlobalInvocationID;
|
||||||
|
};
|
||||||
|
|
||||||
|
layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void main_create_lut(tint_symbol_3 tint_symbol_2) {
|
||||||
|
main_create_lut_inner(tint_symbol_2.GlobalInvocationID);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_3 inputs;
|
||||||
|
inputs.GlobalInvocationID = gl_GlobalInvocationID;
|
||||||
|
main_create_lut(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:44: 'InterlockedOr' : no matching overloaded function found
|
||||||
|
ERROR: 0:44: '' : compilation terminated
|
||||||
|
ERROR: 2 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform Uniforms_1 {
|
||||||
|
uint numTriangles;
|
||||||
|
uint gridSize;
|
||||||
|
uint pad1;
|
||||||
|
uint pad2;
|
||||||
|
vec3 bbMin;
|
||||||
|
vec3 bbMax;
|
||||||
|
} uniforms;
|
||||||
|
layout (binding = 10) buffer U32s_1 {
|
||||||
|
uint values[];
|
||||||
|
} indices;
|
||||||
|
layout (binding = 11) buffer F32s_1 {
|
||||||
|
float values[];
|
||||||
|
} positions;
|
||||||
|
layout (binding = 20) buffer AU32s_1 {
|
||||||
|
uint values[];
|
||||||
|
} counters;
|
||||||
|
layout (binding = 21) buffer AI32s_1 {
|
||||||
|
int values[];
|
||||||
|
} LUT;
|
||||||
|
layout (binding = 50) buffer Dbg_1 {
|
||||||
|
uint offsetCounter;
|
||||||
|
uint pad0;
|
||||||
|
uint pad1;
|
||||||
|
uint pad2;
|
||||||
|
uint value0;
|
||||||
|
uint value1;
|
||||||
|
uint value2;
|
||||||
|
uint value3;
|
||||||
|
float value_f32_0;
|
||||||
|
float value_f32_1;
|
||||||
|
float value_f32_2;
|
||||||
|
float value_f32_3;
|
||||||
|
} dbg;
|
||||||
|
|
||||||
|
vec3 toVoxelPos(vec3 position) {
|
||||||
|
vec3 bbMin = vec3(uniforms.bbMin.x, uniforms.bbMin.y, uniforms.bbMin.z);
|
||||||
|
vec3 bbMax = vec3(uniforms.bbMax.x, uniforms.bbMax.y, uniforms.bbMax.z);
|
||||||
|
vec3 bbSize = (bbMax - bbMin);
|
||||||
|
float cubeSize = max(max(bbSize.x, bbSize.y), bbSize.z);
|
||||||
|
float gridSize = float(uniforms.gridSize);
|
||||||
|
float gx = ((gridSize * (position.x - uniforms.bbMin.x)) / cubeSize);
|
||||||
|
float gy = ((gridSize * (position.y - uniforms.bbMin.y)) / cubeSize);
|
||||||
|
float gz = ((gridSize * (position.z - uniforms.bbMin.z)) / cubeSize);
|
||||||
|
return vec3(gx, gy, gz);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint toIndex1D(uint gridSize, vec3 voxelPos) {
|
||||||
|
uvec3 icoord = uvec3(voxelPos);
|
||||||
|
return ((icoord.x + (gridSize * icoord.y)) + ((gridSize * gridSize) * icoord.z));
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 loadPosition(uint vertexIndex) {
|
||||||
|
vec3 position = vec3(positions.values[((3u * vertexIndex) + 0u)], positions.values[((3u * vertexIndex) + 1u)], positions.values[((3u * vertexIndex) + 2u)]);
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
void doIgnore() {
|
||||||
|
uint g42 = uniforms.numTriangles;
|
||||||
|
uint kj6 = dbg.value1;
|
||||||
|
uint atomic_result = 0u;
|
||||||
|
InterlockedOr(counters.values[0], 0, atomic_result);
|
||||||
|
uint b53 = atomic_result;
|
||||||
|
uint rwg = indices.values[0];
|
||||||
|
float rb5 = positions.values[0];
|
||||||
|
int atomic_result_1 = 0;
|
||||||
|
InterlockedOr(LUT.values[0], 0, atomic_result_1);
|
||||||
|
int g55 = atomic_result_1;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct tint_symbol_1 {
|
||||||
|
uvec3 GlobalInvocationID;
|
||||||
|
};
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
uvec3 GlobalInvocationID;
|
||||||
|
};
|
||||||
|
struct tint_symbol_5 {
|
||||||
|
uvec3 GlobalInvocationID;
|
||||||
|
};
|
||||||
|
|
||||||
|
void main_sort_triangles_inner(uvec3 GlobalInvocationID) {
|
||||||
|
uint triangleIndex = GlobalInvocationID.x;
|
||||||
|
doIgnore();
|
||||||
|
if ((triangleIndex >= uniforms.numTriangles)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uint i0 = indices.values[((3u * triangleIndex) + 0u)];
|
||||||
|
uint i1 = indices.values[((3u * triangleIndex) + 1u)];
|
||||||
|
uint i2 = indices.values[((3u * triangleIndex) + 2u)];
|
||||||
|
vec3 p0 = loadPosition(i0);
|
||||||
|
vec3 p1 = loadPosition(i1);
|
||||||
|
vec3 p2 = loadPosition(i2);
|
||||||
|
vec3 center = (((p0 + p1) + p2) / 3.0f);
|
||||||
|
vec3 voxelPos = toVoxelPos(center);
|
||||||
|
uint voxelIndex = toIndex1D(uniforms.gridSize, voxelPos);
|
||||||
|
int atomic_result_2 = 0;
|
||||||
|
InterlockedAdd(LUT.values[voxelIndex], 1, atomic_result_2);
|
||||||
|
int triangleOffset = atomic_result_2;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void main_sort_triangles(tint_symbol_5 tint_symbol_4) {
|
||||||
|
main_sort_triangles_inner(tint_symbol_4.GlobalInvocationID);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_5 inputs;
|
||||||
|
inputs.GlobalInvocationID = gl_GlobalInvocationID;
|
||||||
|
main_sort_triangles(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:66: 'InterlockedOr' : no matching overloaded function found
|
||||||
|
ERROR: 0:66: '' : compilation terminated
|
||||||
|
ERROR: 2 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
146
test/bug/tint/1121.wgsl.expected.glsl
Normal file
146
test/bug/tint/1121.wgsl.expected.glsl
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct LightData {
|
||||||
|
vec4 position;
|
||||||
|
vec3 color;
|
||||||
|
float radius;
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 0) buffer LightsBuffer_1 {
|
||||||
|
LightData lights[];
|
||||||
|
} lightsBuffer;
|
||||||
|
|
||||||
|
struct TileLightIdData {
|
||||||
|
uint count;
|
||||||
|
uint lightId[64];
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 0) buffer Tiles_1 {
|
||||||
|
TileLightIdData data[4];
|
||||||
|
} tileLightId;
|
||||||
|
|
||||||
|
layout (binding = 0) uniform Config_1 {
|
||||||
|
uint numLights;
|
||||||
|
uint numTiles;
|
||||||
|
uint tileCountX;
|
||||||
|
uint tileCountY;
|
||||||
|
uint numTileLightSlot;
|
||||||
|
uint tileSize;
|
||||||
|
} config;
|
||||||
|
|
||||||
|
layout (binding = 0) uniform Uniforms_1 {
|
||||||
|
vec4 tint_symbol;
|
||||||
|
vec4 tint_symbol_1;
|
||||||
|
mat4 viewMatrix;
|
||||||
|
mat4 projectionMatrix;
|
||||||
|
vec4 fullScreenSize;
|
||||||
|
} uniforms;
|
||||||
|
|
||||||
|
struct tint_symbol_4 {
|
||||||
|
uvec3 GlobalInvocationID;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tint_symbol_2_inner(uvec3 GlobalInvocationID) {
|
||||||
|
uint index = GlobalInvocationID.x;
|
||||||
|
if ((index >= config.numLights)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
lightsBuffer.lights[index].position.y = ((lightsBuffer.lights[index].position.y - 0.100000001f) + (0.001f * (float(index) - (64.0f * floor((float(index) / 64.0f))))));
|
||||||
|
if ((lightsBuffer.lights[index].position.y < uniforms.tint_symbol.y)) {
|
||||||
|
lightsBuffer.lights[index].position.y = uniforms.tint_symbol_1.y;
|
||||||
|
}
|
||||||
|
mat4 M = uniforms.projectionMatrix;
|
||||||
|
float viewNear = (-(M[3][2]) / (-1.0f + M[2][2]));
|
||||||
|
float viewFar = (-(M[3][2]) / (1.0f + M[2][2]));
|
||||||
|
vec4 lightPos = lightsBuffer.lights[index].position;
|
||||||
|
lightPos = (uniforms.viewMatrix * lightPos);
|
||||||
|
lightPos = (lightPos / lightPos.w);
|
||||||
|
float lightRadius = lightsBuffer.lights[index].radius;
|
||||||
|
vec4 boxMin = (lightPos - vec4(vec3((lightRadius).xxx), 0.0f));
|
||||||
|
vec4 boxMax = (lightPos + vec4(vec3((lightRadius).xxx), 0.0f));
|
||||||
|
vec4 frustumPlanes[6] = vec4[6](vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
frustumPlanes[4] = vec4(0.0f, 0.0f, -1.0f, viewNear);
|
||||||
|
frustumPlanes[5] = vec4(0.0f, 0.0f, 1.0f, -(viewFar));
|
||||||
|
int TILE_SIZE = 16;
|
||||||
|
int TILE_COUNT_X = 2;
|
||||||
|
{
|
||||||
|
for(int y_1 = 0; (y_1 < 2); y_1 = (y_1 + 1)) {
|
||||||
|
{
|
||||||
|
for(int x_1 = 0; (x_1 < TILE_COUNT_X); x_1 = (x_1 + 1)) {
|
||||||
|
ivec2 tilePixel0Idx = ivec2((x_1 * TILE_SIZE), (y_1 * TILE_SIZE));
|
||||||
|
vec2 floorCoord = (((2.0f * vec2(tilePixel0Idx)) / uniforms.fullScreenSize.xy) - vec2((1.0f).xx));
|
||||||
|
vec2 ceilCoord = (((2.0f * vec2((tilePixel0Idx + ivec2((TILE_SIZE).xx)))) / uniforms.fullScreenSize.xy) - vec2((1.0f).xx));
|
||||||
|
vec2 viewFloorCoord = vec2((((-(viewNear) * floorCoord.x) - (M[2][0] * viewNear)) / M[0][0]), (((-(viewNear) * floorCoord.y) - (M[2][1] * viewNear)) / M[1][1]));
|
||||||
|
vec2 viewCeilCoord = vec2((((-(viewNear) * ceilCoord.x) - (M[2][0] * viewNear)) / M[0][0]), (((-(viewNear) * ceilCoord.y) - (M[2][1] * viewNear)) / M[1][1]));
|
||||||
|
frustumPlanes[0] = vec4(1.0f, 0.0f, (-(viewFloorCoord.x) / viewNear), 0.0f);
|
||||||
|
frustumPlanes[1] = vec4(-1.0f, 0.0f, (viewCeilCoord.x / viewNear), 0.0f);
|
||||||
|
frustumPlanes[2] = vec4(0.0f, 1.0f, (-(viewFloorCoord.y) / viewNear), 0.0f);
|
||||||
|
frustumPlanes[3] = vec4(0.0f, -1.0f, (viewCeilCoord.y / viewNear), 0.0f);
|
||||||
|
float dp = 0.0f;
|
||||||
|
{
|
||||||
|
for(uint i = 0u; (i < 6u); i = (i + 1u)) {
|
||||||
|
vec4 p = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
if ((frustumPlanes[i].x > 0.0f)) {
|
||||||
|
p.x = boxMax.x;
|
||||||
|
} else {
|
||||||
|
p.x = boxMin.x;
|
||||||
|
}
|
||||||
|
if ((frustumPlanes[i].y > 0.0f)) {
|
||||||
|
p.y = boxMax.y;
|
||||||
|
} else {
|
||||||
|
p.y = boxMin.y;
|
||||||
|
}
|
||||||
|
if ((frustumPlanes[i].z > 0.0f)) {
|
||||||
|
p.z = boxMax.z;
|
||||||
|
} else {
|
||||||
|
p.z = boxMin.z;
|
||||||
|
}
|
||||||
|
p.w = 1.0f;
|
||||||
|
dp = (dp + min(0.0f, dot(p, frustumPlanes[i])));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((dp >= 0.0f)) {
|
||||||
|
uint tileId = uint((x_1 + (y_1 * TILE_COUNT_X)));
|
||||||
|
bool tint_tmp = (tileId < 0u);
|
||||||
|
if (!tint_tmp) {
|
||||||
|
tint_tmp = (tileId >= config.numTiles);
|
||||||
|
}
|
||||||
|
if ((tint_tmp)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
uint atomic_result = 0u;
|
||||||
|
InterlockedAdd(tileLightId.data[tileId].count, 1u, atomic_result);
|
||||||
|
uint offset = atomic_result;
|
||||||
|
if ((offset >= config.numTileLightSlot)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
tileLightId.data[tileId].lightId[offset] = GlobalInvocationID.x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol_2(tint_symbol_4 tint_symbol_3) {
|
||||||
|
tint_symbol_2_inner(tint_symbol_3.GlobalInvocationID);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_4 inputs;
|
||||||
|
inputs.GlobalInvocationID = gl_GlobalInvocationID;
|
||||||
|
tint_symbol_2(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:60: 'scalar swizzle' : not supported with this profile: es
|
||||||
|
ERROR: 0:60: '' : compilation terminated
|
||||||
|
ERROR: 2 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
0
test/bug/tint/1136.wgsl.expected.glsl
Normal file
0
test/bug/tint/1136.wgsl.expected.glsl
Normal file
24
test/bug/tint/219.spvasm.expected.glsl
Normal file
24
test/bug/tint/219.spvasm.expected.glsl
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
float x_200(inout vec2 x_201) {
|
||||||
|
float x_212 = x_201.x;
|
||||||
|
return x_212;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main_1() {
|
||||||
|
vec2 x_11 = vec2(0.0f, 0.0f);
|
||||||
|
float x_12 = x_200(x_11);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
main_1();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
37
test/bug/tint/221.wgsl.expected.glsl
Normal file
37
test/bug/tint/221.wgsl.expected.glsl
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) buffer Buf_1 {
|
||||||
|
uint count;
|
||||||
|
uint data[50];
|
||||||
|
} b;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
uint i = 0u;
|
||||||
|
while (true) {
|
||||||
|
if ((i >= b.count)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
uint p_save = i;
|
||||||
|
if (((i % 2u) == 0u)) {
|
||||||
|
{
|
||||||
|
b.data[p_save] = (b.data[p_save] * 2u);
|
||||||
|
i = (i + 1u);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
b.data[p_save] = 0u;
|
||||||
|
{
|
||||||
|
b.data[p_save] = (b.data[p_save] * 2u);
|
||||||
|
i = (i + 1u);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
27
test/bug/tint/292.wgsl.expected.glsl
Normal file
27
test/bug/tint/292.wgsl.expected.glsl
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct tint_symbol_1 {
|
||||||
|
vec4 value;
|
||||||
|
};
|
||||||
|
|
||||||
|
vec4 tint_symbol_inner() {
|
||||||
|
vec3 light = vec3(1.200000048f, 1.0f, 2.0f);
|
||||||
|
vec3 negative_light = -(light);
|
||||||
|
return vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
tint_symbol_1 tint_symbol() {
|
||||||
|
vec4 inner_result = tint_symbol_inner();
|
||||||
|
tint_symbol_1 wrapper_result = tint_symbol_1(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
wrapper_result.value = inner_result;
|
||||||
|
return wrapper_result;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_1 outputs;
|
||||||
|
outputs = tint_symbol();
|
||||||
|
gl_Position = outputs.value;
|
||||||
|
gl_Position.y = -gl_Position.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
0
test/bug/tint/294.wgsl.expected.glsl
Normal file
0
test/bug/tint/294.wgsl.expected.glsl
Normal file
0
test/bug/tint/369.wgsl.expected.glsl
Normal file
0
test/bug/tint/369.wgsl.expected.glsl
Normal file
55
test/bug/tint/403.wgsl.expected.glsl
Normal file
55
test/bug/tint/403.wgsl.expected.glsl
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform vertexUniformBuffer1_1 {
|
||||||
|
mat2 transform1;
|
||||||
|
} x_20;
|
||||||
|
layout (binding = 0) uniform vertexUniformBuffer2_1 {
|
||||||
|
mat2 transform2;
|
||||||
|
} x_26;
|
||||||
|
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
uint gl_VertexIndex;
|
||||||
|
};
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
vec4 value;
|
||||||
|
};
|
||||||
|
|
||||||
|
vec4 tint_symbol_inner(uint gl_VertexIndex) {
|
||||||
|
vec2 indexable[3] = vec2[3](vec2(0.0f, 0.0f), vec2(0.0f, 0.0f), vec2(0.0f, 0.0f));
|
||||||
|
mat2 x_23 = x_20.transform1;
|
||||||
|
mat2 x_28 = x_26.transform2;
|
||||||
|
uint x_46 = gl_VertexIndex;
|
||||||
|
vec2 tint_symbol_4[3] = vec2[3](vec2(-1.0f, 1.0f), vec2(1.0f, 1.0f), vec2(-1.0f, -1.0f));
|
||||||
|
indexable = tint_symbol_4;
|
||||||
|
vec2 x_51 = indexable[x_46];
|
||||||
|
vec2 x_52 = (mat2((x_23[0u] + x_28[0u]), (x_23[1u] + x_28[1u])) * x_51);
|
||||||
|
return vec4(x_52.x, x_52.y, 0.0f, 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) {
|
||||||
|
vec4 inner_result = tint_symbol_inner(tint_symbol_1.gl_VertexIndex);
|
||||||
|
tint_symbol_3 wrapper_result = tint_symbol_3(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
wrapper_result.value = inner_result;
|
||||||
|
return wrapper_result;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_2 inputs;
|
||||||
|
inputs.gl_VertexIndex = uint(gl_VertexID);
|
||||||
|
tint_symbol_3 outputs;
|
||||||
|
outputs = tint_symbol(inputs);
|
||||||
|
gl_Position = outputs.value;
|
||||||
|
gl_Position.y = -gl_Position.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:19: 'gl_VertexIndex' : identifiers starting with "gl_" are reserved
|
||||||
|
ERROR: 0:19: '' : compilation terminated
|
||||||
|
ERROR: 2 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
36
test/bug/tint/413.spvasm.expected.glsl
Normal file
36
test/bug/tint/413.spvasm.expected.glsl
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
uniform highp usampler2D Src;
|
||||||
|
uniform highp writeonly image2D Dst;
|
||||||
|
|
||||||
|
void main_1() {
|
||||||
|
uvec4 srcValue = uvec4(0u, 0u, 0u, 0u);
|
||||||
|
uvec4 x_18 = texelFetch(Src, ivec3(0, 0, 0));
|
||||||
|
srcValue = x_18;
|
||||||
|
uint x_22 = srcValue.x;
|
||||||
|
srcValue.x = (x_22 + uint(1));
|
||||||
|
imageStore(Dst, ivec2(0, 0), srcValue).x;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
main_1();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:9: 'texelFetch' : no matching overloaded function found
|
||||||
|
ERROR: 0:9: '=' : cannot convert from ' const float' to ' temp highp 4-component vector of uint'
|
||||||
|
ERROR: 0:9: '' : compilation terminated
|
||||||
|
ERROR: 3 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
31
test/bug/tint/453.wgsl.expected.glsl
Normal file
31
test/bug/tint/453.wgsl.expected.glsl
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
uniform highp usampler2D Src;
|
||||||
|
uniform highp writeonly image2D Dst;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
uvec4 srcValue = uvec4(0u, 0u, 0u, 0u);
|
||||||
|
uvec4 x_22 = texelFetch(Src, ivec3(0, 0, 0));
|
||||||
|
srcValue = x_22;
|
||||||
|
uint x_24 = srcValue.x;
|
||||||
|
uint x_25 = (x_24 + 1u);
|
||||||
|
imageStore(Dst, ivec2(0, 0), srcValue.xxxx).x;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:10: 'texelFetch' : no matching overloaded function found
|
||||||
|
ERROR: 0:10: '=' : cannot convert from ' const float' to ' temp highp 4-component vector of uint'
|
||||||
|
ERROR: 0:10: '' : compilation terminated
|
||||||
|
ERROR: 3 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
18
test/bug/tint/492.wgsl.expected.glsl
Normal file
18
test/bug/tint/492.wgsl.expected.glsl
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) buffer S_1 {
|
||||||
|
int a;
|
||||||
|
} buf;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
buf.a = 12;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
76
test/bug/tint/534.wgsl.expected.glsl
Normal file
76
test/bug/tint/534.wgsl.expected.glsl
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
uniform highp sampler2D src;
|
||||||
|
uniform highp sampler2D dst;
|
||||||
|
layout (binding = 2) buffer OutputBuf_1 {
|
||||||
|
uint result[];
|
||||||
|
} tint_symbol;
|
||||||
|
layout (binding = 3) uniform Uniforms_1 {
|
||||||
|
uint dstTextureFlipY;
|
||||||
|
uint isFloat16;
|
||||||
|
uint isRGB10A2Unorm;
|
||||||
|
uint channelCount;
|
||||||
|
} uniforms;
|
||||||
|
|
||||||
|
uint ConvertToFp16FloatValue(float fp32) {
|
||||||
|
return 1u;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
uvec3 GlobalInvocationID;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tint_symbol_1_inner(uvec3 GlobalInvocationID) {
|
||||||
|
ivec2 size = textureSize(src);
|
||||||
|
ivec2 dstTexCoord = ivec2(GlobalInvocationID.xy);
|
||||||
|
ivec2 srcTexCoord = dstTexCoord;
|
||||||
|
if ((uniforms.dstTextureFlipY == 1u)) {
|
||||||
|
srcTexCoord.y = ((size.y - dstTexCoord.y) - 1);
|
||||||
|
}
|
||||||
|
vec4 srcColor = texelFetch(src, ivec3(srcTexCoord, 0));
|
||||||
|
vec4 dstColor = texelFetch(dst, ivec3(dstTexCoord, 0));
|
||||||
|
bool success = true;
|
||||||
|
uvec4 srcColorBits = uvec4(0u, 0u, 0u, 0u);
|
||||||
|
uvec4 dstColorBits = uvec4(dstColor);
|
||||||
|
{
|
||||||
|
for(uint i = 0u; (i < uniforms.channelCount); i = (i + 1u)) {
|
||||||
|
srcColorBits[i] = ConvertToFp16FloatValue(srcColor[i]);
|
||||||
|
bool tint_tmp = success;
|
||||||
|
if (tint_tmp) {
|
||||||
|
tint_tmp = (srcColorBits[i] == dstColorBits[i]);
|
||||||
|
}
|
||||||
|
success = (tint_tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uint outputIndex = ((GlobalInvocationID.y * uint(size.x)) + GlobalInvocationID.x);
|
||||||
|
if (success) {
|
||||||
|
tint_symbol.result[outputIndex] = uint(1);
|
||||||
|
} else {
|
||||||
|
tint_symbol.result[outputIndex] = uint(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol_1(tint_symbol_3 tint_symbol_2) {
|
||||||
|
tint_symbol_1_inner(tint_symbol_2.GlobalInvocationID);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_3 inputs;
|
||||||
|
inputs.GlobalInvocationID = gl_GlobalInvocationID;
|
||||||
|
tint_symbol_1(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:26: 'textureSize' : no matching overloaded function found
|
||||||
|
ERROR: 0:26: '=' : cannot convert from ' const float' to ' temp highp 2-component vector of int'
|
||||||
|
ERROR: 0:26: '' : compilation terminated
|
||||||
|
ERROR: 3 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
51
test/bug/tint/744.wgsl.expected.glsl
Normal file
51
test/bug/tint/744.wgsl.expected.glsl
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) buffer Matrix_1 {
|
||||||
|
uint numbers[];
|
||||||
|
} firstMatrix;
|
||||||
|
layout (binding = 1) buffer Matrix_2 {
|
||||||
|
uint numbers[];
|
||||||
|
} secondMatrix;
|
||||||
|
layout (binding = 2) buffer Matrix_3 {
|
||||||
|
uint numbers[];
|
||||||
|
} resultMatrix;
|
||||||
|
layout (binding = 3) uniform Uniforms_1 {
|
||||||
|
uvec2 aShape;
|
||||||
|
uvec2 bShape;
|
||||||
|
uvec2 outShape;
|
||||||
|
} uniforms;
|
||||||
|
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
uvec3 global_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tint_symbol_inner(uvec3 global_id) {
|
||||||
|
uvec2 resultCell = uvec2(global_id.y, global_id.x);
|
||||||
|
uint dimInner = uniforms.aShape.y;
|
||||||
|
uint dimOutter = uniforms.outShape.y;
|
||||||
|
uint result = 0u;
|
||||||
|
{
|
||||||
|
for(uint i = 0u; (i < dimInner); i = (i + 1u)) {
|
||||||
|
uint a = (i + (resultCell.x * dimInner));
|
||||||
|
uint b = (resultCell.y + (i * dimOutter));
|
||||||
|
result = (result + (firstMatrix.numbers[a] * secondMatrix.numbers[b]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uint index = (resultCell.y + (resultCell.x * dimOutter));
|
||||||
|
resultMatrix.numbers[index] = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 2, local_size_y = 2, local_size_z = 1) in;
|
||||||
|
void tint_symbol(tint_symbol_2 tint_symbol_1) {
|
||||||
|
tint_symbol_inner(tint_symbol_1.global_id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_2 inputs;
|
||||||
|
inputs.global_id = gl_GlobalInvocationID;
|
||||||
|
tint_symbol(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
1584
test/bug/tint/749.spvasm.expected.glsl
Normal file
1584
test/bug/tint/749.spvasm.expected.glsl
Normal file
File diff suppressed because it is too large
Load Diff
47
test/bug/tint/757.wgsl.expected.glsl
Normal file
47
test/bug/tint/757.wgsl.expected.glsl
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
uniform highp sampler2DArray myTexture;
|
||||||
|
|
||||||
|
layout (binding = 3) buffer Result_1 {
|
||||||
|
float values[];
|
||||||
|
} result;
|
||||||
|
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
uvec3 GlobalInvocationID;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tint_symbol_inner(uvec3 GlobalInvocationID) {
|
||||||
|
uint flatIndex = ((((2u * 2u) * GlobalInvocationID.z) + (2u * GlobalInvocationID.y)) + GlobalInvocationID.x);
|
||||||
|
flatIndex = (flatIndex * 1u);
|
||||||
|
vec4 texel = texelFetch(myTexture, ivec4(ivec3(ivec2(GlobalInvocationID.xy), 0), 0));
|
||||||
|
{
|
||||||
|
for(uint i = 0u; (i < 1u); i = (i + 1u)) {
|
||||||
|
result.values[(flatIndex + i)] = texel.r;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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.GlobalInvocationID);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_2 inputs;
|
||||||
|
inputs.GlobalInvocationID = gl_GlobalInvocationID;
|
||||||
|
tint_symbol(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:18: 'texelFetch' : no matching overloaded function found
|
||||||
|
ERROR: 0:18: '=' : cannot convert from ' const float' to ' temp mediump 4-component vector of float'
|
||||||
|
ERROR: 0:18: '' : compilation terminated
|
||||||
|
ERROR: 3 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
0
test/bug/tint/764.wgsl.expected.glsl
Normal file
0
test/bug/tint/764.wgsl.expected.glsl
Normal file
0
test/bug/tint/782.wgsl.expected.glsl
Normal file
0
test/bug/tint/782.wgsl.expected.glsl
Normal file
3
test/bug/tint/804.spv.expected.glsl
Normal file
3
test/bug/tint/804.spv.expected.glsl
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
error: extended arithmetic is not finalized for WGSL: https://github.com/gpuweb/gpuweb/issues/1565: %712 = OpISubBorrow %710 %107 %470
|
3
test/bug/tint/807.spv.expected.glsl
Normal file
3
test/bug/tint/807.spv.expected.glsl
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
error: undef pointer is not valid: %845 = OpUndef %434
|
46
test/bug/tint/824.wgsl.expected.glsl
Normal file
46
test/bug/tint/824.wgsl.expected.glsl
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct Output {
|
||||||
|
vec4 Position;
|
||||||
|
vec4 color;
|
||||||
|
};
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
uint VertexIndex;
|
||||||
|
uint InstanceIndex;
|
||||||
|
};
|
||||||
|
struct tint_symbol_4 {
|
||||||
|
vec4 color;
|
||||||
|
vec4 Position;
|
||||||
|
};
|
||||||
|
|
||||||
|
Output tint_symbol_inner(uint VertexIndex, uint InstanceIndex) {
|
||||||
|
vec2 zv[4] = vec2[4](vec2(0.200000003f, 0.200000003f), vec2(0.300000012f, 0.300000012f), vec2(-0.100000001f, -0.100000001f), vec2(1.100000024f, 1.100000024f));
|
||||||
|
float z = zv[InstanceIndex].x;
|
||||||
|
Output tint_symbol_1 = Output(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
tint_symbol_1.Position = vec4(0.5f, 0.5f, z, 1.0f);
|
||||||
|
vec4 colors[4] = vec4[4](vec4(1.0f, 0.0f, 0.0f, 1.0f), vec4(0.0f, 1.0f, 0.0f, 1.0f), vec4(0.0f, 0.0f, 1.0f, 1.0f), vec4(1.0f, 1.0f, 1.0f, 1.0f));
|
||||||
|
tint_symbol_1.color = colors[InstanceIndex];
|
||||||
|
return tint_symbol_1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tint_symbol_4 tint_symbol(tint_symbol_3 tint_symbol_2) {
|
||||||
|
Output inner_result = tint_symbol_inner(tint_symbol_2.VertexIndex, tint_symbol_2.InstanceIndex);
|
||||||
|
tint_symbol_4 wrapper_result = tint_symbol_4(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
wrapper_result.Position = inner_result.Position;
|
||||||
|
wrapper_result.color = inner_result.color;
|
||||||
|
return wrapper_result;
|
||||||
|
}
|
||||||
|
out vec4 color;
|
||||||
|
void main() {
|
||||||
|
tint_symbol_3 inputs;
|
||||||
|
inputs.VertexIndex = uint(gl_VertexID);
|
||||||
|
inputs.InstanceIndex = uint(gl_InstanceID);
|
||||||
|
tint_symbol_4 outputs;
|
||||||
|
outputs = tint_symbol(inputs);
|
||||||
|
color = outputs.color;
|
||||||
|
gl_Position = outputs.Position;
|
||||||
|
gl_Position.y = -gl_Position.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
0
test/bug/tint/825.wgsl.expected.glsl
Normal file
0
test/bug/tint/825.wgsl.expected.glsl
Normal file
39
test/bug/tint/827.wgsl.expected.glsl
Normal file
39
test/bug/tint/827.wgsl.expected.glsl
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
const uint width = 128u;
|
||||||
|
uniform highp sampler2D tex;
|
||||||
|
layout (binding = 1) buffer Result_1 {
|
||||||
|
float values[];
|
||||||
|
} result;
|
||||||
|
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
uvec3 GlobalInvocationId;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tint_symbol_inner(uvec3 GlobalInvocationId) {
|
||||||
|
result.values[((GlobalInvocationId.y * width) + GlobalInvocationId.x)] = texelFetch(tex, ivec3(int(GlobalInvocationId.x), int(GlobalInvocationId.y), 0)).x;
|
||||||
|
}
|
||||||
|
|
||||||
|
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.GlobalInvocationId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_2 inputs;
|
||||||
|
inputs.GlobalInvocationId = gl_GlobalInvocationID;
|
||||||
|
tint_symbol(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:16: 'texelFetch' : no matching overloaded function found
|
||||||
|
ERROR: 0:16: '' : compilation terminated
|
||||||
|
ERROR: 2 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
35
test/bug/tint/870.spvasm.expected.glsl
Normal file
35
test/bug/tint/870.spvasm.expected.glsl
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct sspp962805860buildInformationS {
|
||||||
|
vec4 footprint;
|
||||||
|
vec4 offset;
|
||||||
|
int essence;
|
||||||
|
int orientation[6];
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 2) buffer x_B4_BuildInformation_1 {
|
||||||
|
sspp962805860buildInformationS passthru;
|
||||||
|
} sspp962805860buildInformation;
|
||||||
|
|
||||||
|
void main_1() {
|
||||||
|
int orientation[6] = int[6](0, 0, 0, 0, 0, 0);
|
||||||
|
int x_23[6] = sspp962805860buildInformation.passthru.orientation;
|
||||||
|
orientation[0] = x_23[0u];
|
||||||
|
orientation[1] = x_23[1u];
|
||||||
|
orientation[2] = x_23[2u];
|
||||||
|
orientation[3] = x_23[3u];
|
||||||
|
orientation[4] = x_23[4u];
|
||||||
|
orientation[5] = x_23[5u];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void tint_symbol() {
|
||||||
|
main_1();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
116
test/bug/tint/913.wgsl.expected.glsl
Normal file
116
test/bug/tint/913.wgsl.expected.glsl
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
uniform highp sampler2D src;
|
||||||
|
uniform highp sampler2D dst;
|
||||||
|
layout (binding = 2) buffer OutputBuf_1 {
|
||||||
|
uint result[];
|
||||||
|
} tint_symbol;
|
||||||
|
layout (binding = 3) uniform Uniforms_1 {
|
||||||
|
uint dstTextureFlipY;
|
||||||
|
uint channelCount;
|
||||||
|
uvec2 srcCopyOrigin;
|
||||||
|
uvec2 dstCopyOrigin;
|
||||||
|
uvec2 copySize;
|
||||||
|
} uniforms;
|
||||||
|
|
||||||
|
bool aboutEqual(float value, float expect) {
|
||||||
|
return (abs((value - expect)) < 0.001f);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
uvec3 GlobalInvocationID;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tint_symbol_1_inner(uvec3 GlobalInvocationID) {
|
||||||
|
ivec2 srcSize = textureSize(src);
|
||||||
|
ivec2 dstSize = textureSize(dst);
|
||||||
|
uvec2 dstTexCoord = uvec2(GlobalInvocationID.xy);
|
||||||
|
vec4 nonCoveredColor = vec4(0.0f, 1.0f, 0.0f, 1.0f);
|
||||||
|
bool success = true;
|
||||||
|
bool tint_tmp_2 = (dstTexCoord.x < uniforms.dstCopyOrigin.x);
|
||||||
|
if (!tint_tmp_2) {
|
||||||
|
tint_tmp_2 = (dstTexCoord.y < uniforms.dstCopyOrigin.y);
|
||||||
|
}
|
||||||
|
bool tint_tmp_1 = (tint_tmp_2);
|
||||||
|
if (!tint_tmp_1) {
|
||||||
|
tint_tmp_1 = (dstTexCoord.x >= (uniforms.dstCopyOrigin.x + uniforms.copySize.x));
|
||||||
|
}
|
||||||
|
bool tint_tmp = (tint_tmp_1);
|
||||||
|
if (!tint_tmp) {
|
||||||
|
tint_tmp = (dstTexCoord.y >= (uniforms.dstCopyOrigin.y + uniforms.copySize.y));
|
||||||
|
}
|
||||||
|
if ((tint_tmp)) {
|
||||||
|
bool tint_tmp_3 = success;
|
||||||
|
if (tint_tmp_3) {
|
||||||
|
tint_tmp_3 = all((texelFetch(dst, ivec3(ivec2(dstTexCoord), 0)) == nonCoveredColor));
|
||||||
|
}
|
||||||
|
success = (tint_tmp_3);
|
||||||
|
} else {
|
||||||
|
uvec2 srcTexCoord = ((dstTexCoord - uniforms.dstCopyOrigin) + uniforms.srcCopyOrigin);
|
||||||
|
if ((uniforms.dstTextureFlipY == 1u)) {
|
||||||
|
srcTexCoord.y = ((uint(srcSize.y) - srcTexCoord.y) - 1u);
|
||||||
|
}
|
||||||
|
vec4 srcColor = texelFetch(src, ivec3(ivec2(srcTexCoord), 0));
|
||||||
|
vec4 dstColor = texelFetch(dst, ivec3(ivec2(dstTexCoord), 0));
|
||||||
|
if ((uniforms.channelCount == 2u)) {
|
||||||
|
bool tint_tmp_5 = success;
|
||||||
|
if (tint_tmp_5) {
|
||||||
|
tint_tmp_5 = aboutEqual(dstColor.r, srcColor.r);
|
||||||
|
}
|
||||||
|
bool tint_tmp_4 = (tint_tmp_5);
|
||||||
|
if (tint_tmp_4) {
|
||||||
|
tint_tmp_4 = aboutEqual(dstColor.g, srcColor.g);
|
||||||
|
}
|
||||||
|
success = (tint_tmp_4);
|
||||||
|
} else {
|
||||||
|
bool tint_tmp_9 = success;
|
||||||
|
if (tint_tmp_9) {
|
||||||
|
tint_tmp_9 = aboutEqual(dstColor.r, srcColor.r);
|
||||||
|
}
|
||||||
|
bool tint_tmp_8 = (tint_tmp_9);
|
||||||
|
if (tint_tmp_8) {
|
||||||
|
tint_tmp_8 = aboutEqual(dstColor.g, srcColor.g);
|
||||||
|
}
|
||||||
|
bool tint_tmp_7 = (tint_tmp_8);
|
||||||
|
if (tint_tmp_7) {
|
||||||
|
tint_tmp_7 = aboutEqual(dstColor.b, srcColor.b);
|
||||||
|
}
|
||||||
|
bool tint_tmp_6 = (tint_tmp_7);
|
||||||
|
if (tint_tmp_6) {
|
||||||
|
tint_tmp_6 = aboutEqual(dstColor.a, srcColor.a);
|
||||||
|
}
|
||||||
|
success = (tint_tmp_6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uint outputIndex = ((GlobalInvocationID.y * uint(dstSize.x)) + GlobalInvocationID.x);
|
||||||
|
if (success) {
|
||||||
|
tint_symbol.result[outputIndex] = 1u;
|
||||||
|
} else {
|
||||||
|
tint_symbol.result[outputIndex] = 0u;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol_1(tint_symbol_3 tint_symbol_2) {
|
||||||
|
tint_symbol_1_inner(tint_symbol_2.GlobalInvocationID);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_3 inputs;
|
||||||
|
inputs.GlobalInvocationID = gl_GlobalInvocationID;
|
||||||
|
tint_symbol_1(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:27: 'textureSize' : no matching overloaded function found
|
||||||
|
ERROR: 0:27: '=' : cannot convert from ' const float' to ' temp highp 2-component vector of int'
|
||||||
|
ERROR: 0:27: '' : compilation terminated
|
||||||
|
ERROR: 3 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
177
test/bug/tint/914.wgsl.expected.glsl
Normal file
177
test/bug/tint/914.wgsl.expected.glsl
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) buffer Matrix_1 {
|
||||||
|
float numbers[];
|
||||||
|
} firstMatrix;
|
||||||
|
layout (binding = 1) buffer Matrix_2 {
|
||||||
|
float numbers[];
|
||||||
|
} secondMatrix;
|
||||||
|
layout (binding = 2) buffer Matrix_3 {
|
||||||
|
float numbers[];
|
||||||
|
} resultMatrix;
|
||||||
|
layout (binding = 3) uniform Uniforms_1 {
|
||||||
|
uint dimAOuter;
|
||||||
|
uint dimInner;
|
||||||
|
uint dimBOuter;
|
||||||
|
} uniforms;
|
||||||
|
|
||||||
|
float mm_readA(uint row, uint col) {
|
||||||
|
bool tint_tmp = (row < uniforms.dimAOuter);
|
||||||
|
if (tint_tmp) {
|
||||||
|
tint_tmp = (col < uniforms.dimInner);
|
||||||
|
}
|
||||||
|
if ((tint_tmp)) {
|
||||||
|
float result = firstMatrix.numbers[((row * uniforms.dimInner) + col)];
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
float mm_readB(uint row, uint col) {
|
||||||
|
bool tint_tmp_1 = (row < uniforms.dimInner);
|
||||||
|
if (tint_tmp_1) {
|
||||||
|
tint_tmp_1 = (col < uniforms.dimBOuter);
|
||||||
|
}
|
||||||
|
if ((tint_tmp_1)) {
|
||||||
|
float result = secondMatrix.numbers[((row * uniforms.dimBOuter) + col)];
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
void mm_write(uint row, uint col, float value) {
|
||||||
|
bool tint_tmp_2 = (row < uniforms.dimAOuter);
|
||||||
|
if (tint_tmp_2) {
|
||||||
|
tint_tmp_2 = (col < uniforms.dimBOuter);
|
||||||
|
}
|
||||||
|
if ((tint_tmp_2)) {
|
||||||
|
uint index = (col + (row * uniforms.dimBOuter));
|
||||||
|
resultMatrix.numbers[index] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint RowPerThread = 4u;
|
||||||
|
const uint ColPerThread = 4u;
|
||||||
|
const uint TileAOuter = 64u;
|
||||||
|
const uint TileBOuter = 64u;
|
||||||
|
const uint TileInner = 64u;
|
||||||
|
groupshared float mm_Asub[64][64];
|
||||||
|
groupshared float mm_Bsub[64][64];
|
||||||
|
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
uvec3 local_id;
|
||||||
|
uint local_invocation_index;
|
||||||
|
uvec3 global_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tint_symbol_inner(uvec3 local_id, uvec3 global_id, uint local_invocation_index) {
|
||||||
|
{
|
||||||
|
for(uint idx = local_invocation_index; (idx < 4096u); idx = (idx + 256u)) {
|
||||||
|
uint i = (idx / 64u);
|
||||||
|
uint i_1 = (idx % 64u);
|
||||||
|
mm_Asub[i][i_1] = 0.0f;
|
||||||
|
mm_Bsub[i][i_1] = 0.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GroupMemoryBarrierWithGroupSync();
|
||||||
|
uint tileRow = (local_id.y * RowPerThread);
|
||||||
|
uint tileCol = (local_id.x * ColPerThread);
|
||||||
|
uint globalRow = (global_id.y * RowPerThread);
|
||||||
|
uint globalCol = (global_id.x * ColPerThread);
|
||||||
|
uint numTiles = (((uniforms.dimInner - 1u) / TileInner) + 1u);
|
||||||
|
float acc[16] = float[16](0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
float ACached = 0.0f;
|
||||||
|
float BCached[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
{
|
||||||
|
for(uint index = 0u; (index < (RowPerThread * ColPerThread)); index = (index + 1u)) {
|
||||||
|
acc[index] = 0.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uint ColPerThreadA = (TileInner / 16u);
|
||||||
|
uint tileColA = (local_id.x * ColPerThreadA);
|
||||||
|
uint RowPerThreadB = (TileInner / 16u);
|
||||||
|
uint tileRowB = (local_id.y * RowPerThreadB);
|
||||||
|
{
|
||||||
|
for(uint t = 0u; (t < numTiles); t = (t + 1u)) {
|
||||||
|
{
|
||||||
|
for(uint innerRow = 0u; (innerRow < RowPerThread); innerRow = (innerRow + 1u)) {
|
||||||
|
{
|
||||||
|
for(uint innerCol = 0u; (innerCol < ColPerThreadA); innerCol = (innerCol + 1u)) {
|
||||||
|
uint inputRow = (tileRow + innerRow);
|
||||||
|
uint inputCol = (tileColA + innerCol);
|
||||||
|
mm_Asub[inputRow][inputCol] = mm_readA((globalRow + innerRow), ((t * TileInner) + inputCol));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
for(uint innerRow = 0u; (innerRow < RowPerThreadB); innerRow = (innerRow + 1u)) {
|
||||||
|
{
|
||||||
|
for(uint innerCol = 0u; (innerCol < ColPerThread); innerCol = (innerCol + 1u)) {
|
||||||
|
uint inputRow = (tileRowB + innerRow);
|
||||||
|
uint inputCol = (tileCol + innerCol);
|
||||||
|
mm_Bsub[innerCol][inputCol] = mm_readB(((t * TileInner) + inputRow), (globalCol + innerCol));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GroupMemoryBarrierWithGroupSync();
|
||||||
|
{
|
||||||
|
for(uint k = 0u; (k < TileInner); k = (k + 1u)) {
|
||||||
|
{
|
||||||
|
for(uint inner = 0u; (inner < ColPerThread); inner = (inner + 1u)) {
|
||||||
|
BCached[inner] = mm_Bsub[k][(tileCol + inner)];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
for(uint innerRow = 0u; (innerRow < RowPerThread); innerRow = (innerRow + 1u)) {
|
||||||
|
ACached = mm_Asub[(tileRow + innerRow)][k];
|
||||||
|
{
|
||||||
|
for(uint innerCol = 0u; (innerCol < ColPerThread); innerCol = (innerCol + 1u)) {
|
||||||
|
uint index = ((innerRow * ColPerThread) + innerCol);
|
||||||
|
acc[index] = (acc[index] + (ACached * BCached[innerCol]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GroupMemoryBarrierWithGroupSync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
for(uint innerRow = 0u; (innerRow < RowPerThread); innerRow = (innerRow + 1u)) {
|
||||||
|
{
|
||||||
|
for(uint innerCol = 0u; (innerCol < ColPerThread); innerCol = (innerCol + 1u)) {
|
||||||
|
uint index = ((innerRow * ColPerThread) + innerCol);
|
||||||
|
mm_write((globalRow + innerRow), (globalCol + innerCol), acc[index]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in;
|
||||||
|
void tint_symbol(tint_symbol_2 tint_symbol_1) {
|
||||||
|
tint_symbol_inner(tint_symbol_1.local_id, tint_symbol_1.global_id, tint_symbol_1.local_invocation_index);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_2 inputs;
|
||||||
|
inputs.local_id = gl_LocalInvocationID;
|
||||||
|
inputs.local_invocation_index = uint(gl_LocalInvocationIndex);
|
||||||
|
inputs.global_id = gl_GlobalInvocationID;
|
||||||
|
tint_symbol(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:60: '' : syntax error, unexpected IDENTIFIER
|
||||||
|
ERROR: 1 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
182
test/bug/tint/922.wgsl.expected.glsl
Normal file
182
test/bug/tint/922.wgsl.expected.glsl
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct Mat4x4_ {
|
||||||
|
vec4 mx;
|
||||||
|
vec4 my;
|
||||||
|
vec4 mz;
|
||||||
|
vec4 mw;
|
||||||
|
};
|
||||||
|
struct Mat4x3_ {
|
||||||
|
vec4 mx;
|
||||||
|
vec4 my;
|
||||||
|
vec4 mz;
|
||||||
|
};
|
||||||
|
struct Mat4x2_ {
|
||||||
|
vec4 mx;
|
||||||
|
vec4 my;
|
||||||
|
};
|
||||||
|
struct VertexOutput {
|
||||||
|
vec4 v_Color;
|
||||||
|
vec2 v_TexCoord;
|
||||||
|
vec4 member;
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (binding = 0) uniform ub_SceneParams_1 {
|
||||||
|
Mat4x4_ u_Projection;
|
||||||
|
} global;
|
||||||
|
layout (binding = 1) uniform ub_MaterialParams_1 {
|
||||||
|
Mat4x2_ u_TexMtx[1];
|
||||||
|
vec4 u_Misc0_;
|
||||||
|
} global1;
|
||||||
|
layout (binding = 2) uniform ub_PacketParams_1 {
|
||||||
|
Mat4x3_ u_PosMtx[32];
|
||||||
|
} global2;
|
||||||
|
vec3 a_Position1 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec2 a_UV1 = vec2(0.0f, 0.0f);
|
||||||
|
vec4 a_Color1 = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 a_Normal1 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
float a_PosMtxIdx1 = 0.0f;
|
||||||
|
vec4 v_Color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
vec2 v_TexCoord = vec2(0.0f, 0.0f);
|
||||||
|
vec4 tint_symbol = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
|
vec4 Mul(Mat4x4_ m8, vec4 v) {
|
||||||
|
Mat4x4_ m9 = Mat4x4_(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
vec4 v1 = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
m9 = m8;
|
||||||
|
v1 = v;
|
||||||
|
return vec4(dot(m9.mx, v1), dot(m9.my, v1), dot(m9.mz, v1), dot(m9.mw, v1));
|
||||||
|
}
|
||||||
|
|
||||||
|
vec2 Mul2(Mat4x2_ m12, vec4 v4) {
|
||||||
|
Mat4x2_ m13 = Mat4x2_(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
vec4 v5 = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
m13 = m12;
|
||||||
|
v5 = v4;
|
||||||
|
return vec2(dot(m13.mx, v5), dot(m13.my, v5));
|
||||||
|
}
|
||||||
|
|
||||||
|
Mat4x4_ x_Mat4x4_(float n) {
|
||||||
|
float n1 = 0.0f;
|
||||||
|
Mat4x4_ o = Mat4x4_(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
n1 = n;
|
||||||
|
o.mx = vec4(n1, 0.0f, 0.0f, 0.0f);
|
||||||
|
o.my = vec4(0.0f, n1, 0.0f, 0.0f);
|
||||||
|
o.mz = vec4(0.0f, 0.0f, n1, 0.0f);
|
||||||
|
o.mw = vec4(0.0f, 0.0f, 0.0f, n1);
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
Mat4x4_ x_Mat4x4_1(Mat4x3_ m16) {
|
||||||
|
Mat4x3_ m17 = Mat4x3_(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
Mat4x4_ o1 = Mat4x4_(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
m17 = m16;
|
||||||
|
Mat4x4_ x_e4 = x_Mat4x4_(1.0f);
|
||||||
|
o1 = x_e4;
|
||||||
|
o1.mx = m17.mx;
|
||||||
|
o1.my = m17.my;
|
||||||
|
o1.mz = m17.mz;
|
||||||
|
return o1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main1() {
|
||||||
|
Mat4x3_ t_PosMtx = Mat4x3_(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
vec2 t_TexSpaceCoord = vec2(0.0f, 0.0f);
|
||||||
|
Mat4x3_ x_e18 = global2.u_PosMtx[int(a_PosMtxIdx1)];
|
||||||
|
t_PosMtx = x_e18;
|
||||||
|
Mat4x4_ x_e24 = x_Mat4x4_1(t_PosMtx);
|
||||||
|
vec3 x_e25 = a_Position1;
|
||||||
|
Mat4x4_ x_e30 = x_Mat4x4_1(t_PosMtx);
|
||||||
|
vec4 x_e34 = Mul(x_e30, vec4(a_Position1, 1.0f));
|
||||||
|
Mat4x4_ x_e35 = global.u_Projection;
|
||||||
|
Mat4x4_ x_e38 = x_Mat4x4_1(t_PosMtx);
|
||||||
|
vec3 x_e39 = a_Position1;
|
||||||
|
Mat4x4_ x_e44 = x_Mat4x4_1(t_PosMtx);
|
||||||
|
vec4 x_e48 = Mul(x_e44, vec4(a_Position1, 1.0f));
|
||||||
|
vec4 x_e49 = Mul(x_e35, x_e48);
|
||||||
|
tint_symbol = x_e49;
|
||||||
|
v_Color = a_Color1;
|
||||||
|
vec4 x_e52 = global1.u_Misc0_;
|
||||||
|
if ((x_e52.x == 2.0f)) {
|
||||||
|
{
|
||||||
|
vec3 x_e59 = a_Normal1;
|
||||||
|
Mat4x2_ x_e64 = global1.u_TexMtx[0];
|
||||||
|
vec2 x_e68 = Mul2(x_e64, vec4(a_Normal1, 1.0f));
|
||||||
|
v_TexCoord = x_e68.xy;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
{
|
||||||
|
vec2 x_e73 = a_UV1;
|
||||||
|
Mat4x2_ x_e79 = global1.u_TexMtx[0];
|
||||||
|
vec2 x_e84 = Mul2(x_e79, vec4(a_UV1, 1.0f, 1.0f));
|
||||||
|
v_TexCoord = x_e84.xy;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
vec3 a_Position;
|
||||||
|
vec2 a_UV;
|
||||||
|
vec4 a_Color;
|
||||||
|
vec3 a_Normal;
|
||||||
|
float a_PosMtxIdx;
|
||||||
|
};
|
||||||
|
struct tint_symbol_4 {
|
||||||
|
vec4 v_Color;
|
||||||
|
vec2 v_TexCoord;
|
||||||
|
vec4 member;
|
||||||
|
};
|
||||||
|
|
||||||
|
VertexOutput tint_symbol_1_inner(vec3 a_Position, vec2 a_UV, vec4 a_Color, vec3 a_Normal, float a_PosMtxIdx) {
|
||||||
|
a_Position1 = a_Position;
|
||||||
|
a_UV1 = a_UV;
|
||||||
|
a_Color1 = a_Color;
|
||||||
|
a_Normal1 = a_Normal;
|
||||||
|
a_PosMtxIdx1 = a_PosMtxIdx;
|
||||||
|
main1();
|
||||||
|
VertexOutput tint_symbol_5 = VertexOutput(v_Color, v_TexCoord, tint_symbol);
|
||||||
|
return tint_symbol_5;
|
||||||
|
}
|
||||||
|
|
||||||
|
tint_symbol_4 tint_symbol_1(tint_symbol_3 tint_symbol_2) {
|
||||||
|
VertexOutput inner_result = tint_symbol_1_inner(tint_symbol_2.a_Position, tint_symbol_2.a_UV, tint_symbol_2.a_Color, tint_symbol_2.a_Normal, tint_symbol_2.a_PosMtxIdx);
|
||||||
|
tint_symbol_4 wrapper_result = tint_symbol_4(vec4(0.0f, 0.0f, 0.0f, 0.0f), vec2(0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
wrapper_result.v_Color = inner_result.v_Color;
|
||||||
|
wrapper_result.v_TexCoord = inner_result.v_TexCoord;
|
||||||
|
wrapper_result.member = inner_result.member;
|
||||||
|
return wrapper_result;
|
||||||
|
}
|
||||||
|
in vec3 a_Position;
|
||||||
|
in vec2 a_UV;
|
||||||
|
in vec4 a_Color;
|
||||||
|
in vec3 a_Normal;
|
||||||
|
in float a_PosMtxIdx;
|
||||||
|
out vec4 v_Color;
|
||||||
|
out vec2 v_TexCoord;
|
||||||
|
void main() {
|
||||||
|
tint_symbol_3 inputs;
|
||||||
|
inputs.a_Position = a_Position;
|
||||||
|
inputs.a_UV = a_UV;
|
||||||
|
inputs.a_Color = a_Color;
|
||||||
|
inputs.a_Normal = a_Normal;
|
||||||
|
inputs.a_PosMtxIdx = a_PosMtxIdx;
|
||||||
|
tint_symbol_4 outputs;
|
||||||
|
outputs = tint_symbol_1(inputs);
|
||||||
|
v_Color = outputs.v_Color;
|
||||||
|
v_TexCoord = outputs.v_TexCoord;
|
||||||
|
gl_Position = outputs.member;
|
||||||
|
gl_Position.y = -gl_Position.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:157: 'v_Color' : redefinition
|
||||||
|
ERROR: 1 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
40
test/bug/tint/926.wgsl.expected.glsl
Normal file
40
test/bug/tint/926.wgsl.expected.glsl
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 5) buffer DrawIndirectArgs_1 {
|
||||||
|
uint vertexCount;
|
||||||
|
} drawOut;
|
||||||
|
uint cubeVerts = 0u;
|
||||||
|
|
||||||
|
struct tint_symbol_1 {
|
||||||
|
uvec3 global_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
void computeMain_inner(uvec3 global_id) {
|
||||||
|
uint atomic_result = 0u;
|
||||||
|
InterlockedAdd(drawOut.vertexCount, cubeVerts, atomic_result);
|
||||||
|
uint firstVertex = atomic_result;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void computeMain(tint_symbol_1 tint_symbol) {
|
||||||
|
computeMain_inner(tint_symbol.global_id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_1 inputs;
|
||||||
|
inputs.global_id = gl_GlobalInvocationID;
|
||||||
|
computeMain(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:16: 'InterlockedAdd' : no matching overloaded function found
|
||||||
|
ERROR: 0:16: '' : compilation terminated
|
||||||
|
ERROR: 2 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
104
test/bug/tint/942.wgsl.expected.glsl
Normal file
104
test/bug/tint/942.wgsl.expected.glsl
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 1) uniform Params_1 {
|
||||||
|
uint filterDim;
|
||||||
|
uint blockDim;
|
||||||
|
} params;
|
||||||
|
uniform highp sampler2D inputTex;
|
||||||
|
uniform highp writeonly image2D outputTex;
|
||||||
|
|
||||||
|
layout (binding = 3) uniform Flip_1 {
|
||||||
|
uint value;
|
||||||
|
} flip;
|
||||||
|
groupshared vec3 tile[4][256];
|
||||||
|
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
uvec3 LocalInvocationID;
|
||||||
|
uint local_invocation_index;
|
||||||
|
uvec3 WorkGroupID;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tint_symbol_inner(uvec3 WorkGroupID, uvec3 LocalInvocationID, uint local_invocation_index) {
|
||||||
|
{
|
||||||
|
for(uint idx = local_invocation_index; (idx < 1024u); idx = (idx + 64u)) {
|
||||||
|
uint i_1 = (idx / 256u);
|
||||||
|
uint i_2 = (idx % 256u);
|
||||||
|
tile[i_1][i_2] = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GroupMemoryBarrierWithGroupSync();
|
||||||
|
uint filterOffset = ((params.filterDim - 1u) / 2u);
|
||||||
|
ivec2 dims = textureSize(inputTex0);
|
||||||
|
ivec2 baseIndex = (ivec2(((WorkGroupID.xy * uvec2(params.blockDim, 4u)) + (LocalInvocationID.xy * uvec2(4u, 1u)))) - ivec2(int(filterOffset), 0));
|
||||||
|
{
|
||||||
|
for(uint r = 0u; (r < 4u); r = (r + 1u)) {
|
||||||
|
{
|
||||||
|
for(uint c = 0u; (c < 4u); c = (c + 1u)) {
|
||||||
|
ivec2 loadIndex = (baseIndex + ivec2(int(c), int(r)));
|
||||||
|
if ((flip.value != 0u)) {
|
||||||
|
loadIndex = loadIndex.yx;
|
||||||
|
}
|
||||||
|
tile[r][((4u * LocalInvocationID.x) + c)] = textureLod(inputTex, ((vec2(loadIndex) + vec2(0.25f, 0.25f)) / vec2(dims)), 0.0f).rgb;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GroupMemoryBarrierWithGroupSync();
|
||||||
|
{
|
||||||
|
for(uint r = 0u; (r < 4u); r = (r + 1u)) {
|
||||||
|
{
|
||||||
|
for(uint c = 0u; (c < 4u); c = (c + 1u)) {
|
||||||
|
ivec2 writeIndex = (baseIndex + ivec2(int(c), int(r)));
|
||||||
|
if ((flip.value != 0u)) {
|
||||||
|
writeIndex = writeIndex.yx;
|
||||||
|
}
|
||||||
|
uint center = ((4u * LocalInvocationID.x) + c);
|
||||||
|
bool tint_tmp_1 = (center >= filterOffset);
|
||||||
|
if (tint_tmp_1) {
|
||||||
|
tint_tmp_1 = (center < (256u - filterOffset));
|
||||||
|
}
|
||||||
|
bool tint_tmp = (tint_tmp_1);
|
||||||
|
if (tint_tmp) {
|
||||||
|
tint_tmp = all((writeIndex < dims));
|
||||||
|
}
|
||||||
|
if ((tint_tmp)) {
|
||||||
|
vec3 acc = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
{
|
||||||
|
for(uint f = 0u; (f < params.filterDim); f = (f + 1u)) {
|
||||||
|
uint i = ((center + f) - filterOffset);
|
||||||
|
acc = (acc + ((1.0f / float(params.filterDim)) * tile[r][i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
imageStore(outputTex, writeIndex, vec4(acc, 1.0f)).x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol(tint_symbol_2 tint_symbol_1) {
|
||||||
|
tint_symbol_inner(tint_symbol_1.WorkGroupID, tint_symbol_1.LocalInvocationID, tint_symbol_1.local_invocation_index);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_2 inputs;
|
||||||
|
inputs.LocalInvocationID = gl_LocalInvocationID;
|
||||||
|
inputs.local_invocation_index = uint(gl_LocalInvocationIndex);
|
||||||
|
inputs.WorkGroupID = gl_WorkGroupID;
|
||||||
|
tint_symbol(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:16: '' : syntax error, unexpected IDENTIFIER
|
||||||
|
ERROR: 1 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
402
test/bug/tint/943.spvasm.expected.glsl
Normal file
402
test/bug/tint/943.spvasm.expected.glsl
Normal file
@ -0,0 +1,402 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
int dimAOuter_1 = 0;
|
||||||
|
layout (binding = 3) uniform Uniforms_1 {
|
||||||
|
float NAN;
|
||||||
|
ivec3 aShape;
|
||||||
|
ivec3 bShape;
|
||||||
|
ivec3 outShape;
|
||||||
|
ivec2 outShapeStrides;
|
||||||
|
} x_48;
|
||||||
|
int dimInner_1 = 0;
|
||||||
|
int dimBOuter_1 = 0;
|
||||||
|
layout (binding = 0) buffer ssbOut_1 {
|
||||||
|
float result[];
|
||||||
|
} x_54;
|
||||||
|
uvec3 tint_symbol = uvec3(0u, 0u, 0u);
|
||||||
|
uvec3 tint_symbol_1 = uvec3(0u, 0u, 0u);
|
||||||
|
groupshared float mm_Asub[64][64];
|
||||||
|
groupshared float mm_Bsub[64][1];
|
||||||
|
layout (binding = 1) buffer ssbA_1 {
|
||||||
|
float A[];
|
||||||
|
} x_165;
|
||||||
|
int batch = 0;
|
||||||
|
layout (binding = 2) buffer ssbB_1 {
|
||||||
|
float B[];
|
||||||
|
} x_185;
|
||||||
|
|
||||||
|
bool coordsInBounds_vi2_vi2_(inout ivec2 coord, inout ivec2 shape) {
|
||||||
|
bool x_87 = false;
|
||||||
|
bool x_88_phi = false;
|
||||||
|
ivec2 x_76 = coord;
|
||||||
|
bool x_81 = all((x_76 >= ivec2(0, 0)));
|
||||||
|
x_88_phi = x_81;
|
||||||
|
if (x_81) {
|
||||||
|
ivec2 x_84 = coord;
|
||||||
|
ivec2 x_85 = shape;
|
||||||
|
x_87 = all((x_84 < x_85));
|
||||||
|
x_88_phi = x_87;
|
||||||
|
}
|
||||||
|
return x_88_phi;
|
||||||
|
}
|
||||||
|
|
||||||
|
float mm_readA_i1_i1_(inout int row, inout int col) {
|
||||||
|
int batchASize = 0;
|
||||||
|
ivec2 param_10 = ivec2(0, 0);
|
||||||
|
ivec2 param_11 = ivec2(0, 0);
|
||||||
|
float x_430 = 0.0f;
|
||||||
|
int x_417 = x_48.aShape.y;
|
||||||
|
int x_419 = x_48.aShape.z;
|
||||||
|
batchASize = (x_417 * x_419);
|
||||||
|
int x_421 = row;
|
||||||
|
int x_422 = col;
|
||||||
|
int x_424 = dimAOuter_1;
|
||||||
|
int x_425 = dimInner_1;
|
||||||
|
param_10 = ivec2(x_421, x_422);
|
||||||
|
param_11 = ivec2(x_424, x_425);
|
||||||
|
bool x_429 = coordsInBounds_vi2_vi2_(param_10, param_11);
|
||||||
|
if (x_429) {
|
||||||
|
int x_438 = batch;
|
||||||
|
int x_439 = batchASize;
|
||||||
|
int x_441 = row;
|
||||||
|
int x_442 = dimInner_1;
|
||||||
|
int x_445 = col;
|
||||||
|
float x_448 = x_165.A[(((x_438 * x_439) + (x_441 * x_442)) + x_445)];
|
||||||
|
x_430 = x_448;
|
||||||
|
} else {
|
||||||
|
x_430 = 0.0f;
|
||||||
|
}
|
||||||
|
return x_430;
|
||||||
|
}
|
||||||
|
|
||||||
|
float mm_readB_i1_i1_(inout int row_1, inout int col_1) {
|
||||||
|
int batchBSize = 0;
|
||||||
|
ivec2 param_12 = ivec2(0, 0);
|
||||||
|
ivec2 param_13 = ivec2(0, 0);
|
||||||
|
float x_468 = 0.0f;
|
||||||
|
int x_455 = x_48.bShape.y;
|
||||||
|
int x_457 = x_48.bShape.z;
|
||||||
|
batchBSize = (x_455 * x_457);
|
||||||
|
int x_459 = row_1;
|
||||||
|
int x_460 = col_1;
|
||||||
|
int x_462 = dimInner_1;
|
||||||
|
int x_463 = dimBOuter_1;
|
||||||
|
param_12 = ivec2(x_459, x_460);
|
||||||
|
param_13 = ivec2(x_462, x_463);
|
||||||
|
bool x_467 = coordsInBounds_vi2_vi2_(param_12, param_13);
|
||||||
|
if (x_467) {
|
||||||
|
int x_475 = batch;
|
||||||
|
int x_476 = batchBSize;
|
||||||
|
int x_478 = row_1;
|
||||||
|
int x_479 = dimBOuter_1;
|
||||||
|
int x_482 = col_1;
|
||||||
|
float x_485 = x_185.B[(((x_475 * x_476) + (x_478 * x_479)) + x_482)];
|
||||||
|
x_468 = x_485;
|
||||||
|
} else {
|
||||||
|
x_468 = 0.0f;
|
||||||
|
}
|
||||||
|
return x_468;
|
||||||
|
}
|
||||||
|
|
||||||
|
int getOutputFlatIndex_vi3_(inout ivec3 coords) {
|
||||||
|
ivec3 x_99 = coords;
|
||||||
|
int x_105 = x_48.outShapeStrides.x;
|
||||||
|
int x_107 = x_48.outShapeStrides.y;
|
||||||
|
return int(dot(vec3(x_99), vec3(ivec3(x_105, x_107, 1))));
|
||||||
|
}
|
||||||
|
|
||||||
|
void setOutput_i1_f1_(inout int flatIndex, inout float value) {
|
||||||
|
int x_95 = flatIndex;
|
||||||
|
float x_96 = value;
|
||||||
|
x_54.result[x_95] = x_96;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setOutput_i1_i1_i1_f1_(inout int d0, inout int d1, inout int d2, inout float value_1) {
|
||||||
|
int flatIndex_1 = 0;
|
||||||
|
ivec3 param = ivec3(0, 0, 0);
|
||||||
|
int param_1 = 0;
|
||||||
|
float param_2 = 0.0f;
|
||||||
|
int x_115 = d0;
|
||||||
|
int x_116 = d1;
|
||||||
|
int x_117 = d2;
|
||||||
|
param = ivec3(x_115, x_116, x_117);
|
||||||
|
int x_120 = getOutputFlatIndex_vi3_(param);
|
||||||
|
flatIndex_1 = x_120;
|
||||||
|
param_1 = flatIndex_1;
|
||||||
|
float x_124 = value_1;
|
||||||
|
param_2 = x_124;
|
||||||
|
setOutput_i1_f1_(param_1, param_2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void mm_write_i1_i1_f1_(inout int row_2, inout int col_2, inout float value_2) {
|
||||||
|
ivec3 outCoord = ivec3(0, 0, 0);
|
||||||
|
int param_14 = 0;
|
||||||
|
int param_15 = 0;
|
||||||
|
int param_16 = 0;
|
||||||
|
float param_17 = 0.0f;
|
||||||
|
int x_491 = batch;
|
||||||
|
int x_492 = row_2;
|
||||||
|
int x_493 = col_2;
|
||||||
|
outCoord = ivec3(x_491, x_492, x_493);
|
||||||
|
param_14 = batch;
|
||||||
|
int x_498 = row_2;
|
||||||
|
param_15 = x_498;
|
||||||
|
int x_500 = col_2;
|
||||||
|
param_16 = x_500;
|
||||||
|
float x_502 = value_2;
|
||||||
|
param_17 = x_502;
|
||||||
|
setOutput_i1_i1_i1_f1_(param_14, param_15, param_16, param_17);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void mm_matMul_i1_i1_i1_(inout int dimAOuter, inout int dimInner, inout int dimBOuter) {
|
||||||
|
int tileRow = 0;
|
||||||
|
int tileCol = 0;
|
||||||
|
int globalRow = 0;
|
||||||
|
int globalCol = 0;
|
||||||
|
int numTiles = 0;
|
||||||
|
int innerRow = 0;
|
||||||
|
int innerCol = 0;
|
||||||
|
float acc[1][1] = float[1][1](float[1](0.0f));
|
||||||
|
int tileColA = 0;
|
||||||
|
int tileRowB = 0;
|
||||||
|
int t = 0;
|
||||||
|
int innerRow_1 = 0;
|
||||||
|
int innerCol_1 = 0;
|
||||||
|
int inputRow = 0;
|
||||||
|
int inputCol = 0;
|
||||||
|
int param_3 = 0;
|
||||||
|
int param_4 = 0;
|
||||||
|
int innerRow_2 = 0;
|
||||||
|
int innerCol_2 = 0;
|
||||||
|
int inputRow_1 = 0;
|
||||||
|
int inputCol_1 = 0;
|
||||||
|
int param_5 = 0;
|
||||||
|
int param_6 = 0;
|
||||||
|
int k = 0;
|
||||||
|
int inner = 0;
|
||||||
|
float BCached[1] = float[1](0.0f);
|
||||||
|
int innerRow_3 = 0;
|
||||||
|
float ACached = 0.0f;
|
||||||
|
int innerCol_3 = 0;
|
||||||
|
int innerRow_4 = 0;
|
||||||
|
int innerCol_4 = 0;
|
||||||
|
int param_7 = 0;
|
||||||
|
int param_8 = 0;
|
||||||
|
float param_9 = 0.0f;
|
||||||
|
uint x_132 = tint_symbol.y;
|
||||||
|
tileRow = (int(x_132) * 1);
|
||||||
|
uint x_137 = tint_symbol.x;
|
||||||
|
tileCol = (int(x_137) * 1);
|
||||||
|
uint x_143 = tint_symbol_1.y;
|
||||||
|
globalRow = (int(x_143) * 1);
|
||||||
|
uint x_148 = tint_symbol_1.x;
|
||||||
|
globalCol = (int(x_148) * 1);
|
||||||
|
int x_152 = dimInner;
|
||||||
|
numTiles = (((x_152 - 1) / 64) + 1);
|
||||||
|
innerRow = 0;
|
||||||
|
{
|
||||||
|
for(; (innerRow < 1); innerRow = (innerRow + 1)) {
|
||||||
|
innerCol = 0;
|
||||||
|
{
|
||||||
|
for(; (innerCol < 1); innerCol = (innerCol + 1)) {
|
||||||
|
acc[innerRow][innerCol] = 0.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uint x_187 = tint_symbol.x;
|
||||||
|
tileColA = (int(x_187) * 64);
|
||||||
|
uint x_192 = tint_symbol.y;
|
||||||
|
tileRowB = (int(x_192) * 1);
|
||||||
|
t = 0;
|
||||||
|
{
|
||||||
|
for(; (t < numTiles); t = (t + 1)) {
|
||||||
|
innerRow_1 = 0;
|
||||||
|
{
|
||||||
|
for(; (innerRow_1 < 1); innerRow_1 = (innerRow_1 + 1)) {
|
||||||
|
innerCol_1 = 0;
|
||||||
|
{
|
||||||
|
for(; (innerCol_1 < 64); innerCol_1 = (innerCol_1 + 1)) {
|
||||||
|
inputRow = (tileRow + innerRow_1);
|
||||||
|
inputCol = (tileColA + innerCol_1);
|
||||||
|
int x_233 = inputRow;
|
||||||
|
int x_234 = inputCol;
|
||||||
|
int x_238 = t;
|
||||||
|
int x_240 = inputCol;
|
||||||
|
param_3 = (globalRow + innerRow_1);
|
||||||
|
param_4 = ((x_238 * 64) + x_240);
|
||||||
|
float x_244 = mm_readA_i1_i1_(param_3, param_4);
|
||||||
|
mm_Asub[x_233][x_234] = x_244;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
innerRow_2 = 0;
|
||||||
|
{
|
||||||
|
for(; (innerRow_2 < 1); innerRow_2 = (innerRow_2 + 1)) {
|
||||||
|
innerCol_2 = 0;
|
||||||
|
{
|
||||||
|
for(; (innerCol_2 < 1); innerCol_2 = (innerCol_2 + 1)) {
|
||||||
|
inputRow_1 = (tileRowB + innerRow_2);
|
||||||
|
inputCol_1 = (tileCol + innerCol_2);
|
||||||
|
int x_278 = inputRow_1;
|
||||||
|
int x_279 = inputCol_1;
|
||||||
|
int x_284 = globalCol;
|
||||||
|
int x_285 = innerCol_2;
|
||||||
|
param_5 = ((t * 64) + inputRow_1);
|
||||||
|
param_6 = (x_284 + x_285);
|
||||||
|
float x_289 = mm_readB_i1_i1_(param_5, param_6);
|
||||||
|
mm_Bsub[x_278][x_279] = x_289;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GroupMemoryBarrierWithGroupSync();
|
||||||
|
k = 0;
|
||||||
|
{
|
||||||
|
for(; (k < 64); k = (k + 1)) {
|
||||||
|
inner = 0;
|
||||||
|
{
|
||||||
|
for(; (inner < 1); inner = (inner + 1)) {
|
||||||
|
int x_314 = inner;
|
||||||
|
float x_320 = mm_Bsub[k][(tileCol + inner)];
|
||||||
|
BCached[x_314] = x_320;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
innerRow_3 = 0;
|
||||||
|
{
|
||||||
|
for(; (innerRow_3 < 1); innerRow_3 = (innerRow_3 + 1)) {
|
||||||
|
float x_338 = mm_Asub[(tileRow + innerRow_3)][k];
|
||||||
|
ACached = x_338;
|
||||||
|
innerCol_3 = 0;
|
||||||
|
{
|
||||||
|
for(; (innerCol_3 < 1); innerCol_3 = (innerCol_3 + 1)) {
|
||||||
|
int x_347 = innerRow_3;
|
||||||
|
int x_348 = innerCol_3;
|
||||||
|
float x_349 = ACached;
|
||||||
|
float x_352 = BCached[innerCol_3];
|
||||||
|
float x_355 = acc[x_347][x_348];
|
||||||
|
acc[x_347][x_348] = (x_355 + (x_349 * x_352));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GroupMemoryBarrierWithGroupSync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
innerRow_4 = 0;
|
||||||
|
{
|
||||||
|
for(; (innerRow_4 < 1); innerRow_4 = (innerRow_4 + 1)) {
|
||||||
|
innerCol_4 = 0;
|
||||||
|
while (true) {
|
||||||
|
bool x_393 = false;
|
||||||
|
bool x_394_phi = false;
|
||||||
|
if ((innerCol_4 < 1)) {
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
int x_382 = globalCol;
|
||||||
|
int x_383 = innerCol_4;
|
||||||
|
int x_385 = dimBOuter;
|
||||||
|
bool x_386 = ((x_382 + x_383) < x_385);
|
||||||
|
x_394_phi = x_386;
|
||||||
|
if (x_386) {
|
||||||
|
int x_389 = globalRow;
|
||||||
|
int x_390 = innerRow_4;
|
||||||
|
int x_392 = dimAOuter;
|
||||||
|
x_393 = ((x_389 + x_390) < x_392);
|
||||||
|
x_394_phi = x_393;
|
||||||
|
}
|
||||||
|
if (x_394_phi) {
|
||||||
|
int x_400 = globalCol;
|
||||||
|
int x_401 = innerCol_4;
|
||||||
|
int x_403 = innerRow_4;
|
||||||
|
int x_404 = innerCol_4;
|
||||||
|
param_7 = (globalRow + innerRow_4);
|
||||||
|
param_8 = (x_400 + x_401);
|
||||||
|
float x_409 = acc[x_403][x_404];
|
||||||
|
param_9 = x_409;
|
||||||
|
mm_write_i1_i1_f1_(param_7, param_8, param_9);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
innerCol_4 = (innerCol_4 + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main_1() {
|
||||||
|
int param_18 = 0;
|
||||||
|
int param_19 = 0;
|
||||||
|
int param_20 = 0;
|
||||||
|
int x_67 = x_48.aShape.y;
|
||||||
|
dimAOuter_1 = x_67;
|
||||||
|
int x_71 = x_48.aShape.z;
|
||||||
|
dimInner_1 = x_71;
|
||||||
|
int x_75 = x_48.bShape.z;
|
||||||
|
dimBOuter_1 = x_75;
|
||||||
|
uint x_505 = tint_symbol_1.z;
|
||||||
|
batch = int(x_505);
|
||||||
|
param_18 = dimAOuter_1;
|
||||||
|
param_19 = dimInner_1;
|
||||||
|
param_20 = dimBOuter_1;
|
||||||
|
mm_matMul_i1_i1_i1_(param_18, param_19, param_20);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct tint_symbol_4 {
|
||||||
|
uvec3 gl_LocalInvocationID_param;
|
||||||
|
uint local_invocation_index;
|
||||||
|
uvec3 gl_GlobalInvocationID_param;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tint_symbol_2_inner(uvec3 gl_LocalInvocationID_param, uvec3 gl_GlobalInvocationID_param, uint local_invocation_index) {
|
||||||
|
{
|
||||||
|
uint i_1 = local_invocation_index;
|
||||||
|
uint i_2 = (local_invocation_index % 1u);
|
||||||
|
mm_Bsub[i_1][i_2] = 0.0f;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
for(uint idx = local_invocation_index; (idx < 4096u); idx = (idx + 64u)) {
|
||||||
|
uint i = (idx / 64u);
|
||||||
|
uint i_1 = (idx % 64u);
|
||||||
|
mm_Asub[i][i_1] = 0.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GroupMemoryBarrierWithGroupSync();
|
||||||
|
tint_symbol = gl_LocalInvocationID_param;
|
||||||
|
tint_symbol_1 = gl_GlobalInvocationID_param;
|
||||||
|
main_1();
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 64, local_size_z = 1) in;
|
||||||
|
void tint_symbol_2(tint_symbol_4 tint_symbol_3) {
|
||||||
|
tint_symbol_2_inner(tint_symbol_3.gl_LocalInvocationID_param, tint_symbol_3.gl_GlobalInvocationID_param, tint_symbol_3.local_invocation_index);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_4 inputs;
|
||||||
|
inputs.gl_LocalInvocationID_param = gl_LocalInvocationID;
|
||||||
|
inputs.local_invocation_index = uint(gl_LocalInvocationIndex);
|
||||||
|
inputs.gl_GlobalInvocationID_param = gl_GlobalInvocationID;
|
||||||
|
tint_symbol_2(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:20: '' : syntax error, unexpected IDENTIFIER
|
||||||
|
ERROR: 1 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
227
test/bug/tint/948.wgsl.expected.glsl
Normal file
227
test/bug/tint/948.wgsl.expected.glsl
Normal file
@ -0,0 +1,227 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 9) uniform LeftOver_1 {
|
||||||
|
float time;
|
||||||
|
uint padding;
|
||||||
|
mat4 worldViewProjection;
|
||||||
|
vec2 outputSize;
|
||||||
|
vec2 stageSize;
|
||||||
|
vec2 spriteMapSize;
|
||||||
|
float stageScale;
|
||||||
|
float spriteCount;
|
||||||
|
vec3 colorMul;
|
||||||
|
} x_20;
|
||||||
|
uniform highp sampler2D frameMapTexture;
|
||||||
|
|
||||||
|
vec2 tUV = vec2(0.0f, 0.0f);
|
||||||
|
uniform highp sampler2D tileMapsTexture0;
|
||||||
|
|
||||||
|
uniform highp sampler2D tileMapsTexture1;
|
||||||
|
uniform highp sampler2D animationMapTexture;
|
||||||
|
|
||||||
|
float mt = 0.0f;
|
||||||
|
uniform highp sampler2D spriteSheetTexture;
|
||||||
|
|
||||||
|
vec4 glFragColor = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
vec2 tileID_1 = vec2(0.0f, 0.0f);
|
||||||
|
vec2 levelUnits = vec2(0.0f, 0.0f);
|
||||||
|
vec2 stageUnits_1 = vec2(0.0f, 0.0f);
|
||||||
|
vec3 vPosition = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec2 vUV = vec2(0.0f, 0.0f);
|
||||||
|
|
||||||
|
mat4 getFrameData_f1_(inout float frameID) {
|
||||||
|
float fX = 0.0f;
|
||||||
|
float x_15 = frameID;
|
||||||
|
float x_25 = x_20.spriteCount;
|
||||||
|
fX = (x_15 / x_25);
|
||||||
|
vec4 x_40 = texture(frameMapTexture, vec2(fX, 0.0f), 0.0f);
|
||||||
|
vec4 x_47 = texture(frameMapTexture, vec2(fX, 0.25f), 0.0f);
|
||||||
|
vec4 x_54 = texture(frameMapTexture, vec2(fX, 0.5f), 0.0f);
|
||||||
|
return mat4(vec4(x_40.x, x_40.y, x_40.z, x_40.w), vec4(x_47.x, x_47.y, x_47.z, x_47.w), vec4(x_54.x, x_54.y, x_54.z, x_54.w), vec4(vec4(0.0f, 0.0f, 0.0f, 0.0f).x, vec4(0.0f, 0.0f, 0.0f, 0.0f).y, vec4(0.0f, 0.0f, 0.0f, 0.0f).z, vec4(0.0f, 0.0f, 0.0f, 0.0f).w));
|
||||||
|
}
|
||||||
|
|
||||||
|
void main_1() {
|
||||||
|
vec4 color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
vec2 tileUV = vec2(0.0f, 0.0f);
|
||||||
|
vec2 tileID = vec2(0.0f, 0.0f);
|
||||||
|
vec2 sheetUnits = vec2(0.0f, 0.0f);
|
||||||
|
float spriteUnits = 0.0f;
|
||||||
|
vec2 stageUnits = vec2(0.0f, 0.0f);
|
||||||
|
int i = 0;
|
||||||
|
float frameID_1 = 0.0f;
|
||||||
|
vec4 animationData = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
float f = 0.0f;
|
||||||
|
mat4 frameData = mat4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
float param = 0.0f;
|
||||||
|
vec2 frameSize = vec2(0.0f, 0.0f);
|
||||||
|
vec2 offset_1 = vec2(0.0f, 0.0f);
|
||||||
|
vec2 ratio = vec2(0.0f, 0.0f);
|
||||||
|
vec4 nc = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
float alpha = 0.0f;
|
||||||
|
vec3 mixed = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
color = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
tileUV = frac(tUV);
|
||||||
|
float x_91 = tileUV.y;
|
||||||
|
tileUV.y = (1.0f - x_91);
|
||||||
|
tileID = floor(tUV);
|
||||||
|
vec2 x_101 = x_20.spriteMapSize;
|
||||||
|
sheetUnits = (vec2(1.0f, 1.0f) / x_101);
|
||||||
|
float x_106 = x_20.spriteCount;
|
||||||
|
spriteUnits = (1.0f / x_106);
|
||||||
|
vec2 x_111 = x_20.stageSize;
|
||||||
|
stageUnits = (vec2(1.0f, 1.0f) / x_111);
|
||||||
|
i = 0;
|
||||||
|
{
|
||||||
|
for(; (i < 2); i = (i + 1)) {
|
||||||
|
switch(i) {
|
||||||
|
case 1: {
|
||||||
|
vec2 x_150 = tileID;
|
||||||
|
vec2 x_154 = x_20.stageSize;
|
||||||
|
vec4 x_156 = texture(tileMapsTexture1, ((x_150 + vec2(0.5f, 0.5f)) / x_154), 0.0f);
|
||||||
|
frameID_1 = x_156.x;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0: {
|
||||||
|
vec2 x_136 = tileID;
|
||||||
|
vec2 x_140 = x_20.stageSize;
|
||||||
|
vec4 x_142 = texture(tileMapsTexture0, ((x_136 + vec2(0.5f, 0.5f)) / x_140), 0.0f);
|
||||||
|
frameID_1 = x_142.x;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
float x_166 = frameID_1;
|
||||||
|
float x_169 = x_20.spriteCount;
|
||||||
|
vec4 x_172 = texture(animationMapTexture, vec2(((x_166 + 0.5f) / x_169), 0.0f), 0.0f);
|
||||||
|
animationData = x_172;
|
||||||
|
float x_174 = animationData.y;
|
||||||
|
if ((x_174 > 0.0f)) {
|
||||||
|
float x_181 = x_20.time;
|
||||||
|
float x_184 = animationData.z;
|
||||||
|
mt = ((x_181 * x_184) % 1.0f);
|
||||||
|
f = 0.0f;
|
||||||
|
{
|
||||||
|
for(; (f < 8.0f); f = (f + 1.0f)) {
|
||||||
|
float x_197 = animationData.y;
|
||||||
|
if ((x_197 > mt)) {
|
||||||
|
float x_203 = animationData.x;
|
||||||
|
frameID_1 = x_203;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
float x_208 = frameID_1;
|
||||||
|
float x_211 = x_20.spriteCount;
|
||||||
|
vec4 x_217 = texture(animationMapTexture, vec2(((x_208 + 0.5f) / x_211), (0.125f * f)), 0.0f);
|
||||||
|
animationData = x_217;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
param = (frameID_1 + 0.5f);
|
||||||
|
mat4 x_225 = getFrameData_f1_(param);
|
||||||
|
frameData = x_225;
|
||||||
|
vec4 x_228 = frameData[0];
|
||||||
|
vec2 x_231 = x_20.spriteMapSize;
|
||||||
|
frameSize = (vec2(x_228.w, x_228.z) / x_231);
|
||||||
|
vec4 x_235 = frameData[0];
|
||||||
|
offset_1 = (vec2(x_235.x, x_235.y) * sheetUnits);
|
||||||
|
vec4 x_241 = frameData[2];
|
||||||
|
vec4 x_244 = frameData[0];
|
||||||
|
ratio = (vec2(x_241.x, x_241.y) / vec2(x_244.w, x_244.z));
|
||||||
|
float x_248 = frameData[2].z;
|
||||||
|
if ((x_248 == 1.0f)) {
|
||||||
|
vec2 x_252 = tileUV;
|
||||||
|
tileUV = vec2(x_252.y, x_252.x);
|
||||||
|
}
|
||||||
|
if ((i == 0)) {
|
||||||
|
vec4 x_268 = texture(spriteSheetTexture, ((tileUV * frameSize) + offset_1));
|
||||||
|
color = x_268;
|
||||||
|
} else {
|
||||||
|
vec4 x_279 = texture(spriteSheetTexture, ((tileUV * frameSize) + offset_1));
|
||||||
|
nc = x_279;
|
||||||
|
float x_283 = color.w;
|
||||||
|
float x_285 = nc.w;
|
||||||
|
alpha = min((x_283 + x_285), 1.0f);
|
||||||
|
vec4 x_290 = color;
|
||||||
|
vec4 x_292 = nc;
|
||||||
|
float x_295 = nc.w;
|
||||||
|
mixed = mix(vec3(x_290.x, x_290.y, x_290.z), vec3(x_292.x, x_292.y, x_292.z), vec3(x_295, x_295, x_295));
|
||||||
|
vec3 x_298 = mixed;
|
||||||
|
color = vec4(x_298.x, x_298.y, x_298.z, alpha);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vec3 x_310 = x_20.colorMul;
|
||||||
|
vec4 x_311 = color;
|
||||||
|
vec3 x_313 = (vec3(x_311.x, x_311.y, x_311.z) * x_310);
|
||||||
|
color = vec4(x_313.x, x_313.y, x_313.z, color.w);
|
||||||
|
glFragColor = color;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct main_out {
|
||||||
|
vec4 glFragColor_1;
|
||||||
|
};
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
vec3 vPosition_param;
|
||||||
|
vec2 vUV_param;
|
||||||
|
vec2 tUV_param;
|
||||||
|
vec2 stageUnits_1_param;
|
||||||
|
vec2 levelUnits_param;
|
||||||
|
vec2 tileID_1_param;
|
||||||
|
};
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
vec4 glFragColor_1;
|
||||||
|
};
|
||||||
|
|
||||||
|
main_out tint_symbol_inner(vec2 tUV_param, vec2 tileID_1_param, vec2 levelUnits_param, vec2 stageUnits_1_param, vec3 vPosition_param, vec2 vUV_param) {
|
||||||
|
tUV = tUV_param;
|
||||||
|
tileID_1 = tileID_1_param;
|
||||||
|
levelUnits = levelUnits_param;
|
||||||
|
stageUnits_1 = stageUnits_1_param;
|
||||||
|
vPosition = vPosition_param;
|
||||||
|
vUV = vUV_param;
|
||||||
|
main_1();
|
||||||
|
main_out tint_symbol_4 = main_out(glFragColor);
|
||||||
|
return tint_symbol_4;
|
||||||
|
}
|
||||||
|
|
||||||
|
tint_symbol_3 tint_symbol(tint_symbol_2 tint_symbol_1) {
|
||||||
|
main_out inner_result = tint_symbol_inner(tint_symbol_1.tUV_param, tint_symbol_1.tileID_1_param, tint_symbol_1.levelUnits_param, tint_symbol_1.stageUnits_1_param, tint_symbol_1.vPosition_param, tint_symbol_1.vUV_param);
|
||||||
|
tint_symbol_3 wrapper_result = tint_symbol_3(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
wrapper_result.glFragColor_1 = inner_result.glFragColor_1;
|
||||||
|
return wrapper_result;
|
||||||
|
}
|
||||||
|
in vec3 vPosition_param;
|
||||||
|
in vec2 vUV_param;
|
||||||
|
in vec2 tUV_param;
|
||||||
|
in vec2 stageUnits_1_param;
|
||||||
|
in vec2 levelUnits_param;
|
||||||
|
in vec2 tileID_1_param;
|
||||||
|
out vec4 glFragColor_1;
|
||||||
|
void main() {
|
||||||
|
tint_symbol_2 inputs;
|
||||||
|
inputs.vPosition_param = vPosition_param;
|
||||||
|
inputs.vUV_param = vUV_param;
|
||||||
|
inputs.tUV_param = tUV_param;
|
||||||
|
inputs.stageUnits_1_param = stageUnits_1_param;
|
||||||
|
inputs.levelUnits_param = levelUnits_param;
|
||||||
|
inputs.tileID_1_param = tileID_1_param;
|
||||||
|
tint_symbol_3 outputs;
|
||||||
|
outputs = tint_symbol(inputs);
|
||||||
|
glFragColor_1 = outputs.glFragColor_1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:65: 'frac' : no matching overloaded function found
|
||||||
|
ERROR: 0:65: 'assign' : cannot convert from ' const float' to ' temp mediump 2-component vector of float'
|
||||||
|
ERROR: 0:65: '' : compilation terminated
|
||||||
|
ERROR: 3 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
386
test/bug/tint/949.wgsl.expected.glsl
Normal file
386
test/bug/tint/949.wgsl.expected.glsl
Normal file
@ -0,0 +1,386 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct lightingInfo {
|
||||||
|
vec3 diffuse;
|
||||||
|
vec3 specular;
|
||||||
|
};
|
||||||
|
|
||||||
|
float u_Float = 0.0f;
|
||||||
|
vec3 u_Color = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
uniform highp sampler2D TextureSamplerTexture;
|
||||||
|
|
||||||
|
vec2 vMainuv = vec2(0.0f, 0.0f);
|
||||||
|
layout (binding = 6) uniform LeftOver_1 {
|
||||||
|
mat4 u_World;
|
||||||
|
mat4 u_ViewProjection;
|
||||||
|
float u_bumpStrength;
|
||||||
|
uint padding;
|
||||||
|
vec3 u_cameraPosition;
|
||||||
|
float u_parallaxScale;
|
||||||
|
float textureInfoName;
|
||||||
|
uint padding_1;
|
||||||
|
vec2 tangentSpaceParameter0;
|
||||||
|
} x_269;
|
||||||
|
vec4 v_output1 = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
bool tint_symbol = false;
|
||||||
|
vec2 v_uv = vec2(0.0f, 0.0f);
|
||||||
|
vec4 v_output2 = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
uniform highp sampler2D TextureSampler1Texture;
|
||||||
|
|
||||||
|
layout (binding = 5) uniform Light0_1 {
|
||||||
|
vec4 vLightData;
|
||||||
|
vec4 vLightDiffuse;
|
||||||
|
vec4 vLightSpecular;
|
||||||
|
vec3 vLightGround;
|
||||||
|
uint padding_2;
|
||||||
|
vec4 shadowsInfo;
|
||||||
|
vec2 depthValues;
|
||||||
|
} light0;
|
||||||
|
vec4 glFragColor = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
|
mat3 cotangent_frame_vf3_vf3_vf2_vf2_(inout vec3 normal_1, inout vec3 p, inout vec2 uv, inout vec2 tangentSpaceParams) {
|
||||||
|
vec3 dp1 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 dp2 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec2 duv1 = vec2(0.0f, 0.0f);
|
||||||
|
vec2 duv2 = vec2(0.0f, 0.0f);
|
||||||
|
vec3 dp2perp = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 dp1perp = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 tangent = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 bitangent = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
float invmax = 0.0f;
|
||||||
|
vec3 x_133 = p;
|
||||||
|
dp1 = ddx(x_133);
|
||||||
|
vec3 x_136 = p;
|
||||||
|
dp2 = ddy(x_136);
|
||||||
|
vec2 x_139 = uv;
|
||||||
|
duv1 = ddx(x_139);
|
||||||
|
vec2 x_142 = uv;
|
||||||
|
duv2 = ddy(x_142);
|
||||||
|
vec3 x_145 = dp2;
|
||||||
|
vec3 x_146 = normal_1;
|
||||||
|
dp2perp = cross(x_145, x_146);
|
||||||
|
vec3 x_149 = normal_1;
|
||||||
|
dp1perp = cross(x_149, dp1);
|
||||||
|
vec3 x_153 = dp2perp;
|
||||||
|
float x_155 = duv1.x;
|
||||||
|
vec3 x_157 = dp1perp;
|
||||||
|
float x_159 = duv2.x;
|
||||||
|
tangent = ((x_153 * x_155) + (x_157 * x_159));
|
||||||
|
vec3 x_163 = dp2perp;
|
||||||
|
float x_165 = duv1.y;
|
||||||
|
vec3 x_167 = dp1perp;
|
||||||
|
float x_169 = duv2.y;
|
||||||
|
bitangent = ((x_163 * x_165) + (x_167 * x_169));
|
||||||
|
float x_173 = tangentSpaceParams.x;
|
||||||
|
tangent = (tangent * x_173);
|
||||||
|
float x_177 = tangentSpaceParams.y;
|
||||||
|
bitangent = (bitangent * x_177);
|
||||||
|
invmax = rsqrt(max(dot(tangent, tangent), dot(bitangent, bitangent)));
|
||||||
|
vec3 x_191 = (tangent * invmax);
|
||||||
|
vec3 x_194 = (bitangent * invmax);
|
||||||
|
vec3 x_195 = normal_1;
|
||||||
|
return mat3(vec3(x_191.x, x_191.y, x_191.z), vec3(x_194.x, x_194.y, x_194.z), vec3(x_195.x, x_195.y, x_195.z));
|
||||||
|
}
|
||||||
|
|
||||||
|
mat3 transposeMat3_mf33_(inout mat3 inMatrix) {
|
||||||
|
vec3 i0 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 i1 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 i2 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
mat3 outMatrix = mat3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 x_60 = inMatrix[0];
|
||||||
|
i0 = x_60;
|
||||||
|
vec3 x_64 = inMatrix[1];
|
||||||
|
i1 = x_64;
|
||||||
|
vec3 x_68 = inMatrix[2];
|
||||||
|
i2 = x_68;
|
||||||
|
float x_73 = i0.x;
|
||||||
|
float x_75 = i1.x;
|
||||||
|
float x_77 = i2.x;
|
||||||
|
vec3 x_78 = vec3(x_73, x_75, x_77);
|
||||||
|
float x_81 = i0.y;
|
||||||
|
float x_83 = i1.y;
|
||||||
|
float x_85 = i2.y;
|
||||||
|
vec3 x_86 = vec3(x_81, x_83, x_85);
|
||||||
|
float x_89 = i0.z;
|
||||||
|
float x_91 = i1.z;
|
||||||
|
float x_93 = i2.z;
|
||||||
|
vec3 x_94 = vec3(x_89, x_91, x_93);
|
||||||
|
outMatrix = mat3(vec3(x_78.x, x_78.y, x_78.z), vec3(x_86.x, x_86.y, x_86.z), vec3(x_94.x, x_94.y, x_94.z));
|
||||||
|
return outMatrix;
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 perturbNormalBase_mf33_vf3_f1_(inout mat3 cotangentFrame, inout vec3 normal, inout float scale) {
|
||||||
|
mat3 x_113 = cotangentFrame;
|
||||||
|
vec3 x_114 = normal;
|
||||||
|
return normalize((x_113 * x_114));
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 perturbNormal_mf33_vf3_f1_(inout mat3 cotangentFrame_1, inout vec3 textureSample, inout float scale_1) {
|
||||||
|
mat3 param = mat3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 param_1 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
float param_2 = 0.0f;
|
||||||
|
vec3 x_119 = textureSample;
|
||||||
|
mat3 x_125 = cotangentFrame_1;
|
||||||
|
param = x_125;
|
||||||
|
param_1 = ((x_119 * 2.0f) - vec3(1.0f, 1.0f, 1.0f));
|
||||||
|
float x_128 = scale_1;
|
||||||
|
param_2 = x_128;
|
||||||
|
vec3 x_129 = perturbNormalBase_mf33_vf3_f1_(param, param_1, param_2);
|
||||||
|
return x_129;
|
||||||
|
}
|
||||||
|
|
||||||
|
lightingInfo computeHemisphericLighting_vf3_vf3_vf4_vf3_vf3_vf3_f1_(inout vec3 viewDirectionW, inout vec3 vNormal, inout vec4 lightData, inout vec3 diffuseColor, inout vec3 specularColor, inout vec3 groundColor, inout float glossiness) {
|
||||||
|
float ndl = 0.0f;
|
||||||
|
lightingInfo result = lightingInfo(vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f));
|
||||||
|
vec3 angleW = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
float specComp = 0.0f;
|
||||||
|
vec3 x_212 = vNormal;
|
||||||
|
vec4 x_213 = lightData;
|
||||||
|
ndl = ((dot(x_212, vec3(x_213.x, x_213.y, x_213.z)) * 0.5f) + 0.5f);
|
||||||
|
vec3 x_220 = groundColor;
|
||||||
|
vec3 x_221 = diffuseColor;
|
||||||
|
float x_222 = ndl;
|
||||||
|
result.diffuse = mix(x_220, x_221, vec3(x_222, x_222, x_222));
|
||||||
|
vec3 x_227 = viewDirectionW;
|
||||||
|
vec4 x_228 = lightData;
|
||||||
|
angleW = normalize((x_227 + vec3(x_228.x, x_228.y, x_228.z)));
|
||||||
|
vec3 x_233 = vNormal;
|
||||||
|
specComp = max(0.0f, dot(x_233, angleW));
|
||||||
|
float x_237 = specComp;
|
||||||
|
float x_238 = glossiness;
|
||||||
|
specComp = pow(x_237, max(1.0f, x_238));
|
||||||
|
float x_241 = specComp;
|
||||||
|
vec3 x_242 = specularColor;
|
||||||
|
result.specular = (x_242 * x_241);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main_1() {
|
||||||
|
vec4 tempTextureRead = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 rgb = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 output5 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec4 output4 = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
vec2 uvOffset = vec2(0.0f, 0.0f);
|
||||||
|
float normalScale = 0.0f;
|
||||||
|
vec2 TBNUV = vec2(0.0f, 0.0f);
|
||||||
|
vec2 x_299 = vec2(0.0f, 0.0f);
|
||||||
|
mat3 TBN = mat3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 param_3 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 param_4 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec2 param_5 = vec2(0.0f, 0.0f);
|
||||||
|
vec2 param_6 = vec2(0.0f, 0.0f);
|
||||||
|
mat3 invTBN = mat3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
mat3 param_7 = mat3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
float parallaxLimit = 0.0f;
|
||||||
|
vec2 vOffsetDir = vec2(0.0f, 0.0f);
|
||||||
|
vec2 vMaxOffset = vec2(0.0f, 0.0f);
|
||||||
|
float numSamples = 0.0f;
|
||||||
|
float stepSize = 0.0f;
|
||||||
|
float currRayHeight = 0.0f;
|
||||||
|
vec2 vCurrOffset = vec2(0.0f, 0.0f);
|
||||||
|
vec2 vLastOffset = vec2(0.0f, 0.0f);
|
||||||
|
float lastSampledHeight = 0.0f;
|
||||||
|
float currSampledHeight = 0.0f;
|
||||||
|
int i = 0;
|
||||||
|
float delta1 = 0.0f;
|
||||||
|
float delta2 = 0.0f;
|
||||||
|
float ratio = 0.0f;
|
||||||
|
vec2 parallaxOcclusion_0 = vec2(0.0f, 0.0f);
|
||||||
|
mat3 param_8 = mat3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 param_9 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
float param_10 = 0.0f;
|
||||||
|
vec2 output6 = vec2(0.0f, 0.0f);
|
||||||
|
vec4 tempTextureRead1 = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 rgb1 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 viewDirectionW_1 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
float shadow = 0.0f;
|
||||||
|
float glossiness_1 = 0.0f;
|
||||||
|
vec3 diffuseBase = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 specularBase = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 normalW = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
lightingInfo info = lightingInfo(vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 0.0f, 0.0f));
|
||||||
|
vec3 param_11 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 param_12 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec4 param_13 = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 param_14 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 param_15 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 param_16 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
float param_17 = 0.0f;
|
||||||
|
vec3 diffuseOutput = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 specularOutput = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec3 output3 = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
u_Float = 100.0f;
|
||||||
|
u_Color = vec3(0.5f, 0.5f, 0.5f);
|
||||||
|
vec4 x_262 = texture(TextureSamplerTexture, vMainuv);
|
||||||
|
tempTextureRead = x_262;
|
||||||
|
vec4 x_264 = tempTextureRead;
|
||||||
|
float x_273 = x_269.textureInfoName;
|
||||||
|
rgb = (vec3(x_264.x, x_264.y, x_264.z) * x_273);
|
||||||
|
vec3 x_279 = x_269.u_cameraPosition;
|
||||||
|
vec4 x_282 = v_output1;
|
||||||
|
output5 = normalize((x_279 - vec3(x_282.x, x_282.y, x_282.z)));
|
||||||
|
output4 = vec4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
uvOffset = vec2(0.0f, 0.0f);
|
||||||
|
float x_292 = x_269.u_bumpStrength;
|
||||||
|
normalScale = (1.0f / x_292);
|
||||||
|
if (tint_symbol) {
|
||||||
|
x_299 = v_uv;
|
||||||
|
} else {
|
||||||
|
x_299 = -(v_uv);
|
||||||
|
}
|
||||||
|
TBNUV = x_299;
|
||||||
|
vec4 x_310 = v_output2;
|
||||||
|
param_3 = (vec3(x_310.x, x_310.y, x_310.z) * normalScale);
|
||||||
|
vec4 x_317 = v_output1;
|
||||||
|
param_4 = vec3(x_317.x, x_317.y, x_317.z);
|
||||||
|
param_5 = TBNUV;
|
||||||
|
vec2 x_324 = x_269.tangentSpaceParameter0;
|
||||||
|
param_6 = x_324;
|
||||||
|
mat3 x_325 = cotangent_frame_vf3_vf3_vf2_vf2_(param_3, param_4, param_5, param_6);
|
||||||
|
TBN = x_325;
|
||||||
|
param_7 = TBN;
|
||||||
|
mat3 x_329 = transposeMat3_mf33_(param_7);
|
||||||
|
invTBN = x_329;
|
||||||
|
vec3 x_334 = (invTBN * -(output5));
|
||||||
|
parallaxLimit = (length(vec2(x_334.x, x_334.y)) / (invTBN * -(output5)).z);
|
||||||
|
float x_345 = x_269.u_parallaxScale;
|
||||||
|
parallaxLimit = (parallaxLimit * x_345);
|
||||||
|
vec3 x_352 = (invTBN * -(output5));
|
||||||
|
vOffsetDir = normalize(vec2(x_352.x, x_352.y));
|
||||||
|
vMaxOffset = (vOffsetDir * parallaxLimit);
|
||||||
|
vec4 x_366 = v_output2;
|
||||||
|
numSamples = (15.0f + (dot((invTBN * -(output5)), (invTBN * vec3(x_366.x, x_366.y, x_366.z))) * -11.0f));
|
||||||
|
stepSize = (1.0f / numSamples);
|
||||||
|
currRayHeight = 1.0f;
|
||||||
|
vCurrOffset = vec2(0.0f, 0.0f);
|
||||||
|
vLastOffset = vec2(0.0f, 0.0f);
|
||||||
|
lastSampledHeight = 1.0f;
|
||||||
|
currSampledHeight = 1.0f;
|
||||||
|
i = 0;
|
||||||
|
{
|
||||||
|
for(; (i < 15); i = (i + 1)) {
|
||||||
|
vec4 x_397 = texture(TextureSamplerTexture, (v_uv + vCurrOffset));
|
||||||
|
currSampledHeight = x_397.w;
|
||||||
|
if ((currSampledHeight > currRayHeight)) {
|
||||||
|
delta1 = (currSampledHeight - currRayHeight);
|
||||||
|
delta2 = ((currRayHeight + stepSize) - lastSampledHeight);
|
||||||
|
ratio = (delta1 / (delta1 + delta2));
|
||||||
|
vCurrOffset = ((vLastOffset * ratio) + (vCurrOffset * (1.0f - ratio)));
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
currRayHeight = (currRayHeight - stepSize);
|
||||||
|
vLastOffset = vCurrOffset;
|
||||||
|
vCurrOffset = (vCurrOffset + (vMaxOffset * stepSize));
|
||||||
|
lastSampledHeight = currSampledHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
parallaxOcclusion_0 = vCurrOffset;
|
||||||
|
uvOffset = parallaxOcclusion_0;
|
||||||
|
vec4 x_452 = texture(TextureSamplerTexture, (v_uv + uvOffset));
|
||||||
|
float x_454 = x_269.u_bumpStrength;
|
||||||
|
param_8 = TBN;
|
||||||
|
param_9 = vec3(x_452.x, x_452.y, x_452.z);
|
||||||
|
param_10 = (1.0f / x_454);
|
||||||
|
vec3 x_461 = perturbNormal_mf33_vf3_f1_(param_8, param_9, param_10);
|
||||||
|
output4 = vec4(x_461.x, x_461.y, x_461.z, output4.w);
|
||||||
|
output6 = (v_uv + uvOffset);
|
||||||
|
vec4 x_475 = texture(TextureSampler1Texture, output6);
|
||||||
|
tempTextureRead1 = x_475;
|
||||||
|
vec4 x_477 = tempTextureRead1;
|
||||||
|
rgb1 = vec3(x_477.x, x_477.y, x_477.z);
|
||||||
|
vec3 x_481 = x_269.u_cameraPosition;
|
||||||
|
vec4 x_482 = v_output1;
|
||||||
|
viewDirectionW_1 = normalize((x_481 - vec3(x_482.x, x_482.y, x_482.z)));
|
||||||
|
shadow = 1.0f;
|
||||||
|
glossiness_1 = (1.0f * u_Float);
|
||||||
|
diffuseBase = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
specularBase = vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
vec4 x_494 = output4;
|
||||||
|
normalW = vec3(x_494.x, x_494.y, x_494.z);
|
||||||
|
param_11 = viewDirectionW_1;
|
||||||
|
param_12 = normalW;
|
||||||
|
vec4 x_507 = light0.vLightData;
|
||||||
|
param_13 = x_507;
|
||||||
|
vec4 x_510 = light0.vLightDiffuse;
|
||||||
|
param_14 = vec3(x_510.x, x_510.y, x_510.z);
|
||||||
|
vec4 x_514 = light0.vLightSpecular;
|
||||||
|
param_15 = vec3(x_514.x, x_514.y, x_514.z);
|
||||||
|
vec3 x_518 = light0.vLightGround;
|
||||||
|
param_16 = x_518;
|
||||||
|
param_17 = glossiness_1;
|
||||||
|
lightingInfo x_521 = computeHemisphericLighting_vf3_vf3_vf4_vf3_vf3_vf3_f1_(param_11, param_12, param_13, param_14, param_15, param_16, param_17);
|
||||||
|
info = x_521;
|
||||||
|
shadow = 1.0f;
|
||||||
|
vec3 x_523 = info.diffuse;
|
||||||
|
diffuseBase = (diffuseBase + (x_523 * shadow));
|
||||||
|
vec3 x_529 = info.specular;
|
||||||
|
specularBase = (specularBase + (x_529 * shadow));
|
||||||
|
diffuseOutput = (diffuseBase * rgb1);
|
||||||
|
specularOutput = (specularBase * u_Color);
|
||||||
|
output3 = (diffuseOutput + specularOutput);
|
||||||
|
vec3 x_548 = output3;
|
||||||
|
glFragColor = vec4(x_548.x, x_548.y, x_548.z, 1.0f);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct main_out {
|
||||||
|
vec4 glFragColor_1;
|
||||||
|
};
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
vec4 v_output1_param;
|
||||||
|
vec2 vMainuv_param;
|
||||||
|
vec4 v_output2_param;
|
||||||
|
vec2 v_uv_param;
|
||||||
|
bool gl_FrontFacing_param;
|
||||||
|
};
|
||||||
|
struct tint_symbol_4 {
|
||||||
|
vec4 glFragColor_1;
|
||||||
|
};
|
||||||
|
|
||||||
|
main_out tint_symbol_1_inner(vec2 vMainuv_param, vec4 v_output1_param, bool gl_FrontFacing_param, vec2 v_uv_param, vec4 v_output2_param) {
|
||||||
|
vMainuv = vMainuv_param;
|
||||||
|
v_output1 = v_output1_param;
|
||||||
|
tint_symbol = gl_FrontFacing_param;
|
||||||
|
v_uv = v_uv_param;
|
||||||
|
v_output2 = v_output2_param;
|
||||||
|
main_1();
|
||||||
|
main_out tint_symbol_5 = main_out(glFragColor);
|
||||||
|
return tint_symbol_5;
|
||||||
|
}
|
||||||
|
|
||||||
|
tint_symbol_4 tint_symbol_1(tint_symbol_3 tint_symbol_2) {
|
||||||
|
main_out inner_result = tint_symbol_1_inner(tint_symbol_2.vMainuv_param, tint_symbol_2.v_output1_param, tint_symbol_2.gl_FrontFacing_param, tint_symbol_2.v_uv_param, tint_symbol_2.v_output2_param);
|
||||||
|
tint_symbol_4 wrapper_result = tint_symbol_4(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
wrapper_result.glFragColor_1 = inner_result.glFragColor_1;
|
||||||
|
return wrapper_result;
|
||||||
|
}
|
||||||
|
in vec4 v_output1_param;
|
||||||
|
in vec2 vMainuv_param;
|
||||||
|
in vec4 v_output2_param;
|
||||||
|
in vec2 v_uv_param;
|
||||||
|
out vec4 glFragColor_1;
|
||||||
|
void main() {
|
||||||
|
tint_symbol_3 inputs;
|
||||||
|
inputs.v_output1_param = v_output1_param;
|
||||||
|
inputs.vMainuv_param = vMainuv_param;
|
||||||
|
inputs.v_output2_param = v_output2_param;
|
||||||
|
inputs.v_uv_param = v_uv_param;
|
||||||
|
inputs.gl_FrontFacing_param = gl_FrontFacing;
|
||||||
|
tint_symbol_4 outputs;
|
||||||
|
outputs = tint_symbol_1(inputs);
|
||||||
|
glFragColor_1 = outputs.glFragColor_1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:53: 'ddx' : no matching overloaded function found
|
||||||
|
ERROR: 0:53: 'assign' : cannot convert from ' const float' to ' temp mediump 3-component vector of float'
|
||||||
|
ERROR: 0:53: '' : compilation terminated
|
||||||
|
ERROR: 3 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
93
test/bug/tint/951.spvasm.expected.glsl
Normal file
93
test/bug/tint/951.spvasm.expected.glsl
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) buffer ssbOut_1 {
|
||||||
|
float result[];
|
||||||
|
} x_16;
|
||||||
|
layout (binding = 1) buffer ssbA_1 {
|
||||||
|
float A[];
|
||||||
|
} x_20;
|
||||||
|
uvec3 tint_symbol = uvec3(0u, 0u, 0u);
|
||||||
|
layout (binding = 2) uniform Uniforms_1 {
|
||||||
|
float NAN;
|
||||||
|
int aShape;
|
||||||
|
int outShape;
|
||||||
|
int outShapeStrides;
|
||||||
|
int size;
|
||||||
|
} x_24;
|
||||||
|
|
||||||
|
float getAAtOutCoords_() {
|
||||||
|
uint x_42 = tint_symbol.x;
|
||||||
|
float x_44 = x_20.A[x_42];
|
||||||
|
return x_44;
|
||||||
|
}
|
||||||
|
|
||||||
|
float unaryOperation_f1_(inout float a) {
|
||||||
|
float x_47 = a;
|
||||||
|
if ((x_47 < 0.0f)) {
|
||||||
|
return asfloat(0x7f800000u);
|
||||||
|
}
|
||||||
|
float x_55 = a;
|
||||||
|
return log(x_55);
|
||||||
|
}
|
||||||
|
|
||||||
|
void setOutput_i1_f1_(inout int flatIndex, inout float value) {
|
||||||
|
int x_27 = flatIndex;
|
||||||
|
float x_28 = value;
|
||||||
|
x_16.result[x_27] = x_28;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main_1() {
|
||||||
|
int index = 0;
|
||||||
|
float a_1 = 0.0f;
|
||||||
|
float param = 0.0f;
|
||||||
|
int param_1 = 0;
|
||||||
|
float param_2 = 0.0f;
|
||||||
|
uint x_61 = tint_symbol.x;
|
||||||
|
index = int(x_61);
|
||||||
|
int x_63 = index;
|
||||||
|
int x_70 = x_24.size;
|
||||||
|
if ((x_63 < x_70)) {
|
||||||
|
float x_75 = getAAtOutCoords_();
|
||||||
|
a_1 = x_75;
|
||||||
|
param = a_1;
|
||||||
|
float x_78 = unaryOperation_f1_(param);
|
||||||
|
param_1 = index;
|
||||||
|
param_2 = x_78;
|
||||||
|
setOutput_i1_f1_(param_1, param_2);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
uvec3 gl_GlobalInvocationID_param;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tint_symbol_1_inner(uvec3 gl_GlobalInvocationID_param) {
|
||||||
|
tint_symbol = gl_GlobalInvocationID_param;
|
||||||
|
main_1();
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol_1(tint_symbol_3 tint_symbol_2) {
|
||||||
|
tint_symbol_1_inner(tint_symbol_2.gl_GlobalInvocationID_param);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_3 inputs;
|
||||||
|
inputs.gl_GlobalInvocationID_param = gl_GlobalInvocationID;
|
||||||
|
tint_symbol_1(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:29: 'asfloat' : no matching overloaded function found
|
||||||
|
ERROR: 0:29: '' : compilation terminated
|
||||||
|
ERROR: 2 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
93
test/bug/tint/959.wgsl.expected.glsl
Normal file
93
test/bug/tint/959.wgsl.expected.glsl
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) buffer S_1 {
|
||||||
|
float a;
|
||||||
|
} b0;
|
||||||
|
layout (binding = 0) buffer S_2 {
|
||||||
|
float a;
|
||||||
|
} b1;
|
||||||
|
layout (binding = 0) buffer S_3 {
|
||||||
|
float a;
|
||||||
|
} b2;
|
||||||
|
layout (binding = 0) buffer S_4 {
|
||||||
|
float a;
|
||||||
|
} b3;
|
||||||
|
layout (binding = 0) buffer S_5 {
|
||||||
|
float a;
|
||||||
|
} b4;
|
||||||
|
layout (binding = 0) buffer S_6 {
|
||||||
|
float a;
|
||||||
|
} b5;
|
||||||
|
layout (binding = 0) buffer S_7 {
|
||||||
|
float a;
|
||||||
|
} b6;
|
||||||
|
layout (binding = 0) buffer S_8 {
|
||||||
|
float a;
|
||||||
|
} b7;
|
||||||
|
layout (binding = 1) uniform S_9 {
|
||||||
|
float a;
|
||||||
|
} b8;
|
||||||
|
layout (binding = 1) uniform S_10 {
|
||||||
|
float a;
|
||||||
|
} b9;
|
||||||
|
layout (binding = 1) uniform S_11 {
|
||||||
|
float a;
|
||||||
|
} b10;
|
||||||
|
layout (binding = 1) uniform S_12 {
|
||||||
|
float a;
|
||||||
|
} b11;
|
||||||
|
layout (binding = 1) uniform S_13 {
|
||||||
|
float a;
|
||||||
|
} b12;
|
||||||
|
layout (binding = 1) uniform S_14 {
|
||||||
|
float a;
|
||||||
|
} b13;
|
||||||
|
layout (binding = 1) uniform S_15 {
|
||||||
|
float a;
|
||||||
|
} b14;
|
||||||
|
layout (binding = 1) uniform S_16 {
|
||||||
|
float a;
|
||||||
|
} b15;
|
||||||
|
uniform highp sampler2D t0;
|
||||||
|
uniform highp sampler2D t1;
|
||||||
|
uniform highp sampler2D t2;
|
||||||
|
uniform highp sampler2D t3;
|
||||||
|
uniform highp sampler2D t4;
|
||||||
|
uniform highp sampler2D t5;
|
||||||
|
uniform highp sampler2D t6;
|
||||||
|
uniform highp sampler2D t7;
|
||||||
|
uniform highp sampler2D t8;
|
||||||
|
uniform highp sampler2D t9;
|
||||||
|
uniform highp sampler2D t10;
|
||||||
|
uniform highp sampler2D t11;
|
||||||
|
uniform highp sampler2D t12;
|
||||||
|
uniform highp sampler2D t13;
|
||||||
|
uniform highp sampler2D t14;
|
||||||
|
uniform highp sampler2D t15;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void tint_symbol() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
75
test/bug/tint/977.spvasm.expected.glsl
Normal file
75
test/bug/tint/977.spvasm.expected.glsl
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
uvec3 tint_symbol = uvec3(0u, 0u, 0u);
|
||||||
|
layout (binding = 2) buffer ResultMatrix_1 {
|
||||||
|
float numbers[];
|
||||||
|
} resultMatrix;
|
||||||
|
|
||||||
|
float binaryOperation_f1_f1_(inout float a, inout float b) {
|
||||||
|
float x_26 = 0.0f;
|
||||||
|
float x_13 = b;
|
||||||
|
if ((x_13 == 0.0f)) {
|
||||||
|
return 1.0f;
|
||||||
|
}
|
||||||
|
float x_21 = b;
|
||||||
|
if (!((round((x_21 - (2.0f * floor((x_21 / 2.0f))))) == 1.0f))) {
|
||||||
|
float x_29 = a;
|
||||||
|
float x_31 = b;
|
||||||
|
x_26 = pow(abs(x_29), x_31);
|
||||||
|
} else {
|
||||||
|
float x_34 = a;
|
||||||
|
float x_36 = a;
|
||||||
|
float x_38 = b;
|
||||||
|
x_26 = (sign(x_34) * pow(abs(x_36), x_38));
|
||||||
|
}
|
||||||
|
return x_26;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main_1() {
|
||||||
|
int index = 0;
|
||||||
|
int a_1 = 0;
|
||||||
|
float param = 0.0f;
|
||||||
|
float param_1 = 0.0f;
|
||||||
|
uint x_54 = tint_symbol.x;
|
||||||
|
index = int(x_54);
|
||||||
|
a_1 = -10;
|
||||||
|
int x_63 = index;
|
||||||
|
param = -4.0f;
|
||||||
|
param_1 = -3.0f;
|
||||||
|
float x_68 = binaryOperation_f1_f1_(param, param_1);
|
||||||
|
resultMatrix.numbers[x_63] = x_68;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
uvec3 gl_GlobalInvocationID_param;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tint_symbol_1_inner(uvec3 gl_GlobalInvocationID_param) {
|
||||||
|
tint_symbol = gl_GlobalInvocationID_param;
|
||||||
|
main_1();
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol_1(tint_symbol_3 tint_symbol_2) {
|
||||||
|
tint_symbol_1_inner(tint_symbol_2.gl_GlobalInvocationID_param);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_3 inputs;
|
||||||
|
inputs.gl_GlobalInvocationID_param = gl_GlobalInvocationID;
|
||||||
|
tint_symbol_1(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:50: 'gl_GlobalInvocationID_param' : identifiers starting with "gl_" are reserved
|
||||||
|
ERROR: 0:50: '' : compilation terminated
|
||||||
|
ERROR: 2 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
46
test/bug/tint/978.wgsl.expected.glsl
Normal file
46
test/bug/tint/978.wgsl.expected.glsl
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct FragmentInput {
|
||||||
|
vec2 vUv;
|
||||||
|
};
|
||||||
|
struct FragmentOutput {
|
||||||
|
vec4 color;
|
||||||
|
};
|
||||||
|
|
||||||
|
uniform highp sampler2D depthMap;
|
||||||
|
|
||||||
|
|
||||||
|
struct tint_symbol_3 {
|
||||||
|
vec2 vUv;
|
||||||
|
};
|
||||||
|
struct tint_symbol_4 {
|
||||||
|
vec4 color;
|
||||||
|
};
|
||||||
|
|
||||||
|
FragmentOutput tint_symbol_inner(FragmentInput fIn) {
|
||||||
|
float tint_symbol_1 = texture(depthMap, fIn.vUv).x;
|
||||||
|
vec3 color = vec3(tint_symbol_1, tint_symbol_1, tint_symbol_1);
|
||||||
|
FragmentOutput fOut = FragmentOutput(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
fOut.color = vec4(color, 1.0f);
|
||||||
|
return fOut;
|
||||||
|
}
|
||||||
|
|
||||||
|
tint_symbol_4 tint_symbol(tint_symbol_3 tint_symbol_2) {
|
||||||
|
FragmentInput tint_symbol_5 = FragmentInput(tint_symbol_2.vUv);
|
||||||
|
FragmentOutput inner_result = tint_symbol_inner(tint_symbol_5);
|
||||||
|
tint_symbol_4 wrapper_result = tint_symbol_4(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
wrapper_result.color = inner_result.color;
|
||||||
|
return wrapper_result;
|
||||||
|
}
|
||||||
|
in vec2 vUv;
|
||||||
|
out vec4 color;
|
||||||
|
void main() {
|
||||||
|
tint_symbol_3 inputs;
|
||||||
|
inputs.vUv = vUv;
|
||||||
|
tint_symbol_4 outputs;
|
||||||
|
outputs = tint_symbol(inputs);
|
||||||
|
color = outputs.color;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
43
test/bug/tint/980.wgsl.expected.glsl
Normal file
43
test/bug/tint/980.wgsl.expected.glsl
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
vec3 Bad(uint index, vec3 rd) {
|
||||||
|
vec3 normal = vec3((0.0f).xxx);
|
||||||
|
normal[index] = -(sign(rd[index]));
|
||||||
|
return normalize(normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
layout (binding = 0) buffer S_1 {
|
||||||
|
vec3 v;
|
||||||
|
uint i;
|
||||||
|
} io;
|
||||||
|
|
||||||
|
struct tint_symbol_2 {
|
||||||
|
uint idx;
|
||||||
|
};
|
||||||
|
|
||||||
|
void tint_symbol_inner(uint idx) {
|
||||||
|
io.v = Bad(io.i, io.v);
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol_2 inputs;
|
||||||
|
inputs.idx = uint(gl_LocalInvocationIndex);
|
||||||
|
tint_symbol(inputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:5: 'scalar swizzle' : not supported with this profile: es
|
||||||
|
ERROR: 0:5: '' : compilation terminated
|
||||||
|
ERROR: 2 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
0
test/bug/tint/990.wgsl.expected.glsl
Normal file
0
test/bug/tint/990.wgsl.expected.glsl
Normal file
36
test/bug/tint/992.wgsl.expected.glsl
Normal file
36
test/bug/tint/992.wgsl.expected.glsl
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
struct tint_symbol {
|
||||||
|
vec4 value;
|
||||||
|
};
|
||||||
|
|
||||||
|
vec4 frag_main_inner() {
|
||||||
|
float b = 0.0f;
|
||||||
|
vec3 v = vec3((b).xxx);
|
||||||
|
return vec4(v, 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
tint_symbol frag_main() {
|
||||||
|
vec4 inner_result = frag_main_inner();
|
||||||
|
tint_symbol wrapper_result = tint_symbol(vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||||
|
wrapper_result.value = inner_result;
|
||||||
|
return wrapper_result;
|
||||||
|
}
|
||||||
|
out vec4 value;
|
||||||
|
void main() {
|
||||||
|
tint_symbol outputs;
|
||||||
|
outputs = frag_main();
|
||||||
|
value = outputs.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:10: 'scalar swizzle' : not supported with this profile: es
|
||||||
|
ERROR: 0:10: '' : compilation terminated
|
||||||
|
ERROR: 2 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
41
test/bug/tint/993.wgsl.expected.glsl
Normal file
41
test/bug/tint/993.wgsl.expected.glsl
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
SKIP: FAILED
|
||||||
|
|
||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform Constants_1 {
|
||||||
|
uint zero;
|
||||||
|
} constants;
|
||||||
|
|
||||||
|
layout (binding = 1) buffer Result_1 {
|
||||||
|
uint value;
|
||||||
|
} result;
|
||||||
|
|
||||||
|
layout (binding = 0) buffer TestData_1 {
|
||||||
|
int data[3];
|
||||||
|
} s;
|
||||||
|
|
||||||
|
int runTest() {
|
||||||
|
int atomic_result = 0;
|
||||||
|
InterlockedOr(s.data[(0u + uint(constants.zero))], 0, atomic_result);
|
||||||
|
return atomic_result;
|
||||||
|
}
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
result.value = uint(runTest());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error parsing GLSL shader:
|
||||||
|
ERROR: 0:19: 'InterlockedOr' : no matching overloaded function found
|
||||||
|
ERROR: 0:19: '' : compilation terminated
|
||||||
|
ERROR: 2 compilation errors. No code generated.
|
||||||
|
|
||||||
|
|
||||||
|
|
24
test/bug/tint/998.wgsl.expected.glsl
Normal file
24
test/bug/tint/998.wgsl.expected.glsl
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
|
||||||
|
layout (binding = 0) uniform Constants_1 {
|
||||||
|
uint zero;
|
||||||
|
} constants;
|
||||||
|
|
||||||
|
struct S {
|
||||||
|
uint data[3];
|
||||||
|
};
|
||||||
|
|
||||||
|
S s = S(uint[3](0u, 0u, 0u));
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void tint_symbol() {
|
||||||
|
s.data[constants.zero] = 0u;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
tint_symbol();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
mat3 a = mat3(vec3(1.0f, 2.0f, 3.0f), vec3(4.0f, 5.0f, 6.0f), vec3(7.0f, 8.0f, 9.0f));
|
||||||
|
mat3 b = mat3(vec3(-1.0f, -2.0f, -3.0f), vec3(-4.0f, -5.0f, -6.0f), vec3(-7.0f, -8.0f, -9.0f));
|
||||||
|
mat3 r = (a + b);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
float r = (1.0f + 2.0f);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
int r = (1 + 2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
uint r = (1u + 2u);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
float a = 4.0f;
|
||||||
|
vec3 b = vec3(1.0f, 2.0f, 3.0f);
|
||||||
|
vec3 r = (a + b);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
int a = 4;
|
||||||
|
ivec3 b = ivec3(1, 2, 3);
|
||||||
|
ivec3 r = (a + b);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
uint a = 4u;
|
||||||
|
uvec3 b = uvec3(1u, 2u, 3u);
|
||||||
|
uvec3 r = (a + b);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
#version 310 es
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
||||||
|
void f() {
|
||||||
|
vec3 a = vec3(1.0f, 2.0f, 3.0f);
|
||||||
|
vec3 r = (a + 4.0f);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void main() {
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user