Better fast cache removal

Remove only the respective key from the fast cache when a const buffer is modified with `CbData`.
This commit is contained in:
gdkchan 2018-12-11 04:22:01 +01:00 committed by Ryada Productions
parent 3db742a3f8
commit e777e9d9ff
2 changed files with 5 additions and 3 deletions

View file

@ -132,9 +132,9 @@ namespace Ryujinx.Graphics
}
}
public void ClearPbCache(NvGpuBufferType Type)
public void RemoveFromPbCache(NvGpuBufferType Type, long Key)
{
UploadedKeys[(int)Type].Clear();
UploadedKeys[(int)Type].Remove(Key);
}
}
}

View file

@ -934,13 +934,15 @@ namespace Ryujinx.Graphics.Graphics3d
{
long Position = MakeInt64From2xInt32(NvGpuEngine3dReg.ConstBufferAddress);
long Key = Vmm.GetPhysicalAddress(Position);
int Offset = ReadRegister(NvGpuEngine3dReg.ConstBufferOffset);
Vmm.WriteInt32(Position + Offset, MethCall.Argument);
WriteRegister(NvGpuEngine3dReg.ConstBufferOffset, Offset + 4);
Gpu.ResourceManager.ClearPbCache(NvGpuBufferType.ConstBuffer);
Gpu.ResourceManager.RemoveFromPbCache(NvGpuBufferType.ConstBuffer, Key);
}
private void CbBind(NvGpuVmm Vmm, GpuMethodCall MethCall)