mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-06-29 03:46:24 +02:00
Add spin lock to prevent waiting for fences on multiple threads at once on Adreno
This commit is contained in:
parent
25e97de1fa
commit
faacbd0d15
5 changed files with 66 additions and 16 deletions
|
@ -18,6 +18,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
private readonly Device _device;
|
||||
private readonly Queue _queue;
|
||||
private readonly object _queueLock;
|
||||
private readonly bool _fenceNeedsLock;
|
||||
private readonly CommandPool _pool;
|
||||
private readonly Thread _owner;
|
||||
|
||||
|
@ -61,12 +62,13 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
private int _queuedCount;
|
||||
private int _inUseCount;
|
||||
|
||||
public unsafe CommandBufferPool(Vk api, Device device, Queue queue, object queueLock, uint queueFamilyIndex, bool isLight = false)
|
||||
public unsafe CommandBufferPool(Vk api, Device device, Queue queue, object queueLock, uint queueFamilyIndex, bool fenceNeedsLock, bool isLight = false)
|
||||
{
|
||||
_api = api;
|
||||
_device = device;
|
||||
_queue = queue;
|
||||
_queueLock = queueLock;
|
||||
_fenceNeedsLock = fenceNeedsLock;
|
||||
_owner = Thread.CurrentThread;
|
||||
|
||||
var commandPoolCreateInfo = new CommandPoolCreateInfo
|
||||
|
@ -357,7 +359,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
if (refreshFence)
|
||||
{
|
||||
entry.Fence = new FenceHolder(_api, _device);
|
||||
entry.Fence = new FenceHolder(_api, _device, _fenceNeedsLock);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue