Merge pull request #384 from Sergio0694/dev/disable-gpu-timeout-flag

Add COMPUTESHARP_DISABLE_GPU_TIMEOUT option
このコミットが含まれているのは:
Sergio Pedri authored and GitHub committed 2022-09-19 12:52:30 -07:00
コミット bbc5308dcf
2ファイル変更
+18 -2

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

+7 -1
ファイルの表示
@@ -1,8 +1,9 @@
using System;
#if NET6_0_OR_GREATER
using System.Runtime.CompilerServices;
#endif
#else
using CommunityToolkit.Diagnostics;
#endif
using ComputeSharp.Core.Extensions;
#if !NET6_0_OR_GREATER
using ComputeSharp.Graphics.Resources.Enums;
@@ -362,6 +363,11 @@ internal static unsafe class ID3D12DeviceExtensions
d3D12CommandQueueDesc.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE;
d3D12CommandQueueDesc.NodeMask = 0;
if (Configuration.IsGpuTimeoutDisabled)
{
d3D12CommandQueueDesc.Flags |= D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT;
}
d3D12Device.CreateCommandQueue(
&d3D12CommandQueueDesc,
Windows.__uuidof<ID3D12CommandQueue>(),
+11 -1
ファイルの表示
@@ -18,6 +18,11 @@ internal static class Configuration
/// </summary>
private const string EnableDeviceRemovedExtendedDataInfo = "COMPUTESHARP_ENABLE_DEVICE_REMOVED_EXTENDED_DATA";
/// <summary>
/// The configuration property name for <see cref="IsGpuTimeoutDisabled"/>.
/// </summary>
private const string DisableGpuTimeout = "COMPUTESHARP_DISABLE_GPU_TIMEOUT";
/// <summary>
/// Indicates whether or not the debug output is enabled.
/// </summary>
@@ -28,6 +33,11 @@ internal static class Configuration
/// </summary>
public static readonly bool IsDeviceRemovedExtendedDataEnabled = GetConfigurationValue(EnableDeviceRemovedExtendedDataInfo);
/// <summary>
/// Indicates whether or not the GPU timeout is disabled.
/// </summary>
public static readonly bool IsGpuTimeoutDisabled = GetConfigurationValue(DisableGpuTimeout);
/// <summary>
/// Gets a configuration value for a specified property.
/// </summary>
@@ -36,7 +46,7 @@ internal static class Configuration
private static bool GetConfigurationValue(string propertyName)
{
#if DEBUG
if (Debugger.IsAttached)
if (Debugger.IsAttached && propertyName != DisableGpuTimeout)
{
return true;
}