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
donner::geode::ScopedWgpuResourceArena Class Reference

Scoped owner for short-lived WebGPU resources used while recording a command encoder. More...

#include "donner/svg/renderer/geode/GeodeWgpuUtil.h"

Public Member Functions

wgpu::Buffer retain (wgpu::Buffer handle)
 Retain a buffer handle and return a borrowed alias.
wgpu::Texture retain (wgpu::Texture handle)
 Retain a texture handle and return a borrowed alias.
wgpu::TextureView retain (wgpu::TextureView handle)
 Retain a texture-view handle and return a borrowed alias.
wgpu::Sampler retain (wgpu::Sampler handle)
 Retain a sampler handle and return a borrowed alias.
wgpu::BindGroup retain (wgpu::BindGroup handle)
 Retain a bind-group handle and return a borrowed alias.
void releaseAll ()
 Release all retained handles without explicitly destroying resource backings.

Detailed Description

Scoped owner for short-lived WebGPU resources used while recording a command encoder.

The returned wgpu:: values are borrowed aliases that remain valid while the arena is alive. This is useful for render-pass helpers that need handles to survive until the enclosing encoder is finished, but do not need bespoke ownership fields for every per-draw texture view / bind group / buffer.

Member Function Documentation

◆ releaseAll()

void donner::geode::ScopedWgpuResourceArena::releaseAll ( )
inline

Release all retained handles without explicitly destroying resource backings.

Use this after submitting commands. The queue retains resources required by in-flight work, while an explicit destroy() can invalidate that work.


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