Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
BrowserObjectTable.h File Reference

donner::gpu::browser::BrowserObjectTable - checked identifiers for browser-owned objects. More...

#include <array>
#include <cstddef>
#include <cstdint>
#include <optional>
#include <ostream>
#include <string_view>
#include <utility>
#include <vector>
Include dependency graph for BrowserObjectTable.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::gpu::browser::BrowserObjectInsertion
 What BrowserObjectTable::insert did: the identifier it minted, and any identifier the slot was still holding. More...
class  donner::gpu::browser::BrowserObjectTable
 Maps the runtime's per-kind resource slots to the identifiers the browser side knows them by. More...

Namespaces

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

Typedefs

using donner::gpu::browser::BrowserObjectId = uint32_t
 Identifier of one object the browser side owns.

Enumerations

enum class  donner::gpu::browser::BrowserObjectKind : uint8_t {
  Buffer ,
  Texture ,
  TextureView ,
  Sampler ,
  BindGroupLayout ,
  BindGroup ,
  PipelineLayout ,
  ShaderModule ,
  RenderPipeline ,
  ComputePipeline ,
  Surface ,
  BufferMapping ,
  kCount
}
 Kind of browser object a BrowserObjectId names. More...

Functions

std::string_view donner::gpu::browser::BrowserObjectKindName (BrowserObjectKind kind)
 Returns the name of kind, e.g. "buffer". Used in diagnostics.
std::ostream & donner::gpu::browser::operator<< (std::ostream &os, BrowserObjectKind value)
 Ostream output operator.

Variables

constexpr size_t donner::gpu::browser::kBrowserObjectKindCount = static_cast<size_t>(BrowserObjectKind::kCount)
 Number of BrowserObjectKind enumerators, for per-kind table sizing.
constexpr BrowserObjectId donner::gpu::browser::kNoBrowserObject = 0
 Identifier value that names no browser object. Every operation refuses it.

Detailed Description

donner::gpu::browser::BrowserObjectTable - checked identifiers for browser-owned objects.

Typedef Documentation

◆ BrowserObjectId

Identifier of one object the browser side owns.

Identifiers are minted in increasing order and never reused, so an identifier retained past its object's destruction names nothing rather than naming whatever was created next. That is the property slot indices alone cannot provide: the runtime recycles slots, so a stale slot index would eventually address a live object of the same kind.

Enumeration Type Documentation

◆ BrowserObjectKind

enum class donner::gpu::browser::BrowserObjectKind : uint8_t
strong

Kind of browser object a BrowserObjectId names.

The kind travels with every identifier so the browser side can refuse an identifier that names a live object of the wrong kind, rather than calling a texture method on a buffer and surfacing whatever the browser makes of that.

Enumerator
Buffer 

A buffer.

Texture 

A texture.

TextureView 

A view of a texture.

Sampler 

A sampler.

BindGroupLayout 

A bind group layout.

BindGroup 

A bind group.

PipelineLayout 

A pipeline layout.

ShaderModule 

A shader module.

RenderPipeline 

A render pipeline.

ComputePipeline 

A compute pipeline.

Surface 

A presentation surface and the canvas context behind it.

BufferMapping 

A host mapping of a buffer range.

kCount 

Number of kinds. Not a kind; it exists so per-kind storage and the protocol table below are sized by the enumeration itself rather than by a number kept in step with it by hand.

Function Documentation

◆ BrowserObjectKindName()

std::string_view donner::gpu::browser::BrowserObjectKindName ( BrowserObjectKind kind)

Returns the name of kind, e.g. "buffer". Used in diagnostics.

Parameters
kindKind to name.

◆ operator<<()

std::ostream & donner::gpu::browser::operator<< ( std::ostream & os,
BrowserObjectKind value )

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.