mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-12 06:45:16 +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,13 +1,13 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 59
|
||||
; Bound: 58
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %tint_symbol_1
|
||||
OpEntryPoint Fragment %main "main" %value
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %value "value"
|
||||
OpName %ret_i32 "ret_i32"
|
||||
OpName %ret_u32 "ret_u32"
|
||||
OpName %ret_f32 "ret_f32"
|
||||
@@ -16,17 +16,16 @@
|
||||
OpName %ret_MyStruct "ret_MyStruct"
|
||||
OpName %ret_MyArray "ret_MyArray"
|
||||
OpName %let_decls "let_decls"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %main_inner "main_inner"
|
||||
OpName %main "main"
|
||||
OpDecorate %tint_symbol_1 Location 0
|
||||
OpDecorate %value Location 0
|
||||
OpMemberDecorate %MyStruct 0 Offset 0
|
||||
OpDecorate %_arr_float_uint_10 ArrayStride 4
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %5
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%int = OpTypeInt 32 1
|
||||
%6 = OpTypeFunction %int
|
||||
%int_1 = OpConstant %int 1
|
||||
@@ -52,9 +51,9 @@
|
||||
%40 = OpConstantComposite %v3float %float_1 %float_1 %float_1
|
||||
%mat3v3float = OpTypeMatrix %v3float 3
|
||||
%43 = OpConstantComposite %MyStruct %float_1
|
||||
%50 = OpTypeFunction %void %v4float
|
||||
%50 = OpTypeFunction %v4float
|
||||
%float_0 = OpConstant %float 0
|
||||
%58 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
|
||||
%54 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
|
||||
%ret_i32 = OpFunction %int None %6
|
||||
%9 = OpLabel
|
||||
OpReturnValue %int_1
|
||||
@@ -86,14 +85,13 @@
|
||||
%49 = OpFunctionCall %_arr_float_uint_10 %ret_MyArray
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %50
|
||||
%tint_symbol = OpFunctionParameter %v4float
|
||||
%53 = OpLabel
|
||||
OpStore %tint_symbol_1 %tint_symbol
|
||||
OpReturn
|
||||
%main_inner = OpFunction %v4float None %50
|
||||
%52 = OpLabel
|
||||
OpReturnValue %54
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %31
|
||||
%55 = OpLabel
|
||||
%56 = OpFunctionCall %void %tint_symbol_2 %58
|
||||
%56 = OpLabel
|
||||
%57 = OpFunctionCall %v4float %main_inner
|
||||
OpStore %value %57
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 93
|
||||
; Bound: 92
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %tint_symbol_1
|
||||
OpEntryPoint Fragment %main "main" %value
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %value "value"
|
||||
OpName %ret_i32 "ret_i32"
|
||||
OpName %ret_u32 "ret_u32"
|
||||
OpName %ret_f32 "ret_f32"
|
||||
@@ -31,17 +31,16 @@
|
||||
OpName %v13 "v13"
|
||||
OpName %v14 "v14"
|
||||
OpName %v15 "v15"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %main_inner "main_inner"
|
||||
OpName %main "main"
|
||||
OpDecorate %tint_symbol_1 Location 0
|
||||
OpDecorate %value Location 0
|
||||
OpMemberDecorate %MyStruct 0 Offset 0
|
||||
OpDecorate %_arr_float_uint_10 ArrayStride 4
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %5
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%int = OpTypeInt 32 1
|
||||
%6 = OpTypeFunction %int
|
||||
%int_1 = OpConstant %int 1
|
||||
@@ -83,9 +82,9 @@
|
||||
%67 = OpConstantComposite %MyStruct %float_1
|
||||
%_ptr_Function_MyStruct = OpTypePointer Function %MyStruct
|
||||
%_ptr_Function__arr_float_uint_10 = OpTypePointer Function %_arr_float_uint_10
|
||||
%84 = OpTypeFunction %void %v4float
|
||||
%84 = OpTypeFunction %v4float
|
||||
%float_0 = OpConstant %float 0
|
||||
%92 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
|
||||
%88 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
|
||||
%ret_i32 = OpFunction %int None %6
|
||||
%9 = OpLabel
|
||||
OpReturnValue %int_1
|
||||
@@ -150,14 +149,13 @@
|
||||
OpStore %v15 %82
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %84
|
||||
%tint_symbol = OpFunctionParameter %v4float
|
||||
%87 = OpLabel
|
||||
OpStore %tint_symbol_1 %tint_symbol
|
||||
OpReturn
|
||||
%main_inner = OpFunction %v4float None %84
|
||||
%86 = OpLabel
|
||||
OpReturnValue %88
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %31
|
||||
%89 = OpLabel
|
||||
%90 = OpFunctionCall %void %tint_symbol_2 %92
|
||||
%90 = OpLabel
|
||||
%91 = OpFunctionCall %v4float %main_inner
|
||||
OpStore %value %91
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 35
|
||||
; Bound: 34
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %tint_symbol_1
|
||||
OpEntryPoint Fragment %main "main" %value
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpName %value "value"
|
||||
OpName %v1 "v1"
|
||||
OpName %v2 "v2"
|
||||
OpName %v3 "v3"
|
||||
@@ -18,18 +19,20 @@
|
||||
OpMemberName %MyStruct 0 "f1"
|
||||
OpName %v8 "v8"
|
||||
OpName %v9 "v9"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %main_inner "main_inner"
|
||||
OpName %main "main"
|
||||
OpDecorate %value Location 0
|
||||
OpMemberDecorate %MyStruct 0 Offset 0
|
||||
OpDecorate %_arr_float_uint_10 ArrayStride 4
|
||||
OpDecorate %tint_symbol_1 Location 0
|
||||
%float = OpTypeFloat 32
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%5 = OpConstantNull %v4float
|
||||
%value = OpVariable %_ptr_Output_v4float Output %5
|
||||
%int = OpTypeInt 32 1
|
||||
%v1 = OpConstant %int 1
|
||||
%uint = OpTypeInt 32 0
|
||||
%v2 = OpConstant %uint 1
|
||||
%float = OpTypeFloat 32
|
||||
%v3 = OpConstant %float 1
|
||||
%v3int = OpTypeVector %int 3
|
||||
%v4 = OpConstantComposite %v3int %v1 %v1 %v1
|
||||
@@ -44,23 +47,18 @@
|
||||
%uint_10 = OpConstant %uint 10
|
||||
%_arr_float_uint_10 = OpTypeArray %float %uint_10
|
||||
%v9 = OpConstantNull %_arr_float_uint_10
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%23 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %23
|
||||
%void = OpTypeVoid
|
||||
%24 = OpTypeFunction %void %v4float
|
||||
%29 = OpTypeFunction %void
|
||||
%24 = OpTypeFunction %v4float
|
||||
%float_0 = OpConstant %float 0
|
||||
%34 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
|
||||
%tint_symbol_2 = OpFunction %void None %24
|
||||
%tint_symbol = OpFunctionParameter %v4float
|
||||
%28 = OpLabel
|
||||
OpStore %tint_symbol_1 %tint_symbol
|
||||
OpReturn
|
||||
%28 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
|
||||
%void = OpTypeVoid
|
||||
%29 = OpTypeFunction %void
|
||||
%main_inner = OpFunction %v4float None %24
|
||||
%26 = OpLabel
|
||||
OpReturnValue %28
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %29
|
||||
%31 = OpLabel
|
||||
%32 = OpFunctionCall %void %tint_symbol_2 %34
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %v4float %main_inner
|
||||
OpStore %value %33
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
Reference in New Issue
Block a user