blob: dfc561e111504e9dd37522a65a26dfc2bb003da7 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 172
; Schema: 0
OpCapability Shader
%56 = 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 %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 %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 %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
%_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
%15 = OpTypeFunction %float %_ptr_Function_float %_ptr_Function_float
%22 = OpConstantNull %float
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
%26 = 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
%76 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
%_ptr_Function_v3float = OpTypePointer Function %v3float
%83 = OpConstantNull %v3float
%float_7 = OpConstant %float 7
%float_8 = OpConstant %float 8
%float_9 = OpConstant %float 9
%93 = 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
%159 = OpTypeFunction %void %main_out
%compute_value_f1_f1_ = OpFunction %float None %15
%limit = OpFunctionParameter %_ptr_Function_float
%thirty_two = OpFunctionParameter %_ptr_Function_float
%20 = OpLabel
%result = OpVariable %_ptr_Function_float Function %22
%i = OpVariable %_ptr_Function_int Function %26
OpStore %result %float_n0_5
OpStore %i %int_1
OpBranch %29
%29 = OpLabel
OpLoopMerge %30 %31 None
OpBranch %32
%32 = OpLabel
%33 = OpLoad %int %i
%35 = OpSLessThan %bool %33 %int_800
OpSelectionMerge %37 None
OpBranchConditional %35 %38 %39
%38 = OpLabel
OpBranch %37
%39 = OpLabel
OpBranch %30
%37 = OpLabel
%40 = OpLoad %int %i
%42 = OpSMod %int %40 %int_32
%44 = OpIEqual %bool %42 %int_0
OpSelectionMerge %45 None
OpBranchConditional %44 %46 %47
%46 = OpLabel
%48 = OpLoad %float %result
%50 = OpFAdd %float %48 %float_0_400000006
OpStore %result %50
OpBranch %45
%47 = OpLabel
%51 = OpLoad %int %i
%53 = OpLoad %float %thirty_two
%54 = OpConvertSToF %float %51
%55 = OpExtInst %float %56 RoundEven %53
%57 = OpFRem %float %54 %55
%59 = OpFOrdLessThanEqual %bool %57 %float_0_00999999978
OpSelectionMerge %60 None
OpBranchConditional %59 %61 %60
%61 = OpLabel
%62 = OpLoad %float %result
%64 = OpFAdd %float %62 %float_100
OpStore %result %64
OpBranch %60
%60 = OpLabel
OpBranch %45
%45 = OpLabel
%65 = OpLoad %int %i
%67 = OpLoad %float %limit
%68 = OpConvertSToF %float %65
%69 = OpFOrdGreaterThanEqual %bool %68 %67
OpSelectionMerge %70 None
OpBranchConditional %69 %71 %70
%71 = OpLabel
%72 = OpLoad %float %result
OpReturnValue %72
%70 = OpLabel
OpBranch %31
%31 = OpLabel
%73 = OpLoad %int %i
%74 = OpIAdd %int %73 %int_1
OpStore %i %74
OpBranch %29
%30 = OpLabel
%75 = OpLoad %float %result
OpReturnValue %75
OpFunctionEnd
%main_1 = OpFunction %void None %76
%79 = OpLabel
%c = OpVariable %_ptr_Function_v3float Function %83
%thirty_two_1 = OpVariable %_ptr_Function_float Function %22
%param = OpVariable %_ptr_Function_float Function %22
%param_1 = OpVariable %_ptr_Function_float Function %22
%param_2 = OpVariable %_ptr_Function_float Function %22
%param_3 = OpVariable %_ptr_Function_float Function %22
%i_1 = OpVariable %_ptr_Function_int Function %26
OpStore %c %93
%97 = OpAccessChain %_ptr_Uniform_float %x_13 %uint_0 %uint_0
%98 = OpLoad %float %97
%100 = OpFDiv %float %98 %float_8
%99 = OpExtInst %float %56 RoundEven %100
OpStore %thirty_two_1 %99
%102 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_0
%103 = OpLoad %float %102
OpStore %param %103
%104 = OpLoad %float %thirty_two_1
OpStore %param_1 %104
%105 = OpFunctionCall %float %compute_value_f1_f1_ %param %param_1
%108 = OpAccessChain %_ptr_Function_float %c %uint_0
OpStore %108 %105
%110 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%111 = OpLoad %float %110
OpStore %param_2 %111
%112 = OpLoad %float %thirty_two_1
OpStore %param_3 %112
%113 = OpFunctionCall %float %compute_value_f1_f1_ %param_2 %param_3
%116 = OpAccessChain %_ptr_Function_float %c %uint_1
OpStore %116 %113
%117 = OpAccessChain %_ptr_Function_float %c %uint_0
%118 = OpLoad %float %117
%119 = OpAccessChain %_ptr_Function_float %c %uint_1
%120 = OpLoad %float %119
%122 = OpAccessChain %_ptr_Function_float %c %uint_2
%123 = OpFAdd %float %118 %120
OpStore %122 %123
OpStore %i_1 %int_0
OpBranch %124
%124 = OpLabel
OpLoopMerge %125 %126 None
OpBranch %127
%127 = OpLabel
%128 = OpLoad %int %i_1
%130 = OpSLessThan %bool %128 %int_3
OpSelectionMerge %131 None
OpBranchConditional %130 %132 %133
%132 = OpLabel
OpBranch %131
%133 = OpLabel
OpBranch %125
%131 = OpLabel
%134 = OpLoad %int %i_1
%135 = OpAccessChain %_ptr_Function_float %c %134
%136 = OpLoad %float %135
%138 = OpFOrdGreaterThanEqual %bool %136 %float_1
OpSelectionMerge %139 None
OpBranchConditional %138 %140 %139
%140 = OpLabel
%141 = OpLoad %int %i_1
%142 = OpLoad %int %i_1
%143 = OpAccessChain %_ptr_Function_float %c %142
%144 = OpLoad %float %143
%145 = OpLoad %int %i_1
%146 = OpAccessChain %_ptr_Function_float %c %145
%147 = OpLoad %float %146
%148 = OpAccessChain %_ptr_Function_float %c %141
%149 = OpFMul %float %144 %147
OpStore %148 %149
OpBranch %139
%139 = OpLabel
OpBranch %126
%126 = OpLabel
%150 = OpLoad %int %i_1
%151 = OpIAdd %int %150 %int_1
OpStore %i_1 %151
OpBranch %124
%125 = OpLabel
%152 = OpLoad %v3float %c
%154 = OpExtInst %v3float %56 FAbs %152
%153 = OpExtInst %v3float %56 Normalize %154
%155 = OpCompositeExtract %float %153 0
%156 = OpCompositeExtract %float %153 1
%157 = OpCompositeExtract %float %153 2
%158 = OpCompositeConstruct %v4float %155 %156 %157 %float_1
OpStore %x_GLF_color %158
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %159
%tint_symbol_1 = OpFunctionParameter %main_out
%163 = OpLabel
%164 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %164
OpReturn
OpFunctionEnd
%main = OpFunction %void None %76
%166 = OpLabel
%167 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %167
%168 = OpFunctionCall %void %main_1
%170 = OpLoad %v4float %x_GLF_color
%171 = OpCompositeConstruct %main_out %170
%169 = OpFunctionCall %void %tint_symbol_3 %171
OpReturn
OpFunctionEnd