blob: 9faf394f6234935ee53bb8d72ce68a247addf8c5 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 207
; 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
%79 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
%_ptr_Function_v3float = OpTypePointer Function %v3float
%86 = OpConstantNull %v3float
%float_7 = OpConstant %float 7
%float_8 = OpConstant %float 8
%float_9 = OpConstant %float 9
%98 = 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
%194 = 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
%60 = OpFRem %float %57 %58
%62 = OpFOrdLessThanEqual %bool %60 %float_0_00999999978
OpSelectionMerge %63 None
OpBranchConditional %62 %64 %63
%64 = OpLabel
%65 = OpLoad %float %result
%67 = OpFAdd %float %65 %float_100
OpStore %result %67
OpBranch %63
%63 = OpLabel
OpBranch %48
%48 = OpLabel
%68 = OpLoad %int %i
%70 = OpLoad %float %limit
%71 = OpConvertSToF %float %68
%72 = OpFOrdGreaterThanEqual %bool %71 %70
OpSelectionMerge %73 None
OpBranchConditional %72 %74 %73
%74 = OpLabel
%75 = OpLoad %float %result
OpReturnValue %75
%73 = OpLabel
OpBranch %34
%34 = OpLabel
%76 = OpLoad %int %i
%77 = OpIAdd %int %76 %int_1
OpStore %i %77
OpBranch %32
%33 = OpLabel
%78 = OpLoad %float %result
OpReturnValue %78
OpFunctionEnd
%main_1 = OpFunction %void None %79
%82 = OpLabel
%c = OpVariable %_ptr_Function_v3float Function %86
%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 %86
%i_1 = OpVariable %_ptr_Function_int Function %29
%j = OpVariable %_ptr_Function_float Function %25
OpStore %c %98
%102 = OpAccessChain %_ptr_Uniform_float %x_13 %uint_0 %uint_0
%103 = OpLoad %float %102
%105 = OpFDiv %float %103 %float_8
%104 = OpExtInst %float %59 RoundEven %105
OpStore %thirty_two_1 %104
%107 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_0
%108 = OpLoad %float %107
OpStore %param %108
%109 = OpLoad %float %thirty_two_1
OpStore %param_1 %109
%110 = OpFunctionCall %float %compute_value_f1_f1_ %param %param_1
%113 = OpAccessChain %_ptr_Function_float %c %uint_0
OpStore %113 %110
%115 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%116 = OpLoad %float %115
OpStore %param_2 %116
%117 = OpLoad %float %thirty_two_1
OpStore %param_3 %117
%118 = OpFunctionCall %float %compute_value_f1_f1_ %param_2 %param_3
%121 = OpAccessChain %_ptr_Function_float %c %uint_1
OpStore %121 %118
%122 = OpAccessChain %_ptr_Function_float %c %uint_0
%123 = OpLoad %float %122
OpSelectionMerge %125 None
OpBranchConditional %true %126 %127
%126 = OpLabel
%128 = OpLoad %v3float %c
OpStore %x_61 %128
OpBranch %125
%127 = OpLabel
%129 = OpLoad %v3float %c
%130 = OpAccessChain %_ptr_Uniform_float %x_19 %uint_0 %uint_0
%131 = OpLoad %float %130
%132 = OpVectorTimesScalar %v3float %129 %131
OpStore %x_61 %132
OpBranch %125
%125 = OpLabel
%133 = OpAccessChain %_ptr_Function_float %x_61 %uint_1
%134 = OpLoad %float %133
%136 = OpAccessChain %_ptr_Function_float %c %uint_2
%137 = OpFAdd %float %123 %134
OpStore %136 %137
OpStore %i_1 %int_0
OpBranch %138
%138 = OpLabel
OpLoopMerge %139 %140 None
OpBranch %141
%141 = OpLabel
%142 = OpLoad %int %i_1
%144 = OpSLessThan %bool %142 %int_3
OpSelectionMerge %145 None
OpBranchConditional %144 %146 %147
%146 = OpLabel
OpBranch %145
%147 = OpLabel
OpBranch %139
%145 = OpLabel
%148 = OpLoad %int %i_1
%149 = OpAccessChain %_ptr_Function_float %c %148
%150 = OpLoad %float %149
%152 = OpFOrdGreaterThanEqual %bool %150 %float_1
OpSelectionMerge %153 None
OpBranchConditional %152 %154 %153
%154 = OpLabel
%155 = OpLoad %int %i_1
%156 = OpLoad %int %i_1
%157 = OpAccessChain %_ptr_Function_float %c %156
%158 = OpLoad %float %157
%159 = OpLoad %int %i_1
%160 = OpAccessChain %_ptr_Function_float %c %159
%161 = OpLoad %float %160
%162 = OpAccessChain %_ptr_Function_float %c %155
%163 = OpFMul %float %158 %161
OpStore %162 %163
OpBranch %153
%153 = OpLabel
OpStore %j %float_0
OpBranch %165
%165 = OpLabel
OpLoopMerge %166 %167 None
OpBranch %168
%168 = OpLabel
%169 = OpAccessChain %_ptr_Uniform_float %x_19 %uint_0 %uint_0
%170 = OpLoad %float %169
%171 = OpAccessChain %_ptr_Uniform_float %x_19 %uint_0 %uint_1
%172 = OpLoad %float %171
%173 = OpFOrdGreaterThan %bool %170 %172
OpSelectionMerge %174 None
OpBranchConditional %173 %175 %176
%175 = OpLabel
OpBranch %174
%176 = OpLabel
OpBranch %166
%174 = OpLabel
%177 = OpLoad %float %j
%178 = OpAccessChain %_ptr_Uniform_float %x_19 %uint_0 %uint_0
%179 = OpLoad %float %178
%180 = OpFOrdGreaterThanEqual %bool %177 %179
OpSelectionMerge %181 None
OpBranchConditional %180 %182 %181
%182 = OpLabel
OpBranch %166
%181 = OpLabel
%183 = OpLoad %float %j
%184 = OpFAdd %float %183 %float_1
OpStore %j %184
OpBranch %167
%167 = OpLabel
OpBranch %165
%166 = OpLabel
OpBranch %140
%140 = OpLabel
%185 = OpLoad %int %i_1
%186 = OpIAdd %int %185 %int_1
OpStore %i_1 %186
OpBranch %138
%139 = OpLabel
%187 = OpLoad %v3float %c
%189 = OpExtInst %v3float %59 FAbs %187
%188 = OpExtInst %v3float %59 Normalize %189
%190 = OpCompositeExtract %float %188 0
%191 = OpCompositeExtract %float %188 1
%192 = OpCompositeExtract %float %188 2
%193 = OpCompositeConstruct %v4float %190 %191 %192 %float_1
OpStore %x_GLF_color %193
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %194
%tint_symbol_1 = OpFunctionParameter %main_out
%198 = OpLabel
%199 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %199
OpReturn
OpFunctionEnd
%main = OpFunction %void None %79
%201 = OpLabel
%202 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %202
%203 = OpFunctionCall %void %main_1
%205 = OpLoad %v4float %x_GLF_color
%206 = OpCompositeConstruct %main_out %205
%204 = OpFunctionCall %void %tint_symbol_3 %206
OpReturn
OpFunctionEnd