SPU/Windows: Fix LS memory mirrors

This is a workaround but this is because of how utils::shm works on Windows path.
This commit is contained in:
Eladash 2020-07-19 06:44:32 +03:00 committed by Ivan
parent 0d8152cd4e
commit f8d2d8ca11

View File

@ -1180,7 +1180,7 @@ spu_thread::~spu_thread()
} }
// Release LS mirrors area // Release LS mirrors area
utils::memory_release(ls - SPU_LS_SIZE, SPU_LS_SIZE * 3); utils::memory_release(ls - (SPU_LS_SIZE * 2), SPU_LS_SIZE * 5);
// Deallocate RawSPU ID // Deallocate RawSPU ID
if (get_type() >= spu_type::raw) if (get_type() >= spu_type::raw)
@ -1196,9 +1196,9 @@ spu_thread::spu_thread(vm::addr_t _ls, lv2_spu_group* group, u32 index, std::str
, ls([&]() , ls([&]()
{ {
const auto [_, shm] = vm::get(vm::any, _ls)->get(_ls); const auto [_, shm] = vm::get(vm::any, _ls)->get(_ls);
const auto addr = static_cast<u8*>(utils::memory_reserve(SPU_LS_SIZE * 3)); const auto addr = static_cast<u8*>(utils::memory_reserve(SPU_LS_SIZE * 5));
for (u32 i = 0; i < 3; i++) for (u32 i = 1; i < 4; i++)
{ {
// Map LS mirrors // Map LS mirrors
const auto ptr = addr + (i * SPU_LS_SIZE); const auto ptr = addr + (i * SPU_LS_SIZE);
@ -1206,7 +1206,7 @@ spu_thread::spu_thread(vm::addr_t _ls, lv2_spu_group* group, u32 index, std::str
} }
// Use the middle mirror // Use the middle mirror
return addr + SPU_LS_SIZE; return addr + (SPU_LS_SIZE * 2);
}()) }())
, thread_type(group ? spu_type::threaded : is_isolated ? spu_type::isolated : spu_type::raw) , thread_type(group ? spu_type::threaded : is_isolated ? spu_type::isolated : spu_type::raw)
, offset(_ls) , offset(_ls)