Skip to content

Instantly share code, notes, and snippets.

@rossy
Created July 9, 2018 11:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rossy/8a348ef7b0196f12261b83d64b1264b2 to your computer and use it in GitHub Desktop.
Save rossy/8a348ef7b0196f12261b83d64b1264b2 to your computer and use it in GitHub Desktop.
; SPIR-V
; Version: 1.0
; Generator: Google Shaderc over Glslang; 7
; Bound: 40
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpSource GLSL 450
OpSourceExtension "GL_GOOGLE_cpp_style_line_directive"
OpSourceExtension "GL_GOOGLE_include_directive"
OpName %main "main"
OpName %value "value"
OpName %SSBO "SSBO"
OpMemberName %SSBO 0 "index"
OpMemberName %SSBO 1 "array"
OpName %_ ""
OpName %i "i"
OpDecorate %_arr_uint_uint_64 ArrayStride 4
OpMemberDecorate %SSBO 0 Offset 0
OpMemberDecorate %SSBO 1 Offset 4
OpDecorate %SSBO BufferBlock
OpDecorate %_ DescriptorSet 0
OpDecorate %_ Binding 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%_ptr_Function_uint = OpTypePointer Function %uint
%uint_64 = OpConstant %uint 64
%_arr_uint_uint_64 = OpTypeArray %uint %uint_64
%SSBO = OpTypeStruct %uint %_arr_uint_uint_64
%_ptr_Uniform_SSBO = OpTypePointer Uniform %SSBO
%_ = OpVariable %_ptr_Uniform_SSBO Uniform
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%int_0 = OpConstant %int 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%uint_0 = OpConstant %uint 0
%bool = OpTypeBool
%main = OpFunction %void None %3
%5 = OpLabel
%value = OpVariable %_ptr_Function_uint Function
%i = OpVariable %_ptr_Function_uint Function
%18 = OpAccessChain %_ptr_Uniform_uint %_ %int_0
%19 = OpLoad %uint %18
%20 = OpAccessChain %_ptr_Uniform_uint %_ %int_1 %19
%21 = OpLoad %uint %20
OpStore %value %21
OpStore %i %uint_0
OpBranch %24
%24 = OpLabel
OpLoopMerge %26 %27 None
OpBranch %28
%28 = OpLabel
%29 = OpLoad %uint %i
%31 = OpULessThan %bool %29 %uint_64
OpBranchConditional %31 %25 %26
%25 = OpLabel
%32 = OpLoad %uint %i
%33 = OpAccessChain %_ptr_Uniform_uint %_ %int_1 %32
OpStore %33 %uint_0
OpBranch %27
%27 = OpLabel
%34 = OpLoad %uint %i
%35 = OpIAdd %uint %34 %int_1
OpStore %i %35
OpBranch %24
%26 = OpLabel
%36 = OpAccessChain %_ptr_Uniform_uint %_ %int_0
%37 = OpLoad %uint %36
%38 = OpLoad %uint %value
%39 = OpAccessChain %_ptr_Uniform_uint %_ %int_1 %37
OpStore %39 %38
OpReturn
OpFunctionEnd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment