mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 21:47:47 +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,19 +1,19 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 65
|
||||
; Bound: 64
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_4
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_symbol_1_1_1 %vertex_point_size
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %tint_pointsize "tint_pointsize"
|
||||
OpName %tint_symbol_1_1_1 "tint_symbol_1_1_1"
|
||||
OpName %vertex_point_size "vertex_point_size"
|
||||
OpName %arg_0 "arg_0"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %tint_symbol_4 "tint_symbol_4"
|
||||
OpName %textureLoad_6273b1 "textureLoad_6273b1"
|
||||
OpName %res "res"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
@@ -21,33 +21,32 @@
|
||||
OpName %vertex_main_1 "vertex_main_1"
|
||||
OpName %vertex_main_out "vertex_main_out"
|
||||
OpMemberName %vertex_main_out 0 "tint_symbol_1_1"
|
||||
OpName %tint_symbol_5 "tint_symbol_5"
|
||||
OpName %tint_symbol_3 "tint_symbol_3"
|
||||
OpName %vertex_main_inner "vertex_main_inner"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main_1 "fragment_main_1"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main_1 "compute_main_1"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %tint_pointsize BuiltIn PointSize
|
||||
OpDecorate %tint_symbol_1_1_1 BuiltIn Position
|
||||
OpDecorate %vertex_point_size BuiltIn PointSize
|
||||
OpDecorate %arg_0 DescriptorSet 1
|
||||
OpDecorate %arg_0 Binding 0
|
||||
OpDecorate %tint_symbol_4 BuiltIn Position
|
||||
OpMemberDecorate %vertex_main_out 0 Offset 0
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%4 = OpConstantNull %float
|
||||
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
|
||||
%7 = OpTypeImage %float 2D 1 0 1 1 Unknown
|
||||
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
|
||||
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
|
||||
%v4float = OpTypeVector %float 4
|
||||
%float_0 = OpConstant %float 0
|
||||
%10 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Private_v4float Private %10
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%15 = OpConstantNull %v4float
|
||||
%tint_symbol_4 = OpVariable %_ptr_Output_v4float Output %15
|
||||
%5 = OpConstantNull %v4float
|
||||
%tint_symbol_1_1_1 = OpVariable %_ptr_Output_v4float Output %5
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%8 = OpConstantNull %float
|
||||
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
|
||||
%11 = OpTypeImage %float 2D 1 0 1 1 Unknown
|
||||
%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
|
||||
%arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
|
||||
%float_0 = OpConstant %float 0
|
||||
%13 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
|
||||
%_ptr_Private_v4float = OpTypePointer Private %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Private_v4float Private %13
|
||||
%void = OpTypeVoid
|
||||
%16 = OpTypeFunction %void
|
||||
%_ptr_Function_float = OpTypePointer Function %float
|
||||
@@ -58,13 +57,13 @@
|
||||
%int_1 = OpConstant %int 1
|
||||
%32 = OpTypeFunction %void %v4float
|
||||
%vertex_main_out = OpTypeStruct %v4float
|
||||
%40 = OpTypeFunction %void %vertex_main_out
|
||||
%40 = OpTypeFunction %vertex_main_out
|
||||
%float_1 = OpConstant %float 1
|
||||
%textureLoad_6273b1 = OpFunction %void None %16
|
||||
%19 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_float Function %4
|
||||
%res = OpVariable %_ptr_Function_float Function %8
|
||||
OpStore %res %float_0
|
||||
%24 = OpLoad %7 %arg_0
|
||||
%24 = OpLoad %11 %arg_0
|
||||
%23 = OpImageFetch %v4float %24 %28 Sample %int_1
|
||||
%22 = OpCompositeExtract %float %23 0
|
||||
%30 = OpCompositeConstruct %v4float %22 %float_0 %float_0 %float_0
|
||||
@@ -81,42 +80,41 @@
|
||||
%vertex_main_1 = OpFunction %void None %16
|
||||
%37 = OpLabel
|
||||
%38 = OpFunctionCall %void %textureLoad_6273b1
|
||||
%39 = OpFunctionCall %void %tint_symbol_2 %10
|
||||
%39 = OpFunctionCall %void %tint_symbol_2 %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_5 = OpFunction %void None %40
|
||||
%tint_symbol_3 = OpFunctionParameter %vertex_main_out
|
||||
%44 = OpLabel
|
||||
%45 = OpCompositeExtract %v4float %tint_symbol_3 0
|
||||
OpStore %tint_symbol_4 %45
|
||||
OpReturn
|
||||
%vertex_main_inner = OpFunction %vertex_main_out None %40
|
||||
%43 = OpLabel
|
||||
%44 = OpFunctionCall %void %vertex_main_1
|
||||
%45 = OpLoad %v4float %tint_symbol_1
|
||||
%46 = OpCompositeConstruct %vertex_main_out %45
|
||||
OpReturnValue %46
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %16
|
||||
%47 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%49 = OpFunctionCall %void %vertex_main_1
|
||||
%51 = OpLoad %v4float %tint_symbol_1
|
||||
%52 = OpCompositeConstruct %vertex_main_out %51
|
||||
%50 = OpFunctionCall %void %tint_symbol_5 %52
|
||||
%48 = OpLabel
|
||||
%49 = OpFunctionCall %vertex_main_out %vertex_main_inner
|
||||
%50 = OpCompositeExtract %v4float %49 0
|
||||
OpStore %tint_symbol_1_1_1 %50
|
||||
OpStore %vertex_point_size %float_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main_1 = OpFunction %void None %16
|
||||
%54 = OpLabel
|
||||
%55 = OpFunctionCall %void %textureLoad_6273b1
|
||||
%53 = OpLabel
|
||||
%54 = OpFunctionCall %void %textureLoad_6273b1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %16
|
||||
%57 = OpLabel
|
||||
%58 = OpFunctionCall %void %fragment_main_1
|
||||
%56 = OpLabel
|
||||
%57 = OpFunctionCall %void %fragment_main_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main_1 = OpFunction %void None %16
|
||||
%60 = OpLabel
|
||||
%61 = OpFunctionCall %void %textureLoad_6273b1
|
||||
%59 = OpLabel
|
||||
%60 = OpFunctionCall %void %textureLoad_6273b1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %16
|
||||
%63 = OpLabel
|
||||
%64 = OpFunctionCall %void %compute_main_1
|
||||
%62 = OpLabel
|
||||
%63 = OpFunctionCall %void %compute_main_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
Reference in New Issue
Block a user