mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-09-07 05:39:08 +01:00
texture_cache: Minor changes
This commit is contained in:
parent
322d0200c8
commit
7228e22098
4 changed files with 17 additions and 19 deletions
|
@ -195,18 +195,18 @@ public:
|
|||
|
||||
virtual void DownloadTexture(std::vector<u8>& staging_buffer) = 0;
|
||||
|
||||
void MarkAsModified(const bool is_modified_, const u64 tick) {
|
||||
void MarkAsModified(bool is_modified_, u64 tick) {
|
||||
is_modified = is_modified_ || is_target;
|
||||
modification_tick = tick;
|
||||
}
|
||||
|
||||
void MarkAsRenderTarget(const bool is_target, const u32 index) {
|
||||
this->is_target = is_target;
|
||||
this->index = index;
|
||||
void MarkAsRenderTarget(bool is_target_, u32 index_) {
|
||||
is_target = is_target_;
|
||||
index = index_;
|
||||
}
|
||||
|
||||
void MarkAsPicked(const bool is_picked) {
|
||||
this->is_picked = is_picked;
|
||||
void MarkAsPicked(bool is_picked_) {
|
||||
is_picked = is_picked_;
|
||||
}
|
||||
|
||||
bool IsModified() const {
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "common/alignment.h"
|
||||
#include "common/bit_util.h"
|
||||
#include "common/cityhash.h"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
namespace VideoCommon {
|
||||
|
||||
std::size_t ViewParams::Hash() const {
|
||||
return static_cast<std::size_t>(base_layer) ^ static_cast<std::size_t>(num_layers << 16) ^
|
||||
return static_cast<std::size_t>(base_layer) ^ (static_cast<std::size_t>(num_layers) << 16) ^
|
||||
(static_cast<std::size_t>(base_level) << 24) ^
|
||||
(static_cast<std::size_t>(num_levels) << 32) ^ (static_cast<std::size_t>(target) << 36);
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
namespace VideoCommon {
|
||||
|
||||
struct ViewParams {
|
||||
ViewParams(VideoCore::Surface::SurfaceTarget target, u32 base_layer, u32 num_layers,
|
||||
u32 base_level, u32 num_levels)
|
||||
constexpr explicit ViewParams(VideoCore::Surface::SurfaceTarget target, u32 base_layer,
|
||||
u32 num_layers, u32 base_level, u32 num_levels)
|
||||
: target{target}, base_layer{base_layer}, num_layers{num_layers}, base_level{base_level},
|
||||
num_levels{num_levels} {}
|
||||
|
||||
|
@ -22,12 +22,6 @@ struct ViewParams {
|
|||
|
||||
bool operator==(const ViewParams& rhs) const;
|
||||
|
||||
VideoCore::Surface::SurfaceTarget target{};
|
||||
u32 base_layer{};
|
||||
u32 num_layers{};
|
||||
u32 base_level{};
|
||||
u32 num_levels{};
|
||||
|
||||
bool IsLayered() const {
|
||||
switch (target) {
|
||||
case VideoCore::Surface::SurfaceTarget::Texture1DArray:
|
||||
|
@ -39,13 +33,19 @@ struct ViewParams {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
VideoCore::Surface::SurfaceTarget target{};
|
||||
u32 base_layer{};
|
||||
u32 num_layers{};
|
||||
u32 base_level{};
|
||||
u32 num_levels{};
|
||||
};
|
||||
|
||||
class ViewBase {
|
||||
public:
|
||||
ViewBase(const ViewParams& params) : params{params} {}
|
||||
constexpr explicit ViewBase(const ViewParams& params) : params{params} {}
|
||||
|
||||
const ViewParams& GetViewParams() const {
|
||||
constexpr const ViewParams& GetViewParams() const {
|
||||
return params;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue