|
|
Donner 0.8.0-pre
Embeddable browser-grade SVG2 engine
|
Small utility shims on top of the wgpu:: C++ wrapper (from eliemichel/WebGPU-distribution's webgpu.hpp) used throughout the Geode renderer. More...
#include <atomic>#include <string_view>#include <utility>#include <vector>#include <webgpu/webgpu.hpp>Classes | |
| class | donner::geode::ScopedWgpuHandle< Handle > |
| Move-only RAII owner for a single WebGPU handle. More... | |
| class | donner::geode::ScopedWgpuResourceArena |
| Scoped owner for short-lived WebGPU resources used while recording a command encoder. More... | |
Namespaces | |
| namespace | donner |
| Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css. | |
Functions | |
| wgpu::StringView | donner::geode::wgpuLabel (const char *text) noexcept |
| Wrap a NUL-terminated C string literal in a wgpu::StringView suitable for direct assignment to a descriptor's label field. std::string_view{} handles the strlen() at compile time when the argument is a literal. | |
| wgpu::StringView | donner::geode::wgpuLabel (std::string_view text) noexcept |
| Wrap an arbitrary std::string_view as a wgpu::StringView. Kept separate from wgpuLabel(const char*) so the common label-literal call path stays trivially copyable without pulling string_view into callers that don't already need it. | |
Small utility shims on top of the wgpu:: C++ wrapper (from eliemichel/WebGPU-distribution's webgpu.hpp) used throughout the Geode renderer.
The vendored webgpu.hpp wraps wgpu-native's C API directly — its wgpu::StringView only has a std::string_view constructor, which makes the otherwise-common descriptor.label = "…" assignment verbose. The helpers in this header exist so the rest of the Geode code can stay readable:
desc.label = wgpuLabel("GeodePipeline");
rather than spelling out the std::string_view wrap at every site. This file also provides a small RAII owner for WebGPU handles returned from create / acquire calls. The vendored webgpu.hpp objects are typed raw handles, not owning smart handles.