| OpCapability Shader |
| %5 = OpExtInstImport "GLSL.std.450" |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint GLCompute %main "main" %sk_GlobalInvocationID |
| OpExecutionMode %main LocalSize 256 1 1 |
| |
| ; Debug Information |
| OpName %inputs "inputs" ; id %11 |
| OpMemberName %inputs 0 "in_data" |
| OpName %outputs "outputs" ; id %14 |
| OpMemberName %outputs 0 "out_data" |
| OpName %sk_GlobalInvocationID "sk_GlobalInvocationID" ; id %16 |
| OpName %shared_uniform "shared_uniform" ; id %20 |
| OpName %shared_data "shared_data" ; id %22 |
| OpName %store_vIf "store_vIf" ; id %6 |
| OpName %main "main" ; id %7 |
| OpName %id "id" ; id %39 |
| OpName %rd_id "rd_id" ; id %42 |
| OpName %wr_id "wr_id" ; id %43 |
| OpName %mask "mask" ; id %44 |
| OpName %uni "uni" ; id %50 |
| OpName %step "step" ; id %74 |
| |
| ; Annotations |
| OpDecorate %_runtimearr_float ArrayStride 4 |
| OpMemberDecorate %inputs 0 Offset 0 |
| OpDecorate %inputs BufferBlock |
| OpDecorate %8 Binding 0 |
| OpDecorate %8 DescriptorSet 0 |
| OpMemberDecorate %outputs 0 Offset 0 |
| OpDecorate %outputs BufferBlock |
| OpDecorate %13 Binding 1 |
| OpDecorate %13 DescriptorSet 0 |
| OpDecorate %sk_GlobalInvocationID BuiltIn GlobalInvocationId |
| |
| ; Types, variables and constants |
| %int = OpTypeInt 32 1 |
| %_ptr_Input_int = OpTypePointer Input %int |
| %float = OpTypeFloat 32 |
| %_runtimearr_float = OpTypeRuntimeArray %float ; ArrayStride 4 |
| %inputs = OpTypeStruct %_runtimearr_float ; BufferBlock |
| %_ptr_Uniform_inputs = OpTypePointer Uniform %inputs |
| %8 = OpVariable %_ptr_Uniform_inputs Uniform ; Binding 0, DescriptorSet 0 |
| %outputs = OpTypeStruct %_runtimearr_float ; BufferBlock |
| %_ptr_Uniform_outputs = OpTypePointer Uniform %outputs |
| %13 = OpVariable %_ptr_Uniform_outputs Uniform ; Binding 1, DescriptorSet 0 |
| %uint = OpTypeInt 32 0 |
| %v3uint = OpTypeVector %uint 3 |
| %_ptr_Input_v3uint = OpTypePointer Input %v3uint |
| %sk_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input ; BuiltIn GlobalInvocationId |
| %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint |
| %shared_uniform = OpVariable %_ptr_Workgroup_uint Workgroup |
| %int_512 = OpConstant %int 512 |
| %_arr_float_int_512 = OpTypeArray %float %int_512 |
| %_ptr_Workgroup__arr_float_int_512 = OpTypePointer Workgroup %_arr_float_int_512 |
| %shared_data = OpVariable %_ptr_Workgroup__arr_float_int_512 Workgroup |
| %void = OpTypeVoid |
| %_ptr_Function_uint = OpTypePointer Function %uint |
| %_ptr_Function_float = OpTypePointer Function %float |
| %29 = OpTypeFunction %void %_ptr_Function_uint %_ptr_Function_float |
| %_ptr_Workgroup_float = OpTypePointer Workgroup %float |
| %37 = OpTypeFunction %void |
| %uint_0 = OpConstant %uint 0 |
| %bool = OpTypeBool |
| %uint_2 = OpConstant %uint 2 |
| %uint_264 = OpConstant %uint 264 |
| %int_0 = OpConstant %int 0 |
| %_ptr_Uniform_float = OpTypePointer Uniform %float |
| %uint_1 = OpConstant %uint 1 |
| %uint_9 = OpConstant %uint 9 |
| |
| |
| ; Function store_vIf |
| %store_vIf = OpFunction %void None %29 |
| %30 = OpFunctionParameter %_ptr_Function_uint |
| %31 = OpFunctionParameter %_ptr_Function_float |
| |
| %32 = OpLabel |
| %33 = OpLoad %float %31 |
| %34 = OpLoad %uint %30 |
| %35 = OpAccessChain %_ptr_Workgroup_float %shared_data %34 |
| OpStore %35 %33 |
| OpReturn |
| OpFunctionEnd |
| |
| |
| ; Function main |
| %main = OpFunction %void None %37 |
| |
| %38 = OpLabel |
| %id = OpVariable %_ptr_Function_uint Function |
| %rd_id = OpVariable %_ptr_Function_uint Function |
| %wr_id = OpVariable %_ptr_Function_uint Function |
| %mask = OpVariable %_ptr_Function_uint Function |
| %uni = OpVariable %_ptr_Function_uint Function |
| %step = OpVariable %_ptr_Function_uint Function |
| %97 = OpVariable %_ptr_Function_uint Function |
| %103 = OpVariable %_ptr_Function_float Function |
| %40 = OpLoad %v3uint %sk_GlobalInvocationID |
| %41 = OpCompositeExtract %uint %40 0 |
| OpStore %id %41 |
| %46 = OpIEqual %bool %41 %uint_0 |
| OpSelectionMerge %49 None |
| OpBranchConditional %46 %48 %49 |
| |
| %48 = OpLabel |
| OpStore %shared_uniform %uint_0 |
| OpBranch %49 |
| |
| %49 = OpLabel |
| OpControlBarrier %uint_2 %uint_2 %uint_264 |
| %53 = OpLoad %uint %shared_uniform |
| OpControlBarrier %uint_2 %uint_2 %uint_264 |
| OpStore %uni %53 |
| %54 = OpIEqual %bool %53 %uint_0 |
| OpSelectionMerge %56 None |
| OpBranchConditional %54 %55 %56 |
| |
| %55 = OpLabel |
| %58 = OpIMul %uint %41 %uint_2 |
| %59 = OpAccessChain %_ptr_Uniform_float %8 %int_0 %58 |
| %61 = OpLoad %float %59 |
| %62 = OpIMul %uint %41 %uint_2 |
| %63 = OpAccessChain %_ptr_Workgroup_float %shared_data %62 |
| OpStore %63 %61 |
| %64 = OpLoad %uint %id |
| %65 = OpIMul %uint %64 %uint_2 |
| %67 = OpIAdd %uint %65 %uint_1 |
| %68 = OpAccessChain %_ptr_Uniform_float %8 %int_0 %67 |
| %69 = OpLoad %float %68 |
| %70 = OpLoad %uint %id |
| %71 = OpIMul %uint %70 %uint_2 |
| %72 = OpIAdd %uint %71 %uint_1 |
| %73 = OpAccessChain %_ptr_Workgroup_float %shared_data %72 |
| OpStore %73 %69 |
| OpControlBarrier %uint_2 %uint_2 %uint_264 |
| OpStore %step %uint_0 |
| OpBranch %75 |
| |
| %75 = OpLabel |
| OpLoopMerge %79 %78 None |
| OpBranch %76 |
| |
| %76 = OpLabel |
| %80 = OpLoad %uint %step |
| %82 = OpULessThan %bool %80 %uint_9 |
| OpBranchConditional %82 %77 %79 |
| |
| %77 = OpLabel |
| %83 = OpLoad %uint %step |
| %84 = OpShiftLeftLogical %uint %uint_1 %83 |
| %85 = OpISub %uint %84 %uint_1 |
| OpStore %mask %85 |
| %86 = OpLoad %uint %id |
| %87 = OpLoad %uint %step |
| %88 = OpShiftRightLogical %uint %86 %87 |
| %89 = OpLoad %uint %step |
| %90 = OpIAdd %uint %89 %uint_1 |
| %91 = OpShiftLeftLogical %uint %88 %90 |
| %92 = OpIAdd %uint %91 %85 |
| OpStore %rd_id %92 |
| %93 = OpIAdd %uint %92 %uint_1 |
| %94 = OpLoad %uint %id |
| %95 = OpBitwiseAnd %uint %94 %85 |
| %96 = OpIAdd %uint %93 %95 |
| OpStore %wr_id %96 |
| OpStore %97 %96 |
| %98 = OpAccessChain %_ptr_Workgroup_float %shared_data %96 |
| %99 = OpLoad %float %98 |
| %100 = OpAccessChain %_ptr_Workgroup_float %shared_data %92 |
| %101 = OpLoad %float %100 |
| %102 = OpFAdd %float %99 %101 |
| OpStore %103 %102 |
| %104 = OpFunctionCall %void %store_vIf %97 %103 |
| OpControlBarrier %uint_2 %uint_2 %uint_264 |
| OpBranch %78 |
| |
| %78 = OpLabel |
| %105 = OpLoad %uint %step |
| %106 = OpIAdd %uint %105 %uint_1 |
| OpStore %step %106 |
| OpBranch %75 |
| |
| %79 = OpLabel |
| %107 = OpLoad %uint %id |
| %108 = OpIMul %uint %107 %uint_2 |
| %109 = OpAccessChain %_ptr_Workgroup_float %shared_data %108 |
| %110 = OpLoad %float %109 |
| %111 = OpLoad %uint %id |
| %112 = OpIMul %uint %111 %uint_2 |
| %113 = OpAccessChain %_ptr_Uniform_float %13 %int_0 %112 |
| OpStore %113 %110 |
| %114 = OpLoad %uint %id |
| %115 = OpIMul %uint %114 %uint_2 |
| %116 = OpIAdd %uint %115 %uint_1 |
| %117 = OpAccessChain %_ptr_Workgroup_float %shared_data %116 |
| %118 = OpLoad %float %117 |
| %119 = OpLoad %uint %id |
| %120 = OpIMul %uint %119 %uint_2 |
| %121 = OpIAdd %uint %120 %uint_1 |
| %122 = OpAccessChain %_ptr_Uniform_float %13 %int_0 %121 |
| OpStore %122 %118 |
| OpBranch %56 |
| |
| %56 = OpLabel |
| OpReturn |
| OpFunctionEnd |