Partially revert "Check if BP and XF changes actually change values before flushing". Dolphin code sucks too much to get optimizations.
This reverts commit 5a77cae2e3
.
Fixes issue 5459.
Fixes issue 5606.
This commit is contained in:
parent
d7e65f03e4
commit
4f652c4086
|
@ -121,18 +121,12 @@ void XFRegWritten(int transferSize, u32 baseAddress, u32 *pData)
|
||||||
case XFMEM_SETVIEWPORT+3:
|
case XFMEM_SETVIEWPORT+3:
|
||||||
case XFMEM_SETVIEWPORT+4:
|
case XFMEM_SETVIEWPORT+4:
|
||||||
case XFMEM_SETVIEWPORT+5:
|
case XFMEM_SETVIEWPORT+5:
|
||||||
{
|
VertexManager::Flush();
|
||||||
u8 size = std::min(transferSize * 4, 6 * 4);
|
VertexShaderManager::SetViewportChanged();
|
||||||
if (memcmp((u32*)&xfregs + (address - 0x1000), pData + dataIndex, size))
|
PixelShaderManager::SetViewportChanged();
|
||||||
{
|
|
||||||
VertexManager::Flush();
|
|
||||||
VertexShaderManager::SetViewportChanged();
|
|
||||||
PixelShaderManager::SetViewportChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
nextAddress = XFMEM_SETVIEWPORT + 6;
|
nextAddress = XFMEM_SETVIEWPORT + 6;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case XFMEM_SETPROJECTION:
|
case XFMEM_SETPROJECTION:
|
||||||
case XFMEM_SETPROJECTION+1:
|
case XFMEM_SETPROJECTION+1:
|
||||||
|
@ -141,21 +135,15 @@ void XFRegWritten(int transferSize, u32 baseAddress, u32 *pData)
|
||||||
case XFMEM_SETPROJECTION+4:
|
case XFMEM_SETPROJECTION+4:
|
||||||
case XFMEM_SETPROJECTION+5:
|
case XFMEM_SETPROJECTION+5:
|
||||||
case XFMEM_SETPROJECTION+6:
|
case XFMEM_SETPROJECTION+6:
|
||||||
{
|
VertexManager::Flush();
|
||||||
u8 size = std::min(transferSize * 4, 7 * 4);
|
VertexShaderManager::SetProjectionChanged();
|
||||||
if (memcmp((u32*)&xfregs + (address - 0x1000), pData + dataIndex, size))
|
|
||||||
{
|
|
||||||
VertexManager::Flush();
|
|
||||||
VertexShaderManager::SetProjectionChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
nextAddress = XFMEM_SETPROJECTION + 7;
|
nextAddress = XFMEM_SETPROJECTION + 7;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case XFMEM_SETNUMTEXGENS: // GXSetNumTexGens
|
case XFMEM_SETNUMTEXGENS: // GXSetNumTexGens
|
||||||
if (xfregs.numTexGen.numTexGens != (newValue & 15))
|
if (xfregs.numTexGen.numTexGens != (newValue & 15))
|
||||||
VertexManager::Flush();
|
VertexManager::Flush();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XFMEM_SETTEXMTXINFO:
|
case XFMEM_SETTEXMTXINFO:
|
||||||
|
@ -166,16 +154,10 @@ void XFRegWritten(int transferSize, u32 baseAddress, u32 *pData)
|
||||||
case XFMEM_SETTEXMTXINFO+5:
|
case XFMEM_SETTEXMTXINFO+5:
|
||||||
case XFMEM_SETTEXMTXINFO+6:
|
case XFMEM_SETTEXMTXINFO+6:
|
||||||
case XFMEM_SETTEXMTXINFO+7:
|
case XFMEM_SETTEXMTXINFO+7:
|
||||||
{
|
VertexManager::Flush();
|
||||||
u8 size = std::min(transferSize * 4, 8 * 4);
|
|
||||||
if (memcmp((u32*)&xfregs + (address - 0x1000), pData + dataIndex, size))
|
|
||||||
{
|
|
||||||
VertexManager::Flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
nextAddress = XFMEM_SETTEXMTXINFO + 8;
|
nextAddress = XFMEM_SETTEXMTXINFO + 8;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case XFMEM_SETPOSMTXINFO:
|
case XFMEM_SETPOSMTXINFO:
|
||||||
case XFMEM_SETPOSMTXINFO+1:
|
case XFMEM_SETPOSMTXINFO+1:
|
||||||
|
@ -185,16 +167,10 @@ void XFRegWritten(int transferSize, u32 baseAddress, u32 *pData)
|
||||||
case XFMEM_SETPOSMTXINFO+5:
|
case XFMEM_SETPOSMTXINFO+5:
|
||||||
case XFMEM_SETPOSMTXINFO+6:
|
case XFMEM_SETPOSMTXINFO+6:
|
||||||
case XFMEM_SETPOSMTXINFO+7:
|
case XFMEM_SETPOSMTXINFO+7:
|
||||||
{
|
VertexManager::Flush();
|
||||||
u8 size = std::min(transferSize * 4, 8 * 4);
|
|
||||||
if (memcmp((u32*)&xfregs + (address - 0x1000), pData + dataIndex, size))
|
|
||||||
{
|
|
||||||
VertexManager::Flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
nextAddress = XFMEM_SETPOSMTXINFO + 8;
|
nextAddress = XFMEM_SETPOSMTXINFO + 8;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
// --------------
|
// --------------
|
||||||
// Unknown Regs
|
// Unknown Regs
|
||||||
|
@ -264,15 +240,8 @@ void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData)
|
||||||
transferSize = 0;
|
transferSize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (u32 i = 0; i < xfMemTransferSize; ++i)
|
XFMemWritten(xfMemTransferSize, xfMemBase);
|
||||||
{
|
memcpy_gc(&xfmem[xfMemBase], pData, xfMemTransferSize * 4);
|
||||||
if (((u32*)&xfmem[xfMemBase])[i] != pData[i])
|
|
||||||
{
|
|
||||||
XFMemWritten(xfMemTransferSize, xfMemBase);
|
|
||||||
memcpy_gc(&xfmem[xfMemBase], pData, xfMemTransferSize * 4);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pData += xfMemTransferSize;
|
pData += xfMemTransferSize;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue