summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2025-10-31 13:15:15 -0500
committeriwubcode <iwubcode@users.noreply.github.com>2025-10-31 13:28:14 -0500
commit6728007cb4832c80745df73f980ccff53691368f (patch)
tree2ba1884b27ec00edef7b27462d55451049e69686 /Source/Core/VideoCommon
parentee7c476e24d59af2c6b8e24486cd08ff09946112 (diff)
VideoCommon: rename ScissorResult 'm_result' to 'rectangles' to better reflect what the member is
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/BPFunctions.cpp10
-rw-r--r--Source/Core/VideoCommon/BPFunctions.h11
-rw-r--r--Source/Core/VideoCommon/Statistics.cpp14
3 files changed, 17 insertions, 18 deletions
diff --git a/Source/Core/VideoCommon/BPFunctions.cpp b/Source/Core/VideoCommon/BPFunctions.cpp
index 1018af0142..660d85c598 100644
--- a/Source/Core/VideoCommon/BPFunctions.cpp
+++ b/Source/Core/VideoCommon/BPFunctions.cpp
@@ -131,7 +131,7 @@ ScissorResult::ScissorResult(ScissorPos scissor_top_left, ScissorPos scissor_bot
RangeList x_ranges = ComputeScissorRanges(left, right, x_off, EFB_WIDTH);
RangeList y_ranges = ComputeScissorRanges(top, bottom, y_off, EFB_HEIGHT);
- m_result.reserve(x_ranges.size() * y_ranges.size());
+ rectangles.reserve(x_ranges.size() * y_ranges.size());
// Now we need to form actual rectangles from the x and y ranges,
// which is a simple Cartesian product of x_ranges_clamped and y_ranges_clamped.
@@ -145,12 +145,12 @@ ScissorResult::ScissorResult(ScissorPos scissor_top_left, ScissorPos scissor_bot
{
DEBUG_ASSERT(y_range.start < y_range.end);
DEBUG_ASSERT(static_cast<u32>(y_range.end) <= EFB_HEIGHT);
- m_result.emplace_back(x_range, y_range);
+ rectangles.emplace_back(x_range, y_range);
}
}
auto cmp = [&](const ScissorRect& lhs, const ScissorRect& rhs) { return IsWorse(lhs, rhs); };
- std::ranges::sort(m_result, cmp);
+ std::ranges::sort(rectangles, cmp);
}
ScissorRect ScissorResult::Best() const
@@ -158,9 +158,9 @@ ScissorRect ScissorResult::Best() const
// For now, simply choose the best rectangle (see ScissorResult::IsWorse).
// This does mean we calculate all rectangles and only choose one, which is not optimal, but this
// is called infrequently. Eventually, all backends will support multiple scissor rects.
- if (!m_result.empty())
+ if (!rectangles.empty())
{
- return m_result.back();
+ return rectangles.back();
}
else
{
diff --git a/Source/Core/VideoCommon/BPFunctions.h b/Source/Core/VideoCommon/BPFunctions.h
index 770d1c674d..a91b98cc40 100644
--- a/Source/Core/VideoCommon/BPFunctions.h
+++ b/Source/Core/VideoCommon/BPFunctions.h
@@ -76,7 +76,7 @@ struct ScissorResult
: scissor_tl{.hex = other.scissor_tl.hex}, scissor_br{.hex = other.scissor_br.hex},
scissor_off{.hex = other.scissor_off.hex}, viewport_left{other.viewport_left},
viewport_right{other.viewport_right}, viewport_top{other.viewport_top},
- viewport_bottom{other.viewport_bottom}, m_result{other.m_result}
+ viewport_bottom{other.viewport_bottom}, rectangles{other.rectangles}
{
}
ScissorResult& operator=(const ScissorResult& other)
@@ -90,14 +90,14 @@ struct ScissorResult
viewport_right = other.viewport_right;
viewport_top = other.viewport_top;
viewport_bottom = other.viewport_bottom;
- m_result = other.m_result;
+ rectangles = other.rectangles;
return *this;
}
ScissorResult(ScissorResult&& other)
: scissor_tl{.hex = other.scissor_tl.hex}, scissor_br{.hex = other.scissor_br.hex},
scissor_off{.hex = other.scissor_off.hex}, viewport_left{other.viewport_left},
viewport_right{other.viewport_right}, viewport_top{other.viewport_top},
- viewport_bottom{other.viewport_bottom}, m_result{std::move(other.m_result)}
+ viewport_bottom{other.viewport_bottom}, rectangles{std::move(other.rectangles)}
{
}
ScissorResult& operator=(ScissorResult&& other)
@@ -111,7 +111,7 @@ struct ScissorResult
viewport_right = other.viewport_right;
viewport_top = other.viewport_top;
viewport_bottom = other.viewport_bottom;
- m_result = std::move(other.m_result);
+ rectangles = std::move(other.rectangles);
return *this;
}
@@ -124,8 +124,7 @@ struct ScissorResult
float viewport_top;
float viewport_bottom;
- // Actual result
- std::vector<ScissorRect> m_result;
+ std::vector<ScissorRect> rectangles;
ScissorRect Best() const;
diff --git a/Source/Core/VideoCommon/Statistics.cpp b/Source/Core/VideoCommon/Statistics.cpp
index b7e49feb19..db098db5c7 100644
--- a/Source/Core/VideoCommon/Statistics.cpp
+++ b/Source/Core/VideoCommon/Statistics.cpp
@@ -313,13 +313,13 @@ void Statistics::DisplayScissor()
draw_rect(info.viewport_left, info.viewport_top, info.viewport_right, info.viewport_bottom,
col);
}
- for (size_t i = 0; i < info.m_result.size(); i++)
+ for (size_t i = 0; i < info.rectangles.size(); i++)
{
// The last entry in the sorted list of results is the one that is used by hardware backends
- const u8 new_alpha = (i == info.m_result.size() - 1) ? 0x40 : 0x80;
+ const u8 new_alpha = (i == info.rectangles.size() - 1) ? 0x40 : 0x80;
const ImU32 new_col = (col & ~IM_COL32_A_MASK) | (new_alpha << IM_COL32_A_SHIFT);
- const auto& r = info.m_result[i];
+ const auto& r = info.rectangles[i];
draw_list->AddRectFilled(vec(r.rect.left + r.x_off, r.rect.top + r.y_off),
vec(r.rect.right + r.x_off, r.rect.bottom + r.y_off), new_col);
}
@@ -367,14 +367,14 @@ void Statistics::DisplayScissor()
ImVec2 p2 = ImGui::GetCursorScreenPos();
// Use a height of 1 since we want this to span two table rows (if possible)
ImGui::Dummy(ImVec2(EFB_WIDTH * scale_height, 1));
- for (size_t i = 0; i < info.m_result.size(); i++)
+ for (size_t i = 0; i < info.rectangles.size(); i++)
{
// The last entry in the sorted list of results is the one that is used by hardware backends
- const u8 new_alpha = (i == info.m_result.size() - 1) ? 0x80 : 0x40;
+ const u8 new_alpha = (i == info.rectangles.size() - 1) ? 0x80 : 0x40;
const ImU32 col = ImGui::GetColorU32(COLORS[index % COLORS.size()]);
const ImU32 new_col = (col & ~IM_COL32_A_MASK) | (new_alpha << IM_COL32_A_SHIFT);
- const auto& r = info.m_result[i];
+ const auto& r = info.rectangles[i];
draw_list->AddRectFilled(
ImVec2(p2.x + r.rect.left * scale_height, p2.y + r.rect.top * scale_height),
ImVec2(p2.x + r.rect.right * scale_height, p2.y + r.rect.bottom * scale_height), new_col);
@@ -382,7 +382,7 @@ void Statistics::DisplayScissor()
draw_list->AddRect(
p2, ImVec2(p2.x + EFB_WIDTH * scale_height, p2.y + EFB_HEIGHT * scale_height), light_grey);
ImGui::SameLine();
- ImGui::Text("%d", int(info.m_result.size()));
+ ImGui::Text("%d", int(info.rectangles.size()));
if (show_raw_scissors)
{