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/textureLoad/fc6d36.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/fc6d36.wgsl.expected.fxc.hlsl
index b01ab41..a1354dd 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fc6d36.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/textureLoad/fc6d36.wgsl.expected.fxc.hlsl
@@ -1,34 +1,43 @@
Texture2DArray<int4> arg_0 : register(t0, space1);
-RWByteAddressBuffer prevent_dce : register(u0, space2);
-void textureLoad_fc6d36() {
+int4 textureLoad_fc6d36() {
int4 res = arg_0.Load(int4(int3((1).xx, 1), 0));
- prevent_dce.Store4(0u, asuint(res));
+ return res;
}
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureLoad_fc6d36();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
+RWByteAddressBuffer prevent_dce : register(u0);
void fragment_main() {
- textureLoad_fc6d36();
+ prevent_dce.Store4(0u, asuint(textureLoad_fc6d36()));
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
- textureLoad_fc6d36();
+ prevent_dce.Store4(0u, asuint(textureLoad_fc6d36()));
return;
}
+
+struct VertexOutput {
+ float4 pos;
+ int4 prevent_dce;
+};
+struct tint_symbol_1 {
+ nointerpolation int4 prevent_dce : TEXCOORD0;
+ float4 pos : SV_Position;
+};
+
+VertexOutput vertex_main_inner() {
+ VertexOutput tint_symbol = (VertexOutput)0;
+ tint_symbol.pos = (0.0f).xxxx;
+ tint_symbol.prevent_dce = textureLoad_fc6d36();
+ return tint_symbol;
+}
+
+tint_symbol_1 vertex_main() {
+ VertexOutput inner_result = vertex_main_inner();
+ tint_symbol_1 wrapper_result = (tint_symbol_1)0;
+ wrapper_result.pos = inner_result.pos;
+ wrapper_result.prevent_dce = inner_result.prevent_dce;
+ return wrapper_result;
+}