Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Packages/com.unity.inputsystem/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ however, it has to be formatted properly to pass verification tests.
- Added the display of the device flag `CanRunInBackground` in device debug view.
- Added analytics for programmatic `InputAction` setup via `InputActionSetupExtensions` when exiting play-mode.

### Fixed
- Removed a redundant warning when using fallback code to parse a HID descriptor. (UUM-71260)

## [1.11.1] - 2024-09-26

### Fixed
Expand Down
9 changes: 7 additions & 2 deletions Packages/com.unity.inputsystem/InputSystem/Plugins/HID/HID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using UnityEngine.InputSystem.LowLevel;
using UnityEngine.InputSystem.Utilities;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Profiling;
using UnityEngine.InputSystem.Layouts;
using UnityEngine.Scripting;
#if UNITY_2021_2_OR_NEWER
Expand Down Expand Up @@ -84,6 +85,8 @@ public HIDDeviceDescriptor hidDescriptor
private bool m_HaveParsedHIDDescriptor;
private HIDDeviceDescriptor m_HIDDescriptor;

private static readonly ProfilerMarker k_HIDParseDescriptorFallback = new ProfilerMarker("HIDParseDescriptorFallback");

// This is the workhorse for figuring out fallback options for HIDs attached to the system.
// If the system cannot find a more specific layout for a given HID, this method will try
// to produce a layout builder on the fly based on the HID descriptor received from
Expand Down Expand Up @@ -1130,8 +1133,10 @@ public static HIDDeviceDescriptor FromJson(string json)
}
catch (Exception)
{
Debug.LogWarning($"Couldn't parse HID descriptor with fast parser. Using fallback");
return JsonUtility.FromJson<HIDDeviceDescriptor>(json);
k_HIDParseDescriptorFallback.Begin();
var descriptor = JsonUtility.FromJson<HIDDeviceDescriptor>(json);
k_HIDParseDescriptorFallback.End();
return descriptor;
}
#else
return JsonUtility.FromJson<HIDDeviceDescriptor>(json);
Expand Down