rsx: Refactor texture cache lookup core to be easier to read

This commit is contained in:
kd-11
2025-11-06 10:42:55 +03:00
committed by kd-11
parent 8126a199f5
commit 1007aaee4c
+13 -8
View File
@@ -1869,9 +1869,10 @@ namespace rsx
{ {
return{ cached_texture->get_view(remap), cached_texture->get_context(), cached_texture->get_format_class(), scale, cached_texture->get_image_type() }; return{ cached_texture->get_view(remap), cached_texture->get_context(), cached_texture->get_format_class(), scale, cached_texture->get_image_type() };
} }
return {};
} }
else
{
// Fast lookup for cyclic reference // Fast lookup for cyclic reference
if (m_rtts.address_is_bound(attr.address)) [[unlikely]] if (m_rtts.address_is_bound(attr.address)) [[unlikely]]
{ {
@@ -2093,9 +2094,13 @@ namespace rsx
return {}; return {};
} }
if (const auto section_count = result.external_subresource_desc.sections_to_copy.size(); const auto section_count = result.external_subresource_desc.sections_to_copy.size();
section_count > 0) if (section_count == 0)
{ {
// Fail
return {};
}
bool result_is_valid; bool result_is_valid;
if (_pool == 0 && !g_cfg.video.write_color_buffers && !g_cfg.video.write_depth_buffer) if (_pool == 0 && !g_cfg.video.write_color_buffers && !g_cfg.video.write_depth_buffer)
{ {
@@ -2111,8 +2116,11 @@ namespace rsx
result_is_valid = result.atlas_covers_target_area(section_count == 1 ? 99 : 90); result_is_valid = result.atlas_covers_target_area(section_count == 1 ? 99 : 90);
} }
if (result_is_valid) if (!result_is_valid)
{ {
return {};
}
// Check for possible duplicates // Check for possible duplicates
usz max_overdraw_ratio = u32{ umax }; usz max_overdraw_ratio = u32{ umax };
usz max_safe_sections = u32{ umax }; usz max_safe_sections = u32{ umax };
@@ -2175,9 +2183,6 @@ namespace rsx
return result; return result;
} }
}
}
}
return {}; return {};
} }