Android: full frame rate after returning from background; no black blocks at the top on entering a run

- nvn_vk.c: present-link tick period estimated over a 60-tick window
  minimum and reset on refresh-rate change, so frame pacing no longer
  locks to ~20 fps after resume. Swapchain acquire barrier srcStage is
  TRANSFER (spec fix).
- GameActivity.java: HUD overlay without a hardware layer; compositing
  that offscreen layer on Adreno produced stepped black blocks at the
  top of the screen during the first ~18 s in game.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-14 16:54:51 +09:00
co-authored by Claude Opus 5.5
parent 4d91f80bae
commit 3076dc4a69
2 changed files with 23 additions and 5 deletions
@@ -88,8 +88,9 @@ public final class GameActivity extends Activity implements SurfaceHolder.Callba
view = new SurfaceView(this);
view.getHolder().addCallback(this);
view.setFocusable(true); view.setFocusableInTouchMode(true);
// 主体层缓存成 GPU 纹理:手指在摇杆上动时只重画摇杆层(见 touch_app.c op_list) | the body layer is cached as a GPU texture: while a finger moves on the stick only the joystick layer is redrawn (see touch_app.c op_list)
overlay = new TouchOverlay(this, 0); overlay.setLayerType(View.LAYER_TYPE_HARDWARE, null);
// 主体层与摇杆层分开:手指在摇杆上动时只重画摇杆层(见 touch_app.c op_list)。主体层不设 LAYER_TYPE_HARDWARE:在 Adreno 上那块离屏层刚进游戏的十几秒里会把屏幕顶部合成成台阶状黑块
// the body and joystick layers are separate: while a finger moves on the stick only the joystick layer is redrawn (see touch_app.c op_list). No LAYER_TYPE_HARDWARE on the body layer: on Adreno that offscreen layer composited stepped black blocks at the top of the screen for the first dozen seconds in game
overlay = new TouchOverlay(this, 0);
joy = new TouchOverlay(this, 1);
goals = new TouchOverlay(this, 2); // 小地图任务终点:跟着玩家走每帧变,单独一层不牵动主体层 | minimap quest goals: change every frame as the player walks, own layer so the body layer is untouched
FrameLayout root = new FrameLayout(this);