mirror of https://github.com/PCSX2/pcsx2.git
MTVU: partially port code to MTVU
Remains volatize as MTGS and the ScopedLockBool stuff
This commit is contained in:
parent
40b1a3996a
commit
3a4787dd98
|
@ -142,7 +142,7 @@ void VU_Thread::ExecuteRingBuffer()
|
|||
break;
|
||||
}
|
||||
case MTVU_NULL_PACKET:
|
||||
AtomicExchange(read_pos, 0);
|
||||
read_pos = 0;
|
||||
break;
|
||||
jNO_DEFAULT;
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ void VU_Thread::ReserveSpace(s32 size)
|
|||
// Use this when reading read_pos from ee thread
|
||||
__fi s32 VU_Thread::GetReadPos()
|
||||
{
|
||||
return AtomicRead(read_pos);
|
||||
return read_pos.load();
|
||||
}
|
||||
// Use this when reading write_pos from vu thread
|
||||
__fi s32 VU_Thread::GetWritePos()
|
||||
|
@ -202,8 +202,7 @@ __fi u32* VU_Thread::GetWritePtr()
|
|||
|
||||
__fi void VU_Thread::incReadPos(s32 offset)
|
||||
{ // Offset in u32 sizes
|
||||
s32 temp = (read_pos + offset) & buffer_mask;
|
||||
AtomicExchange(read_pos, temp);
|
||||
read_pos = (read_pos + offset) & buffer_mask;
|
||||
}
|
||||
__fi void VU_Thread::incWritePos()
|
||||
{ // Adds write_offset
|
||||
|
|
|
@ -30,7 +30,7 @@ class VU_Thread : public pxThread {
|
|||
static const s32 buffer_size = (_1mb * 16) / sizeof(s32);
|
||||
static const u32 buffer_mask = buffer_size - 1;
|
||||
__aligned(4) u32 buffer[buffer_size];
|
||||
__aligned(4) volatile s32 read_pos; // Only modified by VU thread
|
||||
__aligned(4) std::atomic<int> read_pos; // Only modified by VU thread
|
||||
__aligned(4) volatile bool isBusy; // Is thread processing data?
|
||||
__aligned(4) s32 write_pos; // Only modified by EE thread
|
||||
__aligned(4) s32 write_offset; // Only modified by EE thread
|
||||
|
|
Loading…
Reference in New Issue