Texture_Cache: Simplifications to RS Database handling.

This commit is contained in:
Fernando Sahmkow
2019-07-08 08:04:13 -04:00
committed by FernandoS27
parent e2c76c4064
commit 4596d5bd7e
2 changed files with 14 additions and 24 deletions

View File

@@ -207,11 +207,6 @@ public:
void MarkAsRescaled(const bool is_rescaled) {
this->is_rescaled = is_rescaled;
this->is_rescale_candidate = is_rescaled;
}
void MarkAsRescaleCandidate(const bool is_rescale_candidate) {
this->is_rescale_candidate = is_rescale_candidate;
}
void MarkAsPicked(bool is_picked_) {
@@ -239,10 +234,6 @@ public:
return is_rescaled;
}
bool IsRescaleCandidate() const {
return is_rescale_candidate;
}
bool IsRegistered() const {
return is_registered;
}
@@ -336,7 +327,6 @@ private:
bool is_registered{};
bool is_picked{};
bool is_rescaled{};
bool is_rescale_candidate{};
u32 index{NO_RT};
u64 modification_tick{};
};

View File

@@ -254,7 +254,7 @@ public:
std::pair<TSurface, TView> dst_surface = GetSurface(dst_gpu_addr, dst_params, true, false);
std::pair<TSurface, TView> src_surface = GetSurface(src_gpu_addr, src_params, true, false);
if (IsResScannerEnabled()) {
bool is_candidate = src_surface.first->IsRescaleCandidate();
bool is_candidate = IsInRSDatabase(src_surface.first);
if (is_candidate) {
MarkScanner(dst_surface.first);
}
@@ -422,15 +422,10 @@ protected:
// Must be called by child's create surface
void SignalCreatedSurface(TSurface& new_surface) {
const auto& params = new_surface->GetSurfaceParams();
if (EnabledRescaling()) {
if (scaling_database.IsInDatabase(params.pixel_format, params.width, params.height)) {
if (IsInRSDatabase(new_surface)) {
new_surface->MarkAsRescaled(true);
}
} else if (IsResScannerEnabled()) {
if (scaling_database.IsInDatabase(params.pixel_format, params.width, params.height)) {
new_surface->MarkAsRescaleCandidate(true);
}
}
}
@@ -577,9 +572,9 @@ private:
}
}
if (IsResScannerEnabled()) {
bool is_candidate = current_surface->IsRescaleCandidate();
bool is_candidate = IsInRSDatabase(current_surface);
if (is_candidate) {
if (IsBlackListed(new_surface)) {
if (IsRSBlacklisted(new_surface)) {
UnmarkScanner(current_surface);
} else {
MarkScanner(new_surface);
@@ -1063,11 +1058,16 @@ private:
scaling_database.Register(params.pixel_format, params.width, params.height);
}
bool IsBlackListed(const TSurface& surface) {
bool IsRSBlacklisted(const TSurface& surface) {
const auto params = surface->GetSurfaceParams();
return scaling_database.IsBlacklisted(params.pixel_format, params.width, params.height);
}
bool IsInRSDatabase(const TSurface& surface) {
const auto& params = surface->GetSurfaceParams();
return scaling_database.IsInDatabase(params.pixel_format, params.width, params.height);
}
bool CheckBlackListMatch() {
u32 enabled_targets = 0;
u32 black_listed = 0;
@@ -1075,7 +1075,7 @@ private:
for (const auto& target : render_targets) {
if (target.target) {
enabled_targets++;
if (IsBlackListed(target.target)) {
if (IsRSBlacklisted(target.target)) {
black_list = true;
black_listed++;
}
@@ -1083,7 +1083,7 @@ private:
}
if (depth_buffer.target) {
enabled_targets++;
if (IsBlackListed(depth_buffer.target)) {
if (IsRSBlacklisted(depth_buffer.target)) {
black_list = true;
black_listed++;
}
@@ -1121,7 +1121,7 @@ private:
for (const auto& target : render_targets) {
if (target.target) {
enabled_targets++;
if (target.target->IsRescaleCandidate()) {
if (target.target->IsRescaled()) {
rescaling = true;
rescaled_targets++;
}
@@ -1129,7 +1129,7 @@ private:
}
if (depth_buffer.target) {
enabled_targets++;
if (depth_buffer.target->IsRescaleCandidate()) {
if (depth_buffer.target->IsRescaled()) {
rescaling = true;
rescaled_targets++;
}