rsx: Implement framebuffer statistics to track the internal render resolution at runtime.

This commit is contained in:
kd-11 2025-02-09 23:28:37 +03:00 committed by kd-11
parent 0f3d2c7085
commit 10d5907f46
9 changed files with 179 additions and 3 deletions

View file

@ -404,18 +404,19 @@ namespace rsx
return ret;
}
void sort(std::predicate<const Ty&, const Ty&> auto predicate)
simple_array<Ty>& sort(std::predicate<const Ty&, const Ty&> auto predicate)
{
if (_size < 2)
{
return;
return *this;
}
std::sort(begin(), end(), predicate);
return *this;
}
template <typename F, typename U = std::invoke_result_t<F, const Ty&>>
requires std::is_invocable_v<F, const Ty&>
requires (std::is_invocable_v<F, const Ty&> && std::is_trivially_destructible_v<U>)
simple_array<U> map(F&& xform) const
{
simple_array<U> result;
@ -428,6 +429,20 @@ namespace rsx
return result;
}
template <typename F, typename U = std::invoke_result_t<F, const Ty&>>
requires (std::is_invocable_v<F, const Ty&> && !std::is_trivially_destructible_v<U>)
std::vector<U> map(F&& xform) const
{
std::vector<U> result;
result.reserve(size());
for (auto it = begin(); it != end(); ++it)
{
result.push_back(xform(*it));
}
return result;
}
template <typename F, typename U>
requires std::is_invocable_r_v<U, F, const U&, const Ty&>
U reduce(U initial_value, F&& reducer) const