パイプライン生成ロックをデバイス単位に細分化

このコミットが含まれているのは:
routersys committed 2026-07-17 10:44:51 +09:00
1 親 b2cf968fd8
コミット df156cf154
1ファイル変更
+2 -2
+2 -2
ファイルの表示
@@ -21,7 +21,7 @@ internal static unsafe class PipelineDataLoader<T>
/// </summary>
private static readonly ConditionalWeakTable<GraphicsDevice, PipelineData> CachedPipelines = [];
private static readonly object PipelineCreationLock = new();
private static readonly ConditionalWeakTable<GraphicsDevice, object> PipelineCreationLocks = [];
/// <summary>
/// Gets the <see cref="PipelineData"/> instance for a given shader.
@@ -35,7 +35,7 @@ internal static unsafe class PipelineDataLoader<T>
return pipelineData;
}
lock (PipelineCreationLock)
lock (PipelineCreationLocks.GetOrCreateValue(device))
{
if (CachedPipelines.TryGetValue(device, out pipelineData))
{