| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 1 |
| ; Bound: 67 |
| ; Schema: 0 |
| OpCapability Shader |
| %25 = OpExtInstImport "GLSL.std.450" |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint Fragment %main "main" |
| OpExecutionMode %main OriginUpperLeft |
| OpMemberName %v_block_tint_explicit_layout 0 "inner" |
| OpName %v_block_tint_explicit_layout "v_block_tint_explicit_layout" |
| OpMemberName %out_block 0 "inner" |
| OpName %out_block "out_block" |
| OpName %main "main" |
| OpName %size "size" |
| OpMemberName %add_carry_result_u32 0 "result" |
| OpMemberName %add_carry_result_u32 1 "carry" |
| OpName %add_carry_result_u32 "add_carry_result_u32" |
| OpName %tint_div_u32 "tint_div_u32" |
| OpName %lhs "lhs" |
| OpName %rhs "rhs" |
| OpDecorate %_runtimearr_uint ArrayStride 4 |
| OpMemberDecorate %v_block_tint_explicit_layout 0 Offset 0 |
| OpDecorate %v_block_tint_explicit_layout Block |
| OpDecorate %1 DescriptorSet 0 |
| OpDecorate %1 Binding 0 |
| OpDecorate %1 NonWritable |
| OpMemberDecorate %out_block 0 Offset 0 |
| OpDecorate %out_block Block |
| OpDecorate %6 DescriptorSet 0 |
| OpDecorate %6 Binding 1 |
| OpDecorate %6 Coherent |
| %uint = OpTypeInt 32 0 |
| %_runtimearr_uint = OpTypeRuntimeArray %uint |
| %v_block_tint_explicit_layout = OpTypeStruct %_runtimearr_uint |
| %_ptr_StorageBuffer_v_block_tint_explicit_layout = OpTypePointer StorageBuffer %v_block_tint_explicit_layout |
| %1 = OpVariable %_ptr_StorageBuffer_v_block_tint_explicit_layout StorageBuffer |
| %v4uint = OpTypeVector %uint 4 |
| %out_block = OpTypeStruct %v4uint |
| %_ptr_StorageBuffer_out_block = OpTypePointer StorageBuffer %out_block |
| %6 = OpVariable %_ptr_StorageBuffer_out_block StorageBuffer |
| %void = OpTypeVoid |
| %12 = OpTypeFunction %void |
| %size = OpConstant %uint 16 |
| %_ptr_StorageBuffer__runtimearr_uint = OpTypePointer StorageBuffer %_runtimearr_uint |
| %uint_0 = OpConstant %uint 0 |
| %uint_4 = OpConstant %uint 4 |
| %add_carry_result_u32 = OpTypeStruct %uint %uint |
| %bool = OpTypeBool |
| %uint_4294967295 = OpConstant %uint 4294967295 |
| %uint_1 = OpConstant %uint 1 |
| %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint |
| %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint |
| %62 = OpTypeFunction %uint %uint %uint |
| %main = OpFunction %void None %12 |
| %13 = OpLabel |
| %15 = OpFunctionCall %uint %tint_div_u32 %size %size |
| %17 = OpIMul %uint %15 %size |
| %18 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 |
| %21 = OpArrayLength %uint %1 0 |
| %22 = OpIMul %uint %21 %uint_4 |
| %24 = OpExtInst %uint %25 UMax %17 %size |
| %26 = OpIAddCarry %add_carry_result_u32 %uint_0 %24 |
| %28 = OpCompositeExtract %uint %26 0 |
| %29 = OpCompositeExtract %uint %26 1 |
| %30 = OpIEqual %bool %29 %uint_0 |
| %32 = OpSelect %uint %30 %28 %uint_4294967295 |
| %34 = OpULessThan %bool %22 %32 |
| %35 = OpSelect %uint %34 %uint_0 %uint_0 |
| %36 = OpSelect %uint %34 %size %24 |
| %37 = OpIMul %uint %35 %uint_1 |
| %39 = OpUDiv %uint %36 %size |
| %40 = OpISub %uint %39 %uint_1 |
| %41 = OpExtInst %uint %25 UMin %uint_0 %40 |
| %42 = OpIMul %uint %41 %size |
| %43 = OpIAdd %uint %37 %42 |
| %44 = OpUDiv %uint %43 %uint_4 |
| %45 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0 %44 |
| %47 = OpLoad %uint %45 Aligned 16 |
| %48 = OpIAdd %uint %44 %uint_1 |
| %49 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0 %48 |
| %50 = OpLoad %uint %49 None |
| %51 = OpIAdd %uint %48 %uint_1 |
| %52 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0 %51 |
| %53 = OpLoad %uint %52 None |
| %54 = OpIAdd %uint %51 %uint_1 |
| %55 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0 %54 |
| %56 = OpLoad %uint %55 None |
| %57 = OpCompositeConstruct %v4uint %47 %50 %53 %56 |
| %58 = OpAccessChain %_ptr_StorageBuffer_v4uint %6 %uint_0 |
| OpStore %58 %57 None |
| OpReturn |
| OpFunctionEnd |
| %tint_div_u32 = OpFunction %uint None %62 |
| %lhs = OpFunctionParameter %uint |
| %rhs = OpFunctionParameter %uint |
| %63 = OpLabel |
| %64 = OpIEqual %bool %rhs %uint_0 |
| %65 = OpSelect %uint %64 %uint_1 %rhs |
| %66 = OpUDiv %uint %lhs %65 |
| OpReturnValue %66 |
| OpFunctionEnd |