From 8916bbf0fbc9c04935e74ec356c7a215f3d353e8 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 3 Jan 2022 17:48:52 +0100 Subject: [PATCH] Fix an access violation in the shader panel render loop --- src/ComputeSharp.UI/Helpers/SwapChainManager.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ComputeSharp.UI/Helpers/SwapChainManager.cs b/src/ComputeSharp.UI/Helpers/SwapChainManager.cs index babdc16c..fdb806e4 100644 --- a/src/ComputeSharp.UI/Helpers/SwapChainManager.cs +++ b/src/ComputeSharp.UI/Helpers/SwapChainManager.cs @@ -433,7 +433,10 @@ internal sealed unsafe partial class SwapChainManager : NativeObject this.d3D12GraphicsCommandList.Get()->Close().Assert(); // Execute the command list to perform the copy - this.d3D12CommandQueue.Get()->ExecuteCommandLists(1, (ID3D12CommandList**)this.d3D12GraphicsCommandList.GetAddressOf()); + fixed (ID3D12GraphicsCommandList** d3D12GraphicsCommandList = this.d3D12GraphicsCommandList) + { + this.d3D12CommandQueue.Get()->ExecuteCommandLists(1, (ID3D12CommandList**)d3D12GraphicsCommandList); + } // Increment the fence value and signal the fence. Just like with normal dispatches, // the increment must be done after executing the command list and before signaling.