From df156cf154fb1b375b1ad265dc952bea8562b4d2 Mon Sep 17 00:00:00 2001 From: routersys Date: Fri, 17 Jul 2026 10:44:51 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=91=E3=82=A4=E3=83=97=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E7=94=9F=E6=88=90=E3=83=AD=E3=83=83=E3=82=AF=E3=82=92?= =?UTF-8?q?=E3=83=87=E3=83=90=E3=82=A4=E3=82=B9=E5=8D=98=E4=BD=8D=E3=81=AB?= =?UTF-8?q?=E7=B4=B0=E5=88=86=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ComputeSharp/Shaders/Loading/PipelineDataLoader{T}.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ComputeSharp/Shaders/Loading/PipelineDataLoader{T}.cs b/src/ComputeSharp/Shaders/Loading/PipelineDataLoader{T}.cs index de794c30..87ef037d 100644 --- a/src/ComputeSharp/Shaders/Loading/PipelineDataLoader{T}.cs +++ b/src/ComputeSharp/Shaders/Loading/PipelineDataLoader{T}.cs @@ -21,7 +21,7 @@ internal static unsafe class PipelineDataLoader /// private static readonly ConditionalWeakTable CachedPipelines = []; - private static readonly object PipelineCreationLock = new(); + private static readonly ConditionalWeakTable PipelineCreationLocks = []; /// /// Gets the instance for a given shader. @@ -35,7 +35,7 @@ internal static unsafe class PipelineDataLoader return pipelineData; } - lock (PipelineCreationLock) + lock (PipelineCreationLocks.GetOrCreateValue(device)) { if (CachedPipelines.TryGetValue(device, out pipelineData)) {