| ; Generated by DXC from the HLSL below with: | |
| ; dxc -spirv -T cs_6_2 -E main -fspv-target-env=vulkan1.1 -Od -HV 2021 load_between_barriers_Od.hlsl | |
| ; | |
| ; groupshared uint g; | |
| ; RWStructuredBuffer<uint> buf; | |
| ; | |
| ; [numthreads(64, 1, 1)] | |
| ; void main(uint idx : SV_GroupIndex) { | |
| ; if (idx == 0) { | |
| ; g = buf[0]; | |
| ; } | |
| ; GroupMemoryBarrierWithGroupSync(); | |
| ; bool b = g > 4; | |
| ; GroupMemoryBarrierWithGroupSync(); | |
| ; if (b) { | |
| ; buf[idx] = 1; | |
| ; GroupMemoryBarrierWithGroupSync(); | |
| ; } | |
| ; } | |
| ; SPIR-V | |
| ; Version: 1.3 | |
| ; Generator: Google spiregg; 0 | |
| ; Bound: 48 | |
| ; Schema: 0 | |
| OpCapability Shader | |
| OpMemoryModel Logical GLSL450 | |
| OpEntryPoint GLCompute %main "main" %gl_LocalInvocationIndex | |
| OpExecutionMode %main LocalSize 64 1 1 | |
| OpSource HLSL 620 | |
| OpName %g "g" | |
| OpName %type_RWStructuredBuffer_uint "type.RWStructuredBuffer.uint" | |
| OpName %buf "buf" | |
| OpName %main "main" | |
| OpName %param_var_idx "param.var.idx" | |
| OpName %src_main "src.main" | |
| OpName %idx "idx" | |
| OpName %bb_entry "bb.entry" | |
| OpName %b "b" | |
| OpName %if_true "if.true" | |
| OpName %if_merge "if.merge" | |
| OpName %if_true_0 "if.true" | |
| OpName %if_merge_0 "if.merge" | |
| OpDecorate %gl_LocalInvocationIndex BuiltIn LocalInvocationIndex | |
| OpDecorate %buf DescriptorSet 0 | |
| OpDecorate %buf Binding 0 | |
| OpDecorate %_runtimearr_uint ArrayStride 4 | |
| OpMemberDecorate %type_RWStructuredBuffer_uint 0 Offset 0 | |
| OpDecorate %type_RWStructuredBuffer_uint BufferBlock | |
| %uint = OpTypeInt 32 0 | |
| %uint_0 = OpConstant %uint 0 | |
| %int = OpTypeInt 32 1 | |
| %int_0 = OpConstant %int 0 | |
| %uint_4 = OpConstant %uint 4 | |
| %uint_1 = OpConstant %uint 1 | |
| %_ptr_Workgroup_uint = OpTypePointer Workgroup %uint | |
| %_runtimearr_uint = OpTypeRuntimeArray %uint | |
| %type_RWStructuredBuffer_uint = OpTypeStruct %_runtimearr_uint | |
| %_ptr_Uniform_type_RWStructuredBuffer_uint = OpTypePointer Uniform %type_RWStructuredBuffer_uint | |
| %_ptr_Input_uint = OpTypePointer Input %uint | |
| %void = OpTypeVoid | |
| %17 = OpTypeFunction %void | |
| %_ptr_Function_uint = OpTypePointer Function %uint | |
| %24 = OpTypeFunction %void %_ptr_Function_uint | |
| %bool = OpTypeBool | |
| %_ptr_Function_bool = OpTypePointer Function %bool | |
| %_ptr_Uniform_uint = OpTypePointer Uniform %uint | |
| %uint_2 = OpConstant %uint 2 | |
| %uint_264 = OpConstant %uint 264 | |
| %g = OpVariable %_ptr_Workgroup_uint Workgroup | |
| %buf = OpVariable %_ptr_Uniform_type_RWStructuredBuffer_uint Uniform | |
| %gl_LocalInvocationIndex = OpVariable %_ptr_Input_uint Input | |
| %main = OpFunction %void None %17 | |
| %18 = OpLabel | |
| %param_var_idx = OpVariable %_ptr_Function_uint Function | |
| %21 = OpLoad %uint %gl_LocalInvocationIndex | |
| OpStore %param_var_idx %21 | |
| %22 = OpFunctionCall %void %src_main %param_var_idx | |
| OpReturn | |
| OpFunctionEnd | |
| %src_main = OpFunction %void None %24 | |
| %idx = OpFunctionParameter %_ptr_Function_uint | |
| %bb_entry = OpLabel | |
| %b = OpVariable %_ptr_Function_bool Function | |
| %30 = OpLoad %uint %idx | |
| %31 = OpIEqual %bool %30 %uint_0 | |
| OpSelectionMerge %if_merge None | |
| OpBranchConditional %31 %if_true %if_merge | |
| %if_true = OpLabel | |
| %35 = OpAccessChain %_ptr_Uniform_uint %buf %int_0 %uint_0 | |
| %36 = OpLoad %uint %35 | |
| OpStore %g %36 | |
| OpBranch %if_merge | |
| %if_merge = OpLabel | |
| OpControlBarrier %uint_2 %uint_2 %uint_264 | |
| %40 = OpLoad %uint %g | |
| %41 = OpUGreaterThan %bool %40 %uint_4 | |
| OpStore %b %41 | |
| OpControlBarrier %uint_2 %uint_2 %uint_264 | |
| %43 = OpLoad %bool %b | |
| OpSelectionMerge %if_merge_0 None | |
| OpBranchConditional %43 %if_true_0 %if_merge_0 | |
| %if_true_0 = OpLabel | |
| %46 = OpLoad %uint %idx | |
| %47 = OpAccessChain %_ptr_Uniform_uint %buf %int_0 %46 | |
| OpStore %47 %uint_1 | |
| OpControlBarrier %uint_2 %uint_2 %uint_264 | |
| OpBranch %if_merge_0 | |
| %if_merge_0 = OpLabel | |
| OpReturn | |
| OpFunctionEnd |