Skip to content

Show GPU renderer FPS in PerformanceHUD when GPU is active #20

@CREVIOS

Description

@CREVIOS

Problem

The PerformanceHUD shows FPS from the frontend (frames received via IPC). When the GPU renderer is active, the real FPS is tracked in the Rust `GpuRenderer` but not exposed to the UI.

Implementation

Step 1: Expose GPU metrics via Tauri command

Add a command `get_gpu_metrics()` that returns:

```typescript
interface GpuMetrics {
fps: number;
frameTime: number; // ms per frame
publishTime: number; // ms for SharedFrame publish
uploadTime: number; // ms for write_texture
presentTime: number; // ms for submit + present
framesRendered: number;
textureWidth: number;
textureHeight: number;
adapterName: string;
}
```

Step 2: Store metrics in GpuRenderer

The FPS counter already exists (`frames_rendered`, `last_fps_log`). Add a `Mutex` field that's updated every frame and readable from any thread.

Step 3: Display in PerformanceHUD

When GPU renderer is active:

  • Show "GPU: 60.0 FPS" instead of "FPS: 3"
  • Show frame time breakdown (publish/upload/present)
  • Show GPU adapter name
  • Badge: "GPU Accelerated" in green

Files to modify

  • `src-tauri/src/renderer/gpu.rs` — add metrics struct + getter
  • `src-tauri/src/commands/session.rs` — add `get_gpu_metrics` command
  • `src/components/session/PerformanceHUD.tsx` — display GPU metrics
  • `src/hooks/useRdpSession.ts` — poll GPU metrics

Priority: P2 — observability for the GPU pipeline

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersgpuGPU rendering pipelineuiUser interface

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions