blob: 4fd14af431ae2540246afa03567a9c455f257c6e [file] [log] [blame]
OpCapability Shader
OpExtension "SPV_KHR_terminate_invocation"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %1 "main" %gl_FragCoord %3 %4
OpExecutionMode %1 OriginUpperLeft
OpDecorate %gl_FragCoord BuiltIn FragCoord
OpDecorate %3 Location 0
OpDecorate %3 Flat
OpDecorate %4 Location 0
%void = OpTypeVoid
%bool = OpTypeBool
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_10 = OpConstant %int 10
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Input_int = OpTypePointer Input %int
%_ptr_Output_int = OpTypePointer Output %int
%_ptr_Input_v4float = OpTypePointer Input %v4float
%gl_FragCoord = OpVariable %_ptr_Input_v4float Input
%3 = OpVariable %_ptr_Input_int Input
%4 = OpVariable %_ptr_Output_int Output
%16 = OpTypeFunction %void
%1 = OpFunction %void None %16
%17 = OpLabel
%18 = OpLoad %v4float %gl_FragCoord
%19 = OpCompositeExtract %float %18 0
%20 = OpCompositeExtract %float %18 1
%21 = OpCompositeExtract %float %18 2
%22 = OpConvertFToS %int %19
%23 = OpConvertFToS %int %20
%24 = OpConvertFToS %int %21
%25 = OpBitwiseAnd %int %22 %int_1
%26 = OpBitwiseAnd %int %23 %int_1
%27 = OpIAdd %int %25 %26
%28 = OpLoad %int %3
%29 = OpIAdd %int %27 %28
%30 = OpIEqual %bool %29 %24
OpSelectionMerge %31 None
OpBranchConditional %30 %32 %31
%32 = OpLabel
%33 = OpPhi %int %int_0 %17 %34 %35
%36 = OpULessThan %bool %33 %int_10
OpLoopMerge %37 %35 None
OpBranchConditional %36 %38 %37
%38 = OpLabel
OpTerminateInvocation
%35 = OpLabel
%34 = OpIAdd %int %33 %int_1
OpBranch %32
%37 = OpLabel
OpBranch %31
%31 = OpLabel
OpStore %4 %int_1
OpReturn
OpFunctionEnd