1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-09-22 23:13:50 +01:00
Ryujinx/Ryujinx.HLE/HOS/Services
sharmander 06aa8a7578
GPU - Improve Memory Allocation (#1722)
* Implement TreeMap from scratch.

Begin implementation of MemoryBlockManager

* Implement GetFreePosition using MemoryBlocks

* Implementation of Memory Management using a Tree.

Still some issues to work around, but promising thus far.

* Resolved invalid mapping issue.

Performance appears promising.

* Add tick metrics

* Use the logger instead

* Use debug loggin instead of info.

* Remove unnecessary code. Add descriptions of added functions.

* Improve memory allocation even further. As well as improve speed of position fetching.

* Add TreeDictionary to Ryujinx Commons

Removed Unnecessary  Usigns

* Add a Performance Profiler + Improve ReserveFixed

* Begin transition to allocation in nvdrv

* Create singleton nvmemallocator

* Moved Allocation into Nv Related Files

As requested by gdkchan, any allocation of memory has been moved into the driver files.

Mapping remains in the GPU MemoryManager.

* Remove unnecessary usings

* Add missing descriptions

* Correct descriptions

* Fix formatting.

* Remove unnecessary whitespace

* Formatting / Convention Updates

* Changes / Fixes

Made syntax and convention changes as requested by gdkchan.

Fixed an issue where IsRegionUsed would return the wrong boolean.

Fixed an issue where GetFreePosition was asked for an address instead of a size.

* Undo commenting of Assert in shader cache

* Update Ryujinx.Common/Collections/TreeDictionary.cs

Co-authored-by: gdkchan <gab.dark.100@gmail.com>

* Resolved many suggestions

* Implement Improved TreeDictionary

Based off of Pseudo code and custom implementations.

* Rename _set to _dictionary

* Remove unused code

* Remove unused code.

* Remove unnecessary MapLow function.

* Resolve data-structure based issues

* Make adjustments to memory management.

Deactive de-allocation for now, it causes more harm than good.

* Minor refactorings + Re-implement deallocation

Also cleaned up unnecessary code.

* Add Tests for TreeDictionary

* Update data structure to properly balance the tree

* Experimental Implementation:

1. Reduce Time to Next Node to O(1) Runtime
2. Reduce While Loop Ct To 2 (In Most Cases)

* Address issues w/ Deallocating Memory

* Final Build

+ Fully Implement Dictionary Interface for new Data Structure
+ Cover All Memory Allocation Edge Cases, particularly w/ Games that De-Allocate a lot.

* Minor Corrections

Give TreeDictionary its own count (do not depend on inner dictionary)

Properly remove adjacent allocations

* Add AsList

* Fix bug where internal dictionary wasn't being updated w/ new node for overwritten key.

* Address comments in review.

* Fix issue where block wouldn't break out (Fixes UE4 issues)

* Update descriptions

* Update descriptions

* Reduce Node visibility to protect TreeDictionary Integrity + Remove usage of struct.

* Update tests to use new TreeDictionary implementation.

* Remove usage of dictionary in TreeDictionary

* Refactoring / Renaming

* Remove unneeded memoryblock class.

* Add space for while

* Add space for if

* Formatting / descriptions

* Clarified some descriptions

* Reduce visibility of memory allocator

* Edit method names to make more sense as memory blocks are no longer in use.

* Make names consistent.

* Protect against npe when sucessorof is called against keys that don't exist. (Not in use by memory manager, this is for other prs that might use this data structure)

* Possible edge-case resolve

* Update Ryujinx.Common/Collections/TreeDictionary.cs

Co-authored-by: gdkchan <gab.dark.100@gmail.com>

* Update Ryujinx.HLE/HOS/Services/Nv/NvMemoryAllocator.cs

Co-authored-by: gdkchan <gab.dark.100@gmail.com>

* Reduce # of unnecessary duplicate variables / Reduce visibility of variables only internally used.

* Rename count to _count

* Update Description of Add method.

* Fix copypasta

* Address comments

* Address comments

* Remove whitespace

* Address comments, condense variables.

* Consolidate vars

* Fix whitespace.

* Nit

* Fix exception msg

* Fix arrayIndex check

* Fix arrayIndex check + indexer

* Remove whitespace from cast

Co-authored-by: gdkchan <gab.dark.100@gmail.com>
2020-12-09 19:26:05 -03:00
..
Account hle/ui: Basic multi programs support (#1560) 2020-09-21 13:45:30 +10:00
Am am: Implement GetHealthWarningDisappearedSystemEvent (#1788) 2020-12-09 00:08:36 +01:00
Apm apm/am: Refactoring/Unstub services (#1662) 2020-11-08 17:00:54 -03:00
Arp Refactor out Application details from Horizon (#1236) 2020-05-15 03:16:46 -03:00
Audio Make sure to not leak copy handles passed in request (#1772) 2020-12-03 19:19:10 +01:00
Bcat IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel (#1458) 2020-12-02 00:23:43 +01:00
Bgtc
Bluetooth bluetooth: Fix event handle in IBluetoothDriver (#1464) 2020-08-13 01:04:59 +02:00
BluetoothManager Improved Logger (#1292) 2020-08-04 01:32:53 +02:00
Caps caps: Stub SetShimLibraryVersion (#1552) 2020-09-20 13:32:48 +10:00
Cec
Erpt
Es
Eupld
Fatal
Friend friend: Implement GetCompletionEvent and AddPlayHistory (#1554) 2020-09-20 13:45:46 +10:00
Fs IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel (#1458) 2020-12-02 00:23:43 +01:00
Grc
Hid Create a single guest process per IPC message processor (#1769) 2020-12-02 13:14:44 +01:00
Ins
Lbl am/lbl/hid/pctl: Enabled VR Rendering (#1688) 2020-11-15 22:30:20 +01:00
Ldn Improved Logger (#1292) 2020-08-04 01:32:53 +02:00
Lm Improved Logger (#1292) 2020-08-04 01:32:53 +02:00
Loader Add various error codes to Loader (#1208) 2020-05-04 13:22:28 +02:00
Mig
Mii Update to LibHac 0.12.0 (#1485) 2020-09-01 17:08:59 -03:00
Mm Improved Logger (#1292) 2020-08-04 01:32:53 +02:00
Ncm Add various error codes to NCM LR (#1225) 2020-05-08 16:06:32 +02:00
News
Nfc IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel (#1458) 2020-12-02 00:23:43 +01:00
Ngct
Nifm IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel (#1458) 2020-12-02 00:23:43 +01:00
Nim IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel (#1458) 2020-12-02 00:23:43 +01:00
Notification
Npns
Ns IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel (#1458) 2020-12-02 00:23:43 +01:00
Nv GPU - Improve Memory Allocation (#1722) 2020-12-09 19:26:05 -03:00
Olsc olsc: Add service olsc:u and stub some calls (#1734) 2020-11-20 09:56:23 +11:00
Ovln
Pcie
Pctl pctl: Implement IsRestrictionEnabled and fix CheckFreeCommunicationPermission (#1747) 2020-11-24 21:19:06 +01:00
Pcv
Pm
Prepo Improved Logger (#1292) 2020-08-04 01:32:53 +02:00
Psc
Ptm Improved Logger (#1292) 2020-08-04 01:32:53 +02:00
Ro IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel (#1458) 2020-12-02 00:23:43 +01:00
Sdb IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel (#1458) 2020-12-02 00:23:43 +01:00
Settings Update to LibHac 0.12.0 (#1485) 2020-09-01 17:08:59 -03:00
Sm IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel (#1458) 2020-12-02 00:23:43 +01:00
Sockets Create a single guest process per IPC message processor (#1769) 2020-12-02 13:14:44 +01:00
Spl Implement a new physical memory manager and replace DeviceMemory (#856) 2020-05-04 08:54:50 +10:00
Srepo
Ssl Improved Logger (#1292) 2020-08-04 01:32:53 +02:00
SurfaceFlinger Rewrite scheduler context switch code (#1786) 2020-12-09 19:20:05 -03:00
Time Create a single guest process per IPC message processor (#1769) 2020-12-02 13:14:44 +01:00
Usb
Vi Create a single guest process per IPC message processor (#1769) 2020-12-02 13:14:44 +01:00
Wlan
CommandAttributes.cs IPC refactor part 1: Use explicit separate threads to process requests (#1447) 2020-09-22 14:50:40 +10:00
DummyService.cs
IIpcService.cs Refactoring commands handling (#728) 2019-07-11 22:13:43 -03:00
IpcService.cs IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel (#1458) 2020-12-02 00:23:43 +01:00
ServerBase.cs Rewrite scheduler context switch code (#1786) 2020-12-09 19:20:05 -03:00
ServiceAttributes.cs IPC refactor part 1: Use explicit separate threads to process requests (#1447) 2020-09-22 14:50:40 +10:00
ServiceConfiguration.cs