Skip to content

Commit 065525a

Browse files
ldm5180alimpfard
authored andcommitted
LibSoftGPU: Configure stats overlay period
Problem: - The statistics overlay period is hardcoded to 500 ms. This time is very short and can result in the values being very "jumpy". Solution: - Increasing this value can result in more steady values which is useful when trying to evaluate the performance impact of a change. A new config value is offered in `Config.h` to let the developer change to any value desired.
1 parent 3831e5f commit 065525a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Userland/Libraries/LibSoftGPU/Config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ namespace SoftGPU {
1616

1717
static constexpr bool ENABLE_STATISTICS_OVERLAY = false;
1818
static constexpr int NUM_SAMPLERS = 2;
19+
static constexpr int MILLISECONDS_PER_STATISTICS_PERIOD = 500;
1920
static constexpr int SUBPIXEL_BITS = 5;
2021
static constexpr int NUM_LIGHTS = 8;
2122

Userland/Libraries/LibSoftGPU/Device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ void Device::draw_statistics_overlay(Gfx::Bitmap& target)
12241224

12251225
Gfx::Painter painter { target };
12261226

1227-
if (milliseconds > 500) {
1227+
if (milliseconds > MILLISECONDS_PER_STATISTICS_PERIOD) {
12281228

12291229
int num_rendertarget_pixels = m_render_target->width() * m_render_target->height();
12301230

0 commit comments

Comments
 (0)