Texture_Cache: Simplifications to RS Database handling.
This commit is contained in:
committed by
FernandoS27
parent
e2c76c4064
commit
4596d5bd7e
@@ -207,11 +207,6 @@ public:
|
|||||||
|
|
||||||
void MarkAsRescaled(const bool is_rescaled) {
|
void MarkAsRescaled(const bool is_rescaled) {
|
||||||
this->is_rescaled = 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_) {
|
void MarkAsPicked(bool is_picked_) {
|
||||||
@@ -239,10 +234,6 @@ public:
|
|||||||
return is_rescaled;
|
return is_rescaled;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsRescaleCandidate() const {
|
|
||||||
return is_rescale_candidate;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsRegistered() const {
|
bool IsRegistered() const {
|
||||||
return is_registered;
|
return is_registered;
|
||||||
}
|
}
|
||||||
@@ -336,7 +327,6 @@ private:
|
|||||||
bool is_registered{};
|
bool is_registered{};
|
||||||
bool is_picked{};
|
bool is_picked{};
|
||||||
bool is_rescaled{};
|
bool is_rescaled{};
|
||||||
bool is_rescale_candidate{};
|
|
||||||
u32 index{NO_RT};
|
u32 index{NO_RT};
|
||||||
u64 modification_tick{};
|
u64 modification_tick{};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ public:
|
|||||||
std::pair<TSurface, TView> dst_surface = GetSurface(dst_gpu_addr, dst_params, true, false);
|
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);
|
std::pair<TSurface, TView> src_surface = GetSurface(src_gpu_addr, src_params, true, false);
|
||||||
if (IsResScannerEnabled()) {
|
if (IsResScannerEnabled()) {
|
||||||
bool is_candidate = src_surface.first->IsRescaleCandidate();
|
bool is_candidate = IsInRSDatabase(src_surface.first);
|
||||||
if (is_candidate) {
|
if (is_candidate) {
|
||||||
MarkScanner(dst_surface.first);
|
MarkScanner(dst_surface.first);
|
||||||
}
|
}
|
||||||
@@ -422,15 +422,10 @@ protected:
|
|||||||
|
|
||||||
// Must be called by child's create surface
|
// Must be called by child's create surface
|
||||||
void SignalCreatedSurface(TSurface& new_surface) {
|
void SignalCreatedSurface(TSurface& new_surface) {
|
||||||
const auto& params = new_surface->GetSurfaceParams();
|
|
||||||
if (EnabledRescaling()) {
|
if (EnabledRescaling()) {
|
||||||
if (scaling_database.IsInDatabase(params.pixel_format, params.width, params.height)) {
|
if (IsInRSDatabase(new_surface)) {
|
||||||
new_surface->MarkAsRescaled(true);
|
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()) {
|
if (IsResScannerEnabled()) {
|
||||||
bool is_candidate = current_surface->IsRescaleCandidate();
|
bool is_candidate = IsInRSDatabase(current_surface);
|
||||||
if (is_candidate) {
|
if (is_candidate) {
|
||||||
if (IsBlackListed(new_surface)) {
|
if (IsRSBlacklisted(new_surface)) {
|
||||||
UnmarkScanner(current_surface);
|
UnmarkScanner(current_surface);
|
||||||
} else {
|
} else {
|
||||||
MarkScanner(new_surface);
|
MarkScanner(new_surface);
|
||||||
@@ -1063,11 +1058,16 @@ private:
|
|||||||
scaling_database.Register(params.pixel_format, params.width, params.height);
|
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();
|
const auto params = surface->GetSurfaceParams();
|
||||||
return scaling_database.IsBlacklisted(params.pixel_format, params.width, params.height);
|
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() {
|
bool CheckBlackListMatch() {
|
||||||
u32 enabled_targets = 0;
|
u32 enabled_targets = 0;
|
||||||
u32 black_listed = 0;
|
u32 black_listed = 0;
|
||||||
@@ -1075,7 +1075,7 @@ private:
|
|||||||
for (const auto& target : render_targets) {
|
for (const auto& target : render_targets) {
|
||||||
if (target.target) {
|
if (target.target) {
|
||||||
enabled_targets++;
|
enabled_targets++;
|
||||||
if (IsBlackListed(target.target)) {
|
if (IsRSBlacklisted(target.target)) {
|
||||||
black_list = true;
|
black_list = true;
|
||||||
black_listed++;
|
black_listed++;
|
||||||
}
|
}
|
||||||
@@ -1083,7 +1083,7 @@ private:
|
|||||||
}
|
}
|
||||||
if (depth_buffer.target) {
|
if (depth_buffer.target) {
|
||||||
enabled_targets++;
|
enabled_targets++;
|
||||||
if (IsBlackListed(depth_buffer.target)) {
|
if (IsRSBlacklisted(depth_buffer.target)) {
|
||||||
black_list = true;
|
black_list = true;
|
||||||
black_listed++;
|
black_listed++;
|
||||||
}
|
}
|
||||||
@@ -1121,7 +1121,7 @@ private:
|
|||||||
for (const auto& target : render_targets) {
|
for (const auto& target : render_targets) {
|
||||||
if (target.target) {
|
if (target.target) {
|
||||||
enabled_targets++;
|
enabled_targets++;
|
||||||
if (target.target->IsRescaleCandidate()) {
|
if (target.target->IsRescaled()) {
|
||||||
rescaling = true;
|
rescaling = true;
|
||||||
rescaled_targets++;
|
rescaled_targets++;
|
||||||
}
|
}
|
||||||
@@ -1129,7 +1129,7 @@ private:
|
|||||||
}
|
}
|
||||||
if (depth_buffer.target) {
|
if (depth_buffer.target) {
|
||||||
enabled_targets++;
|
enabled_targets++;
|
||||||
if (depth_buffer.target->IsRescaleCandidate()) {
|
if (depth_buffer.target->IsRescaled()) {
|
||||||
rescaling = true;
|
rescaling = true;
|
||||||
rescaled_targets++;
|
rescaled_targets++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user