@@ -1126,8 +1126,9 @@ public void Performance_OptimizedControls_ReadingPose4kTimes(OptimizationTestTyp
11261126
11271127 [ PrebuildSetup ( typeof ( ProjectWideActionsBuildSetup ) ) ]
11281128 [ PostBuildCleanup ( typeof ( ProjectWideActionsBuildSetup ) ) ]
1129- [ UnityTest , Performance ]
1129+ [ UnityTest , Performance , Version ( "2" ) ]
11301130 [ Category ( "Performance" ) ]
1131+ // Simulate a FPS controller with WASD, mouse look and various key presses triggering actions
11311132 public IEnumerator Performance_MeasureInputSystemFrameTimeWithProfilerMarkers_FPS ( )
11321133 {
11331134 var keyboard = InputSystem . AddDevice < Keyboard > ( ) ;
@@ -1169,6 +1170,7 @@ public IEnumerator Performance_MeasureInputSystemFrameTimeWithProfilerMarkers_FP
11691170 {
11701171 if ( i % 60 == 0 )
11711172 {
1173+ PressAndRelease ( keyboard . wKey , queueEventOnly : true ) ;
11721174 PressAndRelease ( keyboard . aKey , queueEventOnly : true ) ;
11731175 PressAndRelease ( keyboard . sKey , queueEventOnly : true ) ;
11741176 PressAndRelease ( keyboard . dKey , queueEventOnly : true ) ;
@@ -1211,6 +1213,8 @@ public IEnumerator Performance_MeasureInputSystemFrameTimeWithProfilerMarkers_Do
12111213 [ PostBuildCleanup ( typeof ( ProjectWideActionsBuildSetup ) ) ]
12121214 [ UnityTest , Performance ]
12131215 [ Category ( "Performance" ) ]
1216+ // Simulate a touch FPS controller with one constantly moving touch as the WASD equivalent
1217+ // and taps/clicks for button presses. Actions from PWA getting triggered.
12141218 public IEnumerator Performance_MeasureInputSystemFrameTimeWithProfilerMarkers_Touch ( )
12151219 {
12161220 var touchscreen = InputSystem . AddDevice < Touchscreen > ( ) ;
@@ -1231,26 +1235,34 @@ public IEnumerator Performance_MeasureInputSystemFrameTimeWithProfilerMarkers_To
12311235
12321236 using ( Measure . ProfilerMarkers ( allInputSystemProfilerMarkers ) )
12331237 {
1238+ // start touch 1
12341239 BeginTouch ( 1 , new Vector2 ( 0.1f , 0.2f ) , queueEventOnly : true ) ;
1235- BeginTouch ( 2 , new Vector2 ( 0.3f , 0.4f ) , queueEventOnly : true ) ;
12361240
12371241 for ( int i = 0 ; i < 500 ; ++ i )
12381242 {
1239- MoveTouch ( 1 , new Vector2 ( 0.1f + i , 0.2f + i ) , queueEventOnly : true ) ;
1243+ // start touch 2
1244+ BeginTouch ( 2 , new Vector2 ( 0.3f , 0.4f ) , queueEventOnly : true ) ;
12401245 MoveTouch ( 2 , new Vector2 ( 0.3f + i , 0.4f + i ) , queueEventOnly : true ) ;
12411246
1247+ // tap touch 3 once per frame
12421248 BeginTouch ( 3 , new Vector2 ( 0.5f , 0.6f ) , queueEventOnly : true ) ;
12431249 MoveTouch ( 3 , new Vector2 ( 0.5f + i , 0.6f + i ) , queueEventOnly : true ) ;
12441250 EndTouch ( 3 , new Vector2 ( 0.7f , 0.7f ) , queueEventOnly : true ) ;
12451251
12461252 if ( i % 60 == 0 )
12471253 {
1248- EndTouch ( 1 , new Vector2 ( 0.8f , 0.8f ) , queueEventOnly : true ) ;
1254+ // end and restart touch 2 every 30 frames
12491255 EndTouch ( 2 , new Vector2 ( 0.9f , 0.9f ) , queueEventOnly : true ) ;
1250- BeginTouch ( 1 , new Vector2 ( 0.1f , 0.2f ) , queueEventOnly : true ) ;
12511256 BeginTouch ( 2 , new Vector2 ( 0.3f , 0.4f ) , queueEventOnly : true ) ;
12521257 }
12531258
1259+ // move touch 1 with higher frequency assuming higher touch sampling rate then frames drawn
1260+ // 120Hz screen refresh rate & 2k+ Hz touch sampling rate
1261+ for ( int j = 1 ; j <= 20 ; j ++ )
1262+ {
1263+ MoveTouch ( 1 , new Vector2 ( 0.1f + j , 0.2f + j ) , queueEventOnly : true ) ;
1264+ }
1265+
12541266 InputSystem . Update ( ) ;
12551267
12561268 yield return null ;
0 commit comments