mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:27:43 +00:00
LibSoftGPU: Make divide-by-zero guard more explicit in stats overlay
This previously assigned 1 to any divisor that was 0 which was a bit confusing
This commit is contained in:
parent
57215d0e1f
commit
5028b53b49
1 changed files with 3 additions and 6 deletions
|
@ -900,9 +900,6 @@ void Device::draw_statistics_overlay(Gfx::Bitmap& target)
|
|||
|
||||
if (milliseconds > 500) {
|
||||
|
||||
if (g_num_pixels == 0)
|
||||
g_num_pixels = 1;
|
||||
|
||||
int num_rendertarget_pixels = m_render_target->width() * m_render_target->height();
|
||||
|
||||
StringBuilder builder;
|
||||
|
@ -913,9 +910,9 @@ void Device::draw_statistics_overlay(Gfx::Bitmap& target)
|
|||
builder.append(String::formatted("SIMD usage : {}%\n", g_num_quads > 0 ? g_num_pixels_shaded * 25 / g_num_quads : 0));
|
||||
builder.append(String::formatted("Pixels : {}, Shaded: {}%, Blended: {}%, Overdraw: {}%\n",
|
||||
g_num_pixels,
|
||||
g_num_pixels_shaded * 100 / g_num_pixels,
|
||||
g_num_pixels_blended * 100 / g_num_pixels_shaded,
|
||||
g_num_pixels_shaded * 100 / num_rendertarget_pixels - 100));
|
||||
g_num_pixels > 0 ? g_num_pixels_shaded * 100 / g_num_pixels : 0,
|
||||
g_num_pixels_shaded > 0 ? g_num_pixels_blended * 100 / g_num_pixels_shaded : 0,
|
||||
num_rendertarget_pixels > 0 ? g_num_pixels_shaded * 100 / num_rendertarget_pixels - 100 : 0));
|
||||
builder.append(String::formatted("Sampler calls: {}\n", g_num_sampler_calls));
|
||||
|
||||
debug_string = builder.to_string();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue