Stable numeric codes the runtime and the browser side use to name enumerated descriptor values.
More...
|
| std::optional< uint32_t > | donner::gpu::browser::WireTextureFormat (TextureFormat value) |
| | Code for value, or nullopt if it is not a known enumerator.
|
| std::optional< uint32_t > | donner::gpu::browser::WireTextureUsage (TextureUsage value) |
| | Codes for the flags in value, or nullopt if it carries an unrecognized bit. An empty mask encodes as zero.
|
| std::optional< uint32_t > | donner::gpu::browser::WireBufferUsage (BufferUsage value) |
| | Codes for the flags in value, or nullopt if it carries an unrecognized bit. An empty mask encodes as zero.
|
| std::optional< uint32_t > | donner::gpu::browser::WireShaderStage (ShaderStage value) |
| | Codes for the flags in value, or nullopt if it carries an unrecognized bit. An empty mask encodes as zero.
|
| std::optional< uint32_t > | donner::gpu::browser::WireColorWriteMask (ColorWriteMask value) |
| | Codes for the flags in value, or nullopt if it carries an unrecognized bit. An empty mask encodes as zero.
|
| std::optional< uint32_t > | donner::gpu::browser::WireFilterMode (FilterMode value) |
| | Code for value, or nullopt if it is not a known enumerator.
|
| std::optional< uint32_t > | donner::gpu::browser::WireAddressMode (AddressMode value) |
| | Code for value, or nullopt if it is not a known enumerator.
|
| std::optional< uint32_t > | donner::gpu::browser::WireVertexFormat (VertexFormat value) |
| | Code for value, or nullopt if it is not a known enumerator.
|
| std::optional< uint32_t > | donner::gpu::browser::WireVertexStepMode (VertexStepMode value) |
| | Code for value, or nullopt if it is not a known enumerator.
|
| std::optional< uint32_t > | donner::gpu::browser::WireIndexFormat (IndexFormat value) |
| | Code for value, or nullopt if it is not a known enumerator.
|
| std::optional< uint32_t > | donner::gpu::browser::WirePrimitiveTopology (PrimitiveTopology value) |
| | Code for value, or nullopt if it is not a known enumerator.
|
| std::optional< uint32_t > | donner::gpu::browser::WireCullMode (CullMode value) |
| | Code for value, or nullopt if it is not a known enumerator.
|
| std::optional< uint32_t > | donner::gpu::browser::WireBlendFactor (BlendFactor value) |
| | Code for value, or nullopt if it is not a known enumerator.
|
| std::optional< uint32_t > | donner::gpu::browser::WireBlendOperation (BlendOperation value) |
| | Code for value, or nullopt if it is not a known enumerator.
|
| std::optional< uint32_t > | donner::gpu::browser::WireBindingType (BindingType value) |
| | Code for value, or nullopt if it is not a known enumerator.
|
| std::optional< uint32_t > | donner::gpu::browser::WireLoadOp (LoadOp value) |
| | Code for value, or nullopt if it is not a known enumerator.
|
| std::optional< uint32_t > | donner::gpu::browser::WireStoreOp (StoreOp value) |
| | Code for value, or nullopt if it is not a known enumerator.
|
| std::optional< uint32_t > | donner::gpu::browser::WirePresentMode (PresentMode value) |
| | Code for value, or nullopt if it is not a known enumerator.
|
| std::optional< uint32_t > | donner::gpu::browser::WireSurfaceAlphaMode (SurfaceAlphaMode value) |
| | Code for value, or nullopt if it is not a known enumerator.
|
| std::optional< uint32_t > | donner::gpu::browser::WireBrowserObjectKind (BrowserObjectKind value) |
| | Code for value, or nullopt if it is not a known kind.
|
| std::optional< BridgeStatus > | donner::gpu::browser::BridgeStatusFromWire (uint32_t code) |
| | The status code stands for, or nullopt if this protocol assigns it none.
|
| std::optional< BrowserDeviceRequestState > | donner::gpu::browser::RequestStateFromWire (uint32_t code) |
| | The request state code stands for, or nullopt if this protocol assigns it none.
|
| std::optional< MapSliceState > | donner::gpu::browser::MapSliceStateFromWire (uint32_t code) |
| | The mapping state code stands for, or nullopt if this protocol assigns it none.
|
| std::optional< SurfaceStatus > | donner::gpu::browser::SurfaceStatusFromWire (uint32_t code) |
| | The surface outcome code stands for, or nullopt if this protocol assigns it none.
|
| std::span< const uint32_t > | donner::gpu::browser::ProtocolCodeTable () |
| | Every code this protocol assigns, in one fixed order.
|
Stable numeric codes the runtime and the browser side use to name enumerated descriptor values.
The browser side is JavaScript, so it cannot share the runtime's C++ enumerators. Rather than let it read their underlying values - which would turn reordering an enumerator into a silent change of what a descriptor means - every enumerated value that crosses the boundary is translated here into a code that is fixed for the life of the protocol.
Three things keep the two halves in agreement, and it is worth being exact about which does what, because none of them covers the others:
- The translations below are exhaustive switches, so adding an enumerator without giving it a code fails to compile and removing one stops compiling at its use.
- The tests in this package pin every code, so changing a number on this side is a test failure. They cannot see the JavaScript side.
- ProtocolCodeTable is compared against the table library_donner_gpu.js holds, element by element, before a device is requested. That is the check that covers the JavaScript side, and it is a runtime one: a disagreement fails the device request rather than the build.
Linking covers something narrower still: it proves the C++ half references no entry point the library leaves undefined. It does not check parameter lists, because a JavaScript function ignores extra arguments and reads missing ones as undefined.
Every translation is total over the enumerators it accepts and returns nullopt for anything else, so a value that reached here without passing the runtime's own enum validation stops at the boundary instead of being handed to the browser as a number it will interpret as something else.