Skip to content

Commit 8562a21

Browse files
committed
removed redundant warning
1 parent 82ec624 commit 8562a21

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ however, it has to be formatted properly to pass verification tests.
1414
- Added the display of the device flag `CanRunInBackground` in device debug view.
1515
- Added analytics for programmatic `InputAction` setup via `InputActionSetupExtensions` when exiting play-mode.
1616

17+
### Fixed
18+
- Removed a redundant warning when using fallback code to parse a HID descriptor. (UUM-71260)
19+
1720
## [1.11.1] - 2024-09-26
1821

1922
### Fixed

Packages/com.unity.inputsystem/InputSystem/Plugins/HID/HID.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using UnityEngine.InputSystem.LowLevel;
77
using UnityEngine.InputSystem.Utilities;
88
using Unity.Collections.LowLevel.Unsafe;
9+
using Unity.Profiling;
910
using UnityEngine.InputSystem.Layouts;
1011
using UnityEngine.Scripting;
1112
#if UNITY_2021_2_OR_NEWER
@@ -83,6 +84,8 @@ public HIDDeviceDescriptor hidDescriptor
8384

8485
private bool m_HaveParsedHIDDescriptor;
8586
private HIDDeviceDescriptor m_HIDDescriptor;
87+
88+
private static readonly ProfilerMarker k_HIDParseDescriptorFallback = new ProfilerMarker("HIDParseDescriptorFallback");
8689

8790
// This is the workhorse for figuring out fallback options for HIDs attached to the system.
8891
// If the system cannot find a more specific layout for a given HID, this method will try
@@ -1130,8 +1133,10 @@ public static HIDDeviceDescriptor FromJson(string json)
11301133
}
11311134
catch (Exception)
11321135
{
1133-
Debug.LogWarning($"Couldn't parse HID descriptor with fast parser. Using fallback");
1134-
return JsonUtility.FromJson<HIDDeviceDescriptor>(json);
1136+
k_HIDParseDescriptorFallback.Begin();
1137+
var descriptor = JsonUtility.FromJson<HIDDeviceDescriptor>(json);
1138+
k_HIDParseDescriptorFallback.End();
1139+
return descriptor;
11351140
}
11361141
#else
11371142
return JsonUtility.FromJson<HIDDeviceDescriptor>(json);

0 commit comments

Comments
 (0)