donner::gpu::browser::BrowserBridge - the boundary between the runtime and the browser's GPU service.
More...
#include <array>#include <cstdint>#include <memory>#include <span>#include <string_view>#include <vector>#include "donner/base/RcString.h"#include "donner/gpu/Descriptors.h"#include "donner/gpu/TextureExport.h"#include "donner/gpu/browser/BrowserObjectTable.h"Classes | |
| struct | donner::gpu::browser::BrowserBindGroupLayoutEntry |
| One entry of a bind group layout, with its enumerated values already encoded. More... | |
| struct | donner::gpu::browser::BrowserBindGroupEntry |
| One entry of a bind group, naming the bound object by identifier. More... | |
| struct | donner::gpu::browser::BrowserVertexAttribute |
| One vertex attribute of a render pipeline, with its format already encoded. More... | |
| struct | donner::gpu::browser::BrowserVertexBufferLayout |
| One vertex buffer slot of a render pipeline. More... | |
| struct | donner::gpu::browser::BrowserBlendComponent |
| One blend term of a color target, with its factors and operation already encoded. More... | |
| struct | donner::gpu::browser::BrowserColorTarget |
| One color target of a render pipeline. More... | |
| struct | donner::gpu::browser::BrowserRenderPipelineRequest |
| A render pipeline, with every referenced object named by identifier. More... | |
| struct | donner::gpu::browser::BrowserComputePipelineRequest |
| A compute pipeline, with every referenced object named by identifier. More... | |
| struct | donner::gpu::browser::BrowserColorAttachment |
| One color attachment of a render pass, naming its view by identifier. More... | |
| struct | donner::gpu::browser::BrowserCopyRegion |
| A rectangular region of texels, for the copy operations. More... | |
| struct | donner::gpu::browser::BrowserTexelLayout |
| The byte layout of texel rows in a copy, already flattened to scalars. More... | |
| struct | donner::gpu::browser::BrowserSurfaceCapabilities |
| What a browser surface reports it supports. More... | |
| class | donner::gpu::browser::BrowserSharedTexture |
| A texture one logical device has shared with the others over the same browser device. More... | |
| class | donner::gpu::browser::BrowserBridge |
| The browser's GPU service, as the runtime uses it. 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::BridgeStatus : uint8_t { Success , UnknownObject , WrongObjectKind , NotOwner , DeviceLost , Failed } |
| What the browser side reports for one bridge call. More... | |
| enum class | donner::gpu::browser::BrowserDeviceRequestState : uint8_t { Pending , Ready , Unavailable , Failed } |
| Progress of an asynchronous request for a browser GPU device. More... | |
| enum class | donner::gpu::browser::BrowserBindingResource : uint8_t { Buffer , TextureView , Sampler } |
| Which kind of resource a donner::gpu::browser::BrowserBindGroupEntry binds. More... | |
Functions | |
| std::ostream & | donner::gpu::browser::operator<< (std::ostream &os, BridgeStatus value) |
| Ostream output operator. | |
| std::ostream & | donner::gpu::browser::operator<< (std::ostream &os, BrowserDeviceRequestState value) |
| Ostream output operator. | |
| std::ostream & | donner::gpu::browser::operator<< (std::ostream &os, BrowserBindingResource value) |
| Ostream output operator. | |
donner::gpu::browser::BrowserBridge - the boundary between the runtime and the browser's GPU service.
Everything below the runtime's validation and above the browser's own API passes through this interface. It is deliberately narrow and flat: objects are named by donner::gpu::browser::BrowserObjectId, every enumerated value arrives as a BrowserWireCodes.h code, and every payload is a span of bytes the browser side copies out. Nothing that could name host memory - a pointer, a native handle, a callback address - crosses it.
Recorded commands are replayed one call at a time rather than handed over as an encoded stream. That keeps the browser side free of a decoder: every operation it performs is one it was called for, with arguments the runtime already validated, so there is no length, opcode or arity arithmetic on the far side to get wrong.
The interface is abstract so the runtime's behavior can be tested without a browser. The production implementation calls the browser; the test implementation records what it was asked to do.
|
strong |
What the browser side reports for one bridge call.
The refusals are separated because they mean different things about what went wrong. An identifier the browser side has never heard of, one that names a live object of another kind, and a call from a context that does not own the device are three distinct failures of the caller; a lost device and a browser-side rejection are failures of the environment.
|
strong |
Which kind of resource a donner::gpu::browser::BrowserBindGroupEntry binds.
| Enumerator | |
|---|---|
| Buffer | A range of a buffer. |
| TextureView | A texture view. |
| Sampler | A sampler. |
|
strong |
Progress of an asynchronous request for a browser GPU device.
A browser hands over a device through promises, so the request has a lifetime of its own rather than being an outcome the constructor can report. The two failures are separated because they call for different responses: a browser with no GPU service at all is donner::gpu::browser::BrowserDeviceRequestState::Unavailable and the caller falls back, while a service that refused this request is donner::gpu::browser::BrowserDeviceRequestState::Failed and the reason says why.
| Enumerator | |
|---|---|
| Pending | The browser has not settled the request yet. |
| Ready | A device is available. |
| Unavailable | The browser exposes no GPU service. |
| Failed | The browser refused to supply a device. |
| std::ostream & donner::gpu::browser::operator<< | ( | std::ostream & | os, |
| BridgeStatus | value ) |
Ostream output operator.
| os | Output stream. |
| value | Value to output. |
| std::ostream & donner::gpu::browser::operator<< | ( | std::ostream & | os, |
| BrowserBindingResource | value ) |
Ostream output operator.
| os | Output stream. |
| value | Value to output. |
| std::ostream & donner::gpu::browser::operator<< | ( | std::ostream & | os, |
| BrowserDeviceRequestState | value ) |
Ostream output operator.
| os | Output stream. |
| value | Value to output. |