mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 12:32:43 +00:00
Fix BE endianess arch support in semaphore_406e (#6116)
Add raw() methods for endianness support types and make use of it.
This commit is contained in:
parent
ade291e73d
commit
cd0ef99df5
@ -490,6 +490,11 @@ public:
|
||||
return storage::from(m_data);
|
||||
}
|
||||
|
||||
stype& raw()
|
||||
{
|
||||
return m_data;
|
||||
}
|
||||
|
||||
se_t& operator=(const se_t&) = default;
|
||||
|
||||
se_t& operator=(type value)
|
||||
@ -533,6 +538,11 @@ public:
|
||||
return std::bit_cast<type>(m_data);
|
||||
}
|
||||
|
||||
stype& raw()
|
||||
{
|
||||
return m_data;
|
||||
}
|
||||
|
||||
se_t& operator=(const se_t& value) = default;
|
||||
|
||||
se_t& operator=(type value)
|
||||
|
@ -370,26 +370,24 @@ namespace rsx
|
||||
frame_capture_data::tile_state tilestate;
|
||||
for (u32 i = 0; i < limits::tiles_count; ++i)
|
||||
{
|
||||
// Avoid byteswapping
|
||||
auto tile = rsx->tiles[i].pack();
|
||||
const auto tile = rsx->tiles[i].pack();
|
||||
auto& tstate = tilestate.tiles[i];
|
||||
tstate.tile = std::bit_cast<u32>(tile.tile);
|
||||
tstate.limit = std::bit_cast<u32>(tile.limit);
|
||||
tstate.pitch = rsx->tiles[i].binded ? std::bit_cast<u32>(tile.pitch) : 0;
|
||||
tstate.format = rsx->tiles[i].binded ? std::bit_cast<u32>(tile.format) : 0;
|
||||
tstate.tile = tile.tile;
|
||||
tstate.limit = tile.limit;
|
||||
tstate.pitch = rsx->tiles[i].binded ? u32{tile.pitch} : 0;
|
||||
tstate.format = rsx->tiles[i].binded ? u32{tile.format} : 0;
|
||||
}
|
||||
|
||||
for (u32 i = 0; i < limits::zculls_count; ++i)
|
||||
{
|
||||
// Avoid byteswapping
|
||||
auto zc = rsx->zculls[i].pack();
|
||||
const auto zc = rsx->zculls[i].pack();
|
||||
auto& zcstate = tilestate.zculls[i];
|
||||
zcstate.region = std::bit_cast<u32>(zc.region);
|
||||
zcstate.size = std::bit_cast<u32>(zc.size);
|
||||
zcstate.start = std::bit_cast<u32>(zc.start);
|
||||
zcstate.offset = std::bit_cast<u32>(zc.offset);
|
||||
zcstate.status0 = rsx->zculls[i].binded ? std::bit_cast<u32>(zc.status0) : 0;
|
||||
zcstate.status1 = rsx->zculls[i].binded ? std::bit_cast<u32>(zc.status1) : 0;
|
||||
zcstate.region = zc.region;
|
||||
zcstate.size = zc.size;
|
||||
zcstate.start = zc.start;
|
||||
zcstate.offset = zc.offset;
|
||||
zcstate.status0 = rsx->zculls[i].binded ? u32{zc.status0} : 0;
|
||||
zcstate.status1 = rsx->zculls[i].binded ? u32{zc.status1} : 0;
|
||||
}
|
||||
|
||||
const u64 tsnum = XXH64(&tilestate, sizeof(frame_capture_data::tile_state), 0);
|
||||
|
@ -228,7 +228,8 @@ void CgBinaryDisasm::TaskFP()
|
||||
verify(HERE), ((m_buffer_size - m_offset) % sizeof(u32) == 0);
|
||||
for (u32 i = 0; i < (m_buffer_size - m_offset) / sizeof(u32); i++)
|
||||
{
|
||||
data[i] = se_storage<u32>::swap(data[i]); // WTF, cannot use be_t<> there?
|
||||
// Get BE data
|
||||
data[i] = be_t<u32>{data[i]}.raw();
|
||||
}
|
||||
|
||||
enum
|
||||
|
@ -375,7 +375,7 @@ public:
|
||||
verify(HERE), (m_buffer_size - m_offset) % sizeof(u32) == 0;
|
||||
for (u32 i = 0; i < (m_buffer_size - m_offset) / sizeof(u32); i++)
|
||||
{
|
||||
vdata[i] = se_storage<u32>::swap(vdata[i]); // WTF, cannot use be_t<> there?
|
||||
vdata[i] = be_t<u32>{vdata[i]}.raw();
|
||||
}
|
||||
|
||||
for (u32 i = 0; i < prog.ucodeSize / sizeof(u32); i++)
|
||||
|
@ -325,7 +325,7 @@ namespace rsx
|
||||
{
|
||||
//Endianness is swapped because common upload code expects input in BE
|
||||
//TODO: Implement fast upload path for LE inputs and do away with this
|
||||
element_push_buffer.push_back(se_storage<u32>::swap(index));
|
||||
element_push_buffer.push_back(be_t<u32>{index}.raw());
|
||||
}
|
||||
|
||||
u32 thread::get_push_buffer_index_count() const
|
||||
|
@ -64,12 +64,10 @@ namespace rsx
|
||||
rsx->sync_point_request = true;
|
||||
const u32 addr = get_address(method_registers.semaphore_offset_406e(), method_registers.semaphore_context_dma_406e());
|
||||
|
||||
#ifdef IS_LE_MACHINE
|
||||
arg = se_storage<u32>::swap(arg);
|
||||
const auto& sema = vm::_ref<le_t<u32>>(addr);
|
||||
#else
|
||||
const auto& sema = vm::_ref<u32>(addr);
|
||||
#endif
|
||||
// Get raw BE value
|
||||
arg = be_t<u32>{arg}.raw();
|
||||
const auto& sema = vm::_ref<nse_t<u32>>(addr);
|
||||
|
||||
// TODO: Remove vblank semaphore hack
|
||||
if (sema == arg || addr == rsx->ctxt_addr + 0x30) return;
|
||||
|
||||
@ -244,8 +242,8 @@ namespace rsx
|
||||
{
|
||||
case rsx::vertex_base_type::ub:
|
||||
case rsx::vertex_base_type::ub256:
|
||||
// One-way byteswap
|
||||
arg = se_storage<u32>::swap(arg);
|
||||
// Get BE data
|
||||
arg = be_t<u32>{arg}.raw();
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user