GS/MicroVU/R5900: added comments on potential risks, commented out legacy xmmbackup instructions.

This commit is contained in:
WCG847 2025-07-25 13:35:18 +01:00
parent 19d375b4bd
commit a54199d084
4 changed files with 6 additions and 4 deletions

View File

@ -624,6 +624,7 @@ bool GSDevice12::SetGPUTimingEnabled(bool enabled)
bool GSDevice12::AllocatePreinitializedGPUBuffer(u32 size, ID3D12Resource** gpu_buffer,
D3D12MA::Allocation** gpu_allocation, const std::function<void(void*)>& fill_callback)
{
// TODO(WCG847) - There is no proper barriers here. Fix D3D12_RESOURCE_STATE_GENERIC_READ and hardcoded macros
// Try to place the fixed index buffer in GPU local memory.
// Use the staging buffer to copy into it.
const D3D12_RESOURCE_DESC rd = {D3D12_RESOURCE_DIMENSION_BUFFER, 0, size, 1, 1, 1, DXGI_FORMAT_UNKNOWN, {1, 0},

View File

@ -77,7 +77,7 @@ namespace R5900
flags, \
NULL, \
::R5900::Interpreter::OpcodeImpl::name, \
nullptr, \
nullptr, \ // TODO(WCG847): This is highly dangerous. Create appropriate fallbacks
::R5900::OpcodeDisasm::name \
}

View File

@ -85,7 +85,6 @@ struct microVU
alignas(16) u32 macFlag [4]; // 4 instances of mac flag (used in execution)
alignas(16) u32 clipFlag[4]; // 4 instances of clip flag (used in execution)
alignas(16) u32 xmmCTemp[4]; // Backup used in mVUclamp2()
alignas(16) u32 xmmBackup[16][4]; // Backup for xmm0~xmm15
u32 index; // VU Index (VU0 or VU1)
u32 cop2; // VU is in COP2 mode? (No/Yes)

View File

@ -190,8 +190,10 @@ __fi void mVUbackupRegs(microVU& mVU, bool toMemory = false, bool onlyNeeded = f
else
{
// TODO(Stenzek): get rid of xmmbackup
// TODO(WCG847): Do some testing on the removal of xMOVAPS.
mVU.regAlloc->flushAll(); // Flush Regalloc
xMOVAPS(ptr128[&mVU.xmmBackup[xmmPQ.Id][0]], xmmPQ);
// [DISABLED](WCG847) Legacy xmmBackup instruction
// xMOVAPS(ptr128[&mVU.xmmBackup[xmmPQ.Id][0]], xmmPQ);
}
}
@ -257,7 +259,7 @@ __fi void mVUrestoreRegs(microVU& mVU, bool fromMemory = false, bool onlyNeeded
}
else
{
xMOVAPS(xmmPQ, ptr128[&mVU.xmmBackup[xmmPQ.Id][0]]);
// xMOVAPS(xmmPQ, ptr128[&mVU.xmmBackup[xmmPQ.Id][0]]);
}
}