blob: ddb9a0aded1899711d619c4a1ccb0ed1be1cf1ec [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 212
; Schema: 0
OpCapability Shader
%59 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %tint_symbol %tint_symbol_2
OpExecutionMode %main OriginUpperLeft
OpName %buf0 "buf0"
OpMemberName %buf0 0 "resolution"
OpName %x_13 "x_13"
OpName %gl_FragCoord "gl_FragCoord"
OpName %buf1 "buf1"
OpMemberName %buf1 0 "injectionSwitch"
OpName %x_19 "x_19"
OpName %x_GLF_color "x_GLF_color"
OpName %tint_symbol "tint_symbol"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %compute_value_f1_f1_ "compute_value_f1_f1_"
OpName %limit "limit"
OpName %thirty_two "thirty_two"
OpName %result "result"
OpName %i "i"
OpName %main_1 "main_1"
OpName %c "c"
OpName %thirty_two_1 "thirty_two_1"
OpName %param "param"
OpName %param_1 "param_1"
OpName %param_2 "param_2"
OpName %param_3 "param_3"
OpName %x_61 "x_61"
OpName %i_1 "i_1"
OpName %j "j"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %tint_symbol_3 "tint_symbol_3"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %main "main"
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_13 NonWritable
OpDecorate %x_13 DescriptorSet 0
OpDecorate %x_13 Binding 0
OpDecorate %buf1 Block
OpMemberDecorate %buf1 0 Offset 0
OpDecorate %x_19 NonWritable
OpDecorate %x_19 DescriptorSet 0
OpDecorate %x_19 Binding 1
OpDecorate %tint_symbol BuiltIn FragCoord
OpDecorate %tint_symbol_2 Location 0
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_13 = OpVariable %_ptr_Uniform_buf0 Uniform
%v4float = OpTypeVector %float 4
%_ptr_Private_v4float = OpTypePointer Private %v4float
%9 = OpConstantNull %v4float
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %9
%buf1 = OpTypeStruct %v2float
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
%x_19 = OpVariable %_ptr_Uniform_buf1 Uniform
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %9
%_ptr_Input_v4float = OpTypePointer Input %v4float
%tint_symbol = OpVariable %_ptr_Input_v4float Input
%_ptr_Output_v4float = OpTypePointer Output %v4float
%tint_symbol_2 = OpVariable %_ptr_Output_v4float Output %9
%_ptr_Function_float = OpTypePointer Function %float
%18 = OpTypeFunction %float %_ptr_Function_float %_ptr_Function_float
%25 = OpConstantNull %float
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
%29 = OpConstantNull %int
%float_n0_5 = OpConstant %float -0.5
%int_1 = OpConstant %int 1
%int_800 = OpConstant %int 800
%bool = OpTypeBool
%int_32 = OpConstant %int 32
%int_0 = OpConstant %int 0
%float_0_400000006 = OpConstant %float 0.400000006
%float_0_00999999978 = OpConstant %float 0.00999999978
%float_100 = OpConstant %float 100
%void = OpTypeVoid
%84 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
%_ptr_Function_v3float = OpTypePointer Function %v3float
%91 = OpConstantNull %v3float
%float_7 = OpConstant %float 7
%float_8 = OpConstant %float 8
%float_9 = OpConstant %float 9
%103 = OpConstantComposite %v3float %float_7 %float_8 %float_9
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_float = OpTypePointer Uniform %float
%_ptr_Private_float = OpTypePointer Private %float
%uint_1 = OpConstant %uint 1
%true = OpConstantTrue %bool
%uint_2 = OpConstant %uint 2
%int_3 = OpConstant %int 3
%float_1 = OpConstant %float 1
%float_0 = OpConstant %float 0
%main_out = OpTypeStruct %v4float
%199 = OpTypeFunction %void %main_out
%compute_value_f1_f1_ = OpFunction %float None %18
%limit = OpFunctionParameter %_ptr_Function_float
%thirty_two = OpFunctionParameter %_ptr_Function_float
%23 = OpLabel
%result = OpVariable %_ptr_Function_float Function %25
%i = OpVariable %_ptr_Function_int Function %29
OpStore %result %float_n0_5
OpStore %i %int_1
OpBranch %32
%32 = OpLabel
OpLoopMerge %33 %34 None
OpBranch %35
%35 = OpLabel
%36 = OpLoad %int %i
%38 = OpSLessThan %bool %36 %int_800
OpSelectionMerge %40 None
OpBranchConditional %38 %41 %42
%41 = OpLabel
OpBranch %40
%42 = OpLabel
OpBranch %33
%40 = OpLabel
%43 = OpLoad %int %i
%45 = OpSMod %int %43 %int_32
%47 = OpIEqual %bool %45 %int_0
OpSelectionMerge %48 None
OpBranchConditional %47 %49 %50
%49 = OpLabel
%51 = OpLoad %float %result
%53 = OpFAdd %float %51 %float_0_400000006
OpStore %result %53
OpBranch %48
%50 = OpLabel
%54 = OpLoad %int %i
%56 = OpLoad %float %thirty_two
%57 = OpConvertSToF %float %54
%58 = OpExtInst %float %59 RoundEven %56
%61 = OpConvertSToF %float %54
%62 = OpExtInst %float %59 RoundEven %56
%63 = OpFDiv %float %61 %62
%60 = OpExtInst %float %59 Floor %63
%64 = OpFMul %float %58 %60
%65 = OpFSub %float %57 %64
%67 = OpFOrdLessThanEqual %bool %65 %float_0_00999999978
OpSelectionMerge %68 None
OpBranchConditional %67 %69 %68
%69 = OpLabel
%70 = OpLoad %float %result
%72 = OpFAdd %float %70 %float_100
OpStore %result %72
OpBranch %68
%68 = OpLabel
OpBranch %48
%48 = OpLabel
%73 = OpLoad %int %i
%75 = OpLoad %float %limit
%76 = OpConvertSToF %float %73
%77 = OpFOrdGreaterThanEqual %bool %76 %75
OpSelectionMerge %78 None
OpBranchConditional %77 %79 %78
%79 = OpLabel
%80 = OpLoad %float %result
OpReturnValue %80
%78 = OpLabel
OpBranch %34
%34 = OpLabel
%81 = OpLoad %int %i
%82 = OpIAdd %int %81 %int_1
OpStore %i %82
OpBranch %32
%33 = OpLabel
%83 = OpLoad %float %result
OpReturnValue %83
OpFunctionEnd
%main_1 = OpFunction %void None %84
%87 = OpLabel
%c = OpVariable %_ptr_Function_v3float Function %91
%thirty_two_1 = OpVariable %_ptr_Function_float Function %25
%param = OpVariable %_ptr_Function_float Function %25
%param_1 = OpVariable %_ptr_Function_float Function %25
%param_2 = OpVariable %_ptr_Function_float Function %25
%param_3 = OpVariable %_ptr_Function_float Function %25
%x_61 = OpVariable %_ptr_Function_v3float Function %91
%i_1 = OpVariable %_ptr_Function_int Function %29
%j = OpVariable %_ptr_Function_float Function %25
OpStore %c %103
%107 = OpAccessChain %_ptr_Uniform_float %x_13 %uint_0 %uint_0
%108 = OpLoad %float %107
%110 = OpFDiv %float %108 %float_8
%109 = OpExtInst %float %59 RoundEven %110
OpStore %thirty_two_1 %109
%112 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_0
%113 = OpLoad %float %112
OpStore %param %113
%114 = OpLoad %float %thirty_two_1
OpStore %param_1 %114
%115 = OpFunctionCall %float %compute_value_f1_f1_ %param %param_1
%118 = OpAccessChain %_ptr_Function_float %c %uint_0
OpStore %118 %115
%120 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%121 = OpLoad %float %120
OpStore %param_2 %121
%122 = OpLoad %float %thirty_two_1
OpStore %param_3 %122
%123 = OpFunctionCall %float %compute_value_f1_f1_ %param_2 %param_3
%126 = OpAccessChain %_ptr_Function_float %c %uint_1
OpStore %126 %123
%127 = OpAccessChain %_ptr_Function_float %c %uint_0
%128 = OpLoad %float %127
OpSelectionMerge %130 None
OpBranchConditional %true %131 %132
%131 = OpLabel
%133 = OpLoad %v3float %c
OpStore %x_61 %133
OpBranch %130
%132 = OpLabel
%134 = OpLoad %v3float %c
%135 = OpAccessChain %_ptr_Uniform_float %x_19 %uint_0 %uint_0
%136 = OpLoad %float %135
%137 = OpVectorTimesScalar %v3float %134 %136
OpStore %x_61 %137
OpBranch %130
%130 = OpLabel
%138 = OpAccessChain %_ptr_Function_float %x_61 %uint_1
%139 = OpLoad %float %138
%141 = OpAccessChain %_ptr_Function_float %c %uint_2
%142 = OpFAdd %float %128 %139
OpStore %141 %142
OpStore %i_1 %int_0
OpBranch %143
%143 = OpLabel
OpLoopMerge %144 %145 None
OpBranch %146
%146 = OpLabel
%147 = OpLoad %int %i_1
%149 = OpSLessThan %bool %147 %int_3
OpSelectionMerge %150 None
OpBranchConditional %149 %151 %152
%151 = OpLabel
OpBranch %150
%152 = OpLabel
OpBranch %144
%150 = OpLabel
%153 = OpLoad %int %i_1
%154 = OpAccessChain %_ptr_Function_float %c %153
%155 = OpLoad %float %154
%157 = OpFOrdGreaterThanEqual %bool %155 %float_1
OpSelectionMerge %158 None
OpBranchConditional %157 %159 %158
%159 = OpLabel
%160 = OpLoad %int %i_1
%161 = OpLoad %int %i_1
%162 = OpAccessChain %_ptr_Function_float %c %161
%163 = OpLoad %float %162
%164 = OpLoad %int %i_1
%165 = OpAccessChain %_ptr_Function_float %c %164
%166 = OpLoad %float %165
%167 = OpAccessChain %_ptr_Function_float %c %160
%168 = OpFMul %float %163 %166
OpStore %167 %168
OpBranch %158
%158 = OpLabel
OpStore %j %float_0
OpBranch %170
%170 = OpLabel
OpLoopMerge %171 %172 None
OpBranch %173
%173 = OpLabel
%174 = OpAccessChain %_ptr_Uniform_float %x_19 %uint_0 %uint_0
%175 = OpLoad %float %174
%176 = OpAccessChain %_ptr_Uniform_float %x_19 %uint_0 %uint_1
%177 = OpLoad %float %176
%178 = OpFOrdGreaterThan %bool %175 %177
OpSelectionMerge %179 None
OpBranchConditional %178 %180 %181
%180 = OpLabel
OpBranch %179
%181 = OpLabel
OpBranch %171
%179 = OpLabel
%182 = OpLoad %float %j
%183 = OpAccessChain %_ptr_Uniform_float %x_19 %uint_0 %uint_0
%184 = OpLoad %float %183
%185 = OpFOrdGreaterThanEqual %bool %182 %184
OpSelectionMerge %186 None
OpBranchConditional %185 %187 %186
%187 = OpLabel
OpBranch %171
%186 = OpLabel
%188 = OpLoad %float %j
%189 = OpFAdd %float %188 %float_1
OpStore %j %189
OpBranch %172
%172 = OpLabel
OpBranch %170
%171 = OpLabel
OpBranch %145
%145 = OpLabel
%190 = OpLoad %int %i_1
%191 = OpIAdd %int %190 %int_1
OpStore %i_1 %191
OpBranch %143
%144 = OpLabel
%192 = OpLoad %v3float %c
%194 = OpExtInst %v3float %59 FAbs %192
%193 = OpExtInst %v3float %59 Normalize %194
%195 = OpCompositeExtract %float %193 0
%196 = OpCompositeExtract %float %193 1
%197 = OpCompositeExtract %float %193 2
%198 = OpCompositeConstruct %v4float %195 %196 %197 %float_1
OpStore %x_GLF_color %198
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %199
%tint_symbol_1 = OpFunctionParameter %main_out
%203 = OpLabel
%204 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %204
OpReturn
OpFunctionEnd
%main = OpFunction %void None %84
%206 = OpLabel
%207 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %207
%208 = OpFunctionCall %void %main_1
%210 = OpLoad %v4float %x_GLF_color
%211 = OpCompositeConstruct %main_out %210
%209 = OpFunctionCall %void %tint_symbol_3 %211
OpReturn
OpFunctionEnd