gl_texture_runtime: Clean up texture upload/download code

* Improve readability and code clarity
This commit is contained in:
emufan4568
2022-09-13 18:08:06 +03:00
committed by GPUCode
parent a932a9f662
commit d2fd8030dd
9 changed files with 295 additions and 300 deletions

View File

@ -22,6 +22,7 @@ struct Rectangle {
: left(left), top(top), right(right), bottom(bottom) {}
constexpr auto operator<=>(const Rectangle&) const = default;
constexpr void operator*=(const T value) {
left *= value;
top *= value;
@ -29,6 +30,9 @@ struct Rectangle {
bottom *= value;
}
[[nodiscard]] constexpr Rectangle operator*(const T value) const {
return Rectangle{left * value, top * value, right * value, bottom * value};
}
[[nodiscard]] constexpr T GetWidth() const {
return std::abs(static_cast<std::make_signed_t<T>>(right - left));
}