rsx: Fix incomplete blit operations getting used as texture inputs

- Raise passing 'score' from 50% to 90% to filter out very incomplete
merge operations.
- Catch unfit sections passing the match test; possible for blit_dst
data but will likely be always harmless. Disabled in release builds by default.
This commit is contained in:
kd-11 2020-01-23 22:35:03 +03:00 committed by kd-11
parent 331c1a394a
commit 7a275eaa3a
1 changed files with 10 additions and 2 deletions

View File

@ -221,8 +221,8 @@ namespace rsx
u16 min_x = external_subresource_desc.width, min_y = external_subresource_desc.height, u16 min_x = external_subresource_desc.width, min_y = external_subresource_desc.height,
max_x = 0, max_y = 0; max_x = 0, max_y = 0;
// Require at least 50% coverage // Require at least 90% coverage
const u32 target_area = (min_x * min_y) / 2; const u32 target_area = ((min_x * min_y) * 90u) / 100u;
for (const auto &section : external_subresource_desc.sections_to_copy) for (const auto &section : external_subresource_desc.sections_to_copy)
{ {
@ -1553,6 +1553,14 @@ namespace rsx
{ {
if (cached_texture->matches(attr.address, attr.gcm_format, attr.width, attr.height, attr.depth, 0)) if (cached_texture->matches(attr.address, attr.gcm_format, attr.width, attr.height, attr.depth, 0))
{ {
#ifdef TEXTURE_CACHE_DEBUG
if (!memory_range.inside(cached_texture->get_confirmed_range()))
{
// TODO. This is easily possible for blit_dst textures if the blit is incomplete in Y
// The possibility that a texture will be split into parts on the CPU like this is very rare
continue;
}
#endif
return{ cached_texture->get_view(encoded_remap, remap), cached_texture->get_context(), cached_texture->get_format_type(), scale, cached_texture->get_image_type() }; return{ cached_texture->get_view(encoded_remap, remap), cached_texture->get_context(), cached_texture->get_format_type(), scale, cached_texture->get_image_type() };
} }
} }