release method

void release(
  1. GpuSync consumerCompletion
)

Gives an acquired frame back to the session once you're done reading it.

consumerCompletion says when your GPU work that reads the texture finishes. Pass GpuSyncKind.cpuComplete when that work has already finished. The session waits for that point before it renders into the texture again. If that wait fails, such as for an OpenGL fence outside the session's share group, the session fails.

See mln_acquired_frame_release in the C API reference.

Errors:

  • Status.unsupported when RenderSessionCapabilities.consumerSyncKinds lacks the kind of consumerCompletion.

Implementation

void release(GpuSync consumerCompletion) => _state.close(
  (handle) => withNativeArena(
    (arena) => raw.mln_acquired_frame_release(
      handle.raw,
      _writeGpuSync(consumerCompletion, arena),
      nativeDiagnostic,
    ),
  ),
);