SPIRV-Cross/shaders-no-opt/asm/comp/image-atomic-nonuniform.vk.nocompat.asm.comp
2020-03-19 11:35:29 +01:00

56 lines
2.4 KiB
Plaintext

; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 8
; Bound: 32
; Schema: 0
OpCapability Shader
OpCapability ShaderNonUniform
OpCapability RuntimeDescriptorArray
OpCapability StorageImageArrayNonUniformIndexing
OpExtension "SPV_EXT_descriptor_indexing"
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main" %gl_GlobalInvocationID
OpExecutionMode %main LocalSize 1 1 1
OpSource GLSL 450
OpSourceExtension "GL_EXT_nonuniform_qualifier"
OpName %main "main"
OpName %uImage "uImage"
OpName %gl_GlobalInvocationID "gl_GlobalInvocationID"
OpDecorate %uImage DescriptorSet 0
OpDecorate %uImage Binding 0
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
OpDecorate %30 NonUniform
%void = OpTypeVoid
%3 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%7 = OpTypeImage %uint 2D 0 0 0 2 R32ui
%_runtimearr_7 = OpTypeRuntimeArray %7
%_ptr_UniformConstant__runtimearr_7 = OpTypePointer UniformConstant %_runtimearr_7
%uImage = OpVariable %_ptr_UniformConstant__runtimearr_7 UniformConstant
%v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
%uint_2 = OpConstant %uint 2
%_ptr_Input_uint = OpTypePointer Input %uint
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%v2uint = OpTypeVector %uint 2
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%uint_1 = OpConstant %uint 1
%uint_0 = OpConstant %uint 0
%_ptr_Image_uint = OpTypePointer Image %uint
%main = OpFunction %void None %3
%5 = OpLabel
%16 = OpAccessChain %_ptr_Input_uint %gl_GlobalInvocationID %uint_2
%17 = OpLoad %uint %16
%18 = OpCopyObject %uint %17
%20 = OpAccessChain %_ptr_UniformConstant_7 %uImage %18
%22 = OpLoad %v3uint %gl_GlobalInvocationID
%23 = OpVectorShuffle %v2uint %22 %22 0 1
%26 = OpBitcast %v2int %23
%30 = OpImageTexelPointer %_ptr_Image_uint %20 %26 %uint_0
%31 = OpAtomicIAdd %uint %30 %uint_1 %uint_0 %uint_1
OpReturn
OpFunctionEnd