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,12 +1,13 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 125
; Bound: 130
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" %tint_symbol
OpEntryPoint GLCompute %main "main" %gl_WorkGroupID_param_1
OpExecutionMode %main LocalSize 4 1 1
OpName %gl_WorkGroupID_param_1 "gl_WorkGroupID_param_1"
OpName %gl_WorkGroupID "gl_WorkGroupID"
OpName %In2 "In2"
OpMemberName %In2 0 "data_in2"
@@ -20,7 +21,6 @@
OpName %In1 "In1"
OpMemberName %In1 0 "data_in1"
OpName %x_19 "x_19"
OpName %tint_symbol "tint_symbol"
OpName %main_1 "main_1"
OpName %base_index_in "base_index_in"
OpName %base_index_out "base_index_out"
@@ -32,7 +32,10 @@
OpName %i "i"
OpName %temp0 "temp0"
OpName %temp1 "temp1"
OpName %main_inner "main_inner"
OpName %gl_WorkGroupID_param "gl_WorkGroupID_param"
OpName %main "main"
OpDecorate %gl_WorkGroupID_param_1 BuiltIn WorkgroupId
OpDecorate %In2 Block
OpMemberDecorate %In2 0 Offset 0
OpDecorate %_arr_int_uint_8 ArrayStride 4
@@ -55,12 +58,13 @@
OpDecorate %x_19 NonWritable
OpDecorate %x_19 DescriptorSet 0
OpDecorate %x_19 Binding 1
OpDecorate %tint_symbol BuiltIn WorkgroupId
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%gl_WorkGroupID_param_1 = OpVariable %_ptr_Input_v3uint Input
%_ptr_Private_v3uint = OpTypePointer Private %v3uint
%5 = OpConstantNull %v3uint
%gl_WorkGroupID = OpVariable %_ptr_Private_v3uint Private %5
%7 = OpConstantNull %v3uint
%gl_WorkGroupID = OpVariable %_ptr_Private_v3uint Private %7
%int = OpTypeInt 32 1
%uint_8 = OpConstant %uint 8
%_arr_int_uint_8 = OpTypeArray %int %uint_8
@@ -80,8 +84,6 @@
%In1 = OpTypeStruct %_arr_int_uint_512
%_ptr_StorageBuffer_In1 = OpTypePointer StorageBuffer %In1
%x_19 = OpVariable %_ptr_StorageBuffer_In1 StorageBuffer
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%tint_symbol = OpVariable %_ptr_Input_v3uint Input
%void = OpTypeVoid
%27 = OpTypeFunction %void
%_ptr_Function_uint = OpTypePointer Function %uint
@@ -98,6 +100,7 @@
%bool = OpTypeBool
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%int_1 = OpConstant %int 1
%121 = OpTypeFunction %void %v3uint
%main_1 = OpFunction %void None %27
%30 = OpLabel
%base_index_in = OpVariable %_ptr_Function_uint Function %33
@@ -213,10 +216,16 @@
%58 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %27
%122 = OpLabel
%123 = OpLoad %v3uint %tint_symbol
OpStore %gl_WorkGroupID %123
%124 = OpFunctionCall %void %main_1
%main_inner = OpFunction %void None %121
%gl_WorkGroupID_param = OpFunctionParameter %v3uint
%124 = OpLabel
OpStore %gl_WorkGroupID %gl_WorkGroupID_param
%125 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd
%main = OpFunction %void None %27
%127 = OpLabel
%129 = OpLoad %v3uint %gl_WorkGroupID_param_1
%128 = OpFunctionCall %void %main_inner %129
OpReturn
OpFunctionEnd

View File

@@ -1,12 +1,13 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 125
; Bound: 130
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" %tint_symbol
OpEntryPoint GLCompute %main "main" %gl_WorkGroupID_param_1
OpExecutionMode %main LocalSize 4 1 1
OpName %gl_WorkGroupID_param_1 "gl_WorkGroupID_param_1"
OpName %gl_WorkGroupID "gl_WorkGroupID"
OpName %In2 "In2"
OpMemberName %In2 0 "data_in2"
@@ -20,7 +21,6 @@
OpName %In1 "In1"
OpMemberName %In1 0 "data_in1"
OpName %x_19 "x_19"
OpName %tint_symbol "tint_symbol"
OpName %main_1 "main_1"
OpName %base_index_in "base_index_in"
OpName %base_index_out "base_index_out"
@@ -32,7 +32,10 @@
OpName %i "i"
OpName %temp0 "temp0"
OpName %temp1 "temp1"
OpName %main_inner "main_inner"
OpName %gl_WorkGroupID_param "gl_WorkGroupID_param"
OpName %main "main"
OpDecorate %gl_WorkGroupID_param_1 BuiltIn WorkgroupId
OpDecorate %In2 Block
OpMemberDecorate %In2 0 Offset 0
OpDecorate %_arr_int_uint_8 ArrayStride 4
@@ -55,12 +58,13 @@
OpDecorate %x_19 NonWritable
OpDecorate %x_19 DescriptorSet 0
OpDecorate %x_19 Binding 1
OpDecorate %tint_symbol BuiltIn WorkgroupId
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%gl_WorkGroupID_param_1 = OpVariable %_ptr_Input_v3uint Input
%_ptr_Private_v3uint = OpTypePointer Private %v3uint
%5 = OpConstantNull %v3uint
%gl_WorkGroupID = OpVariable %_ptr_Private_v3uint Private %5
%7 = OpConstantNull %v3uint
%gl_WorkGroupID = OpVariable %_ptr_Private_v3uint Private %7
%int = OpTypeInt 32 1
%uint_8 = OpConstant %uint 8
%_arr_int_uint_8 = OpTypeArray %int %uint_8
@@ -80,8 +84,6 @@
%In1 = OpTypeStruct %_arr_int_uint_512
%_ptr_StorageBuffer_In1 = OpTypePointer StorageBuffer %In1
%x_19 = OpVariable %_ptr_StorageBuffer_In1 StorageBuffer
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%tint_symbol = OpVariable %_ptr_Input_v3uint Input
%void = OpTypeVoid
%27 = OpTypeFunction %void
%_ptr_Function_uint = OpTypePointer Function %uint
@@ -98,6 +100,7 @@
%bool = OpTypeBool
%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int
%int_1 = OpConstant %int 1
%121 = OpTypeFunction %void %v3uint
%main_1 = OpFunction %void None %27
%30 = OpLabel
%base_index_in = OpVariable %_ptr_Function_uint Function %33
@@ -213,10 +216,16 @@
%58 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %27
%122 = OpLabel
%123 = OpLoad %v3uint %tint_symbol
OpStore %gl_WorkGroupID %123
%124 = OpFunctionCall %void %main_1
%main_inner = OpFunction %void None %121
%gl_WorkGroupID_param = OpFunctionParameter %v3uint
%124 = OpLabel
OpStore %gl_WorkGroupID %gl_WorkGroupID_param
%125 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd
%main = OpFunction %void None %27
%127 = OpLabel
%129 = OpLoad %v3uint %gl_WorkGroupID_param_1
%128 = OpFunctionCall %void %main_inner %129
OpReturn
OpFunctionEnd