| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 0 |
| ; Bound: 83 |
| ; Schema: 0 |
| OpCapability Shader |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint Fragment %foo "foo" %in_1 %coord_1 %value |
| OpExecutionMode %foo OriginUpperLeft |
| OpName %tint_discarded "tint_discarded" |
| OpName %in_1 "in_1" |
| OpName %coord_1 "coord_1" |
| OpName %value "value" |
| OpName %t "t" |
| OpName %s "s" |
| OpName %a_block "a_block" |
| OpMemberName %a_block 0 "inner" |
| OpName %a "a" |
| OpName %foo_inner "foo_inner" |
| OpName %in "in" |
| OpName %coord "coord" |
| OpName %result "result" |
| OpName %i "i" |
| OpName %tint_symbol "tint_symbol" |
| OpName %foo "foo" |
| OpDecorate %in_1 Location 0 |
| OpDecorate %coord_1 Location 1 |
| OpDecorate %value Location 0 |
| OpDecorate %t DescriptorSet 0 |
| OpDecorate %t Binding 0 |
| OpDecorate %s DescriptorSet 0 |
| OpDecorate %s Binding 1 |
| OpDecorate %a_block Block |
| OpMemberDecorate %a_block 0 Offset 0 |
| OpDecorate %a DescriptorSet 0 |
| OpDecorate %a Binding 2 |
| %bool = OpTypeBool |
| %2 = OpConstantNull %bool |
| %_ptr_Private_bool = OpTypePointer Private %bool |
| %tint_discarded = OpVariable %_ptr_Private_bool Private %2 |
| %float = OpTypeFloat 32 |
| %_ptr_Input_float = OpTypePointer Input %float |
| %in_1 = OpVariable %_ptr_Input_float Input |
| %v2float = OpTypeVector %float 2 |
| %_ptr_Input_v2float = OpTypePointer Input %v2float |
| %coord_1 = OpVariable %_ptr_Input_v2float Input |
| %int = OpTypeInt 32 1 |
| %_ptr_Output_int = OpTypePointer Output %int |
| %14 = OpConstantNull %int |
| %value = OpVariable %_ptr_Output_int Output %14 |
| %17 = OpTypeImage %float 2D 0 0 0 1 Unknown |
| %_ptr_UniformConstant_17 = OpTypePointer UniformConstant %17 |
| %t = OpVariable %_ptr_UniformConstant_17 UniformConstant |
| %20 = OpTypeSampler |
| %_ptr_UniformConstant_20 = OpTypePointer UniformConstant %20 |
| %s = OpVariable %_ptr_UniformConstant_20 UniformConstant |
| %a_block = OpTypeStruct %int |
| %_ptr_StorageBuffer_a_block = OpTypePointer StorageBuffer %a_block |
| %a = OpVariable %_ptr_StorageBuffer_a_block StorageBuffer |
| %24 = OpTypeFunction %int %float %v2float |
| %29 = OpConstantNull %float |
| %true = OpConstantTrue %bool |
| %v4float = OpTypeVector %float 4 |
| %39 = OpTypeSampledImage %17 |
| %_ptr_Function_int = OpTypePointer Function %int |
| %int_10 = OpConstant %int 10 |
| %uint = OpTypeInt 32 0 |
| %uint_1 = OpConstant %uint 1 |
| %uint_0 = OpConstant %uint 0 |
| %_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int |
| %int_1 = OpConstant %int 1 |
| %void = OpTypeVoid |
| %73 = OpTypeFunction %void |
| %foo_inner = OpFunction %int None %24 |
| %in = OpFunctionParameter %float |
| %coord = OpFunctionParameter %v2float |
| %28 = OpLabel |
| %result = OpVariable %_ptr_Function_int Function %14 |
| %i = OpVariable %_ptr_Function_int Function %14 |
| %tint_symbol = OpVariable %_ptr_Function_int Function %14 |
| %30 = OpFOrdEqual %bool %in %29 |
| OpSelectionMerge %31 None |
| OpBranchConditional %30 %32 %31 |
| %32 = OpLabel |
| OpStore %tint_discarded %true |
| OpBranch %31 |
| %31 = OpLabel |
| %37 = OpLoad %20 %s |
| %38 = OpLoad %17 %t |
| %40 = OpSampledImage %39 %38 %37 |
| %35 = OpImageSampleImplicitLod %v4float %40 %coord |
| %41 = OpCompositeExtract %float %35 0 |
| %34 = OpConvertFToS %int %41 |
| OpStore %result %34 |
| OpStore %i %14 |
| OpBranch %45 |
| %45 = OpLabel |
| OpLoopMerge %46 %47 None |
| OpBranch %48 |
| %48 = OpLabel |
| %50 = OpLoad %int %i |
| %52 = OpSLessThan %bool %50 %int_10 |
| %49 = OpLogicalNot %bool %52 |
| OpSelectionMerge %53 None |
| OpBranchConditional %49 %54 %53 |
| %54 = OpLabel |
| OpBranch %46 |
| %53 = OpLabel |
| %55 = OpLoad %int %result |
| %56 = OpLoad %int %i |
| %57 = OpIAdd %int %55 %56 |
| OpStore %result %57 |
| OpBranch %47 |
| %47 = OpLabel |
| %60 = OpLoad %bool %tint_discarded |
| %59 = OpLogicalNot %bool %60 |
| OpSelectionMerge %61 None |
| OpBranchConditional %59 %62 %61 |
| %62 = OpLabel |
| %69 = OpAccessChain %_ptr_StorageBuffer_int %a %uint_0 |
| %63 = OpAtomicIAdd %int %69 %uint_1 %uint_0 %int_1 |
| OpStore %tint_symbol %63 |
| OpBranch %61 |
| %61 = OpLabel |
| %71 = OpLoad %int %tint_symbol |
| OpStore %i %71 |
| OpBranch %45 |
| %46 = OpLabel |
| %72 = OpLoad %int %result |
| OpReturnValue %72 |
| OpFunctionEnd |
| %foo = OpFunction %void None %73 |
| %76 = OpLabel |
| %78 = OpLoad %float %in_1 |
| %79 = OpLoad %v2float %coord_1 |
| %77 = OpFunctionCall %int %foo_inner %78 %79 |
| OpStore %value %77 |
| %80 = OpLoad %bool %tint_discarded |
| OpSelectionMerge %81 None |
| OpBranchConditional %80 %82 %81 |
| %82 = OpLabel |
| OpKill |
| %81 = OpLabel |
| OpReturn |
| OpFunctionEnd |