gpu allocation optimizations

ObjectPool now uses ConcurrentBag instead if ConcurrentStack, as it has a smaller memory footprint.

Fix compiler warnings related to Audio Command Pools.

Switch gpu command initialization to use pointers, that way skipping the allocation of the command which is unnecessary.

Skip byte array allocation in Ioctl2/3 if it isn't needed (if the source data is all continuous we don't need to copy it to make it continuous).
This commit is contained in:
LotP
2025-10-27 09:16:23 -05:00
committed by KeatonTheBot
parent e1b6cb71f8
commit 1bb1c7bba8
20 changed files with 295 additions and 232 deletions
+3 -3
View File
@@ -8,11 +8,11 @@ namespace Ryujinx.Common
where T : class
{
private int _size = size;
private readonly ConcurrentStack<T> _items = new();
private readonly ConcurrentBag<T> _items = new();
public T Allocate()
{
bool success = _items.TryPop(out T instance);
bool success = _items.TryTake(out T instance);
if (!success)
{
@@ -26,7 +26,7 @@ namespace Ryujinx.Common
{
if (_size < 0 || _items.Count < _size)
{
_items.Push(obj);
_items.Add(obj);
}
}