mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-15 07:30:06 +00:00
rasterizer_cache: Add sample_count
criteria in FindMatch
This commit is contained in:
parent
44cb5a4ad2
commit
8f791c0863
@ -846,12 +846,16 @@ SurfaceId RasterizerCache<T>::FindMatch(const SurfaceParams& params, ScaleMatch
|
|||||||
SurfaceId match_id{};
|
SurfaceId match_id{};
|
||||||
bool match_valid = false;
|
bool match_valid = false;
|
||||||
u32 match_scale = 0;
|
u32 match_scale = 0;
|
||||||
|
u8 match_sample_count = 0;
|
||||||
SurfaceInterval match_interval{};
|
SurfaceInterval match_interval{};
|
||||||
|
|
||||||
ForEachSurfaceInRegion(params.addr, params.size, [&](SurfaceId surface_id, Surface& surface) {
|
ForEachSurfaceInRegion(params.addr, params.size, [&](SurfaceId surface_id, Surface& surface) {
|
||||||
const bool res_scale_matched = match_scale_type == ScaleMatch::Exact
|
const bool res_scale_matched = match_scale_type == ScaleMatch::Exact
|
||||||
? (params.res_scale == surface.res_scale)
|
? (params.res_scale == surface.res_scale)
|
||||||
: (params.res_scale <= surface.res_scale);
|
: (params.res_scale <= surface.res_scale);
|
||||||
|
const bool sample_count_matched = match_scale_type == ScaleMatch::Exact
|
||||||
|
? (params.sample_count == surface.sample_count)
|
||||||
|
: (params.sample_count <= surface.sample_count);
|
||||||
const bool is_valid =
|
const bool is_valid =
|
||||||
True(find_flags & MatchFlags::Copy)
|
True(find_flags & MatchFlags::Copy)
|
||||||
? true
|
? true
|
||||||
@ -871,11 +875,16 @@ SurfaceId RasterizerCache<T>::FindMatch(const SurfaceParams& params, ScaleMatch
|
|||||||
surface.type != SurfaceType::Fill)
|
surface.type != SurfaceType::Fill)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!sample_count_matched && match_scale_type != ScaleMatch::Ignore &&
|
||||||
|
surface.type != SurfaceType::Fill)
|
||||||
|
return;
|
||||||
|
|
||||||
// Found a match, update only if this is better than the previous one
|
// Found a match, update only if this is better than the previous one
|
||||||
auto UpdateMatch = [&] {
|
auto UpdateMatch = [&] {
|
||||||
match_id = surface_id;
|
match_id = surface_id;
|
||||||
match_valid = is_valid;
|
match_valid = is_valid;
|
||||||
match_scale = surface.res_scale;
|
match_scale = surface.res_scale;
|
||||||
|
match_sample_count = surface.sample_count;
|
||||||
match_interval = surface_interval;
|
match_interval = surface_interval;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -886,6 +895,13 @@ SurfaceId RasterizerCache<T>::FindMatch(const SurfaceParams& params, ScaleMatch
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (surface.sample_count > match_sample_count) {
|
||||||
|
UpdateMatch();
|
||||||
|
return;
|
||||||
|
} else if (surface.sample_count < match_sample_count) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (is_valid && !match_valid) {
|
if (is_valid && !match_valid) {
|
||||||
UpdateMatch();
|
UpdateMatch();
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user