Skip to content

perf ticket 005: depth prepass for main HDR pass #26

@proggeramlug

Description

@proggeramlug

Deferred perf ticket — see docs/perf/005-depth-prepass.md.

Summary

Pre-write depth via a cheap position-only pass so the expensive main HDR fragment shader skips hidden pixels via early-Z. Originally estimated to drop main_hdr from ~17 ms to ~8 ms.

Why deferred

Prototype landed negative (see ticket's deprioritization writeup) — the extra draw overhead on Sponza's 68-mesh count outweighed the early-Z savings because Sponza's overdraw isn't high enough to recoup the additional vertex-shader pass. A proper win needs either:

  • an overdraw-heavy target scene (foliage, hair, dense props), or
  • tight coupling with ticket 009's unified vertex buffer + GPU culling, so the prepass is a single indirect draw instead of 68 individual draws, or
  • bundling with ticket 008 (visibility buffer) where prepass is an inherent part of the pipeline.

Reopen criteria

  • Overdraw factor on a target scene measurably above Sponza's baseline.
  • Ticket 009 starts, at which point prepass becomes a ~1-hour add-on.
  • Ticket 008 reopens, at which point it's a hard prerequisite.

Measurements at time of deferral

  • Sponza --quality 3 --ssgi 1 --fps-only 300: 60.0 fps vsync-capped
  • Main pass CPU: ~700 µs (well inside the vsync budget)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions