Reduce ID3D12InfoQueue debug output allocations

このコミットが含まれているのは:
Sergio Pedri committed 2022-06-19 02:57:58 +02:00
1 親 16ccc67bd9
コミット 1fa665fe88
1ファイル変更
+6 -1
+6 -1
ファイルの表示
@@ -16,6 +16,11 @@ namespace ComputeSharp.Graphics.Helpers;
/// <inheritdoc/>
internal static partial class DeviceHelper
{
/// <summary>
/// A shared <see cref="StringBuilder"/> used from <see cref="FlushAllID3D12InfoQueueMessagesAndCheckForErrorsOrWarnings"/> to create messages.
/// </summary>
private static StringBuilder? infoQueueMessageBuilder;
/// <summary>
/// Flushes all the pending debug messages for all existing <see cref="ID3D12Device"/> instances to the console/debugger.
/// It also checks whether or not there are any error messages being logged that didn't result in an actual crash yet.
@@ -27,7 +32,7 @@ internal static partial class DeviceHelper
lock (DevicesCache)
{
StringBuilder builder = new(1024);
StringBuilder builder = infoQueueMessageBuilder ??= new(1024);
foreach (var pair in D3D12InfoQueueMap)
{