1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

rsx: Handle some more corner cases

This commit is contained in:
kd-11 2022-10-02 18:45:27 +03:00 committed by kd-11
parent 765208a181
commit 533f960854
3 changed files with 14 additions and 4 deletions

View File

@ -3237,7 +3237,7 @@ namespace rsx
return m_predictor;
}
bool is_protected(u32 section_base_address)
bool is_protected(u32 section_base_address, const address_range& test_range, rsx::texture_upload_context context)
{
reader_lock lock(m_cache_mutex);
@ -3246,7 +3246,9 @@ namespace rsx
{
if (tex.get_section_base() == section_base_address)
{
return tex.is_locked();
return tex.get_context() == context &&
tex.is_locked() &&
test_range.inside(tex.get_section_range());
}
}

View File

@ -321,7 +321,11 @@ void GLGSRender::init_buffers(rsx::framebuffer_creation_context context, bool /*
bool lock = surface->is_depth_surface() ? !!g_cfg.video.write_depth_buffer :
!!g_cfg.video.write_color_buffers;
if (lock && !m_gl_texture_cache.is_protected(base_addr))
if (lock &&
!m_gl_texture_cache.is_protected(
base_addr,
surface->get_memory_range(),
rsx::texture_upload_context::framebuffer_storage))
{
lock = false;
}

View File

@ -2426,7 +2426,11 @@ void VKGSRender::prepare_rtts(rsx::framebuffer_creation_context context)
bool lock = surface->is_depth_surface() ? !!g_cfg.video.write_depth_buffer :
!!g_cfg.video.write_color_buffers;
if (lock && !m_texture_cache.is_protected(base_addr))
if (lock &&
!m_texture_cache.is_protected(
base_addr,
surface->get_memory_range(),
rsx::texture_upload_context::framebuffer_storage))
{
lock = false;
}