blob: f7d8cfd18484b65939a9e524ce4463637b7996bd [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 177
; 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
%81 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
%_ptr_Function_v3float = OpTypePointer Function %v3float
%88 = 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
%uint_2 = OpConstant %uint 2
%int_3 = OpConstant %int 3
%float_1 = OpConstant %float 1
%main_out = OpTypeStruct %v4float
%164 = 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
%58 = OpConvertSToF %float %51
%59 = OpExtInst %float %56 RoundEven %53
%60 = OpFDiv %float %58 %59
%57 = OpExtInst %float %56 Floor %60
%61 = OpFMul %float %55 %57
%62 = OpFSub %float %54 %61
%64 = OpFOrdLessThanEqual %bool %62 %float_0_00999999978
OpSelectionMerge %65 None
OpBranchConditional %64 %66 %65
%66 = OpLabel
%67 = OpLoad %float %result
%69 = OpFAdd %float %67 %float_100
OpStore %result %69
OpBranch %65
%65 = OpLabel
OpBranch %45
%45 = OpLabel
%70 = OpLoad %int %i
%72 = OpLoad %float %limit
%73 = OpConvertSToF %float %70
%74 = OpFOrdGreaterThanEqual %bool %73 %72
OpSelectionMerge %75 None
OpBranchConditional %74 %76 %75
%76 = OpLabel
%77 = OpLoad %float %result
OpReturnValue %77
%75 = OpLabel
OpBranch %31
%31 = OpLabel
%78 = OpLoad %int %i
%79 = OpIAdd %int %78 %int_1
OpStore %i %79
OpBranch %29
%30 = OpLabel
%80 = OpLoad %float %result
OpReturnValue %80
OpFunctionEnd
%main_1 = OpFunction %void None %81
%84 = OpLabel
%c = OpVariable %_ptr_Function_v3float Function %88
%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 %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 %56 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
%124 = OpAccessChain %_ptr_Function_float %c %uint_1
%125 = OpLoad %float %124
%127 = OpAccessChain %_ptr_Function_float %c %uint_2
%128 = OpFAdd %float %123 %125
OpStore %127 %128
OpStore %i_1 %int_0
OpBranch %129
%129 = OpLabel
OpLoopMerge %130 %131 None
OpBranch %132
%132 = OpLabel
%133 = OpLoad %int %i_1
%135 = OpSLessThan %bool %133 %int_3
OpSelectionMerge %136 None
OpBranchConditional %135 %137 %138
%137 = OpLabel
OpBranch %136
%138 = OpLabel
OpBranch %130
%136 = OpLabel
%139 = OpLoad %int %i_1
%140 = OpAccessChain %_ptr_Function_float %c %139
%141 = OpLoad %float %140
%143 = OpFOrdGreaterThanEqual %bool %141 %float_1
OpSelectionMerge %144 None
OpBranchConditional %143 %145 %144
%145 = OpLabel
%146 = OpLoad %int %i_1
%147 = OpLoad %int %i_1
%148 = OpAccessChain %_ptr_Function_float %c %147
%149 = OpLoad %float %148
%150 = OpLoad %int %i_1
%151 = OpAccessChain %_ptr_Function_float %c %150
%152 = OpLoad %float %151
%153 = OpAccessChain %_ptr_Function_float %c %146
%154 = OpFMul %float %149 %152
OpStore %153 %154
OpBranch %144
%144 = OpLabel
OpBranch %131
%131 = OpLabel
%155 = OpLoad %int %i_1
%156 = OpIAdd %int %155 %int_1
OpStore %i_1 %156
OpBranch %129
%130 = OpLabel
%157 = OpLoad %v3float %c
%159 = OpExtInst %v3float %56 FAbs %157
%158 = OpExtInst %v3float %56 Normalize %159
%160 = OpCompositeExtract %float %158 0
%161 = OpCompositeExtract %float %158 1
%162 = OpCompositeExtract %float %158 2
%163 = OpCompositeConstruct %v4float %160 %161 %162 %float_1
OpStore %x_GLF_color %163
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %164
%tint_symbol_1 = OpFunctionParameter %main_out
%168 = OpLabel
%169 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %169
OpReturn
OpFunctionEnd
%main = OpFunction %void None %81
%171 = OpLabel
%172 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %172
%173 = OpFunctionCall %void %main_1
%175 = OpLoad %v4float %x_GLF_color
%176 = OpCompositeConstruct %main_out %175
%174 = OpFunctionCall %void %tint_symbol_3 %176
OpReturn
OpFunctionEnd