blob: d892d09edc8719b3a9a8b104376a3309d4e4d6f4 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 137
; Schema: 0
OpCapability Shader
%83 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %tint_symbol %tint_symbol_2
OpExecutionMode %main OriginUpperLeft
OpName %gl_FragCoord "gl_FragCoord"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "resolution"
OpName %x_10 "x_10"
OpName %x_GLF_color "x_GLF_color"
OpName %tint_symbol "tint_symbol"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %collatz_i1_ "collatz_i1_"
OpName %v "v"
OpName %count "count"
OpName %main_1 "main_1"
OpName %lin "lin"
OpName %v_1 "v_1"
OpName %param "param"
OpName %indexable "indexable"
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_10 NonWritable
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %tint_symbol BuiltIn FragCoord
OpDecorate %tint_symbol_2 Location 0
OpDecorate %_arr_v4float_uint_16 ArrayStride 16
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Private_v4float = OpTypePointer Private %v4float
%5 = OpConstantNull %v4float
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %5
%v2float = OpTypeVector %float 2
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_10 = OpVariable %_ptr_Uniform_buf0 Uniform
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
%_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 %5
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
%15 = OpTypeFunction %int %_ptr_Function_int
%22 = OpConstantNull %int
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%bool = OpTypeBool
%int_3 = OpConstant %int 3
%int_2 = OpConstant %int 2
%void = OpTypeVoid
%57 = OpTypeFunction %void
%_ptr_Function_v2float = OpTypePointer Function %v2float
%63 = OpConstantNull %v2float
%uint = OpTypeInt 32 0
%uint_16 = OpConstant %uint 16
%_arr_v4float_uint_16 = OpTypeArray %v4float %uint_16
%_ptr_Function__arr_v4float_uint_16 = OpTypePointer Function %_arr_v4float_uint_16
%71 = OpConstantNull %_arr_v4float_uint_16
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
%float_8 = OpConstant %float 8
%_ptr_Function_float = OpTypePointer Function %float
%uint_1 = OpConstant %uint 1
%int_8 = OpConstant %int 8
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%102 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
%float_0_5 = OpConstant %float 0.5
%104 = OpConstantComposite %v4float %float_0_5 %float_0 %float_0 %float_1
%105 = OpConstantComposite %v4float %float_0 %float_0_5 %float_0 %float_1
%106 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0 %float_1
%107 = OpConstantComposite %v4float %float_0 %float_0 %float_0_5 %float_1
%108 = OpConstantComposite %v4float %float_0_5 %float_0 %float_0_5 %float_1
%109 = OpConstantComposite %v4float %float_0 %float_0_5 %float_0_5 %float_1
%110 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_1
%111 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%112 = OpConstantComposite %v4float %float_0 %float_1 %float_0 %float_1
%113 = OpConstantComposite %v4float %float_1 %float_1 %float_0 %float_1
%114 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1
%115 = OpConstantComposite %v4float %float_1 %float_0 %float_1 %float_1
%116 = OpConstantComposite %v4float %float_0 %float_1 %float_1 %float_1
%117 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%118 = OpConstantComposite %_arr_v4float_uint_16 %102 %104 %105 %106 %107 %108 %109 %110 %102 %111 %112 %113 %114 %115 %116 %117
%int_16 = OpConstant %int 16
%_ptr_Function_v4float = OpTypePointer Function %v4float
%main_out = OpTypeStruct %v4float
%124 = OpTypeFunction %void %main_out
%collatz_i1_ = OpFunction %int None %15
%v = OpFunctionParameter %_ptr_Function_int
%20 = OpLabel
%count = OpVariable %_ptr_Function_int Function %22
OpStore %count %int_0
OpBranch %24
%24 = OpLabel
OpLoopMerge %25 %26 None
OpBranch %27
%27 = OpLabel
%29 = OpLoad %int %v
%31 = OpSGreaterThan %bool %29 %int_1
OpSelectionMerge %33 None
OpBranchConditional %31 %34 %35
%34 = OpLabel
OpBranch %33
%35 = OpLabel
OpBranch %25
%33 = OpLabel
%37 = OpLoad %int %v
%38 = OpBitwiseAnd %int %37 %int_1
%39 = OpIEqual %bool %38 %int_1
OpSelectionMerge %40 None
OpBranchConditional %39 %41 %42
%41 = OpLabel
%44 = OpLoad %int %v
%47 = OpIMul %int %int_3 %44
%48 = OpIAdd %int %47 %int_1
OpStore %v %48
OpBranch %40
%42 = OpLabel
%50 = OpLoad %int %v
%53 = OpSDiv %int %50 %int_2
OpStore %v %53
OpBranch %40
%40 = OpLabel
%54 = OpLoad %int %count
%55 = OpIAdd %int %54 %int_1
OpStore %count %55
OpBranch %26
%26 = OpLabel
OpBranch %24
%25 = OpLabel
%56 = OpLoad %int %count
OpReturnValue %56
OpFunctionEnd
%main_1 = OpFunction %void None %57
%60 = OpLabel
%lin = OpVariable %_ptr_Function_v2float Function %63
%v_1 = OpVariable %_ptr_Function_int Function %22
%param = OpVariable %_ptr_Function_int Function %22
%indexable = OpVariable %_ptr_Function__arr_v4float_uint_16 Function %71
%72 = OpLoad %v4float %gl_FragCoord
%75 = OpAccessChain %_ptr_Uniform_v2float %x_10 %uint_0
%76 = OpLoad %v2float %75
%77 = OpCompositeExtract %float %72 0
%78 = OpCompositeExtract %float %72 1
%79 = OpCompositeConstruct %v2float %77 %78
%80 = OpFDiv %v2float %79 %76
OpStore %lin %80
%81 = OpLoad %v2float %lin
%85 = OpVectorTimesScalar %v2float %81 %float_8
%82 = OpExtInst %v2float %83 Floor %85
OpStore %lin %82
%87 = OpAccessChain %_ptr_Function_float %lin %uint_0
%88 = OpLoad %float %87
%90 = OpAccessChain %_ptr_Function_float %lin %uint_1
%91 = OpLoad %float %90
%92 = OpConvertFToS %int %88
%94 = OpIMul %int %92 %int_8
%95 = OpConvertFToS %int %91
%96 = OpIAdd %int %94 %95
OpStore %v_1 %96
%97 = OpLoad %int %v_1
OpStore %param %97
%98 = OpFunctionCall %int %collatz_i1_ %param
OpStore %indexable %118
%120 = OpSMod %int %98 %int_16
%122 = OpAccessChain %_ptr_Function_v4float %indexable %120
%123 = OpLoad %v4float %122
OpStore %x_GLF_color %123
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %124
%tint_symbol_1 = OpFunctionParameter %main_out
%128 = OpLabel
%129 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %129
OpReturn
OpFunctionEnd
%main = OpFunction %void None %57
%131 = OpLabel
%132 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %132
%133 = OpFunctionCall %void %main_1
%135 = OpLoad %v4float %x_GLF_color
%136 = OpCompositeConstruct %main_out %135
%134 = OpFunctionCall %void %tint_symbol_3 %136
OpReturn
OpFunctionEnd