Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
Loading...
Searching...
No Matches
IrModule.h File Reference

Module model and validating builders for the donner::gpu::shader IR. More...

#include <cstdint>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "donner/base/RcString.h"
#include "donner/gpu/shader/IrExpr.h"
#include "donner/gpu/shader/IrStatement.h"
#include "donner/gpu/shader/IrType.h"
#include "donner/gpu/shader/ShaderResult.h"
Include dependency graph for IrModule.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::gpu::shader::IrConstant
 One module-scope constant. More...
struct  donner::gpu::shader::IrBinding
 One module-scope resource binding. More...
struct  donner::gpu::shader::IrParam
 One entry point parameter or plain function parameter. More...
struct  donner::gpu::shader::IrOutputMember
 One entry point output member. More...
struct  donner::gpu::shader::IrFunction
 One function: a plain function or an entry point. More...
class  donner::gpu::shader::IrModule
 An immutable, validated shader IR module. More...
class  donner::gpu::shader::FunctionBuilder
 Builds one function or entry point. More...
class  donner::gpu::shader::ModuleBuilder
 Builds an IrModule: module-scope constants, resource bindings with (group, binding) uniqueness validation, and functions. 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::shader::BindingKind : uint8_t {
  UniformBuffer ,
  ReadOnlyStorageBuffer ,
  SampledTexture2dF32 ,
  FilteringSampler
}
 Kind of a module-scope resource binding. More...
enum class  donner::gpu::shader::StageKind : uint8_t {
  None ,
  Vertex ,
  Fragment
}
 Pipeline stage of a function. More...
enum class  donner::gpu::shader::BuiltinInput : uint8_t {
  InstanceIndex ,
  Position
}
 Builtin input values available to entry point parameters. More...
enum class  donner::gpu::shader::BuiltinOutput : uint8_t { Position }
 Builtin output values available to entry point outputs. More...

Functions

std::ostream & donner::gpu::shader::operator<< (std::ostream &os, BindingKind value)
 Ostream output operator, e.g. uniform.

Detailed Description

Module model and validating builders for the donner::gpu::shader IR.

A module holds module-scope constants, resource bindings, and functions (plain functions plus vertex/fragment entry points). ModuleBuilder and FunctionBuilder validate every construction step and fail closed with ShaderError on ill-typed input; a successfully built IrModule is immutable and serializes deterministically.

Compute entry points are intentionally out of scope for this packet; StageKind leaves the seam (a Compute enumerator would slot next to Vertex/Fragment, with workgroup-size metadata on IrFunction) for the filter-engine migration packets.

Enumeration Type Documentation

◆ BindingKind

enum class donner::gpu::shader::BindingKind : uint8_t
strong

Kind of a module-scope resource binding.

Enumerator
UniformBuffer 

var<uniform> with a struct type.

ReadOnlyStorageBuffer 

var<storage, read> with a runtime array or struct type.

SampledTexture2dF32 

texture_2d<f32>.

FilteringSampler 

sampler.

◆ BuiltinInput

enum class donner::gpu::shader::BuiltinInput : uint8_t
strong

Builtin input values available to entry point parameters.

Enumerator
InstanceIndex 

instance_index (vertex stage, u32).

Position 

Framebuffer position (fragment stage, vec4<f32>).

◆ BuiltinOutput

enum class donner::gpu::shader::BuiltinOutput : uint8_t
strong

Builtin output values available to entry point outputs.

Enumerator
Position 

Clip-space position (vertex stage, vec4<f32>).

◆ StageKind

enum class donner::gpu::shader::StageKind : uint8_t
strong

Pipeline stage of a function.

Enumerator
None 

Plain (non-entry-point) function.

Vertex 

Vertex entry point.

Fragment 

Fragment entry point.

Function Documentation

◆ operator<<()

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

Ostream output operator, e.g. uniform.

Parameters
osOutput stream.
valueValue to output.