Remove storage textures from vertex tests
The template change in test/tint/builtins/gen/gen.wgsl.tmpl removes the
remaining usages of storage textures in vertex shaders in Tint end2end
tests, replacing them instead with a VertexOutput object to prevent DCE.
The template is the only manually modified file in this change, the rest
were created with:
./tools/run gen
./tools/run tests --generate-expected
Binding numbers and entry point ordering had to be slightly shuffled to
work around: crbug.com/42250109
Bug: 344846829
Change-Id: I6c2c80b78168a13c6c545e7a0dc924d64997ff0e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/193260
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Natalie Chouinard <chouinard@google.com>
diff --git a/test/tint/builtins/gen/literal/fract/ed00ca.wgsl.expected.glsl b/test/tint/builtins/gen/literal/fract/ed00ca.wgsl.expected.glsl
index fa98f72..19dddc7 100644
--- a/test/tint/builtins/gen/literal/fract/ed00ca.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/fract/ed00ca.wgsl.expected.glsl
@@ -1,23 +1,4 @@
#version 310 es
-
-void fract_ed00ca() {
- vec2 res = vec2(0.25f);
-}
-
-vec4 vertex_main() {
- fract_ed00ca();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
precision highp float;
precision highp int;
@@ -25,6 +6,10 @@
vec2 res = vec2(0.25f);
}
+struct VertexOutput {
+ vec4 pos;
+};
+
void fragment_main() {
fract_ed00ca();
}
@@ -39,6 +24,10 @@
vec2 res = vec2(0.25f);
}
+struct VertexOutput {
+ vec4 pos;
+};
+
void compute_main() {
fract_ed00ca();
}
@@ -48,3 +37,28 @@
compute_main();
return;
}
+#version 310 es
+
+void fract_ed00ca() {
+ vec2 res = vec2(0.25f);
+}
+
+struct VertexOutput {
+ vec4 pos;
+};
+
+VertexOutput vertex_main() {
+ VertexOutput tint_symbol = VertexOutput(vec4(0.0f, 0.0f, 0.0f, 0.0f));
+ tint_symbol.pos = vec4(0.0f);
+ fract_ed00ca();
+ return tint_symbol;
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ VertexOutput inner_result = vertex_main();
+ gl_Position = inner_result.pos;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}