Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openxr-api-layer/shaders/overlay_bars_ps.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ float4 PSMain(VSOutput i) : SV_TARGET
// a bar chart and removes that artifact; the shared baseline at the
// strip floor stays crisp for the same reason.
//
// CONTRACT: bar geometry stays integer-aligned (4-px width, integer
// CONTRACT: bar geometry stays integer-aligned (5-px width, integer
// xLeft — see HistogramBarRenderer::drawPanel). With that, covX
// collapses to 1 everywhere and the sides ALSO render crisp — the
// bars look pixel-perfect uniform. If a future layout reintroduces
Expand Down
15 changes: 10 additions & 5 deletions openxr-api-layer/utils/overlay_renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2464,12 +2464,17 @@ namespace openxr_api_layer::detail {
// bars; the count derives from kQuadSlots so adding a slot can't
// silently desync it. kSlotGridEnd (one past the grid run) stays
// separate from the budget slot that immediately follows it.
static constexpr UINT kSlotGridFirst = 1; // interior gridlines [1..4]
static constexpr UINT kSlotGridFirst = 1; // interior gridlines [kSlotGridFirst, kSlotGridEnd)
static constexpr UINT kSlotGridEnd = 5; // one past the last grid slot
static constexpr UINT kSlotBudget = 5; // budget line
static constexpr UINT kSlotBaseline = 6; // 0-ms baseline
static constexpr UINT kSlotAxis = 7; // left vertical ms-axis
static constexpr UINT kQuadSlots = 8; // total
// Trailing single-quad slots derive sequentially from kSlotGridEnd
// so they can never silently collide with the grid run: bump
// kSlotGridEnd (e.g. to add an interior gridline) and budget /
// baseline / axis / total all shift up in lockstep instead of one
// quietly overwriting a grid slot. Values are unchanged (5/6/7/8).
static constexpr UINT kSlotBudget = kSlotGridEnd; // budget line
static constexpr UINT kSlotBaseline = kSlotBudget + 1; // 0-ms baseline
static constexpr UINT kSlotAxis = kSlotBaseline + 1; // left vertical ms-axis
static constexpr UINT kQuadSlots = kSlotAxis + 1; // total
// The [kSlotGridFirst, kSlotGridEnd) gridline slots must cover every
// non-zero tick (kMaxMsAxisTicks counts the 0 tick, drawn as the
// baseline rather than an interior line). Catches a kMaxMsAxisTicks
Expand Down
11 changes: 7 additions & 4 deletions openxr-api-layer/utils/overlay_renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,13 @@ namespace openxr_api_layer::detail {
// code can declare matching rings without hard-coding the value
// (and the cpp's static_assert below guards against drift).
//
// 133 = the bar count that fills the GPU histogram strip exactly
// with the fixed 4-px-bar / 1-px-gap layout: 133×4 + 132×1 = 664 px
// (the strip's inner width). Picking it leaves zero margin and keeps
// every bar pixel-aligned. ~133 samples ≈ 1.5 s @ 90 Hz.
// 133 = the histogram ring size. Originally chosen so the strip filled
// exactly with 4-px bars + 1-px gaps (133×4 + 132×1 = 664 px). The bars
// are now 5-px wide at a 5-px step with no gap (see overlay_renderer.cpp),
// so 133 bars span 133×5 = 665 px and the .cpp centres or left-clips the
// run within the strip's actual width rather than filling it exactly. The
// count is retained for the time window it captures: ~133 samples ≈
// 1.5 s @ 90 Hz.
constexpr std::size_t kOverlayHistoRingSize = 133;

// -------- GPU-path snapshot entry point (Task 18) ---------------------
Expand Down
Loading