blob: dd5cfe34f9526e798dc5df0d0dfc41588a3dee17 [file]
; Generated by DXC from the HLSL below with:
; dxc -spirv -T cs_6_2 -E main -fspv-target-env=vulkan1.1 -O3 -HV 2021 load_between_barriers.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: 34
; 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"
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
%bool = OpTypeBool
%_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
%22 = OpLabel
%23 = OpLoad %uint %gl_LocalInvocationIndex
%24 = OpIEqual %bool %23 %uint_0
OpSelectionMerge %25 None
OpBranchConditional %24 %26 %25
%26 = OpLabel
%27 = OpAccessChain %_ptr_Uniform_uint %buf %int_0 %uint_0
%28 = OpLoad %uint %27
OpStore %g %28
OpBranch %25
%25 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
%29 = OpLoad %uint %g
%30 = OpUGreaterThan %bool %29 %uint_4
OpControlBarrier %uint_2 %uint_2 %uint_264
OpSelectionMerge %31 None
OpBranchConditional %30 %32 %31
%32 = OpLabel
%33 = OpAccessChain %_ptr_Uniform_uint %buf %int_0 %23
OpStore %33 %uint_1
OpControlBarrier %uint_2 %uint_2 %uint_264
OpBranch %31
%31 = OpLabel
OpReturn
OpFunctionEnd