パイプライン生成ロックをデバイス単位に細分化
このコミットが含まれているのは:
1 親
b2cf968fd8
コミット
df156cf154
1ファイル変更
+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))
|
||||
{
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする