spirv: Use generic transform to process shader IO

The refactored CanonicalizeEntryPointIO transform makes it much easier
to handle SPIR-V style IO as well, and doing this removes a lot of
duplicated code. Remove all of the SPIR-V transform code for shader IO
and vertex point size.

Bug: tint:920
Change-Id: Id1b97517619b4d2fd09b45d5aee848259f3dfa77
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60840
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
James Price
2021-08-05 17:34:19 +00:00
committed by Tint LUCI CQ
parent 11e172ab64
commit 11c6fcdb51
1981 changed files with 55207 additions and 57171 deletions

View File

@@ -1,52 +1,59 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 56
; Bound: 72
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main1 "main1"
OpEntryPoint GLCompute %main2 "main2"
OpEntryPoint GLCompute %main3 "main3"
OpEntryPoint GLCompute %main1 "main1" %local_invocation_index_3
OpEntryPoint GLCompute %main2 "main2" %local_invocation_index_1_1
OpEntryPoint GLCompute %main3 "main3" %local_invocation_index_2_1
OpEntryPoint GLCompute %main4 "main4"
OpExecutionMode %main1 LocalSize 1 1 1
OpExecutionMode %main2 LocalSize 1 1 1
OpExecutionMode %main3 LocalSize 1 1 1
OpExecutionMode %main4 LocalSize 1 1 1
OpName %local_invocation_index_3 "local_invocation_index_3"
OpName %local_invocation_index_1_1 "local_invocation_index_1_1"
OpName %local_invocation_index_2_1 "local_invocation_index_2_1"
OpName %a "a"
OpName %b "b"
OpName %c "c"
OpName %tint_symbol "tint_symbol"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %uses_a "uses_a"
OpName %uses_b "uses_b"
OpName %uses_a_and_b "uses_a_and_b"
OpName %no_uses "no_uses"
OpName %outer "outer"
OpName %main1_inner "main1_inner"
OpName %local_invocation_index "local_invocation_index"
OpName %main1 "main1"
OpName %main2_inner "main2_inner"
OpName %local_invocation_index_1 "local_invocation_index_1"
OpName %main2 "main2"
OpName %main3_inner "main3_inner"
OpName %local_invocation_index_2 "local_invocation_index_2"
OpName %main3 "main3"
OpName %main4 "main4"
OpDecorate %tint_symbol BuiltIn LocalInvocationIndex
OpDecorate %tint_symbol_1 BuiltIn LocalInvocationIndex
OpDecorate %tint_symbol_2 BuiltIn LocalInvocationIndex
OpDecorate %local_invocation_index_3 BuiltIn LocalInvocationIndex
OpDecorate %local_invocation_index_1_1 BuiltIn LocalInvocationIndex
OpDecorate %local_invocation_index_2_1 BuiltIn LocalInvocationIndex
%uint = OpTypeInt 32 0
%_ptr_Input_uint = OpTypePointer Input %uint
%local_invocation_index_3 = OpVariable %_ptr_Input_uint Input
%local_invocation_index_1_1 = OpVariable %_ptr_Input_uint Input
%local_invocation_index_2_1 = OpVariable %_ptr_Input_uint Input
%int = OpTypeInt 32 1
%_ptr_Workgroup_int = OpTypePointer Workgroup %int
%a = OpVariable %_ptr_Workgroup_int Workgroup
%b = OpVariable %_ptr_Workgroup_int Workgroup
%c = OpVariable %_ptr_Workgroup_int Workgroup
%uint = OpTypeInt 32 0
%_ptr_Input_uint = OpTypePointer Input %uint
%tint_symbol = OpVariable %_ptr_Input_uint Input
%tint_symbol_1 = OpVariable %_ptr_Input_uint Input
%tint_symbol_2 = OpVariable %_ptr_Input_uint Input
%void = OpTypeVoid
%11 = OpTypeFunction %void
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_0 = OpConstant %int 0
%37 = OpConstantNull %int
%35 = OpTypeFunction %void %uint
%39 = OpConstantNull %int
%uint_2 = OpConstant %uint 2
%uint_264 = OpConstant %uint 264
%int_42 = OpConstant %int 42
@@ -84,33 +91,54 @@
%34 = OpFunctionCall %void %no_uses
OpReturn
OpFunctionEnd
%main1 = OpFunction %void None %11
%36 = OpLabel
OpStore %a %37
%main1_inner = OpFunction %void None %35
%local_invocation_index = OpFunctionParameter %uint
%38 = OpLabel
OpStore %a %39
OpControlBarrier %uint_2 %uint_2 %uint_264
OpStore %a %int_42
%42 = OpFunctionCall %void %uses_a
%44 = OpFunctionCall %void %uses_a
OpReturn
OpFunctionEnd
%main1 = OpFunction %void None %11
%46 = OpLabel
%48 = OpLoad %uint %local_invocation_index_3
%47 = OpFunctionCall %void %main1_inner %48
OpReturn
OpFunctionEnd
%main2_inner = OpFunction %void None %35
%local_invocation_index_1 = OpFunctionParameter %uint
%51 = OpLabel
OpStore %b %39
OpControlBarrier %uint_2 %uint_2 %uint_264
OpStore %b %int_7
%54 = OpFunctionCall %void %uses_b
OpReturn
OpFunctionEnd
%main2 = OpFunction %void None %11
%44 = OpLabel
OpStore %b %37
%56 = OpLabel
%58 = OpLoad %uint %local_invocation_index_1_1
%57 = OpFunctionCall %void %main2_inner %58
OpReturn
OpFunctionEnd
%main3_inner = OpFunction %void None %35
%local_invocation_index_2 = OpFunctionParameter %uint
%61 = OpLabel
OpStore %a %39
OpStore %b %39
OpControlBarrier %uint_2 %uint_2 %uint_264
OpStore %b %int_7
%47 = OpFunctionCall %void %uses_b
%63 = OpFunctionCall %void %outer
%64 = OpFunctionCall %void %no_uses
OpReturn
OpFunctionEnd
%main3 = OpFunction %void None %11
%49 = OpLabel
OpStore %a %37
OpStore %b %37
OpControlBarrier %uint_2 %uint_2 %uint_264
%51 = OpFunctionCall %void %outer
%52 = OpFunctionCall %void %no_uses
%66 = OpLabel
%68 = OpLoad %uint %local_invocation_index_2_1
%67 = OpFunctionCall %void %main3_inner %68
OpReturn
OpFunctionEnd
%main4 = OpFunction %void None %11
%54 = OpLabel
%55 = OpFunctionCall %void %no_uses
%70 = OpLabel
%71 = OpFunctionCall %void %no_uses
OpReturn
OpFunctionEnd