Fix ID3D12InfoQueue messages not being displayed in Release builds

このコミットが含まれているのは:
Sergio Pedri committed 2022-02-01 10:05:45 +01:00
1 親 208b063def
コミット 00e818fc3b
3ファイル変更
+18 -24

検索条件に一致するファイルはありません

+5 -3
ファイルの表示
@@ -256,15 +256,17 @@ internal static unsafe class ID3D12DeviceExtensions
d3D12Device.QueryInterface(Windows.__uuidof<ID3D12InfoQueue>(), d3D12InfoQueue.GetVoidAddressOf()).Assert();
D3D12_MESSAGE_ID* d3D12MessageIds = stackalloc D3D12_MESSAGE_ID[3]
D3D12_MESSAGE_ID* d3D12MessageIds = stackalloc D3D12_MESSAGE_ID[2]
{
D3D12_MESSAGE_ID_CREATEDEVICE_DEBUG_LAYER_STARTUP_OPTIONS,
// The map/unmap warnings when using null ranges are being suppressed due to
// them only being generated due to a bug in the DirectX runtime. using null
// ranges when calling Map()/Unmap() is allowed and perfeclty well defined.
D3D12_MESSAGE_ID_MAP_INVALID_NULLRANGE,
D3D12_MESSAGE_ID_UNMAP_INVALID_NULLRANGE
};
D3D12_INFO_QUEUE_FILTER d3D12InfoQueueFilter = default;
d3D12InfoQueueFilter.DenyList.NumIDs = 3;
d3D12InfoQueueFilter.DenyList.NumIDs = 2;
d3D12InfoQueueFilter.DenyList.pIDList = d3D12MessageIds;
d3D12InfoQueue.Get()->PushRetrievalFilter(&d3D12InfoQueueFilter).Assert();
+3 -21
ファイルの表示
@@ -65,16 +65,7 @@ internal static partial class DeviceHelper
hasErrorsOrWarnings = true;
}
string text = builder.ToString();
if (Debugger.IsAttached)
{
Debug.WriteLine(text);
}
else
{
Trace.WriteLine(text);
}
Trace.WriteLine(builder);
}
queue->ClearStoredMessages();
@@ -94,21 +85,12 @@ internal static partial class DeviceHelper
};
builder.Clear();
builder.AppendLine($"[D3D12 device remove \"{device}\" (HW: {device.IsHardwareAccelerated}, UMA: {device.IsCacheCoherentUMA})]");
builder.AppendLine($"[D3D12 device \"{device}\" removed (HW: {device.IsHardwareAccelerated}, UMA: {device.IsCacheCoherentUMA})]");
builder.AppendLine($"[Reason]: {message}");
hasErrorsOrWarnings = true;
string text = builder.ToString();
if (Debugger.IsAttached)
{
Debug.WriteLine(text);
}
else
{
Trace.WriteLine(text);
}
Trace.WriteLine(builder);
}
}
}
+10
ファイルの表示
@@ -1,4 +1,7 @@
using System;
#if DEBUG
using System.Diagnostics;
#endif
/// <summary>
/// A container for all shared <see cref="AppContext"/> configuration switches for ComputeSharp.
@@ -22,6 +25,13 @@ internal static class Configuration
/// <returns>The value of the specified configuration setting.</returns>
private static bool GetConfigurationValue(string propertyName)
{
#if DEBUG
if (Debugger.IsAttached)
{
return true;
}
#endif
if (AppContext.TryGetSwitch(propertyName, out bool isEnabled))
{
return isEnabled;