プール背圧待機をロック外へ移動

このコミットが含まれているのは:
routersys committed 2026-07-17 10:44:48 +09:00
1 親 2d4bd9ae42
コミット 1ac0e48fde
1ファイル変更
+20 -10
+20 -10
ファイルの表示
@@ -77,26 +77,36 @@ internal readonly unsafe struct ID3D12CommandListPool(D3D12_COMMAND_LIST_TYPE d3
public void ReturnWhenCompleted(ID3D12GraphicsCommandList* d3D12CommandList, ID3D12CommandAllocator* d3D12CommandAllocator, ulong fenceValue, GraphicsResourceLeaseSet? resourceLeases)
{
PendingD3D12CommandListBundle pendingD3D12CommandListBundle = default;
bool hasPendingD3D12CommandListBundle = false;
lock (this.d3D12CommandListBundleQueue)
{
ReclaimCompletedCommandLists();
if (this.pendingD3D12CommandListBundleQueue.Count == MaximumPendingCommandListCount)
{
PendingD3D12CommandListBundle pendingD3D12CommandListBundle = this.pendingD3D12CommandListBundleQueue.Dequeue();
if (pendingD3D12CommandListBundle.FenceValue > d3D12Fence->GetCompletedValue())
{
d3D12Fence->SetEventOnCompletion(pendingD3D12CommandListBundle.FenceValue, default).Assert();
}
pendingD3D12CommandListBundle.ResourceLeases?.Release();
this.d3D12CommandListBundleQueue.Enqueue(pendingD3D12CommandListBundle.D3D12CommandListBundle);
pendingD3D12CommandListBundle = this.pendingD3D12CommandListBundleQueue.Dequeue();
hasPendingD3D12CommandListBundle = true;
}
this.pendingD3D12CommandListBundleQueue.Enqueue(new PendingD3D12CommandListBundle(d3D12CommandList, d3D12CommandAllocator, fenceValue, resourceLeases));
}
if (hasPendingD3D12CommandListBundle)
{
if (pendingD3D12CommandListBundle.FenceValue > d3D12Fence->GetCompletedValue())
{
d3D12Fence->SetEventOnCompletion(pendingD3D12CommandListBundle.FenceValue, default).Assert();
}
pendingD3D12CommandListBundle.ResourceLeases?.Release();
lock (this.d3D12CommandListBundleQueue)
{
this.d3D12CommandListBundleQueue.Enqueue(pendingD3D12CommandListBundle.D3D12CommandListBundle);
}
}
}
/// <inheritdoc/>