blob: f1c0d301d4da30ae3cc8eb583a329bc2884374fb [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 98
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %gl_FragCoord_param_1 %x_GLF_color_1_1
OpExecutionMode %main OriginUpperLeft
OpName %gl_FragCoord_param_1 "gl_FragCoord_param_1"
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
OpName %gl_FragCoord "gl_FragCoord"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "five"
OpName %x_10 "x_10"
OpName %x_GLF_color "x_GLF_color"
OpName %func_f1_ "func_f1_"
OpName %x "x"
OpName %main_1 "main_1"
OpName %f "f"
OpName %i "i"
OpName %param "param"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %main_inner "main_inner"
OpName %gl_FragCoord_param "gl_FragCoord_param"
OpName %main "main"
OpDecorate %gl_FragCoord_param_1 BuiltIn FragCoord
OpDecorate %x_GLF_color_1_1 Location 0
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_10 NonWritable
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%gl_FragCoord_param_1 = OpVariable %_ptr_Input_v4float Input
%_ptr_Output_v4float = OpTypePointer Output %v4float
%7 = OpConstantNull %v4float
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %7
%_ptr_Private_v4float = OpTypePointer Private %v4float
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %7
%int = OpTypeInt 32 1
%buf0 = OpTypeStruct %int
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_10 = OpVariable %_ptr_Uniform_buf0 Uniform
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %7
%_ptr_Function_float = OpTypePointer Function %float
%15 = OpTypeFunction %float %_ptr_Function_float
%float_5 = OpConstant %float 5
%bool = OpTypeBool
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%_ptr_Private_float = OpTypePointer Private %float
%float_0_5 = OpConstant %float 0.5
%uint_1 = OpConstant %uint 1
%float_1 = OpConstant %float 1
%void = OpTypeVoid
%47 = OpTypeFunction %void
%52 = OpConstantNull %float
%_ptr_Function_int = OpTypePointer Function %int
%55 = OpConstantNull %int
%float_0 = OpConstant %float 0
%int_0 = OpConstant %int 0
%_ptr_Uniform_int = OpTypePointer Uniform %int
%int_1 = OpConstant %int 1
%83 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%84 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
%main_out = OpTypeStruct %v4float
%85 = OpTypeFunction %main_out %v4float
%func_f1_ = OpFunction %float None %15
%x = OpFunctionParameter %_ptr_Function_float
%19 = OpLabel
%21 = OpLoad %float %x
%23 = OpFOrdGreaterThan %bool %21 %float_5
OpSelectionMerge %25 None
OpBranchConditional %23 %26 %25
%26 = OpLabel
%30 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_0
%31 = OpLoad %float %30
%33 = OpFOrdLessThan %bool %31 %float_0_5
OpSelectionMerge %34 None
OpBranchConditional %33 %35 %36
%35 = OpLabel
OpKill
%36 = OpLabel
%38 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1
%39 = OpLoad %float %38
%40 = OpFOrdLessThan %bool %39 %float_0_5
OpSelectionMerge %41 None
OpBranchConditional %40 %42 %41
%42 = OpLabel
OpKill
%41 = OpLabel
OpBranch %34
%34 = OpLabel
OpBranch %25
%25 = OpLabel
%44 = OpLoad %float %x
%46 = OpFAdd %float %44 %float_1
OpReturnValue %46
OpFunctionEnd
%main_1 = OpFunction %void None %47
%50 = OpLabel
%f = OpVariable %_ptr_Function_float Function %52
%i = OpVariable %_ptr_Function_int Function %55
%param = OpVariable %_ptr_Function_float Function %52
OpStore %f %float_0
OpStore %i %int_0
OpBranch %59
%59 = OpLabel
OpLoopMerge %60 %61 None
OpBranch %62
%62 = OpLabel
%63 = OpLoad %int %i
%65 = OpAccessChain %_ptr_Uniform_int %x_10 %uint_0
%66 = OpLoad %int %65
%67 = OpSLessThan %bool %63 %66
OpSelectionMerge %68 None
OpBranchConditional %67 %69 %70
%69 = OpLabel
OpBranch %68
%70 = OpLabel
OpBranch %60
%68 = OpLabel
OpBranch %61
%61 = OpLabel
%71 = OpLoad %int %i
%72 = OpConvertSToF %float %71
OpStore %param %72
%73 = OpFunctionCall %float %func_f1_ %param
OpStore %f %73
%75 = OpLoad %int %i
%77 = OpIAdd %int %75 %int_1
OpStore %i %77
OpBranch %59
%60 = OpLabel
%78 = OpLoad %float %f
%79 = OpFOrdEqual %bool %78 %float_5
OpSelectionMerge %80 None
OpBranchConditional %79 %81 %82
%81 = OpLabel
OpStore %x_GLF_color %83
OpBranch %80
%82 = OpLabel
OpStore %x_GLF_color %84
OpBranch %80
%80 = OpLabel
OpReturn
OpFunctionEnd
%main_inner = OpFunction %main_out None %85
%gl_FragCoord_param = OpFunctionParameter %v4float
%89 = OpLabel
OpStore %gl_FragCoord %gl_FragCoord_param
%90 = OpFunctionCall %void %main_1
%91 = OpLoad %v4float %x_GLF_color
%92 = OpCompositeConstruct %main_out %91
OpReturnValue %92
OpFunctionEnd
%main = OpFunction %void None %47
%94 = OpLabel
%96 = OpLoad %v4float %gl_FragCoord_param_1
%95 = OpFunctionCall %main_out %main_inner %96
%97 = OpCompositeExtract %v4float %95 0
OpStore %x_GLF_color_1_1 %97
OpReturn
OpFunctionEnd