Skip to content

Instantly share code, notes, and snippets.

@paniq
Last active August 31, 2017 17:01
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 paniq/9924837240abefdd3a9e1c675d4a28d4 to your computer and use it in GitHub Desktop.
Save paniq/9924837240abefdd3a9e1c675d4a28d4 to your computer and use it in GitHub Desktop.
; SPIR-V
; Version: 1.0
; Generator: Unknown(21315); 20304
; Bound: 50
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
%6 = OpString "/home/lritter/devel/duangle/liminal2/liminal/csgpainter.sc"
%20 = OpString "/home/lritter/devel/duangle/scopes/bin/../lib/scopes/core.sc"
OpSource GLSL 450
OpName %main "main"
OpName %inv "inv"
OpName %count_depth "count_depth"
OpName %i "i"
OpName %fragref "fragref"
OpName %outv "outv"
OpName %_ ""
OpName %__0 ""
OpName %LinkFragment "LinkFragment"
OpMemberName %LinkFragment 0 "objectid"
OpMemberName %LinkFragment 1 "t_init"
OpMemberName %LinkFragment 2 "next"
OpName %LinkBufferArray "LinkBufferArray"
OpMemberName %LinkBufferArray 0 "count"
OpMemberName %LinkBufferArray 1 "fragments"
OpName %src_link_offsets "src_link_offsets"
OpDecorate %inv Location 0
OpDecorate %outv Location 1
OpDecorate %LinkFragment Block
OpMemberDecorate %LinkFragment 0 Offset 0
OpMemberDecorate %LinkFragment 1 Offset 4
OpMemberDecorate %LinkFragment 2 Offset 8
OpDecorate %_runtimearr_LinkFragment ArrayStride 12
OpDecorate %LinkBufferArray BufferBlock
OpMemberDecorate %LinkBufferArray 0 Coherent
OpMemberDecorate %LinkBufferArray 0 Restrict
OpMemberDecorate %LinkBufferArray 0 NonWritable
OpMemberDecorate %LinkBufferArray 0 Offset 0
OpMemberDecorate %LinkBufferArray 1 Coherent
OpMemberDecorate %LinkBufferArray 1 Restrict
OpMemberDecorate %LinkBufferArray 1 NonWritable
OpMemberDecorate %LinkBufferArray 1 Offset 4
OpDecorate %src_link_offsets Binding 2
%void = OpTypeVoid
%3 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Input_int = OpTypePointer Input %int
%inv = OpVariable %_ptr_Input_int Input
%11 = OpTypeFunction %int %int
%int_0 = OpConstant %int 0
%_ptr_Output_int = OpTypePointer Output %int
%outv = OpVariable %_ptr_Output_int Output
%int_128 = OpConstant %int 128
%bool = OpTypeBool
%float = OpTypeFloat 32
%LinkFragment = OpTypeStruct %int %float %int
%_runtimearr_LinkFragment = OpTypeRuntimeArray %LinkFragment
%LinkBufferArray = OpTypeStruct %int %_runtimearr_LinkFragment
%_ptr_Uniform_LinkBufferArray = OpTypePointer Uniform %LinkBufferArray
%src_link_offsets = OpVariable %_ptr_Uniform_LinkBufferArray Uniform
%int_1 = OpConstant %int 1
%_ptr_Uniform__runtimearr_LinkFragment = OpTypePointer Uniform %_runtimearr_LinkFragment
%_ptr_Uniform_LinkFragment = OpTypePointer Uniform %LinkFragment
%int_2 = OpConstant %int 2
%_ptr_Uniform_int = OpTypePointer Uniform %int
%main = OpFunction %void None %3
%5 = OpLabel
OpLine %6 363 13
OpLine %6 368 37
%10 = OpLoad %int %inv
OpLine %6 368 24
%19 = OpFunctionCall %int %count_depth %10
OpLine %20 2344 5
OpStore %outv %19
OpLine %20 1644 5
OpReturn
OpFunctionEnd
%count_depth = OpFunction %int None %11
%12 = OpFunctionParameter %int
%14 = OpLabel
OpLine %6 341 5
OpLine %6 342 32
OpLine %6 342 9
OpBranch %16
%16 = OpLabel
%i = OpPhi %int %int_0 %14 %45 %23
%fragref = OpPhi %int %12 %14 %_ %23
OpLine %20 206 13
%28 = OpIEqual %bool %i %int_128
OpLoopMerge %25 %23 None
OpBranch %29
%29 = OpLabel
%__0 = OpPhi %bool %28 %16
OpLine %20 206 13
%31 = OpIEqual %bool %fragref %int_0
OpLine %20 206 13
%32 = OpLogicalOr %bool %__0 %31
OpLine %6 343 9
OpBranchConditional %32 %25 %33
%33 = OpLabel
OpLine %20 2332 29
OpLine %20 2426 19
%42 = OpAccessChain %_ptr_Uniform__runtimearr_LinkFragment %src_link_offsets %int_1
OpLine %20 1775 17
OpLine %20 1718 37
OpLine %20 2659 18
%44 = OpAccessChain %_ptr_Uniform_LinkFragment %42 %fragref
OpLine %20 1775 17
OpLine %20 206 13
%45 = OpIAdd %int %i %int_1
OpLine %20 1710 21
OpLine %20 2426 19
%48 = OpAccessChain %_ptr_Uniform_int %44 %int_2
OpLine %20 1775 17
OpLine %6 347 22
%49 = OpLoad %int %48
OpBranch %23
%23 = OpLabel
%_ = OpPhi %int %49 %33
OpLine %6 347 9
OpBranch %16
%25 = OpLabel
OpLine %6 344 13
OpReturnValue %i
OpFunctionEnd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment