Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
Descriptors.h File Reference

Typed immutable descriptors for donner::gpu resource creation. More...

#include <array>
#include <cstdint>
#include <optional>
#include <ostream>
#include <type_traits>
#include <variant>
#include <vector>
#include "donner/base/RcString.h"
#include "donner/gpu/Handles.h"
Include dependency graph for Descriptors.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::gpu::IsBitmaskEnum< T >
 Marks an enum as a bitmask, enabling operator|, operator&, operator|=, and HasAllFlags. More...
struct  donner::gpu::NativeSurfaceHandle
 The platform object a surface presents to. More...
struct  donner::gpu::SurfaceDescriptor
 Descriptor for Device::createSurface. More...
struct  donner::gpu::MapWaitParams
 Bounds of a wait for a pending buffer mapping. More...
struct  donner::gpu::Extent2d
 A 2D extent in texels. More...
struct  donner::gpu::Origin2d
 A 2D texel coordinate, used as the corner a copy region starts at. The default (0, 0) is the whole-rect-from-the-origin convention every copy used before sub-rectangle copies existed. More...
struct  donner::gpu::BufferDescriptor
 Descriptor for Device::createBuffer. More...
struct  donner::gpu::TextureDescriptor
 Descriptor for Device::createTexture. All Donner textures are 2D, single-mip. More...
struct  donner::gpu::TextureViewDescriptor
 Descriptor for Device::createTextureView. Views cover the whole texture. More...
struct  donner::gpu::SurfaceConfiguration
 Configuration a surface presents under. More...
struct  donner::gpu::SurfaceCapabilities
 What a surface supports, for choosing a SurfaceConfiguration. More...
struct  donner::gpu::SamplerDescriptor
 Descriptor for Device::createSampler. More...
struct  donner::gpu::BindGroupLayoutEntry
 One entry of a BindGroupLayoutDescriptor. More...
struct  donner::gpu::BindGroupLayoutDescriptor
 Descriptor for Device::createBindGroupLayout. More...
struct  donner::gpu::PipelineLayoutDescriptor
 Descriptor for Device::createPipelineLayout. More...
struct  donner::gpu::WorkgroupSize
 Workgroup size a compute entry point declares. More...
struct  donner::gpu::ComputeEntryPointInfo
 One compute entry point a shader module contains, with the workgroup size compiled into it. More...
struct  donner::gpu::ShaderModuleDescriptor
 Descriptor for Device::createShaderModule. Source is trusted generated build output, never runtime input from documents. Exactly one source representation must be populated: text kinds (ShaderSourceKind::Wgsl, ShaderSourceKind::Msl) require nonempty sourceText and empty spirvWords; ShaderSourceKind::Spirv requires nonempty spirvWords and empty sourceText. Device::createShaderModule fails closed on any other combination. More...
struct  donner::gpu::VertexAttribute
 One vertex attribute within a VertexBufferLayout. More...
struct  donner::gpu::VertexBufferLayout
 Layout of one vertex buffer slot of a render pipeline. More...
struct  donner::gpu::BlendComponent
 One blend term (color or alpha) of a BlendState. More...
struct  donner::gpu::BlendState
 Blend state for one color target. More...
struct  donner::gpu::ColorTargetState
 One color target of a render pipeline's fragment stage. More...
struct  donner::gpu::VertexState
 Vertex stage of a RenderPipelineDescriptor. More...
struct  donner::gpu::FragmentState
 Fragment stage of a RenderPipelineDescriptor. More...
struct  donner::gpu::ComputeState
 Compute stage of a ComputePipelineDescriptor. More...
struct  donner::gpu::ComputePipelineDescriptor
 Descriptor for Device::createComputePipeline. More...
struct  donner::gpu::ComputePassDescriptor
 Descriptor for CommandEncoder::beginComputePass. More...
struct  donner::gpu::RenderPipelineDescriptor
 Descriptor for Device::createRenderPipeline. More...
struct  donner::gpu::RenderPassColorAttachment
 One color attachment of a RenderPassDescriptor. More...
struct  donner::gpu::RenderPassDescriptor
 Descriptor for CommandEncoder::beginRenderPass. More...
struct  donner::gpu::TexelCopyTextureInfo
 Source texture of a texture-to-buffer copy. Copies start at texel (0, 0). More...
struct  donner::gpu::TexelCopyBufferLayout
 Byte layout of texel rows in buffer or host memory for copy operations. More...
struct  donner::gpu::BufferBinding
 A buffer range bound through a bind group. More...
struct  donner::gpu::TextureViewBinding
 A texture view bound through a bind group. More...
struct  donner::gpu::SamplerBinding
 A sampler bound through a bind group. More...
struct  donner::gpu::BindGroupEntry
 One entry of a BindGroupDescriptor. The resource alternative must match the BindingType of the layout entry with the same binding index. More...
struct  donner::gpu::BindGroupDescriptor
 Descriptor for Device::createBindGroup. More...

Namespaces

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

Concepts

concept  donner::gpu::BitmaskEnum
 Concept satisfied by enums marked with IsBitmaskEnum.

Enumerations

enum class  donner::gpu::TextureFormat : uint8_t {
  RGBA8Unorm ,
  BGRA8Unorm ,
  R8Unorm
}
 Texture formats used by Donner render targets, masks, and image uploads. More...
enum class  donner::gpu::TextureUsage : uint32_t {
  None = 0 ,
  RenderAttachment = 1 << 0 ,
  Sampled = 1 << 1 ,
  CopySrc = 1 << 2 ,
  CopyDst = 1 << 3 ,
  StorageBinding = 1 << 4
}
 Texture usage flags. Combinable with |. More...
enum class  donner::gpu::BufferUsage : uint32_t {
  None = 0 ,
  Vertex = 1 << 0 ,
  Index = 1 << 1 ,
  Uniform = 1 << 2 ,
  Storage = 1 << 3 ,
  CopySrc = 1 << 4 ,
  CopyDst = 1 << 5 ,
  MapRead = 1 << 6
}
 Buffer usage flags. Combinable with |. More...
enum class  donner::gpu::NativeSurfaceKind : uint8_t {
  MetalLayer ,
  XlibWindow ,
  WaylandSurface ,
  CanvasSelector
}
 Platform object kind a NativeSurfaceHandle names. More...
enum class  donner::gpu::PresentMode : uint8_t {
  Fifo ,
  Immediate ,
  Mailbox
}
 How presented frames are paced. More...
enum class  donner::gpu::SurfaceAlphaMode : uint8_t {
  Opaque ,
  Premultiplied ,
  Inherit
}
 How a surface composites its alpha channel with what is behind it. More...
enum class  donner::gpu::MapMode : uint8_t { Read }
 How a mapped buffer range is accessed from the host. More...
enum class  donner::gpu::MapSliceState : uint8_t {
  Pending ,
  Ready ,
  DeviceLost ,
  Failed
}
 State of a pending buffer mapping after one backend wait slice. More...
enum class  donner::gpu::MapWaitOutcome : uint8_t {
  Ready ,
  TimedOut ,
  Cancelled ,
  DeviceLost ,
  Failed
}
 Outcome of a bounded wait for a pending buffer mapping. More...
enum class  donner::gpu::ShaderStage : uint32_t {
  None = 0 ,
  Vertex = 1 << 0 ,
  Fragment = 1 << 1 ,
  Compute = 1 << 2
}
 Shader stage visibility flags for bindings. Combinable with |. More...
enum class  donner::gpu::ColorWriteMask : uint32_t {
  None = 0 ,
  Red = 1 << 0 ,
  Green = 1 << 1 ,
  Blue = 1 << 2 ,
  Alpha = 1 << 3 ,
  All = Red | Green | Blue | Alpha
}
 Per-channel color write mask for a color target. Combinable with |. More...
enum class  donner::gpu::FilterMode : uint8_t {
  Nearest ,
  Linear
}
 Sampler minification/magnification filter. More...
enum class  donner::gpu::AddressMode : uint8_t {
  ClampToEdge ,
  Repeat
}
 Sampler texture addressing mode. More...
enum class  donner::gpu::VertexFormat : uint8_t {
  Float32x2 ,
  Float32x4 ,
  Uint32
}
 Vertex attribute formats used by Donner pipelines. More...
enum class  donner::gpu::VertexStepMode : uint8_t {
  Vertex ,
  Instance
}
 Rate at which a vertex buffer is stepped through during a draw. More...
enum class  donner::gpu::PrimitiveTopology : uint8_t {
  TriangleList ,
  TriangleStrip
}
 Primitive topology for render pipelines. More...
enum class  donner::gpu::CullMode : uint8_t {
  None ,
  Back
}
 Face culling mode for render pipelines. More...
enum class  donner::gpu::BlendFactor : uint8_t {
  Zero ,
  One ,
  SrcAlpha ,
  OneMinusSrcAlpha ,
  OneMinusDstAlpha
}
 Blend factors used by Donner pipelines (premultiplied-alpha compositing). More...
enum class  donner::gpu::BlendOperation : uint8_t {
  Add ,
  Max
}
 Blend operations used by Donner pipelines. More...
enum class  donner::gpu::BindingType : uint8_t {
  UniformBuffer ,
  ReadOnlyStorageBuffer ,
  SampledTexture2dFloat ,
  FilteringSampler ,
  WriteOnlyStorageTexture2d
}
 Type of resource a bind group layout entry expects. More...
enum class  donner::gpu::LoadOp : uint8_t {
  Clear ,
  Load
}
 Load operation for a render pass color attachment. More...
enum class  donner::gpu::StoreOp : uint8_t {
  Store ,
  Discard
}
 Store operation for a render pass color attachment. More...
enum class  donner::gpu::ShaderSourceKind : uint8_t {
  Wgsl ,
  Msl ,
  Spirv
}
 Shader source language of a ShaderModuleDescriptor. More...
enum class  donner::gpu::SurfaceStatus : uint8_t {
  Success ,
  Outdated ,
  Lost ,
  DeviceLost ,
  Timeout
}
 Outcome of acquiring from or presenting to a surface. More...

Functions

template<BitmaskEnum T>
constexpr T donner::gpu::operator| (T lhs, T rhs)
 Bitwise-or for bitmask enums.
template<BitmaskEnum T>
constexpr T donner::gpu::operator& (T lhs, T rhs)
 Bitwise-and for bitmask enums.
template<BitmaskEnum T>
constexpr T & donner::gpu::operator|= (T &lhs, T rhs)
 Bitwise-or-assign for bitmask enums.
template<BitmaskEnum T>
constexpr bool donner::gpu::HasAllFlags (T value, T flags)
 Returns true if value contains every flag in flags.
std::ostream & donner::gpu::operator<< (std::ostream &os, TextureFormat value)
 Ostream output operator.
std::ostream & donner::gpu::operator<< (std::ostream &os, TextureUsage value)
 Ostream output operator, e.g. RenderAttachment|CopySrc, or None when no flags are set.
std::ostream & donner::gpu::operator<< (std::ostream &os, BufferUsage value)
 Ostream output operator, e.g. Vertex|CopyDst, or None when no flags are set.
std::ostream & donner::gpu::operator<< (std::ostream &os, ShaderStage value)
 Ostream output operator, e.g. Vertex|Fragment, or None when no flags are set.
std::ostream & donner::gpu::operator<< (std::ostream &os, ColorWriteMask value)
 Ostream output operator, e.g. Red|Green|Blue|Alpha, or None when no flags are set.
std::ostream & donner::gpu::operator<< (std::ostream &os, FilterMode value)
 Ostream output operator.
std::ostream & donner::gpu::operator<< (std::ostream &os, AddressMode value)
 Ostream output operator.
std::ostream & donner::gpu::operator<< (std::ostream &os, VertexFormat value)
 Ostream output operator.
std::ostream & donner::gpu::operator<< (std::ostream &os, VertexStepMode value)
 Ostream output operator.
std::ostream & donner::gpu::operator<< (std::ostream &os, PrimitiveTopology value)
 Ostream output operator.
std::ostream & donner::gpu::operator<< (std::ostream &os, CullMode value)
 Ostream output operator.
std::ostream & donner::gpu::operator<< (std::ostream &os, BlendFactor value)
 Ostream output operator.
std::ostream & donner::gpu::operator<< (std::ostream &os, BlendOperation value)
 Ostream output operator.
std::ostream & donner::gpu::operator<< (std::ostream &os, BindingType value)
 Ostream output operator.
std::ostream & donner::gpu::operator<< (std::ostream &os, LoadOp value)
 Ostream output operator.
std::ostream & donner::gpu::operator<< (std::ostream &os, StoreOp value)
 Ostream output operator.
std::ostream & donner::gpu::operator<< (std::ostream &os, ShaderSourceKind value)
 Ostream output operator.
std::ostream & donner::gpu::operator<< (std::ostream &os, NativeSurfaceKind value)
 Ostream output operator.
std::ostream & donner::gpu::operator<< (std::ostream &os, PresentMode value)
 Ostream output operator.
std::ostream & donner::gpu::operator<< (std::ostream &os, SurfaceAlphaMode value)
 Ostream output operator.
bool donner::gpu::IsKnownEnumValue (TextureFormat value)
 Returns true if value is a known enumerator. Every enum arriving through a descriptor is checked with these overloads so out-of-range casts fail closed with GpuErrorType::InvalidDescriptor instead of flowing into layout or copy math.
bool donner::gpu::IsKnownEnumValue (FilterMode value)
 Returns true if value is a known enumerator.
bool donner::gpu::IsKnownEnumValue (AddressMode value)
 Returns true if value is a known enumerator.
bool donner::gpu::IsKnownEnumValue (VertexFormat value)
 Returns true if value is a known enumerator.
bool donner::gpu::IsKnownEnumValue (VertexStepMode value)
 Returns true if value is a known enumerator.
bool donner::gpu::IsKnownEnumValue (PrimitiveTopology value)
 Returns true if value is a known enumerator.
bool donner::gpu::IsKnownEnumValue (CullMode value)
 Returns true if value is a known enumerator.
bool donner::gpu::IsKnownEnumValue (BlendFactor value)
 Returns true if value is a known enumerator.
bool donner::gpu::IsKnownEnumValue (BlendOperation value)
 Returns true if value is a known enumerator.
bool donner::gpu::IsKnownEnumValue (BindingType value)
 Returns true if value is a known enumerator.
bool donner::gpu::IsKnownEnumValue (LoadOp value)
 Returns true if value is a known enumerator.
bool donner::gpu::IsKnownEnumValue (StoreOp value)
 Returns true if value is a known enumerator.
bool donner::gpu::IsKnownEnumValue (ShaderSourceKind value)
 Returns true if value is a known enumerator.
bool donner::gpu::IsKnownEnumValue (NativeSurfaceKind value)
 Returns true if value is a known enumerator.
bool donner::gpu::IsKnownEnumValue (PresentMode value)
 Returns true if value is a known enumerator.
bool donner::gpu::IsKnownEnumValue (SurfaceAlphaMode value)
 Returns true if value is a known enumerator.
bool donner::gpu::IsValidBitmask (TextureUsage value)
 Returns true if value contains only known flag bits (an empty mask is bit-valid; emptiness is validated separately where required).
bool donner::gpu::IsValidBitmask (BufferUsage value)
 Returns true if value contains only known flag bits.
bool donner::gpu::IsValidBitmask (ShaderStage value)
 Returns true if value contains only known flag bits.
bool donner::gpu::IsValidBitmask (ColorWriteMask value)
 Returns true if value contains only known flag bits.
uint32_t donner::gpu::TextureFormatBytesPerTexel (TextureFormat format)
 Bytes per texel for a TextureFormat.
uint32_t donner::gpu::VertexFormatByteSize (VertexFormat format)
 Byte size of a VertexFormat.
std::ostream & donner::gpu::operator<< (std::ostream &os, SurfaceStatus value)
 Ostream output operator.

Detailed Description

Typed immutable descriptors for donner::gpu resource creation.

The enum and descriptor surface is intentionally narrow: it covers the operations Geode's rendering, filtering, and the editor actually use, not a general GPU API. Descriptors are plain value types, immutable by convention; all validation happens in donner::gpu::Device operations, which fail closed on malformed input.

Enumeration Type Documentation

◆ AddressMode

enum class donner::gpu::AddressMode : uint8_t
strong

Sampler texture addressing mode.

Enumerator
ClampToEdge 

Clamp coordinates to the edge texel.

Repeat 

Wrap coordinates (pattern tiling).

◆ BindingType

enum class donner::gpu::BindingType : uint8_t
strong

Type of resource a bind group layout entry expects.

Enumerator
UniformBuffer 

Uniform buffer binding.

ReadOnlyStorageBuffer 

Read-only storage buffer binding.

SampledTexture2dFloat 

Sampled 2D float texture binding.

FilteringSampler 

Filtering sampler binding.

WriteOnlyStorageTexture2d 

Write-only 2D storage texture binding (compute stage only).

◆ BlendFactor

enum class donner::gpu::BlendFactor : uint8_t
strong

Blend factors used by Donner pipelines (premultiplied-alpha compositing).

Enumerator
Zero 

Factor 0.

One 

Factor 1.

SrcAlpha 

Factor (source alpha).

OneMinusSrcAlpha 

Factor (1 - source alpha).

OneMinusDstAlpha 

Factor (1 - destination alpha); destination-over compositing.

◆ BlendOperation

enum class donner::gpu::BlendOperation : uint8_t
strong

Blend operations used by Donner pipelines.

Enumerator
Add 

Component-wise addition (premultiplied source-over).

Max 

Component-wise maximum (coverage / clip-mask union).

◆ BufferUsage

enum class donner::gpu::BufferUsage : uint32_t
strong

Buffer usage flags. Combinable with |.

Enumerator
None 

No usage; invalid for creation.

Vertex 

Bound as a vertex buffer.

Index 

Bound as an index buffer.

Uniform 

Bound as a uniform buffer.

Storage 

Bound as a read-only storage buffer.

CopySrc 

Source of copy operations.

CopyDst 

Destination of copies and queue writes.

MapRead 

Host-readable after readback.

◆ ColorWriteMask

enum class donner::gpu::ColorWriteMask : uint32_t
strong

Per-channel color write mask for a color target. Combinable with |.

Enumerator
None 

Write no channels.

Red 

Write the red channel.

Green 

Write the green channel.

Blue 

Write the blue channel.

Alpha 

Write the alpha channel.

All 

Write all channels.

◆ CullMode

enum class donner::gpu::CullMode : uint8_t
strong

Face culling mode for render pipelines.

Enumerator
None 

No culling; Donner geometry has no guaranteed winding.

Back 

Cull back faces.

◆ FilterMode

enum class donner::gpu::FilterMode : uint8_t
strong

Sampler minification/magnification filter.

Enumerator
Nearest 

Nearest-texel sampling.

Linear 

Bilinear sampling.

◆ LoadOp

enum class donner::gpu::LoadOp : uint8_t
strong

Load operation for a render pass color attachment.

Enumerator
Clear 

Clear to the attachment's clear color.

Load 

Preserve existing contents.

◆ MapMode

enum class donner::gpu::MapMode : uint8_t
strong

How a mapped buffer range is accessed from the host.

Enumerator
Read 

Host reads the range; the buffer needs BufferUsage::MapRead.

◆ MapSliceState

enum class donner::gpu::MapSliceState : uint8_t
strong

State of a pending buffer mapping after one backend wait slice.

This is what a backend reports; MapWaitOutcome is what the caller of a bounded wait sees, and the two differ because the deadline and the caller's cancellation are decisions the runtime makes, not the backend.

Enumerator
Pending 

The mapping has not completed yet.

Ready 

The mapping completed; its bytes are readable.

DeviceLost 

The device was lost, so the mapping can never complete.

Failed 

The backend reported the mapping itself failed.

◆ MapWaitOutcome

enum class donner::gpu::MapWaitOutcome : uint8_t
strong

Outcome of a bounded wait for a pending buffer mapping.

Every way a wait can end is its own value. A caller that stopped the wait itself, one whose budget ran out, and one whose device died have different recoveries, so folding them into a single failure would throw away the only information that distinguishes them.

Enumerator
Ready 

The mapping completed; its bytes are readable.

TimedOut 

The wait budget elapsed with the mapping still pending.

Cancelled 

The caller's predicate asked to stop waiting.

DeviceLost 

The device was lost, so the mapping can never complete.

Failed 

The backend reported the mapping itself failed.

◆ NativeSurfaceKind

enum class donner::gpu::NativeSurfaceKind : uint8_t
strong

Platform object kind a NativeSurfaceHandle names.

One kind per windowing system this runtime can present to. A browser canvas is named by a CSS selector rather than by a pointer, which is why the handle below carries a string field alongside its pointer fields.

Enumerator
MetalLayer 

Core Animation Metal layer.

XlibWindow 

X11 display plus window id.

WaylandSurface 

Wayland display plus surface. CSS selector naming a browser canvas element.

A browser drives presentation from its own frame loop, so a surface of this kind presents when the host says so rather than when the caller asks: an explicit present on it is rejected rather than performed. Everything else about the surface behaves the same.

◆ PresentMode

enum class donner::gpu::PresentMode : uint8_t
strong

How presented frames are paced.

Enumerator
Fifo 

Queue frames and present on refresh. Always available.

Immediate 

Present without waiting for refresh; may tear.

Mailbox 

Replace the queued frame; no tearing, no blocking.

◆ PrimitiveTopology

enum class donner::gpu::PrimitiveTopology : uint8_t
strong

Primitive topology for render pipelines.

Enumerator
TriangleList 

Separate triangles.

TriangleStrip 

Triangle strip.

◆ ShaderSourceKind

enum class donner::gpu::ShaderSourceKind : uint8_t
strong

Shader source language of a ShaderModuleDescriptor.

Enumerator
Wgsl 

WGSL text.

Msl 

Metal Shading Language text.

Spirv 

SPIR-V binary words (spirvWords; sourceText must be empty).

◆ ShaderStage

enum class donner::gpu::ShaderStage : uint32_t
strong

Shader stage visibility flags for bindings. Combinable with |.

Enumerator
None 

No stage; invalid for bind group layout entries.

Vertex 

Visible to the vertex stage.

Fragment 

Visible to the fragment stage.

Compute 

Visible to the compute stage.

◆ StoreOp

enum class donner::gpu::StoreOp : uint8_t
strong

Store operation for a render pass color attachment.

Enumerator
Store 

Write results back to the texture.

Discard 

Discard results (transient attachments).

◆ SurfaceAlphaMode

enum class donner::gpu::SurfaceAlphaMode : uint8_t
strong

How a surface composites its alpha channel with what is behind it.

Enumerator
Opaque 

Alpha is ignored.

Premultiplied 

Color channels are already multiplied by alpha.

Inherit 

Whatever the platform's default is.

◆ SurfaceStatus

enum class donner::gpu::SurfaceStatus : uint8_t
strong

Outcome of acquiring from or presenting to a surface.

The three failures are different problems with different recoveries, so each is its own value. A surface whose configuration no longer matches its window is Outdated and recovers by reconfiguring; a surface whose platform object is gone is Lost and recovers only by creating a new surface from a fresh native handle; a lost device recovers by neither.

Enumerator
Success 

The operation succeeded.

Outdated 

The configuration no longer matches the window. Reconfigure and retry.

Lost 

The platform object is gone. A new surface is needed.

DeviceLost 

The device was lost.

Timeout 

No texture became available in time. Retry.

◆ TextureFormat

enum class donner::gpu::TextureFormat : uint8_t
strong

Texture formats used by Donner render targets, masks, and image uploads.

Enumerator
RGBA8Unorm 

8-bit RGBA, unsigned normalized. Default render target format.

BGRA8Unorm 

8-bit BGRA, unsigned normalized. Editor surface format.

R8Unorm 

8-bit single channel. Coverage / clip-mask textures.

◆ TextureUsage

enum class donner::gpu::TextureUsage : uint32_t
strong

Texture usage flags. Combinable with |.

Enumerator
None 

No usage; invalid for creation.

RenderAttachment 

Color attachment of a render pass.

Sampled 

Sampled in a shader.

CopySrc 

Source of copy operations (readback).

CopyDst 

Destination of copies and queue writes.

StorageBinding 

Written through a storage-texture binding in a compute shader.

◆ VertexFormat

enum class donner::gpu::VertexFormat : uint8_t
strong

Vertex attribute formats used by Donner pipelines.

Enumerator
Float32x2 

Two 32-bit floats (8 bytes).

Float32x4 

Four 32-bit floats (16 bytes).

Uint32 

One 32-bit unsigned integer (4 bytes).

◆ VertexStepMode

enum class donner::gpu::VertexStepMode : uint8_t
strong

Rate at which a vertex buffer is stepped through during a draw.

Enumerator
Vertex 

Advance per vertex.

Instance 

Advance per instance.

Function Documentation

◆ HasAllFlags()

template<BitmaskEnum T>
bool donner::gpu::HasAllFlags ( T value,
T flags )
constexpr

Returns true if value contains every flag in flags.

Parameters
valueFlags to test.
flagsRequired flags.

◆ IsKnownEnumValue() [1/16]

bool donner::gpu::IsKnownEnumValue ( AddressMode value)

Returns true if value is a known enumerator.

Parameters
valueValue to check.

◆ IsKnownEnumValue() [2/16]

bool donner::gpu::IsKnownEnumValue ( BindingType value)

Returns true if value is a known enumerator.

Parameters
valueValue to check.

◆ IsKnownEnumValue() [3/16]

bool donner::gpu::IsKnownEnumValue ( BlendFactor value)

Returns true if value is a known enumerator.

Parameters
valueValue to check.

◆ IsKnownEnumValue() [4/16]

bool donner::gpu::IsKnownEnumValue ( BlendOperation value)

Returns true if value is a known enumerator.

Parameters
valueValue to check.

◆ IsKnownEnumValue() [5/16]

bool donner::gpu::IsKnownEnumValue ( CullMode value)

Returns true if value is a known enumerator.

Parameters
valueValue to check.

◆ IsKnownEnumValue() [6/16]

bool donner::gpu::IsKnownEnumValue ( FilterMode value)

Returns true if value is a known enumerator.

Parameters
valueValue to check.

◆ IsKnownEnumValue() [7/16]

bool donner::gpu::IsKnownEnumValue ( LoadOp value)

Returns true if value is a known enumerator.

Parameters
valueValue to check.

◆ IsKnownEnumValue() [8/16]

bool donner::gpu::IsKnownEnumValue ( NativeSurfaceKind value)

Returns true if value is a known enumerator.

Parameters
valueValue to check.

◆ IsKnownEnumValue() [9/16]

bool donner::gpu::IsKnownEnumValue ( PresentMode value)

Returns true if value is a known enumerator.

Parameters
valueValue to check.

◆ IsKnownEnumValue() [10/16]

bool donner::gpu::IsKnownEnumValue ( PrimitiveTopology value)

Returns true if value is a known enumerator.

Parameters
valueValue to check.

◆ IsKnownEnumValue() [11/16]

bool donner::gpu::IsKnownEnumValue ( ShaderSourceKind value)

Returns true if value is a known enumerator.

Parameters
valueValue to check.

◆ IsKnownEnumValue() [12/16]

bool donner::gpu::IsKnownEnumValue ( StoreOp value)

Returns true if value is a known enumerator.

Parameters
valueValue to check.

◆ IsKnownEnumValue() [13/16]

bool donner::gpu::IsKnownEnumValue ( SurfaceAlphaMode value)

Returns true if value is a known enumerator.

Parameters
valueValue to check.

◆ IsKnownEnumValue() [14/16]

bool donner::gpu::IsKnownEnumValue ( TextureFormat value)

Returns true if value is a known enumerator. Every enum arriving through a descriptor is checked with these overloads so out-of-range casts fail closed with GpuErrorType::InvalidDescriptor instead of flowing into layout or copy math.

Parameters
valueValue to check.

◆ IsKnownEnumValue() [15/16]

bool donner::gpu::IsKnownEnumValue ( VertexFormat value)

Returns true if value is a known enumerator.

Parameters
valueValue to check.

◆ IsKnownEnumValue() [16/16]

bool donner::gpu::IsKnownEnumValue ( VertexStepMode value)

Returns true if value is a known enumerator.

Parameters
valueValue to check.

◆ IsValidBitmask() [1/4]

bool donner::gpu::IsValidBitmask ( BufferUsage value)

Returns true if value contains only known flag bits.

Parameters
valueBitmask to check.

◆ IsValidBitmask() [2/4]

bool donner::gpu::IsValidBitmask ( ColorWriteMask value)

Returns true if value contains only known flag bits.

Parameters
valueBitmask to check.

◆ IsValidBitmask() [3/4]

bool donner::gpu::IsValidBitmask ( ShaderStage value)

Returns true if value contains only known flag bits.

Parameters
valueBitmask to check.

◆ IsValidBitmask() [4/4]

bool donner::gpu::IsValidBitmask ( TextureUsage value)

Returns true if value contains only known flag bits (an empty mask is bit-valid; emptiness is validated separately where required).

Parameters
valueBitmask to check.

◆ operator&()

template<BitmaskEnum T>
T donner::gpu::operator& ( T lhs,
T rhs )
constexpr

Bitwise-and for bitmask enums.

Parameters
lhsFirst operand.
rhsSecond operand.

◆ operator<<() [1/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [2/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [3/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [4/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [5/21]

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

Ostream output operator, e.g. Vertex|CopyDst, or None when no flags are set.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [6/21]

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

Ostream output operator, e.g. Red|Green|Blue|Alpha, or None when no flags are set.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [7/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [8/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [9/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [10/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [11/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [12/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [13/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [14/21]

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

Ostream output operator, e.g. Vertex|Fragment, or None when no flags are set.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [15/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [16/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [17/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [18/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [19/21]

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

Ostream output operator, e.g. RenderAttachment|CopySrc, or None when no flags are set.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [20/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator<<() [21/21]

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

Ostream output operator.

Parameters
osOutput stream.
valueValue to output.

◆ operator|()

template<BitmaskEnum T>
T donner::gpu::operator| ( T lhs,
T rhs )
constexpr

Bitwise-or for bitmask enums.

Parameters
lhsFirst operand.
rhsSecond operand.

◆ operator|=()

template<BitmaskEnum T>
T & donner::gpu::operator|= ( T & lhs,
T rhs )
constexpr

Bitwise-or-assign for bitmask enums.

Parameters
lhsValue to update.
rhsFlags to add.

◆ TextureFormatBytesPerTexel()

uint32_t donner::gpu::TextureFormatBytesPerTexel ( TextureFormat format)

Bytes per texel for a TextureFormat.

Parameters
formatTexture format.

◆ VertexFormatByteSize()

uint32_t donner::gpu::VertexFormatByteSize ( VertexFormat format)

Byte size of a VertexFormat.

Parameters
formatVertex attribute format.