mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-10 14:08:04 +00:00
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:
committed by
Tint LUCI CQ
parent
11e172ab64
commit
11c6fcdb51
@@ -1,12 +1,13 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 68
|
||||
; Bound: 65
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %main "main" %tint_symbol
|
||||
OpEntryPoint GLCompute %main "main" %idx_1
|
||||
OpExecutionMode %main LocalSize 1 1 1
|
||||
OpName %idx_1 "idx_1"
|
||||
OpName %S "S"
|
||||
OpMemberName %S 0 "arr"
|
||||
OpName %Inner "Inner"
|
||||
@@ -22,8 +23,10 @@
|
||||
OpMemberName %Inner 9 "j"
|
||||
OpMemberName %Inner 10 "k"
|
||||
OpName %s "s"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %main_inner "main_inner"
|
||||
OpName %idx "idx"
|
||||
OpName %main "main"
|
||||
OpDecorate %idx_1 BuiltIn LocalInvocationIndex
|
||||
OpDecorate %S Block
|
||||
OpMemberDecorate %S 0 Offset 0
|
||||
OpMemberDecorate %Inner 0 Offset 0
|
||||
@@ -46,10 +49,11 @@
|
||||
OpDecorate %s NonWritable
|
||||
OpDecorate %s Binding 0
|
||||
OpDecorate %s DescriptorSet 0
|
||||
OpDecorate %tint_symbol BuiltIn LocalInvocationIndex
|
||||
%uint = OpTypeInt 32 0
|
||||
%_ptr_Input_uint = OpTypePointer Input %uint
|
||||
%idx_1 = OpVariable %_ptr_Input_uint Input
|
||||
%int = OpTypeInt 32 1
|
||||
%v3int = OpTypeVector %int 3
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%float = OpTypeFloat 32
|
||||
%v3float = OpTypeVector %float 3
|
||||
@@ -66,10 +70,8 @@
|
||||
%S = OpTypeStruct %_arr_Inner_uint_8
|
||||
%_ptr_Uniform_S = OpTypePointer Uniform %S
|
||||
%s = OpVariable %_ptr_Uniform_S Uniform
|
||||
%_ptr_Input_uint = OpTypePointer Input %uint
|
||||
%tint_symbol = OpVariable %_ptr_Input_uint Input
|
||||
%void = OpTypeVoid
|
||||
%22 = OpTypeFunction %void
|
||||
%22 = OpTypeFunction %void %uint
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform_v3int = OpTypePointer Uniform %v3int
|
||||
%uint_1 = OpConstant %uint 1
|
||||
@@ -85,34 +87,33 @@
|
||||
%_ptr_Uniform_v2int = OpTypePointer Uniform %v2int
|
||||
%uint_7 = OpConstant %uint 7
|
||||
%_ptr_Uniform_mat2v3float = OpTypePointer Uniform %mat2v3float
|
||||
%main = OpFunction %void None %22
|
||||
%25 = OpLabel
|
||||
%27 = OpLoad %uint %tint_symbol
|
||||
%29 = OpAccessChain %_ptr_Uniform_v3int %s %uint_0 %27 %uint_0
|
||||
%60 = OpTypeFunction %void
|
||||
%main_inner = OpFunction %void None %22
|
||||
%idx = OpFunctionParameter %uint
|
||||
%26 = OpLabel
|
||||
%29 = OpAccessChain %_ptr_Uniform_v3int %s %uint_0 %idx %uint_0
|
||||
%30 = OpLoad %v3int %29
|
||||
%31 = OpLoad %uint %tint_symbol
|
||||
%34 = OpAccessChain %_ptr_Uniform_int %s %uint_0 %31 %uint_1
|
||||
%35 = OpLoad %int %34
|
||||
%36 = OpLoad %uint %tint_symbol
|
||||
%39 = OpAccessChain %_ptr_Uniform_v3uint %s %uint_0 %36 %uint_2
|
||||
%40 = OpLoad %v3uint %39
|
||||
%41 = OpLoad %uint %tint_symbol
|
||||
%44 = OpAccessChain %_ptr_Uniform_uint %s %uint_0 %41 %uint_3
|
||||
%45 = OpLoad %uint %44
|
||||
%46 = OpLoad %uint %tint_symbol
|
||||
%48 = OpAccessChain %_ptr_Uniform_v3float %s %uint_0 %46 %uint_4
|
||||
%49 = OpLoad %v3float %48
|
||||
%50 = OpLoad %uint %tint_symbol
|
||||
%53 = OpAccessChain %_ptr_Uniform_float %s %uint_0 %50 %uint_5
|
||||
%54 = OpLoad %float %53
|
||||
%55 = OpLoad %uint %tint_symbol
|
||||
%58 = OpAccessChain %_ptr_Uniform_v2int %s %uint_0 %55 %uint_6
|
||||
%59 = OpLoad %v2int %58
|
||||
%60 = OpLoad %uint %tint_symbol
|
||||
%62 = OpAccessChain %_ptr_Uniform_v2int %s %uint_0 %60 %uint_7
|
||||
%63 = OpLoad %v2int %62
|
||||
%64 = OpLoad %uint %tint_symbol
|
||||
%66 = OpAccessChain %_ptr_Uniform_mat2v3float %s %uint_0 %64 %uint_8
|
||||
%67 = OpLoad %mat2v3float %66
|
||||
%33 = OpAccessChain %_ptr_Uniform_int %s %uint_0 %idx %uint_1
|
||||
%34 = OpLoad %int %33
|
||||
%37 = OpAccessChain %_ptr_Uniform_v3uint %s %uint_0 %idx %uint_2
|
||||
%38 = OpLoad %v3uint %37
|
||||
%41 = OpAccessChain %_ptr_Uniform_uint %s %uint_0 %idx %uint_3
|
||||
%42 = OpLoad %uint %41
|
||||
%44 = OpAccessChain %_ptr_Uniform_v3float %s %uint_0 %idx %uint_4
|
||||
%45 = OpLoad %v3float %44
|
||||
%48 = OpAccessChain %_ptr_Uniform_float %s %uint_0 %idx %uint_5
|
||||
%49 = OpLoad %float %48
|
||||
%52 = OpAccessChain %_ptr_Uniform_v2int %s %uint_0 %idx %uint_6
|
||||
%53 = OpLoad %v2int %52
|
||||
%55 = OpAccessChain %_ptr_Uniform_v2int %s %uint_0 %idx %uint_7
|
||||
%56 = OpLoad %v2int %55
|
||||
%58 = OpAccessChain %_ptr_Uniform_mat2v3float %s %uint_0 %idx %uint_8
|
||||
%59 = OpLoad %mat2v3float %58
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %60
|
||||
%62 = OpLabel
|
||||
%64 = OpLoad %uint %idx_1
|
||||
%63 = OpFunctionCall %void %main_inner %64
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
Reference in New Issue
Block a user