Add Swappy & Pre-Transformed Swapchain

- Adds Swappy for Android for stable frame pacing
- Implements pre-transformed Swapchain so that Godot's compositor is in
charge of rotating the screen instead of Android's compositor
(performance optimization for phones that don't have HW rotator)

============================

The work was performed by collaboration of TheForge and Google. I am
merely splitting it up into smaller PRs and cleaning it up.

Changes from original PR:

- Removed "display/window/frame_pacing/android/target_frame_rate" option
to use Engine::get_max_fps instead.
- Target framerate can be changed at runtime using Engine::set_max_fps.
- Swappy is enabled by default.
- Added documentation.
- enable_auto_swap setting is replaced with swappy_mode.
This commit is contained in:
Matias N. Goldberg 2024-05-05 19:15:56 -03:00
parent 92e51fca72
commit aaa0e2fddf
23 changed files with 1064 additions and 14 deletions

View file

@ -24,19 +24,19 @@ jobs:
cache-name: android-editor
target: editor
tests: false
sconsflags: arch=arm64 production=yes
sconsflags: arch=arm64 production=yes swappy=yes
- name: Template arm32 (target=template_release, arch=arm32)
cache-name: android-template-arm32
target: template_release
tests: false
sconsflags: arch=arm32
sconsflags: arch=arm32 swappy=yes
- name: Template arm64 (target=template_release, arch=arm64)
cache-name: android-template-arm64
target: template_release
tests: false
sconsflags: arch=arm64
sconsflags: arch=arm64 swappy=yes
steps:
- name: Checkout
@ -59,6 +59,17 @@ jobs:
- name: Setup Python and SCons
uses: ./.github/actions/godot-deps
- name: Download pre-built Android Swappy Frame Pacing Library
uses: dsaltares/fetch-gh-release-asset@1.1.2
with:
repo: darksylinc/godot-swappy
version: tags/v2023.3.0.0
file: godot-swappy.7z
target: swappy/godot-swappy.7z
- name: Extract pre-built Android Swappy Frame Pacing Library
run: 7za x -y swappy/godot-swappy.7z -o${{github.workspace}}/thirdparty/swappy-frame-pacing
- name: Compilation
uses: ./.github/actions/godot-build
with: