rsx: Fix get_optimal_blit_target_properties for local memory

This commit is contained in:
Eladash 2020-04-11 13:07:37 +03:00 committed by kd-11
parent d69bec8f59
commit ff74c241c7
2 changed files with 15 additions and 2 deletions

View File

@ -117,6 +117,11 @@ struct RsxDisplayInfo
be_t<u32> pitch;
be_t<u32> width;
be_t<u32> height;
bool valid() const
{
return height != 0u && width != 0u;
}
};
struct lv2_rsx_config

View File

@ -189,13 +189,21 @@ namespace rsx
for (u32 i = 0; i < renderer->display_buffers_count; ++i)
{
const auto& buffer = renderer->display_buffers[i];
const u32 pitch = buffer.pitch? static_cast<u32>(buffer.pitch) : g_fxo->get<rsx::avconf>()->get_bpp() * buffer.width;
if (!buffer.valid())
{
continue;
}
const u32 bpp = g_fxo->get<rsx::avconf>()->get_bpp();
const u32 pitch = buffer.pitch ? +buffer.pitch : bpp * buffer.width;
if (pitch != dst_pitch)
{
continue;
}
const auto buffer_range = address_range::start_length(rsx::constants::local_mem_base + buffer.offset, pitch * buffer.height);
const auto buffer_range = address_range::start_length(rsx::get_address(buffer.offset, CELL_GCM_LOCATION_LOCAL, HERE), pitch * (buffer.height - 1) + (buffer.width * bpp));
if (dst_range.inside(buffer_range))
{
// Match found