Donner SVG main
0.8.0 ยท 766e862a0.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
BrowserDeferredCalls.h File Reference

Browser calls a thread defers to its next round trip to the browser GPU owner. More...

#include <array>
#include <atomic>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <functional>
#include <memory>
#include <span>
#include <string_view>
#include <utility>
#include <vector>
#include "donner/gpu/browser/BrowserBridge.h"
Include dependency graph for BrowserDeferredCalls.h:
This graph shows which files directly or indirectly include this file:

Classes

class  donner::gpu::browser::BrowserOwnerChannel
 How a thread reaches the browser GPU owner: whether its calls cross threads at all, and a synchronous run of one owner callback. More...
class  donner::gpu::browser::BrowserDeferredCalls
 Browser calls whose answer the calling thread does not wait for, held until its next round trip to the GPU owner carries them, in call order, ahead of that round trip's own call. More...
struct  donner::gpu::browser::BrowserDeferredCalls::Call
 One held call. More...
struct  donner::gpu::browser::BrowserDeferredCalls::Report
 What one round trip's held calls reported. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Enumerations

enum class  donner::gpu::browser::BrowserDeferredOperation : uint8_t {
  WriteBuffer ,
  CreateBindGroup ,
  CreateBindGroupLayout ,
  DestroyObject
}
 The bridge operations a thread defers, and the only ones. The browser bridge passes one of these to defer a call; anything else is a direct round trip. More...

Functions

constexpr std::string_view donner::gpu::browser::BrowserDeferredOperationName (BrowserDeferredOperation operation)
 Bridge method name of operation.

Variables

constexpr std::array< std::string_view, 4 > donner::gpu::browser::kBrowserDeferredOperationNames
 Bridge method name of each BrowserDeferredOperation, in enumerator order.

Detailed Description

Browser calls a thread defers to its next round trip to the browser GPU owner.


Class Documentation

◆ donner::gpu::browser::BrowserDeferredCalls::Call

struct donner::gpu::browser::BrowserDeferredCalls::Call

One held call.

Class Members
function< BridgeStatus()> execute
uint64_t objectId = 0 Identifier of the object it writes, builds or destroys. Runs it on the owner; owns copies of everything it reads.
BrowserDeferredOperation operation = BrowserDeferredOperation::WriteBuffer Its kind.
shared_ptr< BrowserDeferredOrigin > origin The device that made it; kept alive by the call.

◆ donner::gpu::browser::BrowserDeferredCalls::Report

struct donner::gpu::browser::BrowserDeferredCalls::Report

What one round trip's held calls reported.

Class Members
bool carriedCallSkipped = false
uint64_t objectId = 0 Its object identifier.
BrowserDeferredOperation operation = BrowserDeferredOperation::WriteBuffer First refused call. Meaningful when refused is nonzero.
size_t refused = 0 Refused calls.
size_t skipped = 0 Calls not run because their device was released. Whether the round trip's own call was not run, because its device had a call refused in the same trip.
BridgeStatus status = BridgeStatus::Success Its status.

Enumeration Type Documentation

◆ BrowserDeferredOperation

The bridge operations a thread defers, and the only ones. The browser bridge passes one of these to defer a call; anything else is a direct round trip.

Enumerator
WriteBuffer 

writeBuffer.

CreateBindGroup 

createBindGroup.

CreateBindGroupLayout 

createBindGroupLayout.

DestroyObject 

destroyObject.

Function Documentation

◆ BrowserDeferredOperationName()

std::string_view donner::gpu::browser::BrowserDeferredOperationName ( BrowserDeferredOperation operation)
constexpr

Bridge method name of operation.

Parameters
operationDeferred operation.

Variable Documentation

◆ kBrowserDeferredOperationNames

std::array<std::string_view, 4> donner::gpu::browser::kBrowserDeferredOperationNames
inlineconstexpr
Initial value:
= {
"writeBuffer", "createBindGroup", "createBindGroupLayout", "destroyObject"}

Bridge method name of each BrowserDeferredOperation, in enumerator order.