Callstack:
libsystem_kernel.dylib`semaphore_wait_trap:
0x7fff78ad5c5c <+0>: movq %rcx, %r10
0x7fff78ad5c5f <+3>: movl $0x1000024, %eax ; imm = 0x1000024
0x7fff78ad5c64 <+8>: syscall
-> 0x7fff78ad5c66 <+10>: retq
0x7fff78ad5c67 <+11>: nop
SceneKit`-[SCNRenderer renderAtTime:viewport:commandBuffer:passDescriptor:]:
0x7fff56e05c9a <+0>: pushq %rbp
0x7fff56e05c9b <+1>: movq %rsp, %rbp
0x7fff56e05c9e <+4>: pushq %r15
0x7fff56e05ca0 <+6>: pushq %r14
0x7fff56e05ca2 <+8>: pushq %r13
0x7fff56e05ca4 <+10>: pushq %r12
0x7fff56e05ca6 <+12>: pushq %rbx
0x7fff56e05ca7 <+13>: pushq %rax
0x7fff56e05ca8 <+14>: movq %rcx, %r14
0x7fff56e05cab <+17>: movq %rdx, %rbx
0x7fff56e05cae <+20>: movsd %xmm0, -0x30(%rbp)
0x7fff56e05cb3 <+25>: movq %rdi, %r15
0x7fff56e05cb6 <+28>: movq 0x4e653beb(%rip), %rsi ; "commandQueue"
0x7fff56e05cbd <+35>: movq %rbx, %rdi
0x7fff56e05cc0 <+38>: callq *0x4e5a48d2(%rip) ; (void *)0x00007fff778c0a00: objc_msgSend
0x7fff56e05cc6 <+44>: movq 0x4e656733(%rip), %rsi ; "_renderAtTime:viewport:encoder:passDescriptor:commandQueue:commandBuffer:"
0x7fff56e05ccd <+51>: movq 0x28(%rbp), %r10
0x7fff56e05cd1 <+55>: movq 0x20(%rbp), %r11
0x7fff56e05cd5 <+59>: movq 0x10(%rbp), %r13
0x7fff56e05cd9 <+63>: movq 0x18(%rbp), %r12
0x7fff56e05cdd <+67>: movl $0x0, %edx
0x7fff56e05ce2 <+72>: movq %r15, %rdi
0x7fff56e05ce5 <+75>: movsd -0x30(%rbp), %xmm0 ; xmm0 = mem[0],zero
0x7fff56e05cea <+80>: movq %r14, %rcx
0x7fff56e05ced <+83>: movq %rax, %r8
0x7fff56e05cf0 <+86>: movq %rbx, %r9
0x7fff56e05cf3 <+89>: pushq %r10
0x7fff56e05cf5 <+91>: pushq %r11
0x7fff56e05cf7 <+93>: pushq %r12
0x7fff56e05cf9 <+95>: pushq %r13
0x7fff56e05cfb <+97>: callq *0x4e5a4897(%rip) ; (void *)0x00007fff778c0a00: objc_msgSend
0x7fff56e05d01 <+103>: addq $0x28, %rsp
0x7fff56e05d05 <+107>: popq %rbx
0x7fff56e05d06 <+108>: popq %r12
0x7fff56e05d08 <+110>: popq %r13
0x7fff56e05d0a <+112>: popq %r14
0x7fff56e05d0c <+114>: popq %r15
0x7fff56e05d0e <+116>: popq %rbp
0x7fff56e05d0f <+117>: retq
Pseudocode:
In theory this should work - I have simplified the code.
The problem is that I use the same scene to render it from multiple views (4 port CAD view). I excepted that line 21 SCNRenderer.render just fill up the commandBuffer and that I can call that multiple times - but thats not the case the whole thing deadlocks. What would be the right way to create a 4-port view and still benefit from SceneKit?
I am using macOS Mojave (version 10.14.1 Beta (18B50c)
MacBook Pro (15-inch, 2016)
Graphic Radeon Pro 460 4096 MB
let renderPassDescriptor = view.currentRenderPassDescriptor
if let renderPassDescriptor = renderPassDescriptor {
renderPassDescriptor.colorAttachments[0].loadAction = .clear
renderPassDescriptor.colorAttachments[0].storeAction = .store
let frameRect = renderView.frame;
if let commandBuffer = commandQueue.makeCommandBuffer() {
for vp in renderView.viewports {
if renderView.viewports.count > 1 && vp.uuid() != renderView.viewports.first?.uuid() {
renderPassDescriptor.colorAttachments[0].loadAction = .load
}
let transformedRect = vp.getTransformedFrame(pixelRect: frameRect, contentScaleFactor: contentScaleFactor)
scnRenderer.scene = vp.scene
scnRenderer.pointOfView = vp.camera.getCamera()
vp.scene.renderer(scnRenderer, updateAtTime: time)
scnRenderer.render(atTime: time, viewport: transformedRect, commandBuffer: commandBuffer, passDescriptor: renderPDesc
}
guard let drawable = view.currentDrawable else {
return
}
commandBuffer.present(drawable)
commandBuffer.commit()
commandBuffer.waitUntilCompleted();
}
}