mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-12 14:46:08 +00:00
tint->dawn: Shuffle source tree in preperation of merging repos
docs/ -> docs/tint/ fuzzers/ -> src/tint/fuzzers/ samples/ -> src/tint/cmd/ src/ -> src/tint/ test/ -> test/tint/ BUG=tint:1418,tint:1433 Change-Id: Id2aa79f989aef3245b80ef4aa37a27ff16cd700b Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/80482 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
committed by
Tint LUCI CQ
parent
38f1e9c75c
commit
dbc13af287
@@ -0,0 +1,483 @@
|
||||
OpCapability Shader
|
||||
%1 = OpExtInstImport "GLSL.std.450"
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Fragment %main "main" %_GLF_color
|
||||
OpExecutionMode %main OriginUpperLeft
|
||||
OpSource ESSL 320
|
||||
OpName %main "main"
|
||||
OpName %BST "BST"
|
||||
OpMemberName %BST 0 "data"
|
||||
OpMemberName %BST 1 "leftIndex"
|
||||
OpMemberName %BST 2 "rightIndex"
|
||||
OpName %makeTreeNode_struct_BST_i1_i1_i11_i1_ "makeTreeNode(struct-BST-i1-i1-i11;i1;"
|
||||
OpName %tree "tree"
|
||||
OpName %data "data"
|
||||
OpName %insert_i1_i1_ "insert(i1;i1;"
|
||||
OpName %treeIndex "treeIndex"
|
||||
OpName %data_0 "data"
|
||||
OpName %search_i1_ "search(i1;"
|
||||
OpName %target "target"
|
||||
OpName %baseIndex "baseIndex"
|
||||
OpName %tree_0 "tree"
|
||||
OpName %buf0 "buf0"
|
||||
OpMemberName %buf0 0 "injectionSwitch"
|
||||
OpName %_ ""
|
||||
OpName %param "param"
|
||||
OpName %param_0 "param"
|
||||
OpName %param_1 "param"
|
||||
OpName %param_2 "param"
|
||||
OpName %index "index"
|
||||
OpName %currentNode "currentNode"
|
||||
OpName %treeIndex_0 "treeIndex"
|
||||
OpName %param_3 "param"
|
||||
OpName %param_4 "param"
|
||||
OpName %param_5 "param"
|
||||
OpName %param_6 "param"
|
||||
OpName %param_7 "param"
|
||||
OpName %param_8 "param"
|
||||
OpName %param_9 "param"
|
||||
OpName %param_10 "param"
|
||||
OpName %param_11 "param"
|
||||
OpName %param_12 "param"
|
||||
OpName %param_13 "param"
|
||||
OpName %param_14 "param"
|
||||
OpName %param_15 "param"
|
||||
OpName %param_16 "param"
|
||||
OpName %param_17 "param"
|
||||
OpName %param_18 "param"
|
||||
OpName %param_19 "param"
|
||||
OpName %param_20 "param"
|
||||
OpName %param_21 "param"
|
||||
OpName %param_22 "param"
|
||||
OpName %count "count"
|
||||
OpName %i "i"
|
||||
OpName %result "result"
|
||||
OpName %param_23 "param"
|
||||
OpName %_GLF_color "_GLF_color"
|
||||
OpMemberDecorate %buf0 0 Offset 0
|
||||
OpDecorate %buf0 Block
|
||||
OpDecorate %_ DescriptorSet 0
|
||||
OpDecorate %_ Binding 0
|
||||
OpDecorate %_GLF_color Location 0
|
||||
%void = OpTypeVoid
|
||||
%49 = OpTypeFunction %void
|
||||
%int = OpTypeInt 32 1
|
||||
%BST = OpTypeStruct %int %int %int
|
||||
%_ptr_Function_BST = OpTypePointer Function %BST
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
%53 = OpTypeFunction %void %_ptr_Function_BST %_ptr_Function_int
|
||||
%54 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_int
|
||||
%55 = OpTypeFunction %int %_ptr_Function_int
|
||||
%int_0 = OpConstant %int 0
|
||||
%int_1 = OpConstant %int 1
|
||||
%int_n1 = OpConstant %int -1
|
||||
%int_2 = OpConstant %int 2
|
||||
%bool = OpTypeBool
|
||||
%uint = OpTypeInt 32 0
|
||||
%uint_10 = OpConstant %uint 10
|
||||
%_arr_BST_uint_10 = OpTypeArray %BST %uint_10
|
||||
%_ptr_Private__arr_BST_uint_10 = OpTypePointer Private %_arr_BST_uint_10
|
||||
%tree_0 = OpVariable %_ptr_Private__arr_BST_uint_10 Private
|
||||
%_ptr_Private_int = OpTypePointer Private %int
|
||||
%float = OpTypeFloat 32
|
||||
%v2float = OpTypeVector %float 2
|
||||
%buf0 = OpTypeStruct %v2float
|
||||
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
|
||||
%_ = OpVariable %_ptr_Uniform_buf0 Uniform
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_Uniform_float = OpTypePointer Uniform %float
|
||||
%uint_1 = OpConstant %uint 1
|
||||
%_ptr_Private_BST = OpTypePointer Private %BST
|
||||
%int_9 = OpConstant %int 9
|
||||
%int_5 = OpConstant %int 5
|
||||
%int_12 = OpConstant %int 12
|
||||
%int_15 = OpConstant %int 15
|
||||
%int_7 = OpConstant %int 7
|
||||
%int_8 = OpConstant %int 8
|
||||
%int_6 = OpConstant %int 6
|
||||
%int_17 = OpConstant %int 17
|
||||
%int_13 = OpConstant %int 13
|
||||
%int_20 = OpConstant %int 20
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%_GLF_color = OpVariable %_ptr_Output_v4float Output
|
||||
%float_1 = OpConstant %float 1
|
||||
%float_0 = OpConstant %float 0
|
||||
%87 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
|
||||
%88 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1
|
||||
%main = OpFunction %void None %49
|
||||
%89 = OpLabel
|
||||
%treeIndex_0 = OpVariable %_ptr_Function_int Function
|
||||
%param_3 = OpVariable %_ptr_Function_BST Function
|
||||
%param_4 = OpVariable %_ptr_Function_int Function
|
||||
%param_5 = OpVariable %_ptr_Function_int Function
|
||||
%param_6 = OpVariable %_ptr_Function_int Function
|
||||
%param_7 = OpVariable %_ptr_Function_int Function
|
||||
%param_8 = OpVariable %_ptr_Function_int Function
|
||||
%param_9 = OpVariable %_ptr_Function_int Function
|
||||
%param_10 = OpVariable %_ptr_Function_int Function
|
||||
%param_11 = OpVariable %_ptr_Function_int Function
|
||||
%param_12 = OpVariable %_ptr_Function_int Function
|
||||
%param_13 = OpVariable %_ptr_Function_int Function
|
||||
%param_14 = OpVariable %_ptr_Function_int Function
|
||||
%param_15 = OpVariable %_ptr_Function_int Function
|
||||
%param_16 = OpVariable %_ptr_Function_int Function
|
||||
%param_17 = OpVariable %_ptr_Function_int Function
|
||||
%param_18 = OpVariable %_ptr_Function_int Function
|
||||
%param_19 = OpVariable %_ptr_Function_int Function
|
||||
%param_20 = OpVariable %_ptr_Function_int Function
|
||||
%param_21 = OpVariable %_ptr_Function_int Function
|
||||
%param_22 = OpVariable %_ptr_Function_int Function
|
||||
%count = OpVariable %_ptr_Function_int Function
|
||||
%i = OpVariable %_ptr_Function_int Function
|
||||
%result = OpVariable %_ptr_Function_int Function
|
||||
%param_23 = OpVariable %_ptr_Function_int Function
|
||||
OpStore %treeIndex_0 %int_0
|
||||
%90 = OpAccessChain %_ptr_Private_BST %tree_0 %int_0
|
||||
%91 = OpLoad %BST %90
|
||||
OpStore %param_3 %91
|
||||
OpStore %param_4 %int_9
|
||||
%92 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param_3 %param_4
|
||||
%93 = OpLoad %BST %param_3
|
||||
%94 = OpAccessChain %_ptr_Private_BST %tree_0 %int_0
|
||||
OpStore %94 %93
|
||||
%95 = OpLoad %int %treeIndex_0
|
||||
%96 = OpIAdd %int %95 %int_1
|
||||
OpStore %treeIndex_0 %96
|
||||
%97 = OpLoad %int %treeIndex_0
|
||||
OpStore %param_5 %97
|
||||
OpStore %param_6 %int_5
|
||||
%98 = OpFunctionCall %void %insert_i1_i1_ %param_5 %param_6
|
||||
%99 = OpLoad %int %treeIndex_0
|
||||
%100 = OpIAdd %int %99 %int_1
|
||||
OpStore %treeIndex_0 %100
|
||||
%101 = OpLoad %int %treeIndex_0
|
||||
OpStore %param_7 %101
|
||||
OpStore %param_8 %int_12
|
||||
%102 = OpFunctionCall %void %insert_i1_i1_ %param_7 %param_8
|
||||
%103 = OpLoad %int %treeIndex_0
|
||||
%104 = OpIAdd %int %103 %int_1
|
||||
OpStore %treeIndex_0 %104
|
||||
%105 = OpLoad %int %treeIndex_0
|
||||
OpStore %param_9 %105
|
||||
OpStore %param_10 %int_15
|
||||
%106 = OpFunctionCall %void %insert_i1_i1_ %param_9 %param_10
|
||||
%107 = OpLoad %int %treeIndex_0
|
||||
%108 = OpIAdd %int %107 %int_1
|
||||
OpStore %treeIndex_0 %108
|
||||
%109 = OpLoad %int %treeIndex_0
|
||||
OpStore %param_11 %109
|
||||
OpStore %param_12 %int_7
|
||||
%110 = OpFunctionCall %void %insert_i1_i1_ %param_11 %param_12
|
||||
%111 = OpLoad %int %treeIndex_0
|
||||
%112 = OpIAdd %int %111 %int_1
|
||||
OpStore %treeIndex_0 %112
|
||||
%113 = OpLoad %int %treeIndex_0
|
||||
OpStore %param_13 %113
|
||||
OpStore %param_14 %int_8
|
||||
%114 = OpFunctionCall %void %insert_i1_i1_ %param_13 %param_14
|
||||
%115 = OpLoad %int %treeIndex_0
|
||||
%116 = OpIAdd %int %115 %int_1
|
||||
OpStore %treeIndex_0 %116
|
||||
%117 = OpLoad %int %treeIndex_0
|
||||
OpStore %param_15 %117
|
||||
OpStore %param_16 %int_2
|
||||
%118 = OpFunctionCall %void %insert_i1_i1_ %param_15 %param_16
|
||||
%119 = OpLoad %int %treeIndex_0
|
||||
%120 = OpIAdd %int %119 %int_1
|
||||
OpStore %treeIndex_0 %120
|
||||
%121 = OpLoad %int %treeIndex_0
|
||||
OpStore %param_17 %121
|
||||
OpStore %param_18 %int_6
|
||||
%122 = OpFunctionCall %void %insert_i1_i1_ %param_17 %param_18
|
||||
%123 = OpLoad %int %treeIndex_0
|
||||
%124 = OpIAdd %int %123 %int_1
|
||||
OpStore %treeIndex_0 %124
|
||||
%125 = OpLoad %int %treeIndex_0
|
||||
OpStore %param_19 %125
|
||||
OpStore %param_20 %int_17
|
||||
%126 = OpFunctionCall %void %insert_i1_i1_ %param_19 %param_20
|
||||
%127 = OpLoad %int %treeIndex_0
|
||||
%128 = OpIAdd %int %127 %int_1
|
||||
OpStore %treeIndex_0 %128
|
||||
%129 = OpLoad %int %treeIndex_0
|
||||
OpStore %param_21 %129
|
||||
OpStore %param_22 %int_13
|
||||
%130 = OpFunctionCall %void %insert_i1_i1_ %param_21 %param_22
|
||||
OpStore %count %int_0
|
||||
OpStore %i %int_0
|
||||
OpBranch %131
|
||||
%131 = OpLabel
|
||||
OpLoopMerge %132 %133 None
|
||||
OpBranch %134
|
||||
%134 = OpLabel
|
||||
%135 = OpLoad %int %i
|
||||
%136 = OpSLessThan %bool %135 %int_20
|
||||
OpBranchConditional %136 %137 %132
|
||||
%137 = OpLabel
|
||||
%138 = OpLoad %int %i
|
||||
OpStore %param_23 %138
|
||||
%139 = OpFunctionCall %int %search_i1_ %param_23
|
||||
OpStore %result %139
|
||||
%140 = OpLoad %int %i
|
||||
OpSelectionMerge %141 None
|
||||
OpSwitch %140 %142 9 %143 5 %143 12 %143 15 %143 7 %143 8 %143 2 %143 6 %143 17 %143 13 %143
|
||||
%142 = OpLabel
|
||||
%144 = OpLoad %int %result
|
||||
%145 = OpIEqual %bool %144 %int_n1
|
||||
OpSelectionMerge %146 None
|
||||
OpBranchConditional %145 %147 %146
|
||||
%147 = OpLabel
|
||||
%148 = OpLoad %int %count
|
||||
%149 = OpIAdd %int %148 %int_1
|
||||
OpStore %count %149
|
||||
OpBranch %146
|
||||
%146 = OpLabel
|
||||
OpBranch %141
|
||||
%143 = OpLabel
|
||||
%150 = OpLoad %int %result
|
||||
%151 = OpLoad %int %i
|
||||
%152 = OpIEqual %bool %150 %151
|
||||
OpSelectionMerge %153 None
|
||||
OpBranchConditional %152 %154 %153
|
||||
%154 = OpLabel
|
||||
%155 = OpLoad %int %count
|
||||
%156 = OpIAdd %int %155 %int_1
|
||||
OpStore %count %156
|
||||
OpBranch %153
|
||||
%153 = OpLabel
|
||||
OpBranch %141
|
||||
%141 = OpLabel
|
||||
OpBranch %133
|
||||
%133 = OpLabel
|
||||
%157 = OpLoad %int %i
|
||||
%158 = OpIAdd %int %157 %int_1
|
||||
OpStore %i %158
|
||||
OpBranch %131
|
||||
%132 = OpLabel
|
||||
%159 = OpLoad %int %count
|
||||
%160 = OpIEqual %bool %159 %int_20
|
||||
OpSelectionMerge %161 None
|
||||
OpBranchConditional %160 %162 %163
|
||||
%162 = OpLabel
|
||||
OpStore %_GLF_color %87
|
||||
OpBranch %161
|
||||
%163 = OpLabel
|
||||
OpStore %_GLF_color %88
|
||||
OpBranch %161
|
||||
%161 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%makeTreeNode_struct_BST_i1_i1_i11_i1_ = OpFunction %void None %53
|
||||
%tree = OpFunctionParameter %_ptr_Function_BST
|
||||
%data = OpFunctionParameter %_ptr_Function_int
|
||||
%164 = OpLabel
|
||||
%165 = OpLoad %int %data
|
||||
%166 = OpAccessChain %_ptr_Function_int %tree %int_0
|
||||
OpStore %166 %165
|
||||
%167 = OpAccessChain %_ptr_Function_int %tree %int_1
|
||||
OpStore %167 %int_n1
|
||||
%168 = OpAccessChain %_ptr_Function_int %tree %int_2
|
||||
OpStore %168 %int_n1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%insert_i1_i1_ = OpFunction %void None %54
|
||||
%treeIndex = OpFunctionParameter %_ptr_Function_int
|
||||
%data_0 = OpFunctionParameter %_ptr_Function_int
|
||||
%169 = OpLabel
|
||||
%baseIndex = OpVariable %_ptr_Function_int Function
|
||||
%param = OpVariable %_ptr_Function_BST Function
|
||||
%param_0 = OpVariable %_ptr_Function_int Function
|
||||
%170 = OpVariable %_ptr_Function_int Function
|
||||
%param_1 = OpVariable %_ptr_Function_BST Function
|
||||
%param_2 = OpVariable %_ptr_Function_int Function
|
||||
OpStore %baseIndex %int_0
|
||||
OpBranch %171
|
||||
%171 = OpLabel
|
||||
OpLoopMerge %172 %173 None
|
||||
OpBranch %174
|
||||
%174 = OpLabel
|
||||
%175 = OpLoad %int %baseIndex
|
||||
%176 = OpLoad %int %treeIndex
|
||||
%177 = OpSLessThanEqual %bool %175 %176
|
||||
OpBranchConditional %177 %178 %172
|
||||
%178 = OpLabel
|
||||
%179 = OpLoad %int %data_0
|
||||
%180 = OpLoad %int %baseIndex
|
||||
%181 = OpAccessChain %_ptr_Private_int %tree_0 %180 %int_0
|
||||
%182 = OpLoad %int %181
|
||||
%183 = OpSLessThanEqual %bool %179 %182
|
||||
OpSelectionMerge %184 None
|
||||
OpBranchConditional %183 %185 %186
|
||||
%185 = OpLabel
|
||||
%187 = OpLoad %int %baseIndex
|
||||
%188 = OpAccessChain %_ptr_Private_int %tree_0 %187 %int_1
|
||||
%189 = OpLoad %int %188
|
||||
%190 = OpIEqual %bool %189 %int_n1
|
||||
OpSelectionMerge %191 None
|
||||
OpBranchConditional %190 %192 %193
|
||||
%192 = OpLabel
|
||||
%194 = OpLoad %int %baseIndex
|
||||
%195 = OpLoad %int %treeIndex
|
||||
%196 = OpAccessChain %_ptr_Private_int %tree_0 %194 %int_1
|
||||
OpStore %196 %195
|
||||
%197 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_0
|
||||
%198 = OpLoad %float %197
|
||||
%199 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_1
|
||||
%200 = OpLoad %float %199
|
||||
%201 = OpFOrdLessThan %bool %198 %200
|
||||
OpSelectionMerge %202 None
|
||||
OpBranchConditional %201 %203 %202
|
||||
%203 = OpLabel
|
||||
%204 = OpLoad %int %treeIndex
|
||||
%205 = OpAccessChain %_ptr_Private_BST %tree_0 %204
|
||||
%206 = OpLoad %BST %205
|
||||
OpStore %param %206
|
||||
%207 = OpLoad %int %data_0
|
||||
OpStore %param_0 %207
|
||||
%208 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param %param_0
|
||||
%209 = OpLoad %BST %param
|
||||
%210 = OpAccessChain %_ptr_Private_BST %tree_0 %204
|
||||
OpStore %210 %209
|
||||
OpBranch %202
|
||||
%202 = OpLabel
|
||||
%211 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_0
|
||||
%212 = OpLoad %float %211
|
||||
%213 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_1
|
||||
%214 = OpLoad %float %213
|
||||
%215 = OpFOrdLessThan %bool %212 %214
|
||||
OpSelectionMerge %216 None
|
||||
OpBranchConditional %215 %217 %216
|
||||
%217 = OpLabel
|
||||
OpReturn
|
||||
%216 = OpLabel
|
||||
OpBranch %191
|
||||
%193 = OpLabel
|
||||
%218 = OpLoad %int %baseIndex
|
||||
%219 = OpAccessChain %_ptr_Private_int %tree_0 %218 %int_1
|
||||
%220 = OpLoad %int %219
|
||||
OpStore %baseIndex %220
|
||||
OpBranch %173
|
||||
%191 = OpLabel
|
||||
OpBranch %184
|
||||
%186 = OpLabel
|
||||
%221 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_0
|
||||
%222 = OpLoad %float %221
|
||||
%223 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_1
|
||||
%224 = OpLoad %float %223
|
||||
%225 = OpFOrdLessThan %bool %222 %224
|
||||
OpSelectionMerge %226 None
|
||||
OpBranchConditional %225 %227 %228
|
||||
%227 = OpLabel
|
||||
%229 = OpLoad %int %baseIndex
|
||||
%230 = OpAccessChain %_ptr_Private_int %tree_0 %229 %int_2
|
||||
%231 = OpLoad %int %230
|
||||
OpStore %170 %231
|
||||
OpBranch %226
|
||||
%228 = OpLabel
|
||||
%232 = OpLoad %int %baseIndex
|
||||
%233 = OpAccessChain %_ptr_Private_int %tree_0 %232 %int_2
|
||||
%234 = OpLoad %int %233
|
||||
OpStore %170 %234
|
||||
OpBranch %226
|
||||
%226 = OpLabel
|
||||
%235 = OpLoad %int %170
|
||||
%236 = OpIEqual %bool %235 %int_n1
|
||||
OpSelectionMerge %237 None
|
||||
OpBranchConditional %236 %238 %239
|
||||
%238 = OpLabel
|
||||
%240 = OpLoad %int %baseIndex
|
||||
%241 = OpLoad %int %treeIndex
|
||||
%242 = OpAccessChain %_ptr_Private_int %tree_0 %240 %int_2
|
||||
OpStore %242 %241
|
||||
%243 = OpLoad %int %treeIndex
|
||||
%244 = OpAccessChain %_ptr_Private_BST %tree_0 %243
|
||||
%245 = OpLoad %BST %244
|
||||
OpStore %param_1 %245
|
||||
%246 = OpLoad %int %data_0
|
||||
OpStore %param_2 %246
|
||||
%247 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param_1 %param_2
|
||||
%248 = OpLoad %BST %param_1
|
||||
%249 = OpAccessChain %_ptr_Private_BST %tree_0 %243
|
||||
OpStore %249 %248
|
||||
OpReturn
|
||||
%239 = OpLabel
|
||||
%250 = OpLoad %int %baseIndex
|
||||
%251 = OpAccessChain %_ptr_Private_int %tree_0 %250 %int_2
|
||||
%252 = OpLoad %int %251
|
||||
OpStore %baseIndex %252
|
||||
OpBranch %173
|
||||
%237 = OpLabel
|
||||
OpUnreachable
|
||||
%184 = OpLabel
|
||||
%253 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_0
|
||||
%254 = OpLoad %float %253
|
||||
%255 = OpAccessChain %_ptr_Uniform_float %_ %int_0 %uint_1
|
||||
%256 = OpLoad %float %255
|
||||
%257 = OpFOrdGreaterThan %bool %254 %256
|
||||
OpSelectionMerge %258 None
|
||||
OpBranchConditional %257 %259 %258
|
||||
%259 = OpLabel
|
||||
OpReturn
|
||||
%258 = OpLabel
|
||||
OpBranch %173
|
||||
%173 = OpLabel
|
||||
OpBranch %171
|
||||
%172 = OpLabel
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%search_i1_ = OpFunction %int None %55
|
||||
%target = OpFunctionParameter %_ptr_Function_int
|
||||
%260 = OpLabel
|
||||
%index = OpVariable %_ptr_Function_int Function
|
||||
%currentNode = OpVariable %_ptr_Function_BST Function
|
||||
%261 = OpVariable %_ptr_Function_int Function
|
||||
OpStore %index %int_0
|
||||
OpBranch %262
|
||||
%262 = OpLabel
|
||||
OpLoopMerge %263 %264 None
|
||||
OpBranch %265
|
||||
%265 = OpLabel
|
||||
%266 = OpLoad %int %index
|
||||
%267 = OpINotEqual %bool %266 %int_n1
|
||||
OpBranchConditional %267 %268 %263
|
||||
%268 = OpLabel
|
||||
%269 = OpLoad %int %index
|
||||
%270 = OpAccessChain %_ptr_Private_BST %tree_0 %269
|
||||
%271 = OpLoad %BST %270
|
||||
OpStore %currentNode %271
|
||||
%272 = OpAccessChain %_ptr_Function_int %currentNode %int_0
|
||||
%273 = OpLoad %int %272
|
||||
%274 = OpLoad %int %target
|
||||
%275 = OpIEqual %bool %273 %274
|
||||
OpSelectionMerge %276 None
|
||||
OpBranchConditional %275 %277 %276
|
||||
%277 = OpLabel
|
||||
%278 = OpLoad %int %target
|
||||
OpReturnValue %278
|
||||
%276 = OpLabel
|
||||
%279 = OpLoad %int %target
|
||||
%280 = OpAccessChain %_ptr_Function_int %currentNode %int_0
|
||||
%281 = OpLoad %int %280
|
||||
%282 = OpSGreaterThan %bool %279 %281
|
||||
OpSelectionMerge %283 None
|
||||
OpBranchConditional %282 %284 %285
|
||||
%284 = OpLabel
|
||||
%286 = OpAccessChain %_ptr_Function_int %currentNode %int_2
|
||||
%287 = OpLoad %int %286
|
||||
OpStore %261 %287
|
||||
OpBranch %283
|
||||
%285 = OpLabel
|
||||
%288 = OpAccessChain %_ptr_Function_int %currentNode %int_1
|
||||
%289 = OpLoad %int %288
|
||||
OpStore %261 %289
|
||||
OpBranch %283
|
||||
%283 = OpLabel
|
||||
%290 = OpLoad %int %261
|
||||
OpStore %index %290
|
||||
OpBranch %264
|
||||
%264 = OpLabel
|
||||
OpBranch %262
|
||||
%263 = OpLabel
|
||||
OpReturnValue %int_n1
|
||||
OpFunctionEnd
|
||||
@@ -0,0 +1,292 @@
|
||||
struct BST {
|
||||
data : i32;
|
||||
leftIndex : i32;
|
||||
rightIndex : i32;
|
||||
};
|
||||
|
||||
struct buf0 {
|
||||
injectionSwitch : vec2<f32>;
|
||||
};
|
||||
|
||||
var<private> tree_1 : array<BST, 10>;
|
||||
|
||||
@group(0) @binding(0) var<uniform> x_16 : buf0;
|
||||
|
||||
var<private> x_GLF_color : vec4<f32>;
|
||||
|
||||
fn makeTreeNode_struct_BST_i1_i1_i11_i1_(tree : ptr<function, BST>, data : ptr<function, i32>) {
|
||||
let x_165 : i32 = *(data);
|
||||
(*(tree)).data = x_165;
|
||||
(*(tree)).leftIndex = -1;
|
||||
(*(tree)).rightIndex = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
fn insert_i1_i1_(treeIndex : ptr<function, i32>, data_1 : ptr<function, i32>) {
|
||||
var baseIndex : i32;
|
||||
var param : BST;
|
||||
var param_1 : i32;
|
||||
var x_170 : i32;
|
||||
var param_2 : BST;
|
||||
var param_3 : i32;
|
||||
baseIndex = 0;
|
||||
loop {
|
||||
let x_175 : i32 = baseIndex;
|
||||
let x_176 : i32 = *(treeIndex);
|
||||
if ((x_175 <= x_176)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
let x_179 : i32 = *(data_1);
|
||||
let x_180 : i32 = baseIndex;
|
||||
let x_182 : i32 = tree_1[x_180].data;
|
||||
if ((x_179 <= x_182)) {
|
||||
let x_187 : i32 = baseIndex;
|
||||
let x_189 : i32 = tree_1[x_187].leftIndex;
|
||||
if ((x_189 == -1)) {
|
||||
let x_194 : i32 = baseIndex;
|
||||
let x_195 : i32 = *(treeIndex);
|
||||
tree_1[x_194].leftIndex = x_195;
|
||||
let x_198 : f32 = x_16.injectionSwitch.x;
|
||||
let x_200 : f32 = x_16.injectionSwitch.y;
|
||||
if ((x_198 < x_200)) {
|
||||
let x_204 : i32 = *(treeIndex);
|
||||
let x_206 : BST = tree_1[x_204];
|
||||
param = x_206;
|
||||
let x_207 : i32 = *(data_1);
|
||||
param_1 = x_207;
|
||||
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param), &(param_1));
|
||||
let x_209 : BST = param;
|
||||
tree_1[x_204] = x_209;
|
||||
}
|
||||
let x_212 : f32 = x_16.injectionSwitch.x;
|
||||
let x_214 : f32 = x_16.injectionSwitch.y;
|
||||
if ((x_212 < x_214)) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
let x_218 : i32 = baseIndex;
|
||||
let x_220 : i32 = tree_1[x_218].leftIndex;
|
||||
baseIndex = x_220;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
let x_222 : f32 = x_16.injectionSwitch.x;
|
||||
let x_224 : f32 = x_16.injectionSwitch.y;
|
||||
if ((x_222 < x_224)) {
|
||||
let x_229 : i32 = baseIndex;
|
||||
let x_231 : i32 = tree_1[x_229].rightIndex;
|
||||
x_170 = x_231;
|
||||
} else {
|
||||
let x_232 : i32 = baseIndex;
|
||||
let x_234 : i32 = tree_1[x_232].rightIndex;
|
||||
x_170 = x_234;
|
||||
}
|
||||
let x_235 : i32 = x_170;
|
||||
if ((x_235 == -1)) {
|
||||
let x_240 : i32 = baseIndex;
|
||||
let x_241 : i32 = *(treeIndex);
|
||||
tree_1[x_240].rightIndex = x_241;
|
||||
let x_243 : i32 = *(treeIndex);
|
||||
let x_245 : BST = tree_1[x_243];
|
||||
param_2 = x_245;
|
||||
let x_246 : i32 = *(data_1);
|
||||
param_3 = x_246;
|
||||
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param_2), &(param_3));
|
||||
let x_248 : BST = param_2;
|
||||
tree_1[x_243] = x_248;
|
||||
return;
|
||||
} else {
|
||||
let x_250 : i32 = baseIndex;
|
||||
let x_252 : i32 = tree_1[x_250].rightIndex;
|
||||
baseIndex = x_252;
|
||||
continue;
|
||||
}
|
||||
return;
|
||||
}
|
||||
let x_254 : f32 = x_16.injectionSwitch.x;
|
||||
let x_256 : f32 = x_16.injectionSwitch.y;
|
||||
if ((x_254 > x_256)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
fn search_i1_(target : ptr<function, i32>) -> i32 {
|
||||
var index : i32;
|
||||
var currentNode : BST;
|
||||
var x_261 : i32;
|
||||
index = 0;
|
||||
loop {
|
||||
let x_266 : i32 = index;
|
||||
if ((x_266 != -1)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
let x_269 : i32 = index;
|
||||
let x_271 : BST = tree_1[x_269];
|
||||
currentNode = x_271;
|
||||
let x_273 : i32 = currentNode.data;
|
||||
let x_274 : i32 = *(target);
|
||||
if ((x_273 == x_274)) {
|
||||
let x_278 : i32 = *(target);
|
||||
return x_278;
|
||||
}
|
||||
let x_279 : i32 = *(target);
|
||||
let x_281 : i32 = currentNode.data;
|
||||
if ((x_279 > x_281)) {
|
||||
let x_287 : i32 = currentNode.rightIndex;
|
||||
x_261 = x_287;
|
||||
} else {
|
||||
let x_289 : i32 = currentNode.leftIndex;
|
||||
x_261 = x_289;
|
||||
}
|
||||
let x_290 : i32 = x_261;
|
||||
index = x_290;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
fn main_1() {
|
||||
var treeIndex_1 : i32;
|
||||
var param_4 : BST;
|
||||
var param_5 : i32;
|
||||
var param_6 : i32;
|
||||
var param_7 : i32;
|
||||
var param_8 : i32;
|
||||
var param_9 : i32;
|
||||
var param_10 : i32;
|
||||
var param_11 : i32;
|
||||
var param_12 : i32;
|
||||
var param_13 : i32;
|
||||
var param_14 : i32;
|
||||
var param_15 : i32;
|
||||
var param_16 : i32;
|
||||
var param_17 : i32;
|
||||
var param_18 : i32;
|
||||
var param_19 : i32;
|
||||
var param_20 : i32;
|
||||
var param_21 : i32;
|
||||
var param_22 : i32;
|
||||
var param_23 : i32;
|
||||
var count : i32;
|
||||
var i : i32;
|
||||
var result : i32;
|
||||
var param_24 : i32;
|
||||
treeIndex_1 = 0;
|
||||
let x_91 : BST = tree_1[0];
|
||||
param_4 = x_91;
|
||||
param_5 = 9;
|
||||
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param_4), &(param_5));
|
||||
let x_93 : BST = param_4;
|
||||
tree_1[0] = x_93;
|
||||
let x_95 : i32 = treeIndex_1;
|
||||
treeIndex_1 = (x_95 + 1);
|
||||
let x_97 : i32 = treeIndex_1;
|
||||
param_6 = x_97;
|
||||
param_7 = 5;
|
||||
insert_i1_i1_(&(param_6), &(param_7));
|
||||
let x_99 : i32 = treeIndex_1;
|
||||
treeIndex_1 = (x_99 + 1);
|
||||
let x_101 : i32 = treeIndex_1;
|
||||
param_8 = x_101;
|
||||
param_9 = 12;
|
||||
insert_i1_i1_(&(param_8), &(param_9));
|
||||
let x_103 : i32 = treeIndex_1;
|
||||
treeIndex_1 = (x_103 + 1);
|
||||
let x_105 : i32 = treeIndex_1;
|
||||
param_10 = x_105;
|
||||
param_11 = 15;
|
||||
insert_i1_i1_(&(param_10), &(param_11));
|
||||
let x_107 : i32 = treeIndex_1;
|
||||
treeIndex_1 = (x_107 + 1);
|
||||
let x_109 : i32 = treeIndex_1;
|
||||
param_12 = x_109;
|
||||
param_13 = 7;
|
||||
insert_i1_i1_(&(param_12), &(param_13));
|
||||
let x_111 : i32 = treeIndex_1;
|
||||
treeIndex_1 = (x_111 + 1);
|
||||
let x_113 : i32 = treeIndex_1;
|
||||
param_14 = x_113;
|
||||
param_15 = 8;
|
||||
insert_i1_i1_(&(param_14), &(param_15));
|
||||
let x_115 : i32 = treeIndex_1;
|
||||
treeIndex_1 = (x_115 + 1);
|
||||
let x_117 : i32 = treeIndex_1;
|
||||
param_16 = x_117;
|
||||
param_17 = 2;
|
||||
insert_i1_i1_(&(param_16), &(param_17));
|
||||
let x_119 : i32 = treeIndex_1;
|
||||
treeIndex_1 = (x_119 + 1);
|
||||
let x_121 : i32 = treeIndex_1;
|
||||
param_18 = x_121;
|
||||
param_19 = 6;
|
||||
insert_i1_i1_(&(param_18), &(param_19));
|
||||
let x_123 : i32 = treeIndex_1;
|
||||
treeIndex_1 = (x_123 + 1);
|
||||
let x_125 : i32 = treeIndex_1;
|
||||
param_20 = x_125;
|
||||
param_21 = 17;
|
||||
insert_i1_i1_(&(param_20), &(param_21));
|
||||
let x_127 : i32 = treeIndex_1;
|
||||
treeIndex_1 = (x_127 + 1);
|
||||
let x_129 : i32 = treeIndex_1;
|
||||
param_22 = x_129;
|
||||
param_23 = 13;
|
||||
insert_i1_i1_(&(param_22), &(param_23));
|
||||
count = 0;
|
||||
i = 0;
|
||||
loop {
|
||||
let x_135 : i32 = i;
|
||||
if ((x_135 < 20)) {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
let x_138 : i32 = i;
|
||||
param_24 = x_138;
|
||||
let x_139 : i32 = search_i1_(&(param_24));
|
||||
result = x_139;
|
||||
let x_140 : i32 = i;
|
||||
switch(x_140) {
|
||||
case 2, 5, 6, 7, 8, 9, 12, 13, 15, 17: {
|
||||
let x_150 : i32 = result;
|
||||
let x_151 : i32 = i;
|
||||
if ((x_150 == x_151)) {
|
||||
let x_155 : i32 = count;
|
||||
count = (x_155 + 1);
|
||||
}
|
||||
}
|
||||
default: {
|
||||
let x_144 : i32 = result;
|
||||
if ((x_144 == -1)) {
|
||||
let x_148 : i32 = count;
|
||||
count = (x_148 + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
continuing {
|
||||
let x_157 : i32 = i;
|
||||
i = (x_157 + 1);
|
||||
}
|
||||
}
|
||||
let x_159 : i32 = count;
|
||||
if ((x_159 == 20)) {
|
||||
x_GLF_color = vec4<f32>(1.0, 0.0, 0.0, 1.0);
|
||||
} else {
|
||||
x_GLF_color = vec4<f32>(0.0, 0.0, 1.0, 1.0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
struct main_out {
|
||||
@location(0)
|
||||
x_GLF_color_1 : vec4<f32>;
|
||||
};
|
||||
|
||||
@stage(fragment)
|
||||
fn main() -> main_out {
|
||||
main_1();
|
||||
return main_out(x_GLF_color);
|
||||
}
|
||||
Reference in New Issue
Block a user