|
tess 1.0.0
Performance-first tile and path simulation substrate
|
#include <tess/gpu/webgpu_backend.h>
Public Member Functions | |
| WebGpuBackend (WGPUDevice device, WebGpuBackendConfig config={}) | |
| WebGpuBackend (const WebGpuBackend &)=delete | |
| auto | operator= (const WebGpuBackend &) -> WebGpuBackend &=delete |
| WebGpuBackend (WebGpuBackend &&)=delete | |
| auto | operator= (WebGpuBackend &&) -> WebGpuBackend &=delete |
| ~WebGpuBackend () | |
| auto | capabilities () const noexcept -> GpuCapabilities |
| bool | register_field (FieldMirrorDesc desc) |
| auto | field_buffer (std::uint32_t field_index) const noexcept -> WGPUBuffer |
| auto | register_product (WebGpuProductDesc desc) -> std::optional< GpuProductHandle > |
| bool | unregister_product (GpuProductHandle handle) noexcept |
| bool | valid (GpuProductHandle handle) const noexcept |
| bool | upload (const UploadDesc &upload) |
| bool | dispatch (const DispatchDesc &dispatch) |
| bool | readback (const ReadbackDesc &readback) |
| void | notify_device_lost () noexcept |
| void | notify_device_error () noexcept |
Optional stable-C-API WebGPU transport backend.
The backend owns field mirror buffers and retained algorithm handles. It submits compute asynchronously; a successful boolean means submitted, not completed. CPU state remains authoritative. Forward device-loss and uncaptured/error-scope failures through the notification methods so all later work refuses cleanly. Those notifications are thread-safe; other public operations must be externally serialized. Callback completion performs only its separately synchronized operation cleanup.
|
inlineexplicit |
Retains device, obtains its queue, and reserves fixed registries.
|
inline |
Releases registries and retained device objects; readbacks remain safe.
|
inlinenodiscardnoexcept |
Reports configured limits, or no compute after invalidation/device loss.
|
inlinenodiscard |
Encodes and submits one registered compute product asynchronously.
|
inlinenodiscardnoexcept |
Returns a registered mirror buffer, or null when the field is absent.
|
inlinenoexcept |
Permanently disables GPU work after a validation, OOM, or internal error.
Stable-C WebGPU reports device-side failures asynchronously through error scopes or the application's uncaptured-error callback. A submission method's true result therefore cannot observe them. While this backend is alive, forward either callback here to fail closed onto the CPU path. A pending readback reports Failed when this notification wins the callback's atomic terminal-state race, even if its map itself succeeds.
|
inlinenoexcept |
Permanently disables new work after the application reports device loss.
|
inlinenodiscard |
Queues an explicit bounded copy/map readback.
The application callback may run inline before this function returns or later on an arbitrary thread; see WebGpuReadbackCallback.
|
inlinenodiscard |
Creates a chunk-major storage/copy-destination buffer for one field.
|
inlinenodiscard |
Retains one algorithm pipeline/bind group under a generation handle.
|
inlinenoexcept |
Releases a currently valid product and invalidates its generation.
|
inlinenodiscard |
Writes one aligned chunk field slice into its registered mirror.
|
inlinenodiscardnoexcept |
Returns whether handle still names its registered product interval.