mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-11 01:08:39 +12:00
rsx: Fix get_optimal_blit_target_properties for local memory
This commit is contained in:
parent
d69bec8f59
commit
ff74c241c7
2 changed files with 15 additions and 2 deletions
|
@ -117,6 +117,11 @@ struct RsxDisplayInfo
|
||||||
be_t<u32> pitch;
|
be_t<u32> pitch;
|
||||||
be_t<u32> width;
|
be_t<u32> width;
|
||||||
be_t<u32> height;
|
be_t<u32> height;
|
||||||
|
|
||||||
|
bool valid() const
|
||||||
|
{
|
||||||
|
return height != 0u && width != 0u;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct lv2_rsx_config
|
struct lv2_rsx_config
|
||||||
|
|
|
@ -189,13 +189,21 @@ namespace rsx
|
||||||
for (u32 i = 0; i < renderer->display_buffers_count; ++i)
|
for (u32 i = 0; i < renderer->display_buffers_count; ++i)
|
||||||
{
|
{
|
||||||
const auto& buffer = renderer->display_buffers[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)
|
if (pitch != dst_pitch)
|
||||||
{
|
{
|
||||||
continue;
|
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))
|
if (dst_range.inside(buffer_range))
|
||||||
{
|
{
|
||||||
// Match found
|
// Match found
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue