blob: 05b400932905de54868b8af46b9b43ee224e1ced [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 253
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" %WorkGroupID_1 %LocalInvocationID_1 %local_invocation_index_1
OpExecutionMode %main LocalSize 64 1 1
OpName %WorkGroupID_1 "WorkGroupID_1"
OpName %LocalInvocationID_1 "LocalInvocationID_1"
OpName %local_invocation_index_1 "local_invocation_index_1"
OpName %samp "samp"
OpName %params_block "params_block"
OpMemberName %params_block 0 "inner"
OpName %Params "Params"
OpMemberName %Params 0 "filterDim"
OpMemberName %Params 1 "blockDim"
OpName %params "params"
OpName %inputTex "inputTex"
OpName %outputTex "outputTex"
OpName %flip_block "flip_block"
OpMemberName %flip_block 0 "inner"
OpName %Flip "Flip"
OpMemberName %Flip 0 "value"
OpName %flip "flip"
OpName %tile "tile"
OpName %main_inner "main_inner"
OpName %WorkGroupID "WorkGroupID"
OpName %LocalInvocationID "LocalInvocationID"
OpName %local_invocation_index "local_invocation_index"
OpName %idx "idx"
OpName %r "r"
OpName %c "c"
OpName %loadIndex "loadIndex"
OpName %r_0 "r"
OpName %c_0 "c"
OpName %writeIndex "writeIndex"
OpName %acc "acc"
OpName %f "f"
OpName %i "i"
OpName %main "main"
OpDecorate %WorkGroupID_1 BuiltIn WorkgroupId
OpDecorate %LocalInvocationID_1 BuiltIn LocalInvocationId
OpDecorate %local_invocation_index_1 BuiltIn LocalInvocationIndex
OpDecorate %samp DescriptorSet 0
OpDecorate %samp Binding 0
OpDecorate %params_block Block
OpMemberDecorate %params_block 0 Offset 0
OpMemberDecorate %Params 0 Offset 0
OpMemberDecorate %Params 1 Offset 4
OpDecorate %params NonWritable
OpDecorate %params DescriptorSet 0
OpDecorate %params Binding 1
OpDecorate %inputTex DescriptorSet 1
OpDecorate %inputTex Binding 1
OpDecorate %outputTex NonReadable
OpDecorate %outputTex DescriptorSet 1
OpDecorate %outputTex Binding 2
OpDecorate %flip_block Block
OpMemberDecorate %flip_block 0 Offset 0
OpMemberDecorate %Flip 0 Offset 0
OpDecorate %flip NonWritable
OpDecorate %flip DescriptorSet 1
OpDecorate %flip Binding 3
OpDecorate %_arr_v3float_uint_256 ArrayStride 16
OpDecorate %_arr__arr_v3float_uint_256_uint_4 ArrayStride 4096
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%WorkGroupID_1 = OpVariable %_ptr_Input_v3uint Input
%LocalInvocationID_1 = OpVariable %_ptr_Input_v3uint Input
%_ptr_Input_uint = OpTypePointer Input %uint
%local_invocation_index_1 = OpVariable %_ptr_Input_uint Input
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%samp = OpVariable %_ptr_UniformConstant_10 UniformConstant
%Params = OpTypeStruct %uint %uint
%params_block = OpTypeStruct %Params
%_ptr_Uniform_params_block = OpTypePointer Uniform %params_block
%params = OpVariable %_ptr_Uniform_params_block Uniform
%float = OpTypeFloat 32
%17 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_17 = OpTypePointer UniformConstant %17
%inputTex = OpVariable %_ptr_UniformConstant_17 UniformConstant
%21 = OpTypeImage %float 2D 0 0 0 2 Rgba8
%_ptr_UniformConstant_21 = OpTypePointer UniformConstant %21
%outputTex = OpVariable %_ptr_UniformConstant_21 UniformConstant
%Flip = OpTypeStruct %uint
%flip_block = OpTypeStruct %Flip
%_ptr_Uniform_flip_block = OpTypePointer Uniform %flip_block
%flip = OpVariable %_ptr_Uniform_flip_block Uniform
%v3float = OpTypeVector %float 3
%uint_256 = OpConstant %uint 256
%_arr_v3float_uint_256 = OpTypeArray %v3float %uint_256
%uint_4 = OpConstant %uint 4
%_arr__arr_v3float_uint_256_uint_4 = OpTypeArray %_arr_v3float_uint_256 %uint_4
%_ptr_Workgroup__arr__arr_v3float_uint_256_uint_4 = OpTypePointer Workgroup %_arr__arr_v3float_uint_256_uint_4
%tile = OpVariable %_ptr_Workgroup__arr__arr_v3float_uint_256_uint_4 Workgroup
%void = OpTypeVoid
%33 = OpTypeFunction %void %v3uint %v3uint %uint
%_ptr_Function_uint = OpTypePointer Function %uint
%42 = OpConstantNull %uint
%uint_1024 = OpConstant %uint 1024
%bool = OpTypeBool
%_ptr_Workgroup_v3float = OpTypePointer Workgroup %v3float
%60 = OpConstantNull %v3float
%uint_64 = OpConstant %uint 64
%uint_2 = OpConstant %uint 2
%uint_264 = OpConstant %uint 264
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%int = OpTypeInt 32 1
%78 = OpConstantNull %int
%85 = OpConstantComposite %v2uint %uint_4 %uint_1
%_ptr_Function_v2uint = OpTypePointer Function %v2uint
%116 = OpConstantNull %v2uint
%v4float = OpTypeVector %float 4
%134 = OpTypeSampledImage %17
%v2float = OpTypeVector %float 2
%float_0_25 = OpConstant %float 0.25
%140 = OpConstantComposite %v2float %float_0_25 %float_0_25
%144 = OpConstantNull %float
%v2bool = OpTypeVector %bool 2
%_ptr_Function_v3float = OpTypePointer Function %v3float
%float_1 = OpConstant %float 1
%246 = OpTypeFunction %void
%main_inner = OpFunction %void None %33
%WorkGroupID = OpFunctionParameter %v3uint
%LocalInvocationID = OpFunctionParameter %v3uint
%local_invocation_index = OpFunctionParameter %uint
%39 = OpLabel
%idx = OpVariable %_ptr_Function_uint Function %42
%r = OpVariable %_ptr_Function_uint Function %42
%c = OpVariable %_ptr_Function_uint Function %42
%loadIndex = OpVariable %_ptr_Function_v2uint Function %116
%r_0 = OpVariable %_ptr_Function_uint Function %42
%c_0 = OpVariable %_ptr_Function_uint Function %42
%writeIndex = OpVariable %_ptr_Function_v2uint Function %116
%acc = OpVariable %_ptr_Function_v3float Function %60
%f = OpVariable %_ptr_Function_uint Function %42
%i = OpVariable %_ptr_Function_uint Function %42
OpStore %idx %local_invocation_index
OpBranch %43
%43 = OpLabel
OpLoopMerge %44 %45 None
OpBranch %46
%46 = OpLabel
%48 = OpLoad %uint %idx
%50 = OpULessThan %bool %48 %uint_1024
%47 = OpLogicalNot %bool %50
OpSelectionMerge %52 None
OpBranchConditional %47 %53 %52
%53 = OpLabel
OpBranch %44
%52 = OpLabel
%54 = OpLoad %uint %idx
%55 = OpUDiv %uint %54 %uint_256
%56 = OpLoad %uint %idx
%57 = OpUMod %uint %56 %uint_256
%59 = OpAccessChain %_ptr_Workgroup_v3float %tile %55 %57
OpStore %59 %60
OpBranch %45
%45 = OpLabel
%61 = OpLoad %uint %idx
%63 = OpIAdd %uint %61 %uint_64
OpStore %idx %63
OpBranch %43
%44 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
%69 = OpAccessChain %_ptr_Uniform_uint %params %uint_0 %uint_0
%70 = OpLoad %uint %69
%72 = OpISub %uint %70 %uint_1
%73 = OpUDiv %uint %72 %uint_2
%76 = OpLoad %17 %inputTex
%74 = OpImageQuerySizeLod %v2uint %76 %78
%79 = OpVectorShuffle %v2uint %WorkGroupID %WorkGroupID 0 1
%80 = OpAccessChain %_ptr_Uniform_uint %params %uint_0 %uint_1
%81 = OpLoad %uint %80
%82 = OpCompositeConstruct %v2uint %81 %uint_4
%83 = OpIMul %v2uint %79 %82
%84 = OpVectorShuffle %v2uint %LocalInvocationID %LocalInvocationID 0 1
%86 = OpIMul %v2uint %84 %85
%87 = OpIAdd %v2uint %83 %86
%88 = OpCompositeConstruct %v2uint %73 %42
%89 = OpISub %v2uint %87 %88
OpStore %r %42
OpBranch %91
%91 = OpLabel
OpLoopMerge %92 %93 None
OpBranch %94
%94 = OpLabel
%96 = OpLoad %uint %r
%97 = OpULessThan %bool %96 %uint_4
%95 = OpLogicalNot %bool %97
OpSelectionMerge %98 None
OpBranchConditional %95 %99 %98
%99 = OpLabel
OpBranch %92
%98 = OpLabel
OpStore %c %42
OpBranch %101
%101 = OpLabel
OpLoopMerge %102 %103 None
OpBranch %104
%104 = OpLabel
%106 = OpLoad %uint %c
%107 = OpULessThan %bool %106 %uint_4
%105 = OpLogicalNot %bool %107
OpSelectionMerge %108 None
OpBranchConditional %105 %109 %108
%109 = OpLabel
OpBranch %102
%108 = OpLabel
%110 = OpLoad %uint %c
%111 = OpLoad %uint %r
%112 = OpCompositeConstruct %v2uint %110 %111
%113 = OpIAdd %v2uint %89 %112
OpStore %loadIndex %113
%117 = OpAccessChain %_ptr_Uniform_uint %flip %uint_0 %uint_0
%118 = OpLoad %uint %117
%119 = OpINotEqual %bool %118 %42
OpSelectionMerge %120 None
OpBranchConditional %119 %121 %120
%121 = OpLabel
%122 = OpLoad %v2uint %loadIndex
%123 = OpVectorShuffle %v2uint %122 %122 1 0
OpStore %loadIndex %123
OpBranch %120
%120 = OpLabel
%124 = OpLoad %uint %r
%125 = OpCompositeExtract %uint %LocalInvocationID 0
%126 = OpIMul %uint %uint_4 %125
%127 = OpLoad %uint %c
%128 = OpIAdd %uint %126 %127
%129 = OpAccessChain %_ptr_Workgroup_v3float %tile %124 %128
%132 = OpLoad %10 %samp
%133 = OpLoad %17 %inputTex
%135 = OpSampledImage %134 %133 %132
%138 = OpLoad %v2uint %loadIndex
%136 = OpConvertUToF %v2float %138
%141 = OpFAdd %v2float %136 %140
%142 = OpConvertUToF %v2float %74
%143 = OpFDiv %v2float %141 %142
%130 = OpImageSampleExplicitLod %v4float %135 %143 Lod %144
%145 = OpVectorShuffle %v3float %130 %130 0 1 2
OpStore %129 %145
OpBranch %103
%103 = OpLabel
%146 = OpLoad %uint %c
%147 = OpIAdd %uint %146 %uint_1
OpStore %c %147
OpBranch %101
%102 = OpLabel
OpBranch %93
%93 = OpLabel
%148 = OpLoad %uint %r
%149 = OpIAdd %uint %148 %uint_1
OpStore %r %149
OpBranch %91
%92 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
OpStore %r_0 %42
OpBranch %152
%152 = OpLabel
OpLoopMerge %153 %154 None
OpBranch %155
%155 = OpLabel
%157 = OpLoad %uint %r_0
%158 = OpULessThan %bool %157 %uint_4
%156 = OpLogicalNot %bool %158
OpSelectionMerge %159 None
OpBranchConditional %156 %160 %159
%160 = OpLabel
OpBranch %153
%159 = OpLabel
OpStore %c_0 %42
OpBranch %162
%162 = OpLabel
OpLoopMerge %163 %164 None
OpBranch %165
%165 = OpLabel
%167 = OpLoad %uint %c_0
%168 = OpULessThan %bool %167 %uint_4
%166 = OpLogicalNot %bool %168
OpSelectionMerge %169 None
OpBranchConditional %166 %170 %169
%170 = OpLabel
OpBranch %163
%169 = OpLabel
%171 = OpLoad %uint %c_0
%172 = OpLoad %uint %r_0
%173 = OpCompositeConstruct %v2uint %171 %172
%174 = OpIAdd %v2uint %89 %173
OpStore %writeIndex %174
%176 = OpAccessChain %_ptr_Uniform_uint %flip %uint_0 %uint_0
%177 = OpLoad %uint %176
%178 = OpINotEqual %bool %177 %42
OpSelectionMerge %179 None
OpBranchConditional %178 %180 %179
%180 = OpLabel
%181 = OpLoad %v2uint %writeIndex
%182 = OpVectorShuffle %v2uint %181 %181 1 0
OpStore %writeIndex %182
OpBranch %179
%179 = OpLabel
%183 = OpCompositeExtract %uint %LocalInvocationID 0
%184 = OpIMul %uint %uint_4 %183
%185 = OpLoad %uint %c_0
%186 = OpIAdd %uint %184 %185
%187 = OpUGreaterThanEqual %bool %186 %73
OpSelectionMerge %188 None
OpBranchConditional %187 %189 %188
%189 = OpLabel
%190 = OpISub %uint %uint_256 %73
%191 = OpULessThan %bool %186 %190
OpBranch %188
%188 = OpLabel
%192 = OpPhi %bool %187 %179 %191 %189
OpSelectionMerge %193 None
OpBranchConditional %192 %194 %193
%194 = OpLabel
%196 = OpLoad %v2uint %writeIndex
%197 = OpULessThan %v2bool %196 %74
%195 = OpAll %bool %197
OpBranch %193
%193 = OpLabel
%199 = OpPhi %bool %192 %188 %195 %194
OpSelectionMerge %200 None
OpBranchConditional %199 %201 %200
%201 = OpLabel
OpStore %acc %60
OpStore %f %42
OpBranch %205
%205 = OpLabel
OpLoopMerge %206 %207 None
OpBranch %208
%208 = OpLabel
%210 = OpLoad %uint %f
%211 = OpAccessChain %_ptr_Uniform_uint %params %uint_0 %uint_0
%212 = OpLoad %uint %211
%213 = OpULessThan %bool %210 %212
%209 = OpLogicalNot %bool %213
OpSelectionMerge %214 None
OpBranchConditional %209 %215 %214
%215 = OpLabel
OpBranch %206
%214 = OpLabel
%216 = OpLoad %uint %f
%217 = OpIAdd %uint %186 %216
%218 = OpISub %uint %217 %73
OpStore %i %218
%220 = OpLoad %v3float %acc
%223 = OpAccessChain %_ptr_Uniform_uint %params %uint_0 %uint_0
%224 = OpLoad %uint %223
%222 = OpConvertUToF %float %224
%225 = OpFDiv %float %float_1 %222
%226 = OpLoad %uint %r_0
%227 = OpLoad %uint %i
%228 = OpAccessChain %_ptr_Workgroup_v3float %tile %226 %227
%229 = OpLoad %v3float %228
%230 = OpVectorTimesScalar %v3float %229 %225
%231 = OpFAdd %v3float %220 %230
OpStore %acc %231
OpBranch %207
%207 = OpLabel
%232 = OpLoad %uint %f
%233 = OpIAdd %uint %232 %uint_1
OpStore %f %233
OpBranch %205
%206 = OpLabel
%235 = OpLoad %21 %outputTex
%236 = OpLoad %v2uint %writeIndex
%237 = OpLoad %v3float %acc
%238 = OpCompositeExtract %float %237 0
%239 = OpCompositeExtract %float %237 1
%240 = OpCompositeExtract %float %237 2
%241 = OpCompositeConstruct %v4float %238 %239 %240 %float_1
OpImageWrite %235 %236 %241
OpBranch %200
%200 = OpLabel
OpBranch %164
%164 = OpLabel
%242 = OpLoad %uint %c_0
%243 = OpIAdd %uint %242 %uint_1
OpStore %c_0 %243
OpBranch %162
%163 = OpLabel
OpBranch %154
%154 = OpLabel
%244 = OpLoad %uint %r_0
%245 = OpIAdd %uint %244 %uint_1
OpStore %r_0 %245
OpBranch %152
%153 = OpLabel
OpReturn
OpFunctionEnd
%main = OpFunction %void None %246
%248 = OpLabel
%250 = OpLoad %v3uint %WorkGroupID_1
%251 = OpLoad %v3uint %LocalInvocationID_1
%252 = OpLoad %uint %local_invocation_index_1
%249 = OpFunctionCall %void %main_inner %250 %251 %252
OpReturn
OpFunctionEnd