Skip to content

Commit

Permalink
FIX: UUM-71260 Removed redundant warning (#2020)
Browse files Browse the repository at this point in the history
* removed redundant warning
  • Loading branch information
smnwttbr authored Oct 11, 2024
1 parent 5f6e2f5 commit 24012a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
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

0 comments on commit 24012a0

Please sign in to comment.