test/tint/builtins/gen: Use returned value
It appears that FXC and DXC do some validation post dead-code-elimination.
These tests have been updated so that the return value is assigned to a storage buffer, ensuring that all validation is performed.
Many DXC tests are affected by https://github.com/microsoft/DirectXShaderCompiler/issues/5082, which have been SKIP'ed.
Fixed: tint:1859
Change-Id: I0001a9a9821846cd0855c3d8ce2bec79ab8e64ef
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122662
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
diff --git a/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.spvasm
index f110573..bd9cbbd 100644
--- a/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/asin/3cfbd4.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 42
; Schema: 0
OpCapability Shader
OpCapability Float16
@@ -16,6 +16,9 @@
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
OpName %asin_3cfbd4 "asin_3cfbd4"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
@@ -24,6 +27,10 @@
OpName %compute_main "compute_main"
OpDecorate %value BuiltIn Position
OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -32,41 +39,50 @@
%_ptr_Output_float = OpTypePointer Output %float
%8 = OpConstantNull %float
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %void = OpTypeVoid
- %9 = OpTypeFunction %void
%half = OpTypeFloat 16
%v4half = OpTypeVector %half 4
+%prevent_dce_block = OpTypeStruct %v4half
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %14 = OpTypeFunction %void
%half_0x1_ffcpn2 = OpConstant %half 0x1.ffcp-2
- %16 = OpConstantComposite %v4half %half_0x1_ffcpn2 %half_0x1_ffcpn2 %half_0x1_ffcpn2 %half_0x1_ffcpn2
+ %19 = OpConstantComposite %v4half %half_0x1_ffcpn2 %half_0x1_ffcpn2 %half_0x1_ffcpn2 %half_0x1_ffcpn2
%_ptr_Function_v4half = OpTypePointer Function %v4half
- %19 = OpConstantNull %v4half
- %20 = OpTypeFunction %v4float
+ %22 = OpConstantNull %v4half
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4half = OpTypePointer StorageBuffer %v4half
+ %28 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
-%asin_3cfbd4 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4half Function %19
- OpStore %res %16
+%asin_3cfbd4 = OpFunction %void None %14
+ %17 = OpLabel
+ %res = OpVariable %_ptr_Function_v4half Function %22
+ OpStore %res %19
+ %26 = OpAccessChain %_ptr_StorageBuffer_v4half %prevent_dce %uint_0
+ %27 = OpLoad %v4half %res
+ OpStore %26 %27
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
- %22 = OpLabel
- %23 = OpFunctionCall %void %asin_3cfbd4
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %asin_3cfbd4
OpReturnValue %5
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %26
+%vertex_main = OpFunction %void None %14
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %asin_3cfbd4
+%fragment_main = OpFunction %void None %14
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %asin_3cfbd4
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %void %asin_3cfbd4
+%compute_main = OpFunction %void None %14
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %asin_3cfbd4
OpReturn
OpFunctionEnd