| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 0 |
| ; Bound: 57 |
| ; Schema: 0 |
| OpCapability Shader |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint Fragment %main "main" %gl_FragCoord_param_1 %expect_1_1 |
| OpExecutionMode %main OriginUpperLeft |
| OpName %gl_FragCoord_param_1 "gl_FragCoord_param_1" |
| OpName %expect_1_1 "expect_1_1" |
| OpName %gl_FragCoord "gl_FragCoord" |
| OpName %expect "expect" |
| OpName %main_1 "main_1" |
| OpName %inbounds "inbounds" |
| OpName %x_31 "x_31" |
| OpName %x_32_phi "x_32_phi" |
| OpName %main_out "main_out" |
| OpMemberName %main_out 0 "expect_1" |
| OpName %main_inner "main_inner" |
| OpName %gl_FragCoord_param "gl_FragCoord_param" |
| OpName %main "main" |
| OpDecorate %gl_FragCoord_param_1 BuiltIn FragCoord |
| OpDecorate %expect_1_1 Location 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 |
| %int = OpTypeInt 32 1 |
| %_ptr_Output_int = OpTypePointer Output %int |
| %8 = OpConstantNull %int |
| %expect_1_1 = OpVariable %_ptr_Output_int Output %8 |
| %_ptr_Private_v4float = OpTypePointer Private %v4float |
| %11 = OpConstantNull %v4float |
| %gl_FragCoord = OpVariable %_ptr_Private_v4float Private %11 |
| %_ptr_Private_int = OpTypePointer Private %int |
| %expect = OpVariable %_ptr_Private_int Private %8 |
| %void = OpTypeVoid |
| %14 = OpTypeFunction %void |
| %bool = OpTypeBool |
| %_ptr_Function_bool = OpTypePointer Function %bool |
| %21 = OpConstantNull %bool |
| %uint = OpTypeInt 32 0 |
| %uint_0 = OpConstant %uint 0 |
| %_ptr_Private_float = OpTypePointer Private %float |
| %float_128 = OpConstant %float 128 |
| %uint_1 = OpConstant %uint 1 |
| %int_1 = OpConstant %int 1 |
| %int_n1 = OpConstant %int -1 |
| %main_out = OpTypeStruct %int |
| %44 = OpTypeFunction %main_out %v4float |
| %main_1 = OpFunction %void None %14 |
| %17 = OpLabel |
| %inbounds = OpVariable %_ptr_Function_bool Function %21 |
| %x_31 = OpVariable %_ptr_Function_bool Function %21 |
| %x_32_phi = OpVariable %_ptr_Function_bool Function %21 |
| %27 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_0 |
| %28 = OpLoad %float %27 |
| %30 = OpFOrdLessThan %bool %28 %float_128 |
| OpStore %x_32_phi %30 |
| %31 = OpLogicalNot %bool %30 |
| OpSelectionMerge %32 None |
| OpBranchConditional %31 %33 %32 |
| %33 = OpLabel |
| %35 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_1 |
| %36 = OpLoad %float %35 |
| %37 = OpFOrdLessThan %bool %36 %float_128 |
| OpStore %x_31 %37 |
| %38 = OpLoad %bool %x_31 |
| OpStore %x_32_phi %38 |
| OpBranch %32 |
| %32 = OpLabel |
| %39 = OpLoad %bool %x_32_phi |
| OpStore %inbounds %39 |
| %40 = OpLoad %bool %inbounds |
| %41 = OpSelect %int %40 %int_1 %int_n1 |
| OpStore %expect %41 |
| OpReturn |
| OpFunctionEnd |
| %main_inner = OpFunction %main_out None %44 |
| %gl_FragCoord_param = OpFunctionParameter %v4float |
| %48 = OpLabel |
| OpStore %gl_FragCoord %gl_FragCoord_param |
| %49 = OpFunctionCall %void %main_1 |
| %50 = OpLoad %int %expect |
| %51 = OpCompositeConstruct %main_out %50 |
| OpReturnValue %51 |
| OpFunctionEnd |
| %main = OpFunction %void None %14 |
| %53 = OpLabel |
| %55 = OpLoad %v4float %gl_FragCoord_param_1 |
| %54 = OpFunctionCall %main_out %main_inner %55 |
| %56 = OpCompositeExtract %int %54 0 |
| OpStore %expect_1_1 %56 |
| OpReturn |
| OpFunctionEnd |