0
0
Fork 0

Fix IsRegionInUse check on NV memory allocator (#2243)

This commit is contained in:
gdkchan 2021-04-24 21:13:58 -03:00 committed by GitHub
parent 305f06eb71
commit 992133e9ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,5 @@
using Ryujinx.Common.Collections; using Ryujinx.Common.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Ryujinx.Common;
using System; using System;
using Ryujinx.Graphics.Gpu.Memory; using Ryujinx.Graphics.Gpu.Memory;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
@ -198,7 +197,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices
{ {
bool reachedEndOfAddresses = false; bool reachedEndOfAddresses = false;
ulong targetAddress; ulong targetAddress;
if(start == DefaultStart) if (start == DefaultStart)
{ {
Logger.Debug?.Print(LogClass.ServiceNv, $"Target address set to start of the last available range: 0x{_list.Last.Value:X}."); Logger.Debug?.Print(LogClass.ServiceNv, $"Target address set to start of the last available range: 0x{_list.Last.Value:X}.");
targetAddress = _list.Last.Value; targetAddress = _list.Last.Value;
@ -301,7 +300,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices
freeAddressStartPosition = floorAddress; freeAddressStartPosition = floorAddress;
if (floorAddress != InvalidAddress) if (floorAddress != InvalidAddress)
{ {
return !(gpuVa >= floorAddress && ((gpuVa + size) < _tree.Get(floorAddress))); return !(gpuVa >= floorAddress && ((gpuVa + size) <= _tree.Get(floorAddress)));
} }
} }
return true; return true;