Skip to content

fix(viewer): harden WebGPU slab recovery#518

Merged
Aymericr merged 1 commit into
mainfrom
agent/webgpu-uv2-recovery
Jul 19, 2026
Merged

fix(viewer): harden WebGPU slab recovery#518
Aymericr merged 1 commit into
mainfrom
agent/webgpu-uv2-recovery

Conversation

@Aymericr

@Aymericr Aymericr commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • copy slab primary UVs into a dedicated uv2 attribute after face splitting
  • reset the renderer target when an MRT post-processing pass throws
  • add a regression test covering uv2 on both slab meshes

This ports the two still-relevant fixes from #464 onto current main and credits Connor Soohoo in the commit. The empty-roof part of #464 is already superseded by the broader export hardening in #466.

Verification

  • bun test src/slab/tests/geometry.test.ts src/slab/tests/definition.test.ts (from packages/nodes)
  • bun run check
  • bun run check-types
  • bun run build

Note

Medium Risk
Touches per-frame WebGPU render error handling and slab GPU geometry attributes; limited scope but affects viewer stability when MRT passes fail.

Overview
Hardens WebGPU rendering for slabs and post-processing recovery paths.

When slab geometry is split into top/side meshes, splitSlabFacesByFacing now duplicates primary uv into uv2 on both sub-geometries (same pattern as columns/roofs), so node-material / MRT pipelines don’t hit missing uv2 bindings. A regression test asserts uv2 matches uv on both slab meshes from buildSlabGeometry.

If the WebGPU MRT post-processing render() throws, the viewer calls setRenderTarget(null) before disposing the pipeline and retrying/falling back, so a stuck MRT target doesn’t poison the direct renderer.render fallback.

Reviewed by Cursor Bugbot for commit 30a0249. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-authored-by: Connor Soohoo <connorsoohoo@users.noreply.github.com>
@Aymericr
Aymericr merged commit 87f3952 into main Jul 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant