From 92975b2e8127def6a692dd19c763fb69feb14409 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 2 Aug 2020 17:32:43 +1000 Subject: [PATCH] GPU/HW: Tiny performance optimization in polygon loading --- src/core/gpu_hw.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index d4ca3acec..e7edf6f2e 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -3,11 +3,12 @@ #include "common/log.h" #include "common/state_wrapper.h" #include "cpu_core.h" +#include "imgui.h" #include "pgxp.h" #include "settings.h" #include "system.h" -#include #include +#include Log_SetChannel(GPU_HW); template @@ -344,10 +345,8 @@ void GPU_HW::LoadVertices() return; // Cull polygons which are too large. - const s32 min_x_12 = std::min(native_vertex_positions[1][0], native_vertex_positions[2][0]); - const s32 max_x_12 = std::max(native_vertex_positions[1][0], native_vertex_positions[2][0]); - const s32 min_y_12 = std::min(native_vertex_positions[1][1], native_vertex_positions[2][1]); - const s32 max_y_12 = std::max(native_vertex_positions[1][1], native_vertex_positions[2][1]); + const auto [min_x_12, max_x_12] = MinMax(native_vertex_positions[1][0], native_vertex_positions[2][0]); + const auto [min_y_12, max_y_12] = MinMax(native_vertex_positions[1][1], native_vertex_positions[2][1]); const s32 min_x = std::min(min_x_12, native_vertex_positions[0][0]); const s32 max_x = std::max(max_x_12, native_vertex_positions[0][0]); const s32 min_y = std::min(min_y_12, native_vertex_positions[0][1]);