Rhino 9 Mac SDK: supported custom Metal drawing inside a display conduit?

We’re developing a streamed, textured-mesh renderer with GPU polygon masks for Rhino 9 on Apple Silicon.

Using the public C++ SDK, we have successfully obtained non-null Metal device, command queue and render encoder pointers during ExecConduit. Before implementing custom drawing that shares Rhino’s viewport depth, we need clarification on the supported integration contract:

  1. Render-pass configuration: How should a plug-in obtain the active color/depth/stencil attachment formats and sample count, including during viewport capture?
  2. Graphics-state restoration: After setting our pipeline, buffers, textures and depth state on the borrowed encoder, how should we restore state or invalidate Rhino’s cached state so subsequent Rhino drawing remains correct?
  3. Resource lifetime: Does Rhino’s command buffer retain resources referenced by custom draws? What supported mechanism should we use to determine when buffers/textures can safely be recycled?

We understand that the encoder is borrowed, valid only during the conduit callback, and must not be released or have endEncoding called on it.

Is this workflow supported by the current Rhino 9 SDK? Is there a minimal Metal conduit example demonstrating shared-depth drawing and state restoration, or are additional SDK APIs required?

Tested with Rhino 9.0.26293.12304, SDK revision 61e10cdf168367857da853071f686f875d906dca

@stevebaer - when you have a chance can you review?

Hi @stevebaer ,

any advice or references would be greatly appreciated, thanks!

Niko