Table of Contents

Struct RenderSessionAttachOptions

Namespace
Maplibre.NativeFfi
Assembly
Maplibre.NativeFfi.dll

Options for attaching a render session to a map.

public readonly record struct RenderSessionAttachOptions : IEquatable<RenderSessionAttachOptions>
Implements
Inherited Members

Remarks

See mln_render_session_attach_options in the C API reference.

Constructors

RenderSessionAttachOptions(RenderDriverKind, GpuSyncKindFlag, Wake, Wake, Wake, QueueLock)

[SetsRequiredMembers]
public RenderSessionAttachOptions(RenderDriverKind Driver, GpuSyncKindFlag ProducerSyncKinds, Wake FrameWake, Wake RedrawWake, Wake DriverWorkWake, QueueLock QueueLock)

Parameters

Driver RenderDriverKind
ProducerSyncKinds GpuSyncKindFlag
FrameWake Wake
RedrawWake Wake
DriverWorkWake Wake
QueueLock QueueLock

Properties

Driver

The thread that runs the session's graphics work, which depends on the target:

public required RenderDriverKind Driver { get; init; }

Property Value

RenderDriverKind

Remarks

  • RenderDriverKind.CallerGraphicsThread for a shared or dedicated EGL or WGL context, an existing WebGL context, or a browser's WebGPU device.
  • RenderDriverKind.CoreWorker for a transferred WebGL canvas, an Android, OpenHarmony, or Win32 window, a Wayland surface, a ring of Android hardware buffers, dmabufs, DXGI shared textures, or IOSurfaces, or an offscreen session.
  • Either one for another Metal or Vulkan target.

An attach with another driver fails with Status.Unsupported.

DriverWorkWake

Called when a session driven by RenderDriverKind.CallerGraphicsThread has work for RenderSessionHandle.ServiceDriverWork(). It isn't called again until a service runs.

public Wake DriverWorkWake { get; init; }

Property Value

Wake

FrameWake

Called when frame results are waiting for RenderSessionHandle.DrainFrameResults(). It isn't called again until a drain takes them.

public Wake FrameWake { get; init; }

Property Value

Wake

ProducerSyncKinds

The kinds of GpuSync that you can wait on before you read an acquired frame. The session uses one of them that its target supports. Zero lets the session pick a kind that names no object to wait on.

public GpuSyncKindFlag ProducerSyncKinds { get; init; }

Property Value

GpuSyncKindFlag

QueueLock

Your lock on the Vulkan queue, when you submit to it yourself.

public QueueLock QueueLock { get; init; }

Property Value

QueueLock

RedrawWake

Called when the session has something new to draw. Demand a frame at your next display refresh. It isn't called again until you demand a frame, or while the session has no target.

public Wake RedrawWake { get; init; }

Property Value

Wake