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
GpuError.h File Reference

Explicit error types returned by donner::gpu APIs. More...

#include <cstdint>
#include <ostream>
#include <string>
#include <string_view>
Include dependency graph for GpuError.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::gpu::GpuError
 An explicit error result from a donner::gpu operation, carrying the error category and a human-readable message that names the offending field or state so a failing test localizes the bug without a rerun. 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::GpuErrorType : uint8_t {
  InvalidDescriptor ,
  InvalidHandle ,
  DeviceMismatch ,
  UsageMismatch ,
  OutOfBounds ,
  LimitExceeded ,
  InvalidState ,
  Unsupported
}
 Category of a GPU runtime error. More...

Functions

std::ostream & donner::gpu::operator<< (std::ostream &os, GpuErrorType value)
 Ostream output operator for GpuErrorType, e.g.
void donner::gpu::PrintTo (const GpuError &error, std::ostream *os)
 gtest PrintTo support for readable test failure messages.

Detailed Description

Explicit error types returned by donner::gpu APIs.

Enumeration Type Documentation

◆ GpuErrorType

enum class donner::gpu::GpuErrorType : uint8_t
strong

Category of a GPU runtime error.

Every invalid descriptor, handle, or state transition fails closed by returning one of these categories wrapped in a GpuError, in release builds too. Asserts are reserved for programmer invariants inside the runtime; invalid input never aborts.

Enumerator
InvalidDescriptor 

A descriptor field is malformed (zero size, bad range, misalignment).

InvalidHandle 

A handle is null, destroyed, or has a stale generation.

DeviceMismatch 

A handle created by one device was used on another device.

UsageMismatch 

A resource lacks the usage flag required by the operation.

OutOfBounds 

An offset, size, or copy region exceeds the resource bounds.

LimitExceeded 

A count or dimension exceeds a documented device limit.

InvalidState 

An operation was issued in an invalid state (encoder state machine).

Unsupported 

The requested feature is not supported by this runtime.

Function Documentation

◆ operator<<()

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

Ostream output operator for GpuErrorType, e.g.

InvalidDescriptor.

Parameters
osOutput stream.
valueError type to output.

◆ PrintTo()

void donner::gpu::PrintTo ( const GpuError & error,
std::ostream * os )
inline

gtest PrintTo support for readable test failure messages.

Parameters
errorError to print.
osOutput stream.