-
Notifications
You must be signed in to change notification settings - Fork 326
FIX: ISXB-925 Fixed an issue where changing InputSettings instance fo… #1954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
62ceae4
4d9cf2b
ab5ff84
310dc20
d294539
db67d57
c93e565
ebe63c9
308f9f7
b52a592
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2116,6 +2116,12 @@ internal struct AvailableDevice | |
internal IInputRuntime m_Runtime; | ||
internal InputMetrics m_Metrics; | ||
internal InputSettings m_Settings; | ||
|
||
// Extract as booleans (from m_Settings) because feature check is in the hot path | ||
internal bool m_OptimizedControlsFeatureEnabled; | ||
internal bool m_ReadValueCachingFeatureEnabled; | ||
internal bool m_ParanoidReadValueCachingChecksEnabled; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please change these to private fields and add an internal read-only accessor property? When refactoring for CoreCLR support, internal fields were very frustrating because I had to check the entire code base for any usages. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This have been adressed now in c93e565 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regarding FWPM refactor I think this is straightforward since ApplySettings seem intact. |
||
|
||
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS | ||
private InputActionAsset m_Actions; | ||
#endif | ||
|
@@ -2645,12 +2651,19 @@ internal void ApplySettings() | |
runPlayerUpdatesInEditMode = m_Settings.IsFeatureEnabled(InputFeatureNames.kRunPlayerUpdatesInEditMode); | ||
#endif | ||
|
||
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN | ||
if (m_Settings.IsFeatureEnabled(InputFeatureNames.kUseWindowsGamingInputBackend)) | ||
{ | ||
var command = UseWindowsGamingInputCommand.Create(true); | ||
if (ExecuteGlobalCommand(ref command) < 0) | ||
Debug.LogError($"Could not enable Windows.Gaming.Input"); | ||
} | ||
#endif | ||
|
||
// Extract feature flags into fields since used in hot-path | ||
m_ReadValueCachingFeatureEnabled = m_Settings.IsFeatureEnabled((InputFeatureNames.kUseReadValueCaching)); | ||
m_OptimizedControlsFeatureEnabled = m_Settings.IsFeatureEnabled((InputFeatureNames.kUseOptimizedControls)); | ||
m_ParanoidReadValueCachingChecksEnabled = m_Settings.IsFeatureEnabled((InputFeatureNames.kParanoidReadValueCachingChecks)); | ||
} | ||
|
||
// Cache some values. | ||
|
@@ -3549,7 +3562,7 @@ private void ResetCurrentProcessedEventBytesForDevices() | |
[Conditional("UNITY_EDITOR")] | ||
void CheckAllDevicesOptimizedControlsHaveValidState() | ||
{ | ||
if (!InputSettings.optimizedControlsFeatureEnabled) | ||
if (!InputSystem.s_Manager.m_OptimizedControlsFeatureEnabled) | ||
return; | ||
|
||
foreach (var device in devices) | ||
|
@@ -3739,7 +3752,7 @@ private unsafe void WriteStateChange(InputStateBuffers.DoubleBuffers buffers, in | |
deviceStateSize); | ||
} | ||
|
||
if (InputSettings.readValueCachingFeatureEnabled) | ||
if (InputSystem.s_Manager.m_ReadValueCachingFeatureEnabled) | ||
{ | ||
// if the buffers have just been flipped, and we're doing a full state update, then the state from the | ||
// previous update is now in the back buffer, and we should be comparing to that when checking what | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!