Skip to content

Commit 24012a0

Browse files
authored
FIX: UUM-71260 Removed redundant warning (#2020)
* removed redundant warning
1 parent 5f6e2f5 commit 24012a0

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
@@ -21,6 +21,9 @@ however, it has to be formatted properly to pass verification tests.
2121
- Added the display of the device flag `CanRunInBackground` in device debug view.
2222
- Added analytics for programmatic `InputAction` setup via `InputActionSetupExtensions` when exiting play-mode.
2323

24+
### Fixed
25+
- Removed a redundant warning when using fallback code to parse a HID descriptor. (UUM-71260)
26+
2427
## [1.11.1] - 2024-09-26
2528

2629
### 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
@@ -84,6 +85,8 @@ public HIDDeviceDescriptor hidDescriptor
8485
private bool m_HaveParsedHIDDescriptor;
8586
private HIDDeviceDescriptor m_HIDDescriptor;
8687

88+
private static readonly ProfilerMarker k_HIDParseDescriptorFallback = new ProfilerMarker("HIDParseDescriptorFallback");
89+
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
8992
// to produce a layout builder on the fly based on the HID descriptor received from
@@ -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)