Donner SVG main
0.8.0 ยท 766e862a0.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::gpu::browser::BrowserPublishedState Struct Reference

Liveness and completion that the browser side of one logical device publishes into memory its owning thread can read, so that thread answers its ownership, loss and completion queries without a synchronous browser call. More...

#include "donner/gpu/browser/BrowserBridge.h"

Public Attributes

std::atomic< uint32_t > status {kUnpublished}
 One of kUnpublished, kLive or kLost.
std::atomic< uint64_t > completedSerial {0}
 Serial of the most recent submission the browser has reported finished.

Static Public Attributes

static constexpr uint32_t kUnpublished = 0
 Status before the browser side has published anything: every query asks the browser.
static constexpr uint32_t kLive = 1
 Status of an owned, live device.
static constexpr uint32_t kLost = 2
 Status of an owned device the browser has reported lost. Permanent.

Detailed Description

Liveness and completion that the browser side of one logical device publishes into memory its owning thread can read, so that thread answers its ownership, loss and completion queries without a synchronous browser call.

The browser side stores each value with a sequentially consistent atomic store, after the state it reports has changed, from the same browser task that changed it; readers load with acquire. A loaded value is therefore one the browser side held at or before the load, never one it has not reached yet, which keeps every stale read conservative:

  • completedSerial only grows, and is stored from the browser's completion callback for the submission it names. A reader can see less work complete than has finished, never more.
  • Status moves from kUnpublished to kLive or kLost, and from kLive to kLost, never back. A reader that still sees kLive has read before the browser task that recorded the loss, which a synchronous query issued at that moment would also have answered as live.

The browser side stops storing when the logical device is released, which the bridge's destructor does before the bridge, and this state inside it, goes away. Reading it is not a browser call, so a read after the GPU owner has stopped does not fail closed by itself; the reader's next browser call does.


The documentation for this struct was generated from the following file: