| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 1 |
| ; Bound: 61 |
| ; Schema: 0 |
| OpCapability Shader |
| %42 = 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 %offset "offset" |
| OpMemberName %add_carry_result_u32 0 "result" |
| OpMemberName %add_carry_result_u32 1 "carry" |
| OpName %add_carry_result_u32 "add_carry_result_u32" |
| 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 |
| %offset = OpConstant %uint 16 |
| %uint_4294967280 = OpConstant %uint 4294967280 |
| %_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 |
| %int = OpTypeInt 32 1 |
| %int_0 = OpConstant %int 0 |
| %_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint |
| %_ptr_StorageBuffer_v4uint = OpTypePointer StorageBuffer %v4uint |
| %main = OpFunction %void None %12 |
| %13 = OpLabel |
| %15 = OpBitwiseAnd %uint %offset %uint_4294967280 |
| %17 = OpAccessChain %_ptr_StorageBuffer__runtimearr_uint %1 %uint_0 |
| %20 = OpArrayLength %uint %1 0 |
| %21 = OpIMul %uint %20 %uint_4 |
| %23 = OpIAddCarry %add_carry_result_u32 %offset %15 |
| %25 = OpCompositeExtract %uint %23 0 |
| %26 = OpCompositeExtract %uint %23 1 |
| %27 = OpIEqual %bool %26 %uint_0 |
| %29 = OpSelect %uint %27 %25 %uint_4294967295 |
| %31 = OpULessThan %bool %21 %29 |
| %32 = OpSelect %uint %31 %uint_0 %15 |
| %33 = OpSelect %uint %31 %offset %offset |
| %34 = OpIMul %uint %32 %uint_1 |
| %36 = OpUDiv %uint %33 %offset |
| %37 = OpISub %uint %36 %uint_1 |
| %38 = OpBitcast %uint %int_0 |
| %41 = OpExtInst %uint %42 UMin %38 %37 |
| %43 = OpIMul %uint %41 %offset |
| %44 = OpIAdd %uint %34 %43 |
| %45 = OpUDiv %uint %44 %uint_4 |
| %46 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0 %45 |
| %48 = OpLoad %uint %46 Aligned 16 |
| %49 = OpIAdd %uint %45 %uint_1 |
| %50 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0 %49 |
| %51 = OpLoad %uint %50 None |
| %52 = OpIAdd %uint %49 %uint_1 |
| %53 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0 %52 |
| %54 = OpLoad %uint %53 None |
| %55 = OpIAdd %uint %52 %uint_1 |
| %56 = OpAccessChain %_ptr_StorageBuffer_uint %1 %uint_0 %55 |
| %57 = OpLoad %uint %56 None |
| %58 = OpCompositeConstruct %v4uint %48 %51 %54 %57 |
| %59 = OpAccessChain %_ptr_StorageBuffer_v4uint %6 %uint_0 |
| OpStore %59 %58 None |
| OpReturn |
| OpFunctionEnd |