attachVulkanBorrowedTexture method

RenderSessionHandle attachVulkanBorrowedTexture(
  1. VulkanBorrowedTextureDescriptor descriptor,
  2. RenderSessionAttachOptions options
)

Creates a session that renders the map into a ring of your Vulkan images.

See mln_map_attach_vulkan_borrowed_texture in the C API reference.

Errors:

  • Status.unsupported when supportedRenderBackendMask() lacks RenderBackendFlag.vulkan, or when the target supports none of the producer_sync_kinds in options.

Implementation

RenderSessionHandle attachVulkanBorrowedTexture(
  VulkanBorrowedTextureDescriptor descriptor,
  RenderSessionAttachOptions options,
) {
  final registrations = _NativeRegistrations(_CallbackRoots());
  return _attach(
    (arena, completion, outSession) => registrations.run(
      () => raw.mln_map_attach_vulkan_borrowed_texture(
        _handle.raw,
        _writeVulkanBorrowedTextureDescriptor(descriptor, arena),
        _writeRenderSessionAttachOptions(options, arena, registrations),
        outSession,
        completion,
        nativeDiagnostic,
      ),
    ),
    (handle, ready) => _adoptOwned(
      handle,
      () =>
          (RenderSessionHandle._(this, _NativeRenderSession(handle), ready)
            .._state.retain(registrations)),
      (handle) {
        _check(raw.mln_render_session_dispose(handle, nativeDiagnostic));
      },
    ),
  );
}