Review asked for three corrections. The backends doc, the providers doc and the trait docs now state that both bundled backends override read_buffer's default body and that wasm32 serves the staging read, with a fault only for a read that did not resolve synchronously. The runtime follow-up paragraph now records that #662 consumed it. The software Vulkan container run is described as local testing. Hosted CI coverage and the pilot consumers' browser and hardware validation remain their own requirements. Em dashes swept from both docs per the house writing rules.
2.0 KiB
GPU providers
Provider ids:
craft.*: shared ops in craft-gpu-providers (no app crate deps)craft.noop,craft.test.echo,craft.mask,craft.composite.premul,craft.readback: registered byregister_all()for worker/runtime initcraft.mask: CPU stand-in for FilmCraft mask composite until WGSL lands on wgpucraft.composite.premul: CPU premultiplied "over" (Normal path fromcomposite.wgsl) until WGSL lands on wgpucraft.readback: CPU decode of staging buffers (f16RGBA →f32, orfmt:u8passthrough); useschunk_bufferagainst device caps andf16_to_f32*from craft-gpu
{app}.*: registered by application wasm at init
Generic worker code must only call ProviderRegistry::dispatch: never import app gpu crates.
Dependency lint: craft-gpu-providers must not depend on effectcraft-*, filmcraft-*, or *-engine.
Readback is async underneath; these providers don't see it
GpuContext::read_buffer, the method every provider above calls, is a blocking convenience over the trait's real primitives, request_read + poll_reads (see gpu-backends.md). Nothing in this crate changed for that. craft-gpu-null still resolves read_buffer immediately. craft-gpu-wgpu's native path now does too, blocking on the device between polls. crates/gpu-wgpu/src/tests.rs runs these same providers (craft.test.echo, craft.composite.premul, craft.readback) against a real WgpuContext as well as the null one, when a real adapter is available (RFC-0022 requirement 2). A provider dispatching a real WGSL job will be the one that actually needs the non-blocking request_read/poll_reads shape directly. On wasm32 today read_buffer serves the staging read, the only backing on that target. A read that did not resolve synchronously faults. A future real device backing there will refuse blocking outright, per gpu-backends.md.