Vixen
dd8b0a81
csharp
public readonly record struct TimelinePoint

A point in one queue's submission history, which another submission may wait for.

Read the guide page for this →

Remarks

The unit of cross-queue synchronisation, and deliberately not a handle. A caller waits for a submission it made rather than for a semaphore it allocated, which is the difference between "the compute segment's dispatches have finished" and "somebody signalled something". Submitting is how one is obtained — Submit returns the point its own work reaches — so the natural way to use this is also the correct one.

⚠ It is a plain record and one can be built by hand, which nothing should do. A value beyond what will ever be signalled is a device-side hang with no validation message and no stack. The type cannot prevent it — the constructor is what deserialisation, the debugger and a test all need — so the check lives where it is cheap instead: NullDevice refuses a point its queues never issued.

⚠ One counter per queue, never one per device. A single counter shared across queues would have to be signalled with increasing values by submissions that finish in an order nobody controls, and a timeline semaphore signalled backwards is invalid usage. Per queue, submissions finish in the order they were made and the counter only climbs.

⚠ Queue is which submitter, not which hardware queue. On a device whose graphics and compute kinds land on one family they share a counter, so a Compute point and a Graphics point are two values on the same timeline — and waiting for one from the other is satisfied by submission order alone. That is exactly what makes a one-queue device produce the same frame as a two-queue one.

Fields and properties (4)

  • public QueueKind Queue

    Whose history it is a point in.

  • public ulong Value

    How many submissions that queue has to have finished to have reached it. Counted from 1; 0 is None, the point every queue has already passed.

  • public static TimelinePoint None

    The point every queue has already reached, which waiting for costs nothing.

  • public bool IsNone

    Whether it is None.

Methods (1)

  • public TimelinePoint(QueueKind Queue, ulong Value)

    A point in one queue's submission history, which another submission may wait for.

Used by (9)

  • CommandRecorderTestsVixen.Graphics.Null.Tests
  • DeviceQueuesVixen.Graphics.RenderGraph
  • ICommandSubmitterVixen.Graphics
  • NullSubmitterVixen.Graphics.Null
  • TimelinePointTestsVixen.Graphics.Tests
  • TimelineSubmissionTestsVixen.Graphics.RenderGraph.Tests
  • TimelineSubmitTestsVixen.Graphics.Vulkan.Tests
  • VulkanDeviceVixen.Graphics.Vulkan
  • VulkanQueueVixen.Graphics.Vulkan