Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::gpu::shader::programs::ErrorLatch Struct Reference

Latches the first builder error so a program can be transliterated linearly. More...

#include "donner/gpu/shader/programs/ErrorLatch.h"

Public Member Functions

IrExpr operator() (ShaderResult< IrExpr > &&result)
 Unwraps an expression result.
IrType operator() (ShaderResult< IrType > &&result)
 Unwraps a type result.
void ok (ShaderStatus &&status)
 Latches a status.

Public Attributes

std::optional< ShaderErrorerror
 First error, if any.

Detailed Description

Latches the first builder error so a program can be transliterated linearly.

On error every subsequent expression receives a dummy 0.0f; the resulting cascade errors are ignored because only the first is reported. The inputs are static, so any latched error is a Donner bug surfaced by the golden test, never a runtime condition.

Member Function Documentation

◆ ok()

void donner::gpu::shader::programs::ErrorLatch::ok ( ShaderStatus && status)
inline

Latches a status.

Parameters
statusStatus to check.

◆ operator()() [1/2]

IrExpr donner::gpu::shader::programs::ErrorLatch::operator() ( ShaderResult< IrExpr > && result)
inline

Unwraps an expression result.

Parameters
resultResult to unwrap.

◆ operator()() [2/2]

IrType donner::gpu::shader::programs::ErrorLatch::operator() ( ShaderResult< IrType > && result)
inline

Unwraps a type result.

Parameters
resultResult to unwrap.

The documentation for this struct was generated from the following file: