rsx: Improve swizzled layout detection

- Reset swizzle flag to false automatically on section reset.
- Detect render target payload and extract swizzle information from it.
This commit is contained in:
kd-11 2020-08-05 22:50:31 +03:00 committed by kd-11
commit 7109fe9889
3 changed files with 11 additions and 0 deletions

View file

@ -1089,6 +1089,7 @@ namespace rsx
gcm_format = 0; gcm_format = 0;
pack_unpack_swap_bytes = false; pack_unpack_swap_bytes = false;
swizzled = false;
sync_timestamp = 0ull; sync_timestamp = 0ull;
synchronized = false; synchronized = false;

View file

@ -95,6 +95,11 @@ namespace gl
ASSERT(!managed_texture); ASSERT(!managed_texture);
} }
if (auto rtt = dynamic_cast<gl::render_target*>(image))
{
swizzled = (rtt->raster_type != rsx::surface_raster_type::linear);
}
flushed = false; flushed = false;
synchronized = false; synchronized = false;
sync_timestamp = 0ull; sync_timestamp = 0ull;

View file

@ -66,6 +66,11 @@ namespace vk
managed_texture.reset(vram_texture); managed_texture.reset(vram_texture);
} }
if (auto rtt = dynamic_cast<vk::render_target*>(image))
{
swizzled = (rtt->raster_type != rsx::surface_raster_type::linear);
}
if (synchronized) if (synchronized)
{ {
// Even if we are managing the same vram section, we cannot guarantee contents are static // Even if we are managing the same vram section, we cannot guarantee contents are static