Commit temporal history only after completed frames

This commit is contained in:
Emil
2026-09-24 02:56:51 +03:00
parent 4b8f9b8132
commit 56a5bc62f6
3 changed files with 55 additions and 0 deletions
+12
View File
@@ -73,6 +73,18 @@ TemporalHistoryDecision
evaluate_temporal_history(const std::optional<TemporalHistoryKey>& previous,
const TemporalHistoryKey& current) noexcept;
// The renderer calls prepare before recording and complete only after a
// successful GPU submission. An exception or failed submission leaves the
// previously completed key intact. This state is independent of P2 HZB.
class TemporalHistoryState {
public:
TemporalHistoryDecision prepare(const TemporalHistoryKey& current) const noexcept;
void complete(const TemporalHistoryKey& rendered);
private:
std::optional<TemporalHistoryKey> completed_;
};
// Sixteen-phase Halton(2,3) offset in clip-space units for scene rasterization.
// UI, picking and history keys use unjittered space. Culling must account for
// this jitter with a conservative edge; HZB depth must match jittered geometry.