blob: b1caf4625f406cb176d9cf28933941152fc33e64 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 191
; 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 %x_GLF_color "x_GLF_color"
OpName %buf1 "buf1"
OpMemberName %buf1 0 "injectionSwitch"
OpName %x_20 "x_20"
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 %i_1 "i_1"
OpName %x_58 "x_58"
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_20 NonWritable
OpDecorate %x_20 DescriptorSet 0
OpDecorate %x_20 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
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %9
%buf1 = OpTypeStruct %v2float
%_ptr_Uniform_buf1 = OpTypePointer Uniform %buf1
%x_20 = OpVariable %_ptr_Uniform_buf1 Uniform
%_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
%102 = 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
%uint_2 = OpConstant %uint 2
%int_3 = OpConstant %int 3
%float_1 = OpConstant %float 1
%main_out = OpTypeStruct %v4float
%178 = 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
%i_1 = OpVariable %_ptr_Function_int Function %29
%x_58 = OpVariable %_ptr_Function_v3float Function %91
OpStore %c %102
%106 = OpAccessChain %_ptr_Uniform_float %x_13 %uint_0 %uint_0
%107 = OpLoad %float %106
%109 = OpFDiv %float %107 %float_8
%108 = OpExtInst %float %59 RoundEven %109
OpStore %thirty_two_1 %108
%111 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_0
%112 = OpLoad %float %111
OpStore %param %112
%113 = OpLoad %float %thirty_two_1
OpStore %param_1 %113
%114 = OpFunctionCall %float %compute_value_f1_f1_ %param %param_1
%117 = OpAccessChain %_ptr_Function_float %c %uint_0
OpStore %117 %114
%119 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%120 = OpLoad %float %119
OpStore %param_2 %120
%121 = OpLoad %float %thirty_two_1
OpStore %param_3 %121
%122 = OpFunctionCall %float %compute_value_f1_f1_ %param_2 %param_3
%125 = OpAccessChain %_ptr_Function_float %c %uint_1
OpStore %125 %122
%126 = OpAccessChain %_ptr_Function_float %c %uint_0
%127 = OpLoad %float %126
%128 = OpAccessChain %_ptr_Function_float %c %uint_1
%129 = OpLoad %float %128
%131 = OpAccessChain %_ptr_Function_float %c %uint_2
%132 = OpFAdd %float %127 %129
OpStore %131 %132
OpStore %i_1 %int_0
OpBranch %133
%133 = OpLabel
OpLoopMerge %134 %135 None
OpBranch %136
%136 = OpLabel
%137 = OpLoad %int %i_1
%139 = OpSLessThan %bool %137 %int_3
OpSelectionMerge %140 None
OpBranchConditional %139 %141 %142
%141 = OpLabel
OpBranch %140
%142 = OpLabel
OpBranch %134
%140 = OpLabel
%143 = OpLoad %int %i_1
%144 = OpAccessChain %_ptr_Function_float %c %143
%145 = OpLoad %float %144
%147 = OpFOrdGreaterThanEqual %bool %145 %float_1
OpSelectionMerge %148 None
OpBranchConditional %147 %149 %148
%149 = OpLabel
%150 = OpLoad %int %i_1
%151 = OpLoad %int %i_1
%152 = OpAccessChain %_ptr_Function_float %c %151
%153 = OpLoad %float %152
%154 = OpLoad %int %i_1
%155 = OpAccessChain %_ptr_Function_float %c %154
%156 = OpLoad %float %155
%157 = OpAccessChain %_ptr_Function_float %c %150
%158 = OpFMul %float %153 %156
OpStore %157 %158
OpBranch %148
%148 = OpLabel
OpBranch %135
%135 = OpLabel
%159 = OpLoad %int %i_1
%160 = OpIAdd %int %159 %int_1
OpStore %i_1 %160
OpBranch %133
%134 = OpLabel
%161 = OpAccessChain %_ptr_Uniform_float %x_20 %uint_0 %uint_0
%162 = OpLoad %float %161
%163 = OpAccessChain %_ptr_Uniform_float %x_20 %uint_0 %uint_1
%164 = OpLoad %float %163
%165 = OpFOrdLessThan %bool %162 %164
OpSelectionMerge %166 None
OpBranchConditional %165 %167 %168
%167 = OpLabel
%169 = OpLoad %v3float %c
%170 = OpExtInst %v3float %59 FAbs %169
OpStore %x_58 %170
OpBranch %166
%168 = OpLabel
%171 = OpLoad %v3float %c
OpStore %x_58 %171
OpBranch %166
%166 = OpLabel
%172 = OpLoad %v3float %x_58
%173 = OpExtInst %v3float %59 Normalize %172
%174 = OpCompositeExtract %float %173 0
%175 = OpCompositeExtract %float %173 1
%176 = OpCompositeExtract %float %173 2
%177 = OpCompositeConstruct %v4float %174 %175 %176 %float_1
OpStore %x_GLF_color %177
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %178
%tint_symbol_1 = OpFunctionParameter %main_out
%182 = OpLabel
%183 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %183
OpReturn
OpFunctionEnd
%main = OpFunction %void None %84
%185 = OpLabel
%186 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %186
%187 = OpFunctionCall %void %main_1
%189 = OpLoad %v4float %x_GLF_color
%190 = OpCompositeConstruct %main_out %189
%188 = OpFunctionCall %void %tint_symbol_3 %190
OpReturn
OpFunctionEnd