Skip to content

feat: FPS counter card with sizes, PC stats and session-menu settings - #146

Merged
lippdev merged 4 commits into
mainfrom
feat/fps-overlay-card
Oct 10, 2026
Merged

lippdev merged 4 commits into
mainfrom
feat/fps-overlay-card

Conversation

@lippdev

@lippdev lippdev commented Oct 10, 2026

Copy link
Copy Markdown
Owner

The FPS counter becomes a card, with sizes and live PC stats, and can be tuned from the session menu.

  • Styles: FPS only (keeps the old "compact" id, so 1.6.0 configs stay as they were), Compact (CPU, GPU and RAM usage) and Detailed (clocks, GPU temperature, VRAM, RAM), besides Afterburner, Off and Custom (game items + PC items, single line).
  • Look: rounded card behind the numbers (RTSS <B> fill, can be turned off), sizes Small / Medium / Large, colour, and position: RTSS's own or one of the four screen corners.
  • PC data without admin: PDH counters (CPU utility and clock, GPU engine utilisation, dedicated VRAM), D3DKMT for GPU clock / temperature / VRAM size, GlobalMemoryStatusEx for RAM. A ticker thread refreshes the slot only while a style needs it, guarded so it never writes after the session stops.
  • Session menu: A on "FPS counter" opens a list (style, size, position, card, colour; in Custom also single line and each item with ✓). A changes the focused line and the list stays open; B closes it.
  • Settings → FPS counter gets the same options. Strings in pt-BR / en-US / es-ES, both changelogs, README feature line, manual checks in docs/TESTING.md.

Unit tests pass locally (overlay text, legacy id, sizes, positions, GPU counter parsing). Tested by the owner on hardware in a local preview build.

🤖 Generated with Claude Code

lippdev and others added 4 commits October 10, 2026 12:17
The counter gets a dark rounded card (RTSS layer with a rounded <B> fill,
can be turned off), three sizes, and new styles: FPS only, Compact (FPS
plus CPU, GPU and RAM usage on one line) and Detailed (frame time, API,
CPU clock, GPU clock and temperature, VRAM and RAM). Custom can pick
every PC item too.

CPU, GPU and memory come from Windows' performance counters and the
display driver (D3DKMT), the sources Task Manager uses: nothing to
install and no admin. Styles that show them are rewritten every second
by a ticker that stops as soon as the style changes or the session ends.

FPS only keeps the "compact" id, so configs saved by 1.6.0 with Compact
still show just the FPS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A on the session menu's FPS counter row now opens a list of its settings
(style, size, position, card, color and, in Custom, the line layout and
each item) instead of only cycling the style. A changes the focused
setting and the list stays open on that row.

The new Position setting keeps RTSS's OSD position by default or pins the
counter to a screen corner with RTSS's sticky layer positions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	CHANGELOG.en-US.md
#	CHANGELOG.md

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The new GPU clock and temperature queries do not match the documented D3DKMT enum/layout, so those Detailed-style values can remain unavailable.

Reviewed changes This review covers the FPS overlay/card and live PC-stat implementation, its session-menu and Settings controls, localization/docs, and associated tests.

  • Overlay styles and presentation: Adds FPS-only, Compact, Detailed, and Custom output, plus configurable size, color, background card, and position.
  • Hardware sampling: Adds PDH, D3DKMT, and Windows memory readers with a periodic RTSS-slot refresh for styles that need PC data.
  • Configuration UI: Exposes the same settings in the Settings page and a persistent session-menu picker.
  • Compatibility and coverage: Retains the legacy compact config ID for FPS-only, adds localization and manual test coverage, and tests pure overlay/counter logic.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6-luna | 𝕏

{
private const int KmtqaiGetSegmentSize = 3;
private const int KmtqaiNodePerfData = 61;
private const int KmtqaiAdapterPerfData = 62;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These performance-query enum values are each one too high: NODEPERFDATA is 60 and ADAPTERPERFDATA is 61 in the Windows enum, so these calls request the wrong payload types and the GPU clock/temperature reads will fail. Please use the documented values (or named constants) before relying on these readings.

Technical details
# D3DKMT query type mismatch

## Affected sites
- `src/ConsoleMode/Native/GpuKmt.cs:13-14` — enum values 61/62 select `ADAPTERPERFDATA` / `ADAPTERPERFDATA_CAPS`, rather than `NODEPERFDATA` / `ADAPTERPERFDATA`.

## Required outcome
- Match the `KMTQUERYADAPTERINFOTYPE` values for node and adapter performance data (60 and 61).

## Reference
- https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/d3dkmthk/ne-d3dkmthk-_kmtqueryadapterinfotype

public uint Voltage;
public uint VoltageMax;
public uint VoltageMaxOc;
public ulong MaxTransitionLatency;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The native D3DKMT_NODE_PERFDATA also has a trailing aligned 64-bit Reserved field. Since Query sends sizeof(T) as DataSize, this shorter buffer can make the node query fail even after the enum is corrected; mirror the full native layout.

Technical details
# Node performance payload size

## Affected sites
- `src/ConsoleMode/Native/GpuKmt.cs:49-60` — `NodePerfData` omits `Reserved`.
- `src/ConsoleMode/Native/GpuKmt.cs:124` — `DataSize` is derived from the undersized struct.

## Required outcome
- Submit a `NodePerfData` buffer with the documented native size and field layout.

## Reference
- https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/d3dkmthk/ns-d3dkmthk-_d3dkmt_node_perfdata

try
{
var adapter = new AdapterPerfData();
var engine = new NodePerfData { NodeOrdinal = node };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PhysicalAdapterIndex is an input to both performance queries, but both structs currently leave it at zero. The PDH instance already identifies phys_N; propagate that index so GPU clock and temperature queries target the selected physical adapter on linked-adapter systems.

Technical details
# Physical adapter selection

## Affected sites
- `src/ConsoleMode/Services/HardwareStats.cs:27, 60-61` — the selected adapter key includes the `phys_N` component, but the index is not exposed to the KMT reader.
- `src/ConsoleMode/Native/GpuKmt.cs:65, 103` — the performance payloads leave `PhysicalAdapterIndex` at zero.

## Required outcome
- Pass the selected physical adapter index to both adapter- and node-performance queries.

## Reference
- https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/d3dkmthk/ns-d3dkmthk-_d3dkmt_node_perfdata
- https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/d3dkmthk/ns-d3dkmthk-_d3dkmt_adapter_perfdata

@lippdev
lippdev merged commit f1b9277 into main Oct 10, 2026
4 checks passed
@lippdev lippdev mentioned this pull request Oct 10, 2026
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