|
|
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.
|
|
bool | donner::geode::wgpuForceFallbackAdapterRequested () noexcept |
| | Whether headless WebGPU creation should request a software fallback adapter. Tests exercise the platform-default hardware adapter unless the environment variable is set explicitly, for example while regenerating deterministic software-rendered goldens.
|
| template<typename Handle> |
| void | donner::geode::ReleaseWgpuHandle (Handle &handle) |
| | Release a raw WebGPU handle and reset the wrapper to null.
|
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.