Skip to content

perf(renderer): PRD-775 draw virtual shadow pages from GPU-built lists, as Unreal does - #602

Closed
jonit-dev wants to merge 1 commit into
developfrom
perf/prd-775-vsm-gpu
Closed

jonit-dev wants to merge 1 commit into
developfrom
perf/prd-775-vsm-gpu

Conversation

@jonit-dev

Copy link
Copy Markdown
Contributor

What is this PR about?

A virtual shadow map draws its cached pages one render pass at a time, and the CPU plans every page. This PR moves that work to the GPU, as Unreal does: the GPU decides which object reaches which page, and all pages draw in one pass.

Why does it matter?

Virtual shadows are the worst score on the stress lab, and the CPU frame costs 20.9 ms at p95 with them on. A plain sun map costs far less on the same scene, so the difference is the page bookkeeping this PR removes.

What changed

Plan only so far. Each phase below lands on this branch and keeps the picture the same.

  • Phase 1: the GPU culls instances per page, and one render pass draws all pages of a level.
  • Phase 2: the shadow stage reads a list of changed casters and stops scanning every caster each frame.
  • Phase 3: the page table and the physical page pool live on the GPU.

How I checked it

Not run yet. Each phase records its red-green test, its paired measurement on the stress lab and a visual judge verdict in the PRD.

Risks

  • Breaking change: none intended. Every game with a virtual shadow takes the new path, so it is high risk until the pixel checks pass.
  • Performance: each phase must pass a paired A/B keep rule, or it is reverted.
  • Migration: none.
  • Rollback: revert the PR. A device without the clip-distances feature keeps the old per-page path.

Still open

All phases and both acceptance criteria.

References

PRD: docs/PRDs/Unreal/shadows/PRD-775-virtual-shadow-pages-are-managed-and-drawn-on-the-gpu.md. The closed plan PR is #596. PRD-775 is also the id of a finished three.js upgrade PRD, which this PR does not touch.

…e decisions

The coordinator settled the Phase 1 keep rule, so the blocked line goes.
The lane draws one pass per granted level and keeps the per-page path on a device with no clip-distances.
@jonit-dev jonit-dev added the prd:0% PRD implementation has no verified phase yet label Nov 2, 2026
@jonit-dev

Copy link
Copy Markdown
Contributor Author

Closed by the owner's order: no new PR for this work. The commits stay on branch perf/prd-775-vsm-gpu.

@jonit-dev jonit-dev closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

prd:0% PRD implementation has no verified phase yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant