test(webgpu): HDRBloom example exercising the HDR post-process primitives (#27)

RT→rgba16float→threshold→blur→composite, end-to-end proof of the three
primitives. threshold/blur run from onBeforeUpdate (one submit each) so the
storage-write→sampled-read dependency gets WebGPU's per-submit barrier
(there is none between dispatches within a compute pass); the composite is a
UI custom shader so it owns the canvas ping-pong. Documents the Vulkan
symmetry (gap 4): the native present path records passes generically and
barriers between them, so the same chain is wireable today.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
catbot 2026-06-09 12:55:14 +00:00
commit bbe1b21c22
10 changed files with 518 additions and 0 deletions

View file

@ -0,0 +1,7 @@
// HDRBloom miss (runs in SHADE). Dark, sub-threshold background so the
// bloom pass only picks up the bright cubes, not the sky.
fn miss_main(ray: RayDesc, payload: ptr<function, Payload>) {
let t = clamp(ray.direction.y * 0.5 + 0.5, 0.0, 1.0);
rtAccumulate(mix(vec3<f32>(0.015, 0.018, 0.030),
vec3<f32>(0.030, 0.040, 0.070), t));
}