Compare commits
131
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
049ded1812 | ||
|
|
ef1c208ed7 | ||
|
|
27171d8ffd | ||
|
|
cc63b40387 | ||
|
|
89ef2f1e90 | ||
|
|
b08d8e8e19 | ||
|
|
2dc74f7574 | ||
|
|
0dea571c63 | ||
|
|
5f088283af | ||
|
|
281a64f6c5 | ||
|
|
8e25301a77 | ||
|
|
c0506d53c9 | ||
|
|
f0a4b084d9 | ||
|
|
ae66be5521 | ||
|
|
aef4a11595 | ||
|
|
cc04546373 | ||
|
|
bdd3d247c3 | ||
|
|
e71c37b34f | ||
|
|
e0296a1176 | ||
|
|
2ce1563b5f | ||
|
|
d9a9f9fed7 | ||
|
|
eace3106d6 | ||
|
|
4829d65f49 | ||
|
|
6877a5e8e6 | ||
|
|
25923966eb | ||
|
|
ffb2a3d6e6 | ||
|
|
aff81a13e3 | ||
|
|
3dbcefc14c | ||
|
|
9cbad0b1ac | ||
|
|
f524ffc3d6 | ||
|
|
1fe92c978a | ||
|
|
1f016211f2 | ||
|
|
49c5ff188b | ||
|
|
46f99b9e08 | ||
|
|
dcb1a3001b | ||
|
|
dbfcd764f3 | ||
|
|
96e4bd4eab | ||
|
|
d788afc126 | ||
|
|
50a7b1b9f5 | ||
|
|
79027970e1 | ||
|
|
6e9853add5 | ||
|
|
07f2dc8e8f | ||
|
|
0f924aebb0 | ||
|
|
8ec499ae3f | ||
|
|
53c1933ac8 | ||
|
|
4df3f775e1 | ||
|
|
6b570c573b | ||
|
|
d164749a7f | ||
|
|
50c5fd79f7 | ||
|
|
c6169cba80 | ||
|
|
017c1c6b31 | ||
|
|
a8df9a7ae1 | ||
|
|
d38fd373f0 | ||
|
|
a6fe10d8ff | ||
|
|
953549704a | ||
|
|
19d8819137 | ||
|
|
1b80b506cb | ||
|
|
4b289a4802 | ||
|
|
238ef76c5c | ||
|
|
906e66e3cf | ||
|
|
c0d14f9632 | ||
|
|
70bda85dd5 | ||
|
|
9e6f81540f | ||
|
|
3e1fc3e60e | ||
|
|
826853fff5 | ||
|
|
9be131cf6d | ||
|
|
5ed97915c7 | ||
|
|
d8654ae1be | ||
|
|
8f4744398d | ||
|
|
8f4cefd3bd | ||
|
|
01dc415f10 | ||
|
|
af1fe6c61c | ||
|
|
7bf75af8a1 | ||
|
|
c08952dff9 | ||
|
|
58430cd393 | ||
|
|
46d42f9ca9 | ||
|
|
43ff1db06b | ||
|
|
f934feb457 | ||
|
|
79d41b29ad | ||
|
|
bb6523cd9c | ||
|
|
925e9743a8 | ||
|
|
049c4be6e5 | ||
|
|
e36cf24ba9 | ||
|
|
1772291da7 | ||
|
|
3c4ac03656 | ||
|
|
7248d01b1b | ||
|
|
f1f98c3bab | ||
|
|
4405e2a389 | ||
|
|
67b82ad9b4 | ||
|
|
33bdc75a99 | ||
|
|
a573f8b14f | ||
|
|
7630173b24 | ||
|
|
7d942367fd | ||
|
|
da0a01a25b | ||
|
|
9a7cb70969 | ||
|
|
7c8f5c2707 | ||
|
|
14b130500f | ||
|
|
afe81ea69f | ||
|
|
5ca0575e67 | ||
|
|
9e405ec92c | ||
|
|
8f0e124b5d | ||
|
|
31c475d5e1 | ||
|
|
46206b3e16 | ||
|
|
4399db4716 | ||
|
|
ee6cf20ae4 | ||
|
|
2a51b044c5 | ||
|
|
ab023667a0 | ||
|
|
0a27c8bb98 | ||
|
|
bcd4e0d99f | ||
|
|
86ea861818 | ||
|
|
76e0460064 | ||
|
|
64647e0d99 | ||
|
|
8bb1895702 | ||
|
|
ae47876386 | ||
|
|
6e252ea3ad | ||
|
|
1f82db66ac | ||
|
|
fbeefc9c9a | ||
|
|
2e3b69e9ff | ||
|
|
9db80cebd9 | ||
|
|
f920aad104 | ||
|
|
e709e1c454 | ||
|
|
5f8655b13e | ||
|
|
c298da6f60 | ||
|
|
caf16c8aa5 | ||
|
|
c1dd542f97 | ||
|
|
cf44aaed14 | ||
|
|
39debda0b0 | ||
|
|
46ec222fa5 | ||
|
|
e2d87c5083 | ||
|
|
1534cf1c93 | ||
|
|
627344ea30 |
No files matched your search
@@ -6,3 +6,4 @@ KeegantheVeganat0r
|
||||
kingokksa
|
||||
ovurrsl
|
||||
KeegantheVeganat0r
|
||||
EnzoDLofi
|
||||
@@ -0,0 +1,35 @@
|
||||
name: Build bionic runtime pack and DroidDeck-Bionic tool
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'tools/bionic-runtime/**'
|
||||
- 'tools/gamescope/patches/0117-wsi-cache-present-bypass-check.patch'
|
||||
- 'tools/gamescope/patches/0119-wsi-default-images-under-limiter.patch'
|
||||
- 'app/src/main/cpp/fakeinput_steam.cpp'
|
||||
- 'tools/gpuload/**'
|
||||
- '.github/workflows/build-bionic-runtime.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Host tools
|
||||
run: |
|
||||
set -euo pipefail
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq --no-install-recommends libwayland-bin libwayland-dev libx11-dev libx11-xcb-dev \
|
||||
libxcb1-dev libxcb-composite0-dev libglm-dev zstd
|
||||
- name: Build
|
||||
run: |
|
||||
set -euo pipefail
|
||||
export NDK="${ANDROID_NDK_LATEST_HOME:-${ANDROID_NDK_HOME:-$ANDROID_NDK_ROOT}}"
|
||||
export BUILD_NUMBER=${{ github.run_number }}
|
||||
tools/bionic-runtime/build.sh "$RUNNER_TEMP/bionic-runtime" "$PWD/out"
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: droiddeck-bionic-runtime-${{ github.sha }}
|
||||
path: out/*
|
||||
@@ -572,23 +572,65 @@ jobs:
|
||||
SOURCE_TREE: ${{ needs.source.outputs.tree-sha }}
|
||||
run: python3 tools/components/prepare.py unpack --tree "$SOURCE_TREE"
|
||||
|
||||
# A hosted runner needs over 20 minutes per launcher; rebuild only when its sources change, and save each
|
||||
# build as soon as it finishes so a later timeout cannot discard it.
|
||||
- name: Restore the Ubisoft launcher build
|
||||
id: ubisoft-cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: app/src/main/assets/linuxfs/usr/local/lib/droiddeck-ubisoft
|
||||
key: ubisoft-launcher-v1-${{ steps.rust.outputs.rustc }}-${{ hashFiles('tools/ubisoft-launcher/src/**', 'tools/ubisoft-launcher/Cargo.toml', 'tools/ubisoft-launcher/Cargo.lock', 'tools/ubisoft-launcher/build.sh', 'tools/ubisoft-launcher/build.rs', 'tools/ubisoft-launcher/.cargo/**') }}
|
||||
- name: Ubisoft launcher service (x86_64-pc-windows-gnu)
|
||||
if: steps.ubisoft-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
command -v x86_64-w64-mingw32-gcc >/dev/null || { sudo apt-get update -qq && sudo apt-get install -y -qq gcc-mingw-w64-x86-64; }
|
||||
bash tools/ubisoft-launcher/build.sh
|
||||
- name: Save the Ubisoft launcher build
|
||||
if: steps.ubisoft-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: app/src/main/assets/linuxfs/usr/local/lib/droiddeck-ubisoft
|
||||
key: ${{ steps.ubisoft-cache.outputs.cache-primary-key }}
|
||||
|
||||
- name: Restore the Rockstar launcher build
|
||||
id: rockstar-cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: app/src/main/assets/linuxfs/usr/local/lib/droiddeck-rockstar
|
||||
key: rockstar-launcher-v1-${{ steps.rust.outputs.rustc }}-${{ hashFiles('tools/rockstar-launcher/src/**', 'tools/rockstar-launcher/Cargo.toml', 'tools/rockstar-launcher/Cargo.lock', 'tools/rockstar-launcher/build.sh', 'tools/rockstar-launcher/build.rs', 'tools/rockstar-launcher/.cargo/**') }}
|
||||
- name: Rockstar launcher service (32-bit and 64-bit)
|
||||
if: steps.rockstar-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
command -v i686-w64-mingw32-gcc >/dev/null || { sudo apt-get update -qq && sudo apt-get install -y -qq gcc-mingw-w64-i686; }
|
||||
command -v x86_64-w64-mingw32-gcc >/dev/null || { sudo apt-get update -qq && sudo apt-get install -y -qq gcc-mingw-w64-x86-64; }
|
||||
bash tools/rockstar-launcher/build.sh
|
||||
- name: Save the Rockstar launcher build
|
||||
if: steps.rockstar-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: app/src/main/assets/linuxfs/usr/local/lib/droiddeck-rockstar
|
||||
key: ${{ steps.rockstar-cache.outputs.cache-primary-key }}
|
||||
|
||||
- name: Restore the Epic launcher build
|
||||
id: epic-cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: app/src/main/assets/linuxfs/usr/local/lib/droiddeck-epic
|
||||
key: epic-launcher-v1-${{ steps.rust.outputs.rustc }}-${{ hashFiles('tools/epic-launcher/src/**', 'tools/epic-launcher/Cargo.toml', 'tools/epic-launcher/Cargo.lock', 'tools/epic-launcher/build.sh', 'tools/epic-launcher/build.rs', 'tools/epic-launcher/.cargo/**') }}
|
||||
- name: Epic Games Launcher parent stand-in (x86_64-pc-windows-gnu)
|
||||
if: steps.epic-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
command -v x86_64-w64-mingw32-gcc >/dev/null || { sudo apt-get update -qq && sudo apt-get install -y -qq gcc-mingw-w64-x86-64; }
|
||||
bash tools/epic-launcher/build.sh
|
||||
- name: Save the Epic launcher build
|
||||
if: steps.epic-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: app/src/main/assets/linuxfs/usr/local/lib/droiddeck-epic
|
||||
key: ${{ steps.epic-cache.outputs.cache-primary-key }}
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
@@ -697,11 +739,32 @@ jobs:
|
||||
run: |
|
||||
echo "version=$(grep -o "org.robolectric:robolectric:[0-9.]*" app/build.gradle | cut -d: -f3)" >> "$GITHUB_OUTPUT"
|
||||
# Robolectric downloads these from Maven Central on first use without retrying, and 429s fail whole test classes.
|
||||
- name: Cache Robolectric's Android jars
|
||||
uses: actions/cache@v4
|
||||
# The cache path sits beside the workspace because runner homes are at different depths from it, and
|
||||
# actions/cache stores paths relative to the workspace. Runners that keep their own ~/.m2 skip the cache.
|
||||
- name: Place Robolectric's Android jars beside the workspace
|
||||
id: robolectric-jars
|
||||
run: |
|
||||
set -euo pipefail
|
||||
jars="$GITHUB_WORKSPACE/../robolectric-jars"
|
||||
m2="$HOME/.m2/repository/org/robolectric/android-all-instrumented"
|
||||
if [ -d "$m2" ] && [ ! -L "$m2" ]; then
|
||||
echo "cache=false" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
mkdir -p "$jars" "$(dirname "$m2")"
|
||||
ln -sfn "$(cd "$jars" && pwd)" "$m2"
|
||||
echo "cache=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
- name: Restore Robolectric's Android jars
|
||||
id: robolectric-cache
|
||||
if: steps.robolectric-jars.outputs.cache == 'true'
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ~/.m2/repository/org/robolectric/android-all-instrumented
|
||||
key: robolectric-android-all-${{ steps.robolectric.outputs.version }}
|
||||
path: ../robolectric-jars
|
||||
key: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-${{ github.run_id }}
|
||||
restore-keys: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-
|
||||
- name: Count the restored Robolectric jars
|
||||
if: steps.robolectric-jars.outputs.cache == 'true'
|
||||
run: echo "ROBOLECTRIC_JARS_BEFORE=$(find "$GITHUB_WORKSPACE/../robolectric-jars" -name '*.jar' | wc -l)" >> "$GITHUB_ENV"
|
||||
- name: Unit tests
|
||||
id: unit-tests
|
||||
env:
|
||||
@@ -712,6 +775,34 @@ jobs:
|
||||
mkdir -p app/build
|
||||
./gradlew testReleaseUnitTest --console=plain --info --stacktrace -Drobolectric.logging=stderr -PndkVersion="$NDK_VERSION" 2>&1 | tee app/build/unit-tests.log
|
||||
|
||||
# actions/cache only saves when the job succeeds, so a run whose tests died on a Maven 429 never filled the cache.
|
||||
# Save the complete jars even after a failed test step, when this run added some; a partial download is dropped first.
|
||||
- name: Save Robolectric's Android jars
|
||||
id: robolectric-jars-final
|
||||
if: always() && steps.robolectric-jars.outputs.cache == 'true'
|
||||
run: |
|
||||
python3 - <<'PY'
|
||||
import glob, os, zipfile
|
||||
root = os.path.join(os.environ['GITHUB_WORKSPACE'], '..', 'robolectric-jars')
|
||||
for f in glob.glob(os.path.join(root, '**', '*'), recursive=True):
|
||||
if not os.path.isfile(f):
|
||||
continue
|
||||
try:
|
||||
ok = f.endswith('.jar') and zipfile.ZipFile(f).testzip() is None
|
||||
except Exception:
|
||||
ok = False
|
||||
if not ok:
|
||||
os.remove(f)
|
||||
PY
|
||||
after=$(find "$GITHUB_WORKSPACE/../robolectric-jars" -name '*.jar' | wc -l)
|
||||
[ "$after" -gt "${ROBOLECTRIC_JARS_BEFORE:-0}" ] && echo "save=true" >> "$GITHUB_OUTPUT" || true
|
||||
- name: Store Robolectric's Android jars
|
||||
if: always() && steps.robolectric-jars-final.outputs.save == 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: ../robolectric-jars
|
||||
key: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-${{ github.run_id }}
|
||||
|
||||
- name: Upload unit test diagnostics
|
||||
id: unit-test-diagnostics
|
||||
if: always() && steps.unit-tests.outcome != 'skipped'
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
# CI
|
||||
|
||||
- Before pushing a PR, run `tools/pre_pr.sh`. It checks authorship and the merge onto `main`, then, when app sources change, compiles and runs lint as CI does. It picks tests by name: `<File>*Test` for changed Kotlin files, and `tools/tests` modules that mention a changed path. Add any other tests that cover your change, and leave the full suites to CI.
|
||||
- CI builds the PR merged onto `main`. Before pushing, merge or rebase onto `origin/main` and compile: most "works locally" Kotlin failures come from that merge.
|
||||
- Before a PR that touches strings or resources, run `./gradlew :app:lintVitalRelease`. The fast loop skips lint, and lint catches `ExtraTranslation` and missing-locale errors.
|
||||
- Commit messages and PR bodies must not carry `Co-Authored-By` or other bot trailers. `tools/release/check_authorship.py` fails the build on them.
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
|
||||
DroidDeck brings the SteamOS experience to Android: Steam Gaming Mode, full Linux desktop, integration with GOG, Epic Games, Xbox, and other storefronts, Steam VR, and more!
|
||||
|
||||
<p align="center"><b>100% open source. No ads. No telemetry. No proprietary components. No source withheld.</b></p>
|
||||
<p align="center"><b>100% open source. No ads. No Subscriptions. No telemetry. No proprietary components. No source withheld.</b></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/Droid-Deck/DroidDeck/releases/download/0.7.1/DroidDeck-0.7.1.apk"><img src="https://img.shields.io/badge/Download-DroidDeck%200.7.1%20APK-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Download DroidDeck 0.7.1"></a>
|
||||
<a href="https://github.com/Droid-Deck/DroidDeck/releases/download/0.7.11/DroidDeck-0.7.11.apk"><img src="https://img.shields.io/badge/Download-DroidDeck%200.7.11%20APK-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Download DroidDeck 0.7.11"></a>
|
||||
<a href="https://discord.gg/JRGAvawjsm"><img src="https://img.shields.io/badge/Discord-Join%20us-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Join the DroidDeck Discord"></a>
|
||||
</p>
|
||||
|
||||
@@ -23,7 +23,7 @@ DroidDeck brings the SteamOS experience to Android: Steam Gaming Mode, full Linu
|
||||
<a href="https://trendshift.io/repositories/267852"><img src="https://trendshift.io/api/badge/trendshift/repositories/267852/daily?language=Kotlin" alt="Droid-Deck%2FDroidDeck | Trendshift" width="250" height="55"></a>
|
||||
</p>
|
||||
|
||||
<p align="center"><img src="docs/media/steam-to-desktop.gif" width="100%" alt="On a Retroid Pocket Duo: Play Steam from the DroidDeck launcher, open Pac-Man in Steam Big Picture and play it, exit the game, then Switch to Desktop from the Power menu"></p>
|
||||
<p align="center"><a href="https://www.youtube.com/watch?v=ruaTSm_7a2c"><img src="docs/media/droiddeck-showcase.gif" width="60%" alt="A table of handhelds and phones all running DroidDeck, one waking to the Steam menu, the AYN Thor's bottom screen used as a touchpad, and scrolling around Steam on a phone before swiping to the home screen. Footage from Cyber Dopamine's video, linked."></a></p>
|
||||
|
||||
> The official website is [droid-deck.dev](https://droid-deck.dev). Only download DroidDeck from this repository's [Releases](https://github.com/Droid-Deck/DroidDeck/releases).
|
||||
|
||||
@@ -38,7 +38,7 @@ DroidDeck brings the SteamOS experience to Android: Steam Gaming Mode, full Linu
|
||||
|
||||
1. Android 9 or newer on Adreno 730 or newer, or any 8xx. Adreno 6xx, Mali, Xclipse and PowerVR are experimental. Adreno 710 is currently unsupported. No root needed.
|
||||
2. About 3 GB free for the runtime, plus 1.1 GB for the desktop and emulators.
|
||||
3. Install the [APK](https://github.com/Droid-Deck/DroidDeck/releases/download/0.7.1/DroidDeck-0.7.1.apk), install the Linux runtime, press **Play** and sign in to Steam.
|
||||
3. Install the [APK](https://github.com/Droid-Deck/DroidDeck/releases/download/0.7.11/DroidDeck-0.7.11.apk), install the Linux runtime, press **Play** and sign in to Steam.
|
||||
4. On Android 14 and newer, turn on **Disable child process restrictions** in Developer options. On Android 12 and 13, Steam's first launch shows a **Fix it for me** button that walks you through it.
|
||||
|
||||
Smart glasses setup is in the [support matrix](docs/smart-glasses-support.md). Release notes are in [docs/releases](docs/releases).
|
||||
@@ -57,9 +57,6 @@ The APK lands in `app/build/outputs/apk/release/`. Install it with `tools/deploy
|
||||
|
||||
On Windows, see `tools/run_windows.ps1` and `tools/prepare_windows_runtime.py`.
|
||||
|
||||
## Limits
|
||||
|
||||
Compatibility and performance vary by device. Desktop compositing is software rendered, and Firefox sandboxing is reduced under proot.
|
||||
|
||||
## Credits and licence
|
||||
|
||||
@@ -71,7 +68,9 @@ DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. V
|
||||
- Runtime, shim, input and controller work build on WinNative and Bannerlator by maxjivi05.
|
||||
- mmap ring buffer controller input by ribbit384 ([WinNative #345](https://github.com/WinNative-Emu/WinNative/pull/345)).
|
||||
- [FEX](https://github.com/FEX-Emu/FEX) (MIT) runs x86 code. DroidDeck's build puts the platform name under `AT_PLATFORM` so [sharun](https://github.com/VHSgunzo/sharun) AppImages by VHSgunzo (MIT) start through its [userland-execve](https://crates.io/crates/userland-execve) loader (MIT), and its GL thunk hands X errors to the program's own error handler. FEX's code disk cache was checked in its source. The fix for host stack left behind when a program leaves a signal handler without returning follows the approach suggested in [FEX-Emu/FEX#2487](https://github.com/FEX-Emu/FEX/issues/2487). The host stack fix for system calls that end a block is a backport of Ryan Houdek's [FEX-Emu/FEX#6122](https://github.com/FEX-Emu/FEX/pull/6122).
|
||||
- x86-64 programs on Wayland reach the GPU through FEX's Wayland client, wayland-egl and EGL thunks. The guest `wl_list` and `wl_array` helpers follow [libwayland](https://gitlab.freedesktop.org/wayland/wayland)'s `src/wayland-util.c` (MIT). The EGL extension table comes from the [Khronos EGL registry](https://github.com/KhronosGroup/EGL-Registry) (Apache-2.0) and Mesa's `egl_other.xml` (MIT).
|
||||
- x86 AppImages, and arm64 ones whose runtime can't unpack on Android, are unpacked with [uruntime](https://github.com/VHSgunzo/uruntime) by VHSgunzo (MIT), shipped unmodified with its licence.
|
||||
- DwarFS AppImages are unpacked without proot by `dwarfsextract` from [DwarFS](https://github.com/mhx/dwarfs) by Marcus Holland-Moritz (MIT), the release binary uruntime embeds, taken out of its self-extracting wrapper and shipped with its licence.
|
||||
- x86 programs linking OpenSSL 3 use the copy in the [Steam Linux Runtime 4.0](https://gitlab.steamos.cloud/steamrt/steamrt). x86 Linux games get the `/etc/asound.conf` that [pressure-vessel](https://gitlab.steamos.cloud/steamrt/steam-runtime-tools) writes.
|
||||
- `WriteProcessMemory` hooks fall back to `/proc/<pid>/mem` the way [Wine](https://gitlab.winehq.org/wine/wine)'s `server/ptrace.c` did before Wine 11.
|
||||
- Windows programs on noexec storage get executable copies of their image pages, following [@yujikaido](https://github.com/yujikaido)'s finding in [droiddeck-rp4pro](https://github.com/yujikaido/droiddeck-rp4pro) that Wine's own processes need the noexec shim.
|
||||
@@ -91,7 +90,7 @@ DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. V
|
||||
<details>
|
||||
<summary><b>Stores</b></summary>
|
||||
|
||||
- Epic Games and GOG build on [Phobos](https://github.com/phobos665)'s adaptation of [Legendary](https://github.com/legendary-gl/legendary) and [gogdl](https://github.com/Heroic-Games-Launcher/heroic-gogdl). GOG install script registry entries are read the way [Heroic Games Launcher](https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher) (GPL-3.0) reads them. GOG cloud storage requests send the Galaxy communication-service User-Agent that gogdl and [Lutris](https://github.com/lutris/lutris) (GPL-3.0) send.
|
||||
- Epic Games and GOG build on [Phobos](https://github.com/phobos665)'s adaptation of [Legendary](https://github.com/legendary-gl/legendary) and [gogdl](https://github.com/Heroic-Games-Launcher/heroic-gogdl). GOG install script registry entries are read the way [Heroic Games Launcher](https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher) (GPL-3.0) reads them. GOG cloud storage requests send the Galaxy communication-service User-Agent that gogdl and [Lutris](https://github.com/lutris/lutris) (GPL-3.0) send. Deleted GOG cloud saves are recognised by the empty-gzip deletion hash gogdl and Lutris skip.
|
||||
- Epic's official Linux launcher preview runs through FEX. That setup is outside Epic's listed Linux support.
|
||||
- The launcher's .deb gets the WebKitGTK and GTK 3 libraries it needs from unmodified [Debian](https://www.debian.org) 13 packages, following [@zooluis](https://github.com/zooluis)'s research in [#2268](https://github.com/Droid-Deck/DroidDeck/pull/2268).
|
||||
- Battle.net is by [@kayakyakr](https://github.com/kayakyakr). It runs Blizzard's own client in Proton (downloaded from Blizzard, not included) and shows key art from the [Battle.net Shop](https://shop.battle.net). Without Steam, its games see the pad as an Xbox 360 controller via `PROTON_SPOOF_STEAMINPUT_VIDPID` in [Proton](https://github.com/ValveSoftware/wine)'s `dlls/winebus.sys`.
|
||||
|
||||
+8
-2
@@ -132,8 +132,8 @@ android {
|
||||
applicationId "com.droiddeck.launcher"
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 34
|
||||
versionCode 19
|
||||
versionName "0.7.1"
|
||||
versionCode 20
|
||||
versionName "0.7.11"
|
||||
buildConfigField "String", "BUILD_LABEL", "\"${escapedBuildLabel}\""
|
||||
buildConfigField "String", "SOURCE_COMMIT", "\"${sourceCommit}\""
|
||||
buildConfigField "int", "PR_NUMBER", "${prNumber}"
|
||||
@@ -284,6 +284,12 @@ def stageRuntimeAssets = tasks.register('stageRuntimeAssets', Sync) {
|
||||
into(runtimeAssetsDir)
|
||||
}
|
||||
android.sourceSets.main.assets.setSrcDirs([runtimeAssetsDir])
|
||||
def stageGraphicsNotices = tasks.register('stageGraphicsNotices', Copy) {
|
||||
from(layout.projectDirectory.file('src/main/cpp/shaders/THIRD_PARTY_NOTICES.txt'))
|
||||
into(layout.buildDirectory.dir('graphicsNotices/licenses/graphics'))
|
||||
}
|
||||
android.sourceSets.main.assets.srcDir(layout.buildDirectory.dir('graphicsNotices'))
|
||||
tasks.named('preBuild').configure { dependsOn(stageGraphicsNotices) }
|
||||
if (vitureSdkDir) android.sourceSets.main.assets.srcDir(layout.buildDirectory.dir('vitureAssets'))
|
||||
if (uvcDir) {
|
||||
def stageUvcNotices = tasks.register('stageUvcNotices', Copy) {
|
||||
|
||||
@@ -3,6 +3,9 @@ package com.droiddeck.launcher.ui
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
@@ -61,7 +61,7 @@ internal val sampleActions: FrontEndActions = FrontEndActions(
|
||||
onSteamSettings = {}, onDesktopSettings = {}, onInstallPackage = {}, onRemovePackage = {}, onRuntime = {},
|
||||
onFrameGenPick = {}, onImportLossless = {}, onProtons = {}, onComponents = {}, onPerformance = {}, onRoms = {},
|
||||
onFiles = {}, onLogs = {}, onOffline = {},
|
||||
onWirelessAdbPair = { _, _, _, _ -> }, onWirelessAdbApply = { _, _, _, _ -> }, onSetPhantomProcessLimit = { _, _ -> },
|
||||
onSetPhantomProcessLimit = { _, _ -> },
|
||||
)
|
||||
|
||||
/** The in-game menu's actions with settled sample values; its switches do nothing. */
|
||||
|
||||
@@ -57,10 +57,7 @@
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<uses-feature android:name="android.hardware.vulkan.version" android:version="0x401000" android:required="true" />
|
||||
@@ -121,14 +118,6 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".BtControllerActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask"
|
||||
android:resizeableActivity="true"
|
||||
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize|density|keyboard|keyboardHidden|navigation|uiMode"
|
||||
android:theme="@style/AppTheme" />
|
||||
|
||||
<activity
|
||||
android:name=".DeviceCodeActivity"
|
||||
android:exported="false"
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <gnu/lib-names.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#include <linux/futex.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/joystick.h>
|
||||
#include <linux/uinput.h>
|
||||
@@ -58,6 +59,59 @@
|
||||
|
||||
#define EXPORT extern "C" __attribute__((visibility("default")))
|
||||
|
||||
struct SymbolSlot {
|
||||
std::atomic<void *> fn{nullptr};
|
||||
std::atomic<bool> resolved{false};
|
||||
};
|
||||
|
||||
template <typename Fn> static Fn resolved_symbol(SymbolSlot &slot, void *handle, const char *name) {
|
||||
if (!slot.resolved.load(std::memory_order_acquire)) {
|
||||
slot.fn.store(dlsym(handle, name), std::memory_order_relaxed);
|
||||
slot.resolved.store(true, std::memory_order_release);
|
||||
}
|
||||
return reinterpret_cast<Fn>(slot.fn.load(std::memory_order_relaxed));
|
||||
}
|
||||
|
||||
enum class Next : size_t {
|
||||
open,
|
||||
openat,
|
||||
close,
|
||||
write,
|
||||
ioctl,
|
||||
poll,
|
||||
ppoll,
|
||||
select,
|
||||
stat,
|
||||
stat64,
|
||||
fstat,
|
||||
fstat64,
|
||||
xstat,
|
||||
xstat64,
|
||||
fxstat,
|
||||
fxstat64,
|
||||
statx,
|
||||
statfs,
|
||||
fstatfs,
|
||||
access,
|
||||
faccessat,
|
||||
opendir,
|
||||
scandir,
|
||||
inotify_add_watch,
|
||||
count
|
||||
};
|
||||
|
||||
static const char *const next_names[] = {"open", "openat", "close", "write", "ioctl", "poll", "ppoll", "select", "stat", "stat64", "fstat", "fstat64", "__xstat", "__xstat64", "__fxstat", "__fxstat64", "statx", "statfs", "fstatfs", "access", "faccessat", "opendir", "scandir", "inotify_add_watch"};
|
||||
static_assert(sizeof(next_names) / sizeof(next_names[0]) == static_cast<size_t>(Next::count), "next_names");
|
||||
static SymbolSlot next_slots[static_cast<size_t>(Next::count)];
|
||||
|
||||
template <typename Fn> static Fn next_symbol(Next which) {
|
||||
return resolved_symbol<Fn>(next_slots[static_cast<size_t>(which)], RTLD_NEXT, next_names[static_cast<size_t>(which)]);
|
||||
}
|
||||
|
||||
static void resolve_next_symbols() {
|
||||
for (size_t i = 0; i < static_cast<size_t>(Next::count); i++) next_symbol<void *>(static_cast<Next>(i));
|
||||
}
|
||||
|
||||
#ifdef __GLIBC__
|
||||
typedef unsigned long ioctl_request_t;
|
||||
#else
|
||||
@@ -205,6 +259,11 @@ static void controller_fork_prepare();
|
||||
static void controller_fork_parent();
|
||||
static void controller_fork_child();
|
||||
|
||||
// bionic: libc's own start-up calls hooked functions (access) before environ is set. Settings read
|
||||
// then would be empty and cached for good, so until environ exists hooks see defaults, uncached.
|
||||
extern "C" char **environ;
|
||||
static bool env_ready() { return environ != nullptr; }
|
||||
|
||||
struct FakeConfig {
|
||||
const char *hook_dir;
|
||||
const char *udev_data_dir;
|
||||
@@ -218,6 +277,10 @@ struct FakeConfig {
|
||||
// would throw a recursive-init error there, so the fields are filled without allocating, and a
|
||||
// reentry on the initializing thread gets them while other threads wait for the fork handlers.
|
||||
static FakeConfig &config() {
|
||||
if (!env_ready()) {
|
||||
static FakeConfig early = {"/data/data/com.termux/files/home/fake-input", nullptr, false, false, false};
|
||||
return early;
|
||||
}
|
||||
static FakeConfig cfg;
|
||||
static std::atomic<int> state{0};
|
||||
static __thread bool initializing __attribute__((tls_model("initial-exec")));
|
||||
@@ -433,6 +496,7 @@ void log(const char *message, ...) {
|
||||
}
|
||||
|
||||
__attribute__((constructor)) static void library_init() {
|
||||
resolve_next_symbols();
|
||||
config();
|
||||
controller_mutex();
|
||||
controller_map();
|
||||
@@ -587,7 +651,7 @@ get_fake_input_rdev(const char *event) {
|
||||
|
||||
__attribute__((visibility("hidden"))) static void load_ring_paths() {
|
||||
std::lock_guard<std::recursive_mutex> guard(controller_mutex());
|
||||
if (ring_paths_loaded)
|
||||
if (ring_paths_loaded || !env_ready())
|
||||
return;
|
||||
|
||||
const char *spec = getenv("FAKE_EVDEV_MEMFD_PATHS");
|
||||
@@ -648,6 +712,19 @@ ring_header_is_valid(const FakeInputRingHeader *ring) {
|
||||
ring->capacity == FAKE_INPUT_RING_CAPACITY;
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static int ring_wait(const FakeInputRingHeader *ring, uint64_t seen, long ns) {
|
||||
struct timespec wait = {0, ns};
|
||||
if (syscall(SYS_futex, &ring->write_seq, FUTEX_WAIT, static_cast<uint32_t>(seen), &wait, nullptr, 0) == 0 ||
|
||||
errno == EAGAIN || errno == ETIMEDOUT)
|
||||
return 0;
|
||||
if (errno == EINTR) return -1;
|
||||
return nanosleep(&wait, nullptr);
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static void ring_wake(const FakeInputRingHeader *ring) {
|
||||
syscall(SYS_futex, &ring->write_seq, FUTEX_WAKE, INT_MAX, nullptr, nullptr, 0);
|
||||
}
|
||||
|
||||
struct SnapshotState {
|
||||
uint64_t sequence = 0;
|
||||
uint64_t write_seq = 0;
|
||||
@@ -724,7 +801,7 @@ open_fake_input_ring(const char *event, int flags) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
|
||||
int fd = my_open(ring_path.c_str(), O_RDWR | (flags & (O_NONBLOCK | O_CLOEXEC)));
|
||||
if (fd < 0)
|
||||
@@ -807,12 +884,25 @@ __attribute__((visibility("hidden"))) static bool is_steam_client() {
|
||||
__attribute__((visibility("hidden"))) static bool presents_steam_virtual() {
|
||||
static int known;
|
||||
if (known == 0) {
|
||||
if (!env_ready()) return false;
|
||||
const char *enabled = getenv("FAKE_EVDEV_STEAM_VIRTUAL");
|
||||
known = enabled && atoi(enabled) && !is_steam_client() ? 1 : -1;
|
||||
}
|
||||
return known == 1;
|
||||
}
|
||||
|
||||
// The bionic Proton layer's winebus has no udev bus, and its SDL bus skips 28de:11ff (Proton reads Steam's virtual
|
||||
// pad through udev/evdev), so with FAKE_EVDEV_STEAM_PAD_AS_X360=1 other processes see that pad as a plain Xbox 360 pad.
|
||||
__attribute__((visibility("hidden"))) static bool steam_pad_as_x360() {
|
||||
static int known;
|
||||
if (known == 0) {
|
||||
if (!env_ready()) return false;
|
||||
const char *v = getenv("FAKE_EVDEV_STEAM_PAD_AS_X360");
|
||||
known = v && atoi(v) && !is_steam_client() ? 1 : -1;
|
||||
}
|
||||
return known == 1;
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static bool
|
||||
presents_xbox_triggers(const FakeController &fake) {
|
||||
return fake.uinput || !is_steam_client();
|
||||
@@ -978,7 +1068,7 @@ __attribute__((visibility("hidden"))) static void unpublish_uinput(UinputWriter
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static int claim_uinput_node(int *fd_out) {
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
for (int node = UINPUT_EVENT_BASE; node < UINPUT_EVENT_LIMIT; node++) {
|
||||
std::string path = uinput_ring_path(node);
|
||||
int fd = my_open(path.c_str(), O_RDWR | O_CREAT | O_EXCL | O_CLOEXEC, 0644);
|
||||
@@ -1005,7 +1095,7 @@ __attribute__((visibility("hidden"))) static int claim_uinput_node(int *fd_out)
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static int publish_uinput(UinputWriter &w) {
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
int fd = -1;
|
||||
int node = claim_uinput_node(&fd);
|
||||
if (node < 0) return -1;
|
||||
@@ -1091,6 +1181,7 @@ __attribute__((visibility("hidden"))) static void flush_uinput(UinputWriter &w)
|
||||
__atomic_thread_fence(__ATOMIC_RELEASE);
|
||||
__atomic_store_n(&ring->snapshot_seq, sequence + 2, __ATOMIC_RELEASE);
|
||||
__atomic_store_n(&ring->write_seq, write_seq, __ATOMIC_RELEASE);
|
||||
ring_wake(ring);
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static ssize_t
|
||||
@@ -1391,6 +1482,7 @@ static std::unordered_map<int, std::shared_ptr<DeckHidraw>> &deck_map() {
|
||||
|
||||
static bool fake_deck_enabled() {
|
||||
static int enabled = -1;
|
||||
if (enabled < 0 && !env_ready()) return false;
|
||||
if (enabled < 0) enabled = getenv("FAKE_EVDEV_DECK") && atoi(getenv("FAKE_EVDEV_DECK")) ? 1 : 0;
|
||||
return enabled == 1;
|
||||
}
|
||||
@@ -1398,6 +1490,7 @@ static bool fake_deck_enabled() {
|
||||
__attribute__((visibility("hidden"))) static uint32_t session_pad_type() {
|
||||
static int type = -1;
|
||||
if (type < 0) {
|
||||
if (!env_ready()) return PAD_TYPE_DECK;
|
||||
const char *env = getenv("FAKE_EVDEV_PAD_TYPE");
|
||||
type = env && !strcmp(env, "steamcontroller") ? PAD_TYPE_STEAM
|
||||
: env && !strcmp(env, "xbox360") ? PAD_TYPE_XBOX
|
||||
@@ -1416,7 +1509,7 @@ __attribute__((visibility("hidden"))) static const uint8_t *ring_blocks() {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
if ((mapped = block.load(std::memory_order_acquire))) return mapped;
|
||||
tries.fetch_add(1, std::memory_order_relaxed);
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
std::string path = get_ring_path_for_slot(0);
|
||||
int fd = path.empty() ? -1 : my_open(path.c_str(), O_RDONLY | O_CLOEXEC);
|
||||
if (fd < 0) return nullptr;
|
||||
@@ -1462,6 +1555,12 @@ __attribute__((visibility("hidden"))) static void sleep_us(int us) {
|
||||
nanosleep(&interval, nullptr);
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static void
|
||||
report_wait(const FakeInputRingHeader *ring, bool fresh, uint64_t seen, int us) {
|
||||
if (fresh) ring_wait(ring, seen, us * 1000L);
|
||||
else sleep_us(us);
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static uint64_t monotonic_us() {
|
||||
struct timespec now;
|
||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
@@ -1470,6 +1569,7 @@ __attribute__((visibility("hidden"))) static uint64_t monotonic_us() {
|
||||
|
||||
static bool fake_triton_enabled() {
|
||||
static int enabled = -1;
|
||||
if (enabled < 0 && !env_ready()) return false;
|
||||
if (enabled < 0)
|
||||
enabled = fake_deck_enabled() && getenv("FAKE_EVDEV_TRITON") && atoi(getenv("FAKE_EVDEV_TRITON")) ? 1 : 0;
|
||||
return enabled == 1;
|
||||
@@ -1633,7 +1733,8 @@ __attribute__((visibility("hidden"))) static void *deck_report_thread(void *arg)
|
||||
int32_t axes[8] = {};
|
||||
DeckExtras extras;
|
||||
while (live_pad_type() == PAD_TYPE_DECK) {
|
||||
if (read_snapshot(self->ring, snap) && snap.generation == ring_generation(self->ring)) {
|
||||
bool fresh = read_snapshot(self->ring, snap);
|
||||
if (fresh && snap.generation == ring_generation(self->ring)) {
|
||||
buttons = snap.buttons;
|
||||
memcpy(axes, snap.axes, sizeof(axes));
|
||||
}
|
||||
@@ -1643,7 +1744,7 @@ __attribute__((visibility("hidden"))) static void *deck_report_thread(void *arg)
|
||||
if (send(self->peer, report, sizeof(report), MSG_DONTWAIT | MSG_NOSIGNAL) < 0 &&
|
||||
errno != EAGAIN && errno != EWOULDBLOCK)
|
||||
break;
|
||||
sleep_us(controller_report_interval_us(DECK_REPORT_INTERVAL_US));
|
||||
report_wait(self->ring, fresh, snap.write_seq, controller_report_interval_us(DECK_REPORT_INTERVAL_US));
|
||||
}
|
||||
syscall(SYS_close, self->peer);
|
||||
munmap(self->ring, self->mapping_size);
|
||||
@@ -1749,7 +1850,8 @@ __attribute__((visibility("hidden"))) static void *sony_report_thread(void *arg)
|
||||
SonyTouch touch;
|
||||
const uint64_t start_us = monotonic_us();
|
||||
while (live_pad_type() == type) {
|
||||
if (read_snapshot(self->ring, snap) && snap.generation == ring_generation(self->ring)) {
|
||||
bool fresh = read_snapshot(self->ring, snap);
|
||||
if (fresh && snap.generation == ring_generation(self->ring)) {
|
||||
buttons = snap.buttons;
|
||||
memcpy(axes, snap.axes, sizeof(axes));
|
||||
}
|
||||
@@ -1759,7 +1861,7 @@ __attribute__((visibility("hidden"))) static void *sony_report_thread(void *arg)
|
||||
if (send(self->peer, report, sizeof(report), MSG_DONTWAIT | MSG_NOSIGNAL) < 0 &&
|
||||
errno != EAGAIN && errno != EWOULDBLOCK)
|
||||
break;
|
||||
sleep_us(controller_report_interval_us(DECK_REPORT_INTERVAL_US));
|
||||
report_wait(self->ring, fresh, snap.write_seq, controller_report_interval_us(DECK_REPORT_INTERVAL_US));
|
||||
}
|
||||
syscall(SYS_close, self->peer);
|
||||
munmap(self->ring, self->mapping_size);
|
||||
@@ -1768,7 +1870,7 @@ __attribute__((visibility("hidden"))) static void *sony_report_thread(void *arg)
|
||||
|
||||
__attribute__((visibility("hidden"))) static int open_deck_hidraw(int flags, uint8_t sony = 0) {
|
||||
const char *path = sony == 4 ? DS4_HIDRAW_PATH : sony == 5 ? DUALSENSE_HIDRAW_PATH : DECK_HIDRAW_PATH;
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
if (!process_reads_pads()) {
|
||||
Logger::log("deck: %s refused: not the Steam client\n", path);
|
||||
errno = ENOENT;
|
||||
@@ -1958,7 +2060,8 @@ __attribute__((visibility("hidden"))) static void *triton_pad_thread(void *arg)
|
||||
DeckExtras extras;
|
||||
const uint64_t start_us = monotonic_us();
|
||||
while (live_pad_type() == PAD_TYPE_STEAM) {
|
||||
if (read_snapshot(self->ring, snap) && snap.generation == ring_generation(self->ring)) {
|
||||
bool fresh = read_snapshot(self->ring, snap);
|
||||
if (fresh && snap.generation == ring_generation(self->ring)) {
|
||||
buttons = snap.buttons;
|
||||
memcpy(axes, snap.axes, sizeof(axes));
|
||||
}
|
||||
@@ -1969,7 +2072,7 @@ __attribute__((visibility("hidden"))) static void *triton_pad_thread(void *arg)
|
||||
if (send(self->peer, report, sizeof(report), MSG_DONTWAIT | MSG_NOSIGNAL) < 0 &&
|
||||
errno != EAGAIN && errno != EWOULDBLOCK)
|
||||
break;
|
||||
sleep_us(controller_report_interval_us(TRITON_REPORT_INTERVAL_US));
|
||||
report_wait(self->ring, fresh, snap.write_seq, controller_report_interval_us(TRITON_REPORT_INTERVAL_US));
|
||||
}
|
||||
syscall(SYS_close, self->peer);
|
||||
munmap(self->ring, self->mapping_size);
|
||||
@@ -1977,7 +2080,7 @@ __attribute__((visibility("hidden"))) static void *triton_pad_thread(void *arg)
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static int open_triton_hidraw(int flags, bool emulated) {
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
if (!process_reads_pads()) {
|
||||
errno = ENOENT;
|
||||
return -1;
|
||||
@@ -2091,11 +2194,12 @@ static_assert(sizeof(TouchRingFile) <= TOUCH_RING_SIZE, "TouchRingFile layout");
|
||||
|
||||
__attribute__((visibility("hidden"))) static TouchRingFile *touch_ring() {
|
||||
static TouchRingFile *ring = nullptr;
|
||||
if (!env_ready()) return nullptr;
|
||||
static std::once_flag once;
|
||||
std::call_once(once, [] {
|
||||
const char *path = getenv("FAKE_TOUCHCTL_RING");
|
||||
if (!path || !*path || !fake_deck_enabled()) return;
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
int fd = my_open(path, O_RDWR | O_CLOEXEC);
|
||||
if (fd < 0) {
|
||||
Logger::log("touch: %s not openable (%s)\n", path, strerror(errno));
|
||||
@@ -2312,7 +2416,8 @@ __attribute__((visibility("hidden"))) static int inject_uevent(const char *actio
|
||||
const char *subsystem, const char *devname,
|
||||
unsigned major, unsigned minor) {
|
||||
using inject_fn = int (*)(const char *, const char *, const char *, const char *, unsigned, unsigned);
|
||||
static auto inject = reinterpret_cast<inject_fn>(dlsym(RTLD_DEFAULT, "dd_udevmon_inject"));
|
||||
static SymbolSlot inject_slot;
|
||||
const auto inject = resolved_symbol<inject_fn>(inject_slot, RTLD_DEFAULT, "dd_udevmon_inject");
|
||||
return inject ? inject(action, devpath, subsystem, devname, major, minor) : -1;
|
||||
}
|
||||
|
||||
@@ -2434,6 +2539,7 @@ __attribute__((constructor)) static void start_touch_controller() {
|
||||
static constexpr long SYSFS_FS_MAGIC = 0x62656572;
|
||||
|
||||
__attribute__((visibility("hidden"))) static const char *deck_listing_dir() {
|
||||
if (!env_ready()) return nullptr;
|
||||
static const char *dir = getenv("FAKE_DECK_SYSFS_LISTING");
|
||||
return dir && *dir ? dir : nullptr;
|
||||
}
|
||||
@@ -2469,7 +2575,7 @@ __attribute__((visibility("hidden"))) static void note_deck_sysfs(const char *ho
|
||||
}
|
||||
|
||||
EXPORT int fstatfs(int fd, struct statfs *buf) {
|
||||
static auto real = reinterpret_cast<int (*)(int, struct statfs *)>(dlsym(RTLD_NEXT, "fstatfs"));
|
||||
const auto real = next_symbol<int (*)(int, struct statfs *)>(Next::fstatfs);
|
||||
int result = real(fd, buf);
|
||||
if (fake_deck_enabled() && is_deck_sysfs_fd(fd)) {
|
||||
note_deck_sysfs("fstatfs", result);
|
||||
@@ -2479,7 +2585,7 @@ EXPORT int fstatfs(int fd, struct statfs *buf) {
|
||||
}
|
||||
|
||||
EXPORT int statfs(const char *path, struct statfs *buf) {
|
||||
static auto real = reinterpret_cast<int (*)(const char *, struct statfs *)>(dlsym(RTLD_NEXT, "statfs"));
|
||||
const auto real = next_symbol<int (*)(const char *, struct statfs *)>(Next::statfs);
|
||||
int result = real(path, buf);
|
||||
if (fake_deck_enabled() && is_deck_sysfs_path(path)) {
|
||||
note_deck_sysfs(path, result);
|
||||
@@ -2528,7 +2634,7 @@ __attribute__((visibility("hidden"))) static int deck_imu_mode_change(const uint
|
||||
}
|
||||
|
||||
__attribute__((visibility("hidden"))) static void publish_imu_mode(const DeckHidraw &deck, int mode) {
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
if (deck.mapping_size < FAKE_INPUT_RING_SIZE + DECK_IMU_BLOCK_SIZE) return;
|
||||
std::string path = get_ring_path_for_slot(0);
|
||||
int fd = path.empty() ? -1 : my_open(path.c_str(), O_WRONLY | O_CLOEXEC);
|
||||
@@ -3037,7 +3143,7 @@ static int real_fstat(int fd, struct stat *buf);
|
||||
|
||||
__attribute__((visibility("hidden"))) static bool deck_mount_id_from_fdinfo(
|
||||
int dirfd, const char *path, int flags, struct statx *buf) {
|
||||
static auto real_openat = reinterpret_cast<decltype(&::openat)>(dlsym(RTLD_NEXT, "openat"));
|
||||
const auto real_openat = next_symbol<decltype(&::openat)>(Next::openat);
|
||||
int target;
|
||||
if (!path || !*path) {
|
||||
if (!(flags & AT_EMPTY_PATH)) return false;
|
||||
@@ -3075,7 +3181,7 @@ __attribute__((visibility("hidden"))) static bool deck_mount_id_from_fdinfo(
|
||||
}
|
||||
|
||||
EXPORT int statx(int dirfd, const char *path, int flags, unsigned mask, struct statx *buf) {
|
||||
static auto real = reinterpret_cast<decltype(&::statx)>(dlsym(RTLD_NEXT, "statx"));
|
||||
const auto real = next_symbol<decltype(&::statx)>(Next::statx);
|
||||
int result = real(dirfd, path, flags, mask, buf);
|
||||
int saved_errno = errno;
|
||||
constexpr unsigned unique_mount_id = 0x4000;
|
||||
@@ -3096,7 +3202,7 @@ EXPORT int statx(int dirfd, const char *path, int flags, unsigned mask, struct s
|
||||
#endif
|
||||
|
||||
EXPORT DIR *opendir(const char *name) {
|
||||
static auto real = reinterpret_cast<DIR *(*)(const char *)>(dlsym(RTLD_NEXT, "opendir"));
|
||||
const auto real = next_symbol<DIR *(*)(const char *)>(Next::opendir);
|
||||
DIR *dir = real(name);
|
||||
if (!dir) {
|
||||
note_sys_failure(AT_FDCWD, name);
|
||||
@@ -3126,7 +3232,7 @@ EXPORT int open(const char *pathname, int flags, ...) {
|
||||
|
||||
va_end(va);
|
||||
|
||||
static auto my_open = reinterpret_cast<int (*)(const char *, int, ...)>(dlsym(RTLD_NEXT, "open"));
|
||||
const auto my_open = next_symbol<int (*)(const char *, int, ...)>(Next::open);
|
||||
|
||||
if (fake_uinput_enabled() && is_uinput_path(pathname)) return open_uinput(flags);
|
||||
if (is_deck_hidraw_path(pathname)) return open_deck_hidraw(flags);
|
||||
@@ -3204,7 +3310,7 @@ EXPORT int openat(int dirfd, const char *pathname, int flags, ...) {
|
||||
|
||||
va_end(va);
|
||||
|
||||
static auto my_openat = reinterpret_cast<int (*)(int, const char *, int, ...)>(dlsym(RTLD_NEXT, "openat"));
|
||||
const auto my_openat = next_symbol<int (*)(int, const char *, int, ...)>(Next::openat);
|
||||
|
||||
if (fake_uinput_enabled() && is_uinput_path(pathname)) return open_uinput(flags);
|
||||
if (is_deck_hidraw_path(pathname)) return open_deck_hidraw(flags);
|
||||
@@ -3363,10 +3469,10 @@ static int fake_stat_fd(int fd, S *buf, Real real) {
|
||||
}
|
||||
|
||||
static int real_stat(const char *pathname, struct stat *statbuf) {
|
||||
static auto fn = reinterpret_cast<int (*)(const char *, struct stat *)>(dlsym(RTLD_NEXT, "stat"));
|
||||
const auto fn = next_symbol<int (*)(const char *, struct stat *)>(Next::stat);
|
||||
if (fn) return fn(pathname, statbuf);
|
||||
#ifdef _STAT_VER
|
||||
static auto xfn = reinterpret_cast<int (*)(int, const char *, struct stat *)>(dlsym(RTLD_NEXT, "__xstat"));
|
||||
const auto xfn = next_symbol<int (*)(int, const char *, struct stat *)>(Next::xstat);
|
||||
if (xfn) return xfn(_STAT_VER, pathname, statbuf);
|
||||
#endif
|
||||
errno = ENOSYS;
|
||||
@@ -3374,10 +3480,10 @@ static int real_stat(const char *pathname, struct stat *statbuf) {
|
||||
}
|
||||
|
||||
static int real_fstat(int fd, struct stat *buf) {
|
||||
static auto fn = reinterpret_cast<int (*)(int, struct stat *)>(dlsym(RTLD_NEXT, "fstat"));
|
||||
const auto fn = next_symbol<int (*)(int, struct stat *)>(Next::fstat);
|
||||
if (fn) return fn(fd, buf);
|
||||
#ifdef _STAT_VER
|
||||
static auto xfn = reinterpret_cast<int (*)(int, int, struct stat *)>(dlsym(RTLD_NEXT, "__fxstat"));
|
||||
const auto xfn = next_symbol<int (*)(int, int, struct stat *)>(Next::fxstat);
|
||||
if (xfn) return xfn(_STAT_VER, fd, buf);
|
||||
#endif
|
||||
errno = ENOSYS;
|
||||
@@ -3393,7 +3499,7 @@ EXPORT int fstat(int fd, struct stat *buf) {
|
||||
}
|
||||
|
||||
EXPORT int access(const char *pathname, int mode) {
|
||||
static auto my_access = reinterpret_cast<decltype(&::access)>(dlsym(RTLD_NEXT, "access"));
|
||||
const auto my_access = next_symbol<decltype(&::access)>(Next::access);
|
||||
if (fake_uinput_enabled() && is_uinput_path(pathname)) return 0;
|
||||
if (is_deck_hidraw_path(pathname) && process_reads_pads()) return 0;
|
||||
if ((is_triton_hidraw_path(pathname) || is_triton_pad_path(pathname) || sony_pad_path(pathname)) &&
|
||||
@@ -3434,7 +3540,7 @@ EXPORT int access(const char *pathname, int mode) {
|
||||
}
|
||||
|
||||
EXPORT int faccessat(int dirfd, const char *pathname, int mode, int flags) {
|
||||
static auto my_faccessat = reinterpret_cast<decltype(&::faccessat)>(dlsym(RTLD_NEXT, "faccessat"));
|
||||
const auto my_faccessat = next_symbol<decltype(&::faccessat)>(Next::faccessat);
|
||||
if (fake_uinput_enabled() && is_uinput_path(pathname)) return 0;
|
||||
if (is_deck_hidraw_path(pathname) && process_reads_pads()) return 0;
|
||||
if ((is_triton_hidraw_path(pathname) || is_triton_pad_path(pathname) || sony_pad_path(pathname)) &&
|
||||
@@ -3478,7 +3584,7 @@ EXPORT int scandir(const char *dirp, struct dirent ***namelist,
|
||||
int (*filter)(const struct dirent *),
|
||||
int (*compar)(const struct dirent **,
|
||||
const struct dirent **)) {
|
||||
static auto my_scandir = reinterpret_cast<decltype(&::scandir)>(dlsym(RTLD_NEXT, "scandir"));
|
||||
const auto my_scandir = next_symbol<decltype(&::scandir)>(Next::scandir);
|
||||
|
||||
if (dirp) {
|
||||
if (!strcmp(dirp, "/dev/input")) {
|
||||
@@ -3492,7 +3598,7 @@ EXPORT int scandir(const char *dirp, struct dirent ***namelist,
|
||||
}
|
||||
|
||||
EXPORT int inotify_add_watch(int fd, const char *pathname, uint32_t mask) {
|
||||
static auto my_inotify_add_watch = reinterpret_cast<decltype(&::inotify_add_watch)>(dlsym(RTLD_NEXT, "inotify_add_watch"));
|
||||
const auto my_inotify_add_watch = next_symbol<decltype(&::inotify_add_watch)>(Next::inotify_add_watch);
|
||||
|
||||
char *fake_path = nullptr;
|
||||
if (pathname) {
|
||||
@@ -3631,7 +3737,7 @@ static bool wait_snapshot(std::shared_ptr<FakeController> fake,
|
||||
|
||||
static int forward_ioctl(int fd, ioctl_request_t op, void *argp) {
|
||||
using ioctl_fn = int (*)(int, ioctl_request_t, ...);
|
||||
static const auto next = reinterpret_cast<ioctl_fn>(dlsym(RTLD_NEXT, "ioctl"));
|
||||
const auto next = next_symbol<ioctl_fn>(Next::ioctl);
|
||||
return next ? next(fd, op, argp) : static_cast<int>(syscall(SYS_ioctl, fd, op, argp));
|
||||
}
|
||||
|
||||
@@ -3689,6 +3795,10 @@ EXPORT int ioctl(int fd, ioctl_request_t op, ...) {
|
||||
id.bustype = 0x03;
|
||||
if (made) {
|
||||
id = made->id;
|
||||
if (steam_pad_as_x360() && id.vendor == STEAM_VIRTUAL_VENDOR_ID && id.product == STEAM_VIRTUAL_PRODUCT_ID) {
|
||||
id.vendor = X360_VENDOR_ID;
|
||||
id.product = X360_PRODUCT_ID;
|
||||
}
|
||||
} else if (presents_steam_virtual()) {
|
||||
id.vendor = STEAM_VIRTUAL_VENDOR_ID;
|
||||
id.product = STEAM_VIRTUAL_PRODUCT_ID;
|
||||
@@ -3866,7 +3976,7 @@ EXPORT int ioctl(int fd, ioctl_request_t op, ...) {
|
||||
}
|
||||
|
||||
EXPORT int close(int fd) {
|
||||
static auto my_close = reinterpret_cast<decltype(&::close)>(dlsym(RTLD_NEXT, "close"));
|
||||
const auto my_close = next_symbol<decltype(&::close)>(Next::close);
|
||||
|
||||
if (!watched(fd)) return my_close(fd);
|
||||
close_uinput(fd);
|
||||
@@ -3930,6 +4040,7 @@ static ssize_t read_input(int fd, void *buf, size_t count) {
|
||||
errno = ENODEV;
|
||||
return -1;
|
||||
}
|
||||
bool idle = false;
|
||||
for (int attempt = 0; attempt < 8; ++attempt) {
|
||||
size_t requested = count / sizeof(struct input_event);
|
||||
if (fake.keyframe_remaining == 0) {
|
||||
@@ -3951,7 +4062,10 @@ static ssize_t read_input(int fd, void *buf, size_t count) {
|
||||
capture_keyframe(fake, snap);
|
||||
} else {
|
||||
size_t events = std::min<uint64_t>(requested, snap.write_seq - fake.read_seq);
|
||||
if (events == 0) break;
|
||||
if (events == 0) {
|
||||
idle = true;
|
||||
break;
|
||||
}
|
||||
const uint8_t *ring_events = reinterpret_cast<const uint8_t *>(fake.ring) +
|
||||
FAKE_INPUT_RING_HEADER_SIZE;
|
||||
std::vector<struct input_event> input_events(events);
|
||||
@@ -3997,9 +4111,14 @@ static ssize_t read_input(int fd, void *buf, size_t count) {
|
||||
errno = EAGAIN;
|
||||
return -1;
|
||||
}
|
||||
const FakeInputRingHeader *ring = fake.ring;
|
||||
uint64_t seen = fake.read_seq;
|
||||
guard.unlock();
|
||||
#ifdef __GLIBC__
|
||||
pthread_testcancel();
|
||||
#endif
|
||||
struct timespec sleep_time = {0, backoff_ns};
|
||||
int result = nanosleep(&sleep_time, nullptr);
|
||||
int result = idle ? ring_wait(ring, seen, backoff_ns) : nanosleep(&sleep_time, nullptr);
|
||||
guard.lock();
|
||||
if (result < 0) return -1;
|
||||
if (low_latency(LATENCY_CONTROLLER)) backoff_ns = kLowLatencyRingWaitUs * 1000;
|
||||
@@ -4054,7 +4173,7 @@ EXPORT ssize_t readv(int fd, const struct iovec *iov, int iovcnt) {
|
||||
}
|
||||
|
||||
EXPORT ssize_t write(int fd, const void *buf, size_t count) {
|
||||
static auto my_write = reinterpret_cast<decltype(&::write)>(dlsym(RTLD_NEXT, "write"));
|
||||
const auto my_write = next_symbol<decltype(&::write)>(Next::write);
|
||||
|
||||
if (!watched(fd)) return my_write(fd, buf, count);
|
||||
std::unique_lock<std::recursive_mutex> guard(controller_mutex());
|
||||
@@ -4129,8 +4248,8 @@ EXPORT ssize_t writev(int fd, const struct iovec *iov, int iovcnt) {
|
||||
|
||||
static int poll_fake(struct pollfd *fds, nfds_t nfds, int timeout,
|
||||
const sigset_t *sigmask) {
|
||||
static auto my_poll = reinterpret_cast<decltype(&::poll)>(dlsym(RTLD_NEXT, "poll"));
|
||||
static auto my_ppoll = reinterpret_cast<decltype(&::ppoll)>(dlsym(RTLD_NEXT, "ppoll"));
|
||||
const auto my_poll = next_symbol<decltype(&::poll)>(Next::poll);
|
||||
const auto my_ppoll = next_symbol<decltype(&::ppoll)>(Next::ppoll);
|
||||
|
||||
nfds_t first = 0;
|
||||
while (first < nfds && !watched(fds[first].fd)) first++;
|
||||
@@ -4234,7 +4353,7 @@ EXPORT int poll(struct pollfd *fds, nfds_t nfds, int timeout) {
|
||||
|
||||
EXPORT int ppoll(struct pollfd *fds, nfds_t nfds,
|
||||
const struct timespec *timeout, const sigset_t *sigmask) {
|
||||
static auto my_ppoll = reinterpret_cast<decltype(&::ppoll)>(dlsym(RTLD_NEXT, "ppoll"));
|
||||
const auto my_ppoll = next_symbol<decltype(&::ppoll)>(Next::ppoll);
|
||||
if (timeout && (timeout->tv_sec < 0 || timeout->tv_nsec < 0 || timeout->tv_nsec >= 1000000000L)) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
@@ -4261,7 +4380,7 @@ EXPORT int ppoll(struct pollfd *fds, nfds_t nfds,
|
||||
|
||||
EXPORT int select(int nfds, fd_set *readfds, fd_set *writefds,
|
||||
fd_set *exceptfds, struct timeval *timeout) {
|
||||
static auto my_select = reinterpret_cast<decltype(&::select)>(dlsym(RTLD_NEXT, "select"));
|
||||
const auto my_select = next_symbol<decltype(&::select)>(Next::select);
|
||||
|
||||
fd_set original_readfds;
|
||||
fd_set original_writefds;
|
||||
@@ -4423,10 +4542,10 @@ EXPORT int openat64(int dirfd, const char *pathname, int flags, ...) {
|
||||
}
|
||||
|
||||
static int real_stat64(const char *pathname, struct stat64 *statbuf) {
|
||||
static auto fn = reinterpret_cast<int (*)(const char *, struct stat64 *)>(dlsym(RTLD_NEXT, "stat64"));
|
||||
const auto fn = next_symbol<int (*)(const char *, struct stat64 *)>(Next::stat64);
|
||||
if (fn) return fn(pathname, statbuf);
|
||||
#ifdef _STAT_VER
|
||||
static auto xfn = reinterpret_cast<int (*)(int, const char *, struct stat64 *)>(dlsym(RTLD_NEXT, "__xstat64"));
|
||||
const auto xfn = next_symbol<int (*)(int, const char *, struct stat64 *)>(Next::xstat64);
|
||||
if (xfn) return xfn(_STAT_VER, pathname, statbuf);
|
||||
#endif
|
||||
errno = ENOSYS;
|
||||
@@ -4434,10 +4553,10 @@ static int real_stat64(const char *pathname, struct stat64 *statbuf) {
|
||||
}
|
||||
|
||||
static int real_fstat64(int fd, struct stat64 *buf) {
|
||||
static auto fn = reinterpret_cast<int (*)(int, struct stat64 *)>(dlsym(RTLD_NEXT, "fstat64"));
|
||||
const auto fn = next_symbol<int (*)(int, struct stat64 *)>(Next::fstat64);
|
||||
if (fn) return fn(fd, buf);
|
||||
#ifdef _STAT_VER
|
||||
static auto xfn = reinterpret_cast<int (*)(int, int, struct stat64 *)>(dlsym(RTLD_NEXT, "__fxstat64"));
|
||||
const auto xfn = next_symbol<int (*)(int, int, struct stat64 *)>(Next::fxstat64);
|
||||
if (xfn) return xfn(_STAT_VER, fd, buf);
|
||||
#endif
|
||||
errno = ENOSYS;
|
||||
@@ -4453,27 +4572,27 @@ EXPORT int fstat64(int fd, struct stat64 *buf) {
|
||||
}
|
||||
|
||||
EXPORT int __xstat(int version, const char *pathname, struct stat *statbuf) {
|
||||
static auto real = reinterpret_cast<int (*)(int, const char *, struct stat *)>(dlsym(RTLD_NEXT, "__xstat"));
|
||||
const auto real = next_symbol<int (*)(int, const char *, struct stat *)>(Next::xstat);
|
||||
if (!real) return stat(pathname, statbuf);
|
||||
return fake_stat_path(pathname, statbuf, [version](const char *path, struct stat *buf) { return real(version, path, buf); });
|
||||
return fake_stat_path(pathname, statbuf, [version, real](const char *path, struct stat *buf) { return real(version, path, buf); });
|
||||
}
|
||||
|
||||
EXPORT int __xstat64(int version, const char *pathname, struct stat64 *statbuf) {
|
||||
static auto real = reinterpret_cast<int (*)(int, const char *, struct stat64 *)>(dlsym(RTLD_NEXT, "__xstat64"));
|
||||
const auto real = next_symbol<int (*)(int, const char *, struct stat64 *)>(Next::xstat64);
|
||||
if (!real) return stat64(pathname, statbuf);
|
||||
return fake_stat_path(pathname, statbuf, [version](const char *path, struct stat64 *buf) { return real(version, path, buf); });
|
||||
return fake_stat_path(pathname, statbuf, [version, real](const char *path, struct stat64 *buf) { return real(version, path, buf); });
|
||||
}
|
||||
|
||||
EXPORT int __fxstat(int version, int fd, struct stat *buf) {
|
||||
static auto real = reinterpret_cast<int (*)(int, int, struct stat *)>(dlsym(RTLD_NEXT, "__fxstat"));
|
||||
const auto real = next_symbol<int (*)(int, int, struct stat *)>(Next::fxstat);
|
||||
if (!real) return fstat(fd, buf);
|
||||
return fake_stat_fd(fd, buf, [version](int f, struct stat *b) { return real(version, f, b); });
|
||||
return fake_stat_fd(fd, buf, [version, real](int f, struct stat *b) { return real(version, f, b); });
|
||||
}
|
||||
|
||||
EXPORT int __fxstat64(int version, int fd, struct stat64 *buf) {
|
||||
static auto real = reinterpret_cast<int (*)(int, int, struct stat64 *)>(dlsym(RTLD_NEXT, "__fxstat64"));
|
||||
const auto real = next_symbol<int (*)(int, int, struct stat64 *)>(Next::fxstat64);
|
||||
if (!real) return fstat64(fd, buf);
|
||||
return fake_stat_fd(fd, buf, [version](int f, struct stat64 *b) { return real(version, f, b); });
|
||||
return fake_stat_fd(fd, buf, [version, real](int f, struct stat64 *b) { return real(version, f, b); });
|
||||
}
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
@@ -4487,18 +4606,37 @@ static const char *const interposed_names[] = {
|
||||
};
|
||||
|
||||
static dlsym_fn next_dlsym() {
|
||||
static const dlsym_fn fn = [] {
|
||||
static std::atomic<dlsym_fn> fn{nullptr};
|
||||
static std::atomic<bool> resolved{false};
|
||||
if (!resolved.load(std::memory_order_acquire)) {
|
||||
#ifdef __x86_64__
|
||||
const char *base = "GLIBC_2.2.5";
|
||||
#else
|
||||
const char *base = "GLIBC_2.0";
|
||||
#endif
|
||||
dlsym_fn found{};
|
||||
for (const char *version : {base, "GLIBC_2.34"}) {
|
||||
if (auto found = reinterpret_cast<dlsym_fn>(dlvsym(RTLD_NEXT, "dlsym", version))) return found;
|
||||
if ((found = reinterpret_cast<dlsym_fn>(dlvsym(RTLD_NEXT, "dlsym", version)))) break;
|
||||
}
|
||||
return dlsym_fn{};
|
||||
}();
|
||||
return fn;
|
||||
fn.store(found, std::memory_order_relaxed);
|
||||
resolved.store(true, std::memory_order_release);
|
||||
}
|
||||
return fn.load(std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
static void *libc_handle() {
|
||||
static std::atomic<void *> handle{nullptr};
|
||||
static std::atomic<bool> resolved{false};
|
||||
if (!resolved.load(std::memory_order_acquire)) {
|
||||
handle.store(dlopen(LIBC_SO, RTLD_LAZY | RTLD_NOLOAD), std::memory_order_relaxed);
|
||||
resolved.store(true, std::memory_order_release);
|
||||
}
|
||||
return handle.load(std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
__attribute__((constructor)) static void resolve_dlsym_targets() {
|
||||
next_dlsym();
|
||||
libc_handle();
|
||||
}
|
||||
|
||||
static void *global_dlsym(void *, const char *name) { return next_dlsym()(RTLD_DEFAULT, name); }
|
||||
@@ -4516,8 +4654,7 @@ extern "C" __attribute__((visibility("hidden"), used)) void *fakeinput_dlsym_tar
|
||||
dlsym_fn next = next_dlsym();
|
||||
if (!next) return reinterpret_cast<void *>(missing_dlsym);
|
||||
if (handle == RTLD_DEFAULT || handle == RTLD_NEXT || name == nullptr) return reinterpret_cast<void *>(next);
|
||||
static void *const libc = dlopen(LIBC_SO, RTLD_LAZY | RTLD_NOLOAD);
|
||||
if (handle != libc || !interposed(name)) return reinterpret_cast<void *>(next);
|
||||
if (handle != libc_handle() || !interposed(name)) return reinterpret_cast<void *>(next);
|
||||
return reinterpret_cast<void *>(global_dlsym);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#include <errno.h>
|
||||
#include <jni.h>
|
||||
#include <limits.h>
|
||||
#include <linux/futex.h>
|
||||
#include <stdatomic.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -11,6 +14,13 @@ Java_com_droiddeck_launcher_input_FakeInputWriter_nativeStoreFence(JNIEnv *env,
|
||||
atomic_thread_fence(memory_order_release);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_droiddeck_launcher_input_FakeInputWriter_nativeWake(JNIEnv *env, jclass clazz, jobject buffer, jint offset) {
|
||||
(void)clazz;
|
||||
uint8_t *base = (*env)->GetDirectBufferAddress(env, buffer);
|
||||
if (base) syscall(SYS_futex, base + offset, FUTEX_WAKE, INT_MAX, NULL, NULL, 0);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_droiddeck_launcher_session_ThreadSignals_tgkill(JNIEnv *env, jclass clazz, jint tgid, jint tid, jint signal) {
|
||||
(void)env;
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
Third-Party Notices — Graphics Shaders
|
||||
======================================
|
||||
|
||||
AMD FidelityFX Super Resolution 1.0 (FSR 1.0)
|
||||
----------------------------------------------
|
||||
The EASU (Edge-Adaptive Spatial Upsampling) and RCAS
|
||||
(Robust Contrast-Adaptive Sharpening) shader implementations
|
||||
are adapted from AMD's FidelityFX FSR 1.0 reference code.
|
||||
|
||||
Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
|
||||
|
||||
SPDX-License-Identifier: MIT
|
||||
|
||||
MIT License
|
||||
-----------
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
NVIDIA Image Scaling (NIS)
|
||||
--------------------------
|
||||
The NIS fragment shader is adapted from NVIDIA's NVIDIA Image Scaling
|
||||
reference implementation, including NVScaler and NIS configuration code.
|
||||
|
||||
Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
|
||||
SPDX-License-Identifier: MIT
|
||||
|
||||
The MIT License text above applies to both AMD FidelityFX FSR 1.0 and NVIDIA Image Scaling (NIS).
|
||||
|
||||
Snapdragon Game Super Resolution 1 (SGSR1)
|
||||
------------------------------------------
|
||||
The SGSR fragment shaders are adapted from Qualcomm's reference GLSL
|
||||
shaders, including the mobile and edge-direction variants.
|
||||
|
||||
Copyright (c) 2025, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
BSD 3-Clause License (SGSR1)
|
||||
----------------------------
|
||||
Copyright (c) 2025, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Upstream SGSR1 BSD 3-Clause License (2023)
|
||||
----------------------------
|
||||
Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,68 @@
|
||||
#version 450
|
||||
|
||||
// =============================================================================
|
||||
// AMD FidelityFX CAS (Contrast-Adaptive Sharpening) - pure-CAS path.
|
||||
//
|
||||
// Ported from the OpenGL FSREffect.java MODE_SUPER_RESOLUTION shader so the
|
||||
// Vulkan compositor's post-process pipeline applies the SAME sharpen the GL
|
||||
// renderer's "Sharpen (CAS)" toggle does. Composable: layers on top of any
|
||||
// scaling mode and runs even at native resolution (no upscale).
|
||||
//
|
||||
// Conventions match upscale.vert: combined-image-sampler at binding 0, the
|
||||
// push-constant block leads with vec4 ndc (offset 0), fragTexCoord in [0,1].
|
||||
//
|
||||
// Slider -> SHARPNESS mapping is done CPU-side (planUpscaleFrame):
|
||||
// SHARPNESS = slider / 100 (clamped 0..1, default slider 60 -> 0.60)
|
||||
// Higher slider = stronger sharpen. This is the genuine AMD CAS sharpness term
|
||||
// (peak = lerp(8,5,SHARPNESS)); note the GL source's level->value comments were
|
||||
// inverted, so we map directly to the AMD term instead of copying that table.
|
||||
// =============================================================================
|
||||
|
||||
layout(binding = 0) uniform sampler2D InputTexture;
|
||||
|
||||
layout(push_constant) uniform PC {
|
||||
vec4 ndc; // quad NDC rect, consumed by upscale.vert (offset 0)
|
||||
vec2 resolution; // input texture size in pixels
|
||||
float sharpness; // CAS SHARPNESS term [0..1]
|
||||
} pc;
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
void main() {
|
||||
vec2 uv = fragTexCoord;
|
||||
vec2 px = 1.0 / pc.resolution;
|
||||
float SHARPNESS = pc.sharpness;
|
||||
|
||||
// 3x3 neighbourhood
|
||||
vec3 a = texture(InputTexture, uv + vec2(-px.x, -px.y)).rgb;
|
||||
vec3 b = texture(InputTexture, uv + vec2( 0.0, -px.y)).rgb;
|
||||
vec3 c = texture(InputTexture, uv + vec2( px.x, -px.y)).rgb;
|
||||
vec3 d = texture(InputTexture, uv + vec2(-px.x, 0.0)).rgb;
|
||||
vec3 e = texture(InputTexture, uv).rgb;
|
||||
vec3 f = texture(InputTexture, uv + vec2( px.x, 0.0)).rgb;
|
||||
vec3 g = texture(InputTexture, uv + vec2(-px.x, px.y)).rgb;
|
||||
vec3 h = texture(InputTexture, uv + vec2( 0.0, px.y)).rgb;
|
||||
vec3 i = texture(InputTexture, uv + vec2( px.x, px.y)).rgb;
|
||||
|
||||
// CAS
|
||||
vec3 mnRGB = min(min(min(d, e), min(f, b)), h);
|
||||
vec3 mnRGB2 = min(min(min(mnRGB, a), min(g, c)), i);
|
||||
mnRGB += mnRGB2;
|
||||
|
||||
vec3 mxRGB = max(max(max(d, e), max(f, b)), h);
|
||||
vec3 mxRGB2 = max(max(max(mxRGB, a), max(g, c)), i);
|
||||
mxRGB += mxRGB2;
|
||||
|
||||
vec3 rcpMxRGB = vec3(1.0) / max(mxRGB, vec3(1e-6));
|
||||
vec3 ampRGB = clamp(min(mnRGB, 2.0 - mxRGB) * rcpMxRGB, 0.0, 1.0);
|
||||
|
||||
float peak = 8.0 - 3.0 * SHARPNESS;
|
||||
vec3 wRGB = -sqrt(ampRGB) / peak;
|
||||
vec3 rcpWeightRGB = vec3(1.0) / (1.0 + 4.0 * wRGB);
|
||||
|
||||
vec3 window = (b + d) + (f + h);
|
||||
vec3 col = clamp((window * wRGB + e) * rcpWeightRGB, 0.0, 1.0);
|
||||
|
||||
outColor = vec4(col, 1.0);
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
// 1116.3.0
|
||||
#pragma once
|
||||
const uint32_t cas_code[] = {
|
||||
0x07230203,0x00010000,0x0008000b,0x000000f3,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x07230203,0x00010000,0x0008000b,0x000000f4,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000000b,0x000000ed,0x00030010,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000000b,0x000000ee,0x00030010,
|
||||
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d,
|
||||
0x00000000,0x00030005,0x00000009,0x00007675,0x00060005,0x0000000b,0x67617266,0x43786554,
|
||||
0x64726f6f,0x00000000,0x00030005,0x0000000d,0x00007870,0x00030005,0x00000010,0x00004350,
|
||||
@@ -15,15 +16,15 @@ const uint32_t cas_code[] = {
|
||||
0x00030005,0x00000065,0x00000067,0x00030005,0x00000071,0x00000068,0x00030005,0x0000007a,
|
||||
0x00000069,0x00040005,0x00000085,0x47526e6d,0x00000042,0x00040005,0x0000008f,0x47526e6d,
|
||||
0x00003242,0x00040005,0x0000009c,0x4752786d,0x00000042,0x00040005,0x000000a6,0x4752786d,
|
||||
0x00003242,0x00050005,0x000000b3,0x4d706372,0x42475278,0x00000000,0x00040005,0x000000b7,
|
||||
0x52706d61,0x00004247,0x00040005,0x000000c5,0x6b616570,0x00000000,0x00040005,0x000000cb,
|
||||
0x42475277,0x00000000,0x00060005,0x000000d2,0x57706372,0x68676965,0x42475274,0x00000000,
|
||||
0x00040005,0x000000d9,0x646e6977,0x0000776f,0x00030005,0x000000e1,0x006c6f63,0x00050005,
|
||||
0x000000ed,0x4374756f,0x726f6c6f,0x00000000,0x00040047,0x0000000b,0x0000001e,0x00000000,
|
||||
0x00003242,0x00050005,0x000000b3,0x4d706372,0x42475278,0x00000000,0x00040005,0x000000ba,
|
||||
0x52706d61,0x00004247,0x00040005,0x000000c6,0x6b616570,0x00000000,0x00040005,0x000000cc,
|
||||
0x42475277,0x00000000,0x00060005,0x000000d3,0x57706372,0x68676965,0x42475274,0x00000000,
|
||||
0x00040005,0x000000da,0x646e6977,0x0000776f,0x00030005,0x000000e2,0x006c6f63,0x00050005,
|
||||
0x000000ee,0x4374756f,0x726f6c6f,0x00000000,0x00040047,0x0000000b,0x0000001e,0x00000000,
|
||||
0x00030047,0x00000010,0x00000002,0x00050048,0x00000010,0x00000000,0x00000023,0x00000000,
|
||||
0x00050048,0x00000010,0x00000001,0x00000023,0x00000010,0x00050048,0x00000010,0x00000002,
|
||||
0x00000023,0x00000018,0x00040047,0x00000026,0x00000021,0x00000000,0x00040047,0x00000026,
|
||||
0x00000022,0x00000000,0x00040047,0x000000ed,0x0000001e,0x00000000,0x00020013,0x00000002,
|
||||
0x00000022,0x00000000,0x00040047,0x000000ee,0x0000001e,0x00000000,0x00020013,0x00000002,
|
||||
0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,
|
||||
0x00000006,0x00000002,0x00040020,0x00000008,0x00000007,0x00000007,0x00040020,0x0000000a,
|
||||
0x00000001,0x00000007,0x0004003b,0x0000000a,0x0000000b,0x00000001,0x0004002b,0x00000006,
|
||||
@@ -38,11 +39,11 @@ const uint32_t cas_code[] = {
|
||||
0x00000025,0x00000000,0x00000024,0x0004003b,0x00000025,0x00000026,0x00000000,0x00040015,
|
||||
0x00000029,0x00000020,0x00000000,0x0004002b,0x00000029,0x0000002a,0x00000000,0x0004002b,
|
||||
0x00000029,0x0000002e,0x00000001,0x0004002b,0x00000006,0x00000039,0x00000000,0x0006002c,
|
||||
0x00000020,0x000000b4,0x0000000e,0x0000000e,0x0000000e,0x0004002b,0x00000006,0x000000b9,
|
||||
0x40000000,0x0004002b,0x00000006,0x000000c6,0x41000000,0x0004002b,0x00000006,0x000000c7,
|
||||
0x40400000,0x0004002b,0x00000006,0x000000cc,0xbf800000,0x0006002c,0x00000020,0x000000cd,
|
||||
0x000000cc,0x000000cc,0x000000cc,0x0004002b,0x00000006,0x000000d3,0x40800000,0x00040020,
|
||||
0x000000ec,0x00000003,0x0000000f,0x0004003b,0x000000ec,0x000000ed,0x00000003,0x00050036,
|
||||
0x00000020,0x000000b4,0x0000000e,0x0000000e,0x0000000e,0x0004002b,0x00000006,0x000000b6,
|
||||
0x358637bd,0x0006002c,0x00000020,0x000000b7,0x000000b6,0x000000b6,0x000000b6,0x0004002b,
|
||||
0x00000006,0x000000bc,0x40000000,0x0004002b,0x00000006,0x000000c7,0x41000000,0x0004002b,
|
||||
0x00000006,0x000000c8,0x40400000,0x0004002b,0x00000006,0x000000d4,0x40800000,0x00040020,
|
||||
0x000000ed,0x00000003,0x0000000f,0x0004003b,0x000000ed,0x000000ee,0x00000003,0x00050036,
|
||||
0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,0x00000008,
|
||||
0x00000009,0x00000007,0x0004003b,0x00000008,0x0000000d,0x00000007,0x0004003b,0x0000001a,
|
||||
0x0000001b,0x00000007,0x0004003b,0x00000021,0x00000022,0x00000007,0x0004003b,0x00000021,
|
||||
@@ -52,10 +53,10 @@ const uint32_t cas_code[] = {
|
||||
0x00000071,0x00000007,0x0004003b,0x00000021,0x0000007a,0x00000007,0x0004003b,0x00000021,
|
||||
0x00000085,0x00000007,0x0004003b,0x00000021,0x0000008f,0x00000007,0x0004003b,0x00000021,
|
||||
0x0000009c,0x00000007,0x0004003b,0x00000021,0x000000a6,0x00000007,0x0004003b,0x00000021,
|
||||
0x000000b3,0x00000007,0x0004003b,0x00000021,0x000000b7,0x00000007,0x0004003b,0x0000001a,
|
||||
0x000000c5,0x00000007,0x0004003b,0x00000021,0x000000cb,0x00000007,0x0004003b,0x00000021,
|
||||
0x000000d2,0x00000007,0x0004003b,0x00000021,0x000000d9,0x00000007,0x0004003b,0x00000021,
|
||||
0x000000e1,0x00000007,0x0004003d,0x00000007,0x0000000c,0x0000000b,0x0003003e,0x00000009,
|
||||
0x000000b3,0x00000007,0x0004003b,0x00000021,0x000000ba,0x00000007,0x0004003b,0x0000001a,
|
||||
0x000000c6,0x00000007,0x0004003b,0x00000021,0x000000cc,0x00000007,0x0004003b,0x00000021,
|
||||
0x000000d3,0x00000007,0x0004003b,0x00000021,0x000000da,0x00000007,0x0004003b,0x00000021,
|
||||
0x000000e2,0x00000007,0x0004003d,0x00000007,0x0000000c,0x0000000b,0x0003003e,0x00000009,
|
||||
0x0000000c,0x00050041,0x00000015,0x00000016,0x00000012,0x00000014,0x0004003d,0x00000007,
|
||||
0x00000017,0x00000016,0x00050050,0x00000007,0x00000018,0x0000000e,0x0000000e,0x00050088,
|
||||
0x00000007,0x00000019,0x00000018,0x00000017,0x0003003e,0x0000000d,0x00000019,0x00050041,
|
||||
@@ -143,38 +144,39 @@ const uint32_t cas_code[] = {
|
||||
0x0000007a,0x0007000c,0x00000020,0x000000af,0x00000001,0x00000028,0x000000ad,0x000000ae,
|
||||
0x0003003e,0x000000a6,0x000000af,0x0004003d,0x00000020,0x000000b0,0x000000a6,0x0004003d,
|
||||
0x00000020,0x000000b1,0x0000009c,0x00050081,0x00000020,0x000000b2,0x000000b1,0x000000b0,
|
||||
0x0003003e,0x0000009c,0x000000b2,0x0004003d,0x00000020,0x000000b5,0x0000009c,0x00050088,
|
||||
0x00000020,0x000000b6,0x000000b4,0x000000b5,0x0003003e,0x000000b3,0x000000b6,0x0004003d,
|
||||
0x00000020,0x000000b8,0x00000085,0x0004003d,0x00000020,0x000000ba,0x0000009c,0x00060050,
|
||||
0x00000020,0x000000bb,0x000000b9,0x000000b9,0x000000b9,0x00050083,0x00000020,0x000000bc,
|
||||
0x000000bb,0x000000ba,0x0007000c,0x00000020,0x000000bd,0x00000001,0x00000025,0x000000b8,
|
||||
0x000000bc,0x0004003d,0x00000020,0x000000be,0x000000b3,0x00050085,0x00000020,0x000000bf,
|
||||
0x000000bd,0x000000be,0x00060050,0x00000020,0x000000c0,0x00000039,0x00000039,0x00000039,
|
||||
0x00060050,0x00000020,0x000000c1,0x0000000e,0x0000000e,0x0000000e,0x0008000c,0x00000020,
|
||||
0x000000c2,0x00000001,0x0000002b,0x000000bf,0x000000c0,0x000000c1,0x0003003e,0x000000b7,
|
||||
0x000000c2,0x0004003d,0x00000020,0x000000c3,0x000000b7,0x0006000c,0x00000020,0x000000c4,
|
||||
0x00000001,0x00000020,0x000000c3,0x0003003e,0x000000b7,0x000000c4,0x0004003d,0x00000006,
|
||||
0x000000c8,0x0000001b,0x00050085,0x00000006,0x000000c9,0x000000c7,0x000000c8,0x00050083,
|
||||
0x00000006,0x000000ca,0x000000c6,0x000000c9,0x0003003e,0x000000c5,0x000000ca,0x0004003d,
|
||||
0x00000020,0x000000ce,0x000000b7,0x0004003d,0x00000006,0x000000cf,0x000000c5,0x0005008e,
|
||||
0x00000020,0x000000d0,0x000000ce,0x000000cf,0x00050088,0x00000020,0x000000d1,0x000000cd,
|
||||
0x000000d0,0x0003003e,0x000000cb,0x000000d1,0x0004003d,0x00000020,0x000000d4,0x000000cb,
|
||||
0x0005008e,0x00000020,0x000000d5,0x000000d4,0x000000d3,0x00060050,0x00000020,0x000000d6,
|
||||
0x0000000e,0x0000000e,0x0000000e,0x00050081,0x00000020,0x000000d7,0x000000d6,0x000000d5,
|
||||
0x00050088,0x00000020,0x000000d8,0x000000b4,0x000000d7,0x0003003e,0x000000d2,0x000000d8,
|
||||
0x0004003d,0x00000020,0x000000da,0x00000036,0x0004003d,0x00000020,0x000000db,0x0000004d,
|
||||
0x00050081,0x00000020,0x000000dc,0x000000da,0x000000db,0x0004003d,0x00000020,0x000000dd,
|
||||
0x0000005c,0x0004003d,0x00000020,0x000000de,0x00000071,0x00050081,0x00000020,0x000000df,
|
||||
0x000000dd,0x000000de,0x00050081,0x00000020,0x000000e0,0x000000dc,0x000000df,0x0003003e,
|
||||
0x000000d9,0x000000e0,0x0004003d,0x00000020,0x000000e2,0x000000d9,0x0004003d,0x00000020,
|
||||
0x000000e3,0x000000cb,0x00050085,0x00000020,0x000000e4,0x000000e2,0x000000e3,0x0004003d,
|
||||
0x00000020,0x000000e5,0x00000057,0x00050081,0x00000020,0x000000e6,0x000000e4,0x000000e5,
|
||||
0x0004003d,0x00000020,0x000000e7,0x000000d2,0x00050085,0x00000020,0x000000e8,0x000000e6,
|
||||
0x000000e7,0x00060050,0x00000020,0x000000e9,0x00000039,0x00000039,0x00000039,0x00060050,
|
||||
0x00000020,0x000000ea,0x0000000e,0x0000000e,0x0000000e,0x0008000c,0x00000020,0x000000eb,
|
||||
0x00000001,0x0000002b,0x000000e8,0x000000e9,0x000000ea,0x0003003e,0x000000e1,0x000000eb,
|
||||
0x0004003d,0x00000020,0x000000ee,0x000000e1,0x00050051,0x00000006,0x000000ef,0x000000ee,
|
||||
0x00000000,0x00050051,0x00000006,0x000000f0,0x000000ee,0x00000001,0x00050051,0x00000006,
|
||||
0x000000f1,0x000000ee,0x00000002,0x00070050,0x0000000f,0x000000f2,0x000000ef,0x000000f0,
|
||||
0x000000f1,0x0000000e,0x0003003e,0x000000ed,0x000000f2,0x000100fd,0x00010038
|
||||
0x0003003e,0x0000009c,0x000000b2,0x0004003d,0x00000020,0x000000b5,0x0000009c,0x0007000c,
|
||||
0x00000020,0x000000b8,0x00000001,0x00000028,0x000000b5,0x000000b7,0x00050088,0x00000020,
|
||||
0x000000b9,0x000000b4,0x000000b8,0x0003003e,0x000000b3,0x000000b9,0x0004003d,0x00000020,
|
||||
0x000000bb,0x00000085,0x0004003d,0x00000020,0x000000bd,0x0000009c,0x00060050,0x00000020,
|
||||
0x000000be,0x000000bc,0x000000bc,0x000000bc,0x00050083,0x00000020,0x000000bf,0x000000be,
|
||||
0x000000bd,0x0007000c,0x00000020,0x000000c0,0x00000001,0x00000025,0x000000bb,0x000000bf,
|
||||
0x0004003d,0x00000020,0x000000c1,0x000000b3,0x00050085,0x00000020,0x000000c2,0x000000c0,
|
||||
0x000000c1,0x00060050,0x00000020,0x000000c3,0x00000039,0x00000039,0x00000039,0x00060050,
|
||||
0x00000020,0x000000c4,0x0000000e,0x0000000e,0x0000000e,0x0008000c,0x00000020,0x000000c5,
|
||||
0x00000001,0x0000002b,0x000000c2,0x000000c3,0x000000c4,0x0003003e,0x000000ba,0x000000c5,
|
||||
0x0004003d,0x00000006,0x000000c9,0x0000001b,0x00050085,0x00000006,0x000000ca,0x000000c8,
|
||||
0x000000c9,0x00050083,0x00000006,0x000000cb,0x000000c7,0x000000ca,0x0003003e,0x000000c6,
|
||||
0x000000cb,0x0004003d,0x00000020,0x000000cd,0x000000ba,0x0006000c,0x00000020,0x000000ce,
|
||||
0x00000001,0x0000001f,0x000000cd,0x0004007f,0x00000020,0x000000cf,0x000000ce,0x0004003d,
|
||||
0x00000006,0x000000d0,0x000000c6,0x00060050,0x00000020,0x000000d1,0x000000d0,0x000000d0,
|
||||
0x000000d0,0x00050088,0x00000020,0x000000d2,0x000000cf,0x000000d1,0x0003003e,0x000000cc,
|
||||
0x000000d2,0x0004003d,0x00000020,0x000000d5,0x000000cc,0x0005008e,0x00000020,0x000000d6,
|
||||
0x000000d5,0x000000d4,0x00060050,0x00000020,0x000000d7,0x0000000e,0x0000000e,0x0000000e,
|
||||
0x00050081,0x00000020,0x000000d8,0x000000d7,0x000000d6,0x00050088,0x00000020,0x000000d9,
|
||||
0x000000b4,0x000000d8,0x0003003e,0x000000d3,0x000000d9,0x0004003d,0x00000020,0x000000db,
|
||||
0x00000036,0x0004003d,0x00000020,0x000000dc,0x0000004d,0x00050081,0x00000020,0x000000dd,
|
||||
0x000000db,0x000000dc,0x0004003d,0x00000020,0x000000de,0x0000005c,0x0004003d,0x00000020,
|
||||
0x000000df,0x00000071,0x00050081,0x00000020,0x000000e0,0x000000de,0x000000df,0x00050081,
|
||||
0x00000020,0x000000e1,0x000000dd,0x000000e0,0x0003003e,0x000000da,0x000000e1,0x0004003d,
|
||||
0x00000020,0x000000e3,0x000000da,0x0004003d,0x00000020,0x000000e4,0x000000cc,0x00050085,
|
||||
0x00000020,0x000000e5,0x000000e3,0x000000e4,0x0004003d,0x00000020,0x000000e6,0x00000057,
|
||||
0x00050081,0x00000020,0x000000e7,0x000000e5,0x000000e6,0x0004003d,0x00000020,0x000000e8,
|
||||
0x000000d3,0x00050085,0x00000020,0x000000e9,0x000000e7,0x000000e8,0x00060050,0x00000020,
|
||||
0x000000ea,0x00000039,0x00000039,0x00000039,0x00060050,0x00000020,0x000000eb,0x0000000e,
|
||||
0x0000000e,0x0000000e,0x0008000c,0x00000020,0x000000ec,0x00000001,0x0000002b,0x000000e9,
|
||||
0x000000ea,0x000000eb,0x0003003e,0x000000e2,0x000000ec,0x0004003d,0x00000020,0x000000ef,
|
||||
0x000000e2,0x00050051,0x00000006,0x000000f0,0x000000ef,0x00000000,0x00050051,0x00000006,
|
||||
0x000000f1,0x000000ef,0x00000001,0x00050051,0x00000006,0x000000f2,0x000000ef,0x00000002,
|
||||
0x00070050,0x0000000f,0x000000f3,0x000000f0,0x000000f1,0x000000f2,0x0000000e,0x0003003e,
|
||||
0x000000ee,0x000000f3,0x000100fd,0x00010038
|
||||
};
|
||||
@@ -0,0 +1,52 @@
|
||||
#version 450
|
||||
|
||||
// =============================================================================
|
||||
// Color grade (brightness / contrast / saturation / gamma) post effect.
|
||||
//
|
||||
// Ported verbatim from the OpenGL ColorEffect.java shader. The four terms are
|
||||
// prepared CPU-side (planUpscaleFrame) exactly as the GL path does:
|
||||
// brightness = brightnessSlider / 100 clamped to [-1, 1]
|
||||
// contrast = contrastSlider / 100 clamped to [ 0, 2]
|
||||
// saturation = saturationSlider / 100 clamped to [ 0, 2]
|
||||
// gamma = gammaSlider clamped to [0.1, 5]
|
||||
// (the clamps replicate ColorEffectMaterial.use()). Neutral = (0,0,1,1) -> no-op,
|
||||
// matching the GL "remove the effect" check; the chain skips Color when neutral.
|
||||
//
|
||||
// Term ORDER inside this shader is brightness -> contrast -> saturation -> gamma.
|
||||
// Saturation sits after contrast and before gamma deliberately: it mixes towards
|
||||
// Rec.709 luma of the already-graded linear-ish signal, so the greyscale it blends
|
||||
// against is the one the viewer sees, and the gamma curve is still applied last to
|
||||
// the finished colour. ColorEffect.java applies its terms in the same order, so a
|
||||
// Screen Effect "Look" grades identically on the OpenGL and Vulkan renderers.
|
||||
//
|
||||
// Conventions match upscale.vert: combined-image-sampler at binding 0, the
|
||||
// push-constant block leads with vec4 ndc (offset 0), fragTexCoord in [0,1].
|
||||
// `saturation` is APPENDED at the end of the block so the offsets of the three
|
||||
// original terms are unchanged.
|
||||
// Runs after Toon, before CAS in the canonical chain (grade the clean image).
|
||||
// =============================================================================
|
||||
|
||||
layout(binding = 0) uniform sampler2D InputTexture;
|
||||
|
||||
layout(push_constant) uniform PC {
|
||||
vec4 ndc; // quad NDC rect, consumed by upscale.vert (offset 0)
|
||||
float brightness; // additive, [-1, 1]
|
||||
float contrast; // [0, 2]; effective multiplier = clamp(contrast+1, 0.5, 2)
|
||||
float gamma; // [0.1, 5]
|
||||
float saturation; // [0, 2]; 1 = unchanged, 0 = greyscale
|
||||
} pc;
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
void main() {
|
||||
vec4 texelColor = texture(InputTexture, fragTexCoord);
|
||||
vec3 color = texelColor.rgb;
|
||||
color = clamp(color + pc.brightness, 0.0, 1.0);
|
||||
color = (color - 0.5) * clamp(pc.contrast + 1.0, 0.5, 2.0) + 0.5;
|
||||
vec3 grey = vec3(dot(color, vec3(0.2126, 0.7152, 0.0722)));
|
||||
color = mix(grey, color, clamp(pc.saturation, 0.0, 2.0));
|
||||
color = max(color, vec3(0.0));
|
||||
color = pow(color, vec3(1.0 / pc.gamma));
|
||||
outColor = vec4(color, texelColor.a);
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
// 1116.3.0
|
||||
#pragma once
|
||||
const uint32_t color_code[] = {
|
||||
0x07230203,0x00010000,0x0008000b,0x00000059,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x07230203,0x00010000,0x0008000b,0x0000005c,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000011,0x0000004e,0x00030010,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000011,0x00000051,0x00030010,
|
||||
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d,
|
||||
0x00000000,0x00050005,0x00000009,0x65786574,0x6c6f436c,0x0000726f,0x00060005,0x0000000d,
|
||||
0x75706e49,0x78655474,0x65727574,0x00000000,0x00060005,0x00000011,0x67617266,0x43786554,
|
||||
@@ -11,13 +12,13 @@ const uint32_t color_code[] = {
|
||||
0x67697262,0x656e7468,0x00007373,0x00060006,0x0000001a,0x00000002,0x746e6f63,0x74736172,
|
||||
0x00000000,0x00050006,0x0000001a,0x00000003,0x6d6d6167,0x00000061,0x00060006,0x0000001a,
|
||||
0x00000004,0x75746173,0x69746172,0x00006e6f,0x00030005,0x0000001c,0x00006370,0x00040005,
|
||||
0x00000036,0x79657267,0x00000000,0x00050005,0x0000004e,0x4374756f,0x726f6c6f,0x00000000,
|
||||
0x00000036,0x79657267,0x00000000,0x00050005,0x00000051,0x4374756f,0x726f6c6f,0x00000000,
|
||||
0x00040047,0x0000000d,0x00000021,0x00000000,0x00040047,0x0000000d,0x00000022,0x00000000,
|
||||
0x00040047,0x00000011,0x0000001e,0x00000000,0x00030047,0x0000001a,0x00000002,0x00050048,
|
||||
0x0000001a,0x00000000,0x00000023,0x00000000,0x00050048,0x0000001a,0x00000001,0x00000023,
|
||||
0x00000010,0x00050048,0x0000001a,0x00000002,0x00000023,0x00000014,0x00050048,0x0000001a,
|
||||
0x00000003,0x00000023,0x00000018,0x00050048,0x0000001a,0x00000004,0x00000023,0x0000001c,
|
||||
0x00040047,0x0000004e,0x0000001e,0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,
|
||||
0x00040047,0x00000051,0x0000001e,0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,
|
||||
0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000004,
|
||||
0x00040020,0x00000008,0x00000007,0x00000007,0x00090019,0x0000000a,0x00000006,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x0000000b,0x0000000a,
|
||||
@@ -33,43 +34,46 @@ const uint32_t color_code[] = {
|
||||
0x00000006,0x00000031,0x40000000,0x0004002b,0x00000006,0x00000038,0x3e59b3d0,0x0004002b,
|
||||
0x00000006,0x00000039,0x3f371759,0x0004002b,0x00000006,0x0000003a,0x3d93dd98,0x0006002c,
|
||||
0x00000014,0x0000003b,0x00000038,0x00000039,0x0000003a,0x0004002b,0x0000001d,0x00000040,
|
||||
0x00000004,0x0004002b,0x0000001d,0x00000047,0x00000003,0x00040020,0x0000004d,0x00000003,
|
||||
0x00000007,0x0004003b,0x0000004d,0x0000004e,0x00000003,0x00040015,0x00000050,0x00000020,
|
||||
0x00000000,0x0004002b,0x00000050,0x00000051,0x00000003,0x00040020,0x00000052,0x00000007,
|
||||
0x00000006,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,
|
||||
0x0004003b,0x00000008,0x00000009,0x00000007,0x0004003b,0x00000015,0x00000016,0x00000007,
|
||||
0x0004003b,0x00000015,0x00000036,0x00000007,0x0004003d,0x0000000b,0x0000000e,0x0000000d,
|
||||
0x0004003d,0x0000000f,0x00000012,0x00000011,0x00050057,0x00000007,0x00000013,0x0000000e,
|
||||
0x00000012,0x0003003e,0x00000009,0x00000013,0x0004003d,0x00000007,0x00000017,0x00000009,
|
||||
0x0008004f,0x00000014,0x00000018,0x00000017,0x00000017,0x00000000,0x00000001,0x00000002,
|
||||
0x0003003e,0x00000016,0x00000018,0x0004003d,0x00000014,0x00000019,0x00000016,0x00050041,
|
||||
0x0000001f,0x00000020,0x0000001c,0x0000001e,0x0004003d,0x00000006,0x00000021,0x00000020,
|
||||
0x00060050,0x00000014,0x00000022,0x00000021,0x00000021,0x00000021,0x00050081,0x00000014,
|
||||
0x00000023,0x00000019,0x00000022,0x00060050,0x00000014,0x00000026,0x00000024,0x00000024,
|
||||
0x00000024,0x00060050,0x00000014,0x00000027,0x00000025,0x00000025,0x00000025,0x0008000c,
|
||||
0x00000014,0x00000028,0x00000001,0x0000002b,0x00000023,0x00000026,0x00000027,0x0003003e,
|
||||
0x00000016,0x00000028,0x0004003d,0x00000014,0x00000029,0x00000016,0x00060050,0x00000014,
|
||||
0x0000002b,0x0000002a,0x0000002a,0x0000002a,0x00050083,0x00000014,0x0000002c,0x00000029,
|
||||
0x0000002b,0x00050041,0x0000001f,0x0000002e,0x0000001c,0x0000002d,0x0004003d,0x00000006,
|
||||
0x0000002f,0x0000002e,0x00050081,0x00000006,0x00000030,0x0000002f,0x00000025,0x0008000c,
|
||||
0x00000006,0x00000032,0x00000001,0x0000002b,0x00000030,0x0000002a,0x00000031,0x0005008e,
|
||||
0x00000014,0x00000033,0x0000002c,0x00000032,0x00060050,0x00000014,0x00000034,0x0000002a,
|
||||
0x0000002a,0x0000002a,0x00050081,0x00000014,0x00000035,0x00000033,0x00000034,0x0003003e,
|
||||
0x00000016,0x00000035,0x0004003d,0x00000014,0x00000037,0x00000016,0x00050094,0x00000006,
|
||||
0x0000003c,0x00000037,0x0000003b,0x00060050,0x00000014,0x0000003d,0x0000003c,0x0000003c,
|
||||
0x0000003c,0x0003003e,0x00000036,0x0000003d,0x0004003d,0x00000014,0x0000003e,0x00000036,
|
||||
0x0004003d,0x00000014,0x0000003f,0x00000016,0x00050041,0x0000001f,0x00000041,0x0000001c,
|
||||
0x00000040,0x0004003d,0x00000006,0x00000042,0x00000041,0x0008000c,0x00000006,0x00000043,
|
||||
0x00000001,0x0000002b,0x00000042,0x00000024,0x00000031,0x00060050,0x00000014,0x00000044,
|
||||
0x00000043,0x00000043,0x00000043,0x0008000c,0x00000014,0x00000045,0x00000001,0x0000002e,
|
||||
0x0000003e,0x0000003f,0x00000044,0x0003003e,0x00000016,0x00000045,0x0004003d,0x00000014,
|
||||
0x00000046,0x00000016,0x00050041,0x0000001f,0x00000048,0x0000001c,0x00000047,0x0004003d,
|
||||
0x00000006,0x00000049,0x00000048,0x00050088,0x00000006,0x0000004a,0x00000025,0x00000049,
|
||||
0x00060050,0x00000014,0x0000004b,0x0000004a,0x0000004a,0x0000004a,0x0007000c,0x00000014,
|
||||
0x0000004c,0x00000001,0x0000001a,0x00000046,0x0000004b,0x0003003e,0x00000016,0x0000004c,
|
||||
0x0004003d,0x00000014,0x0000004f,0x00000016,0x00050041,0x00000052,0x00000053,0x00000009,
|
||||
0x00000051,0x0004003d,0x00000006,0x00000054,0x00000053,0x00050051,0x00000006,0x00000055,
|
||||
0x0000004f,0x00000000,0x00050051,0x00000006,0x00000056,0x0000004f,0x00000001,0x00050051,
|
||||
0x00000006,0x00000057,0x0000004f,0x00000002,0x00070050,0x00000007,0x00000058,0x00000055,
|
||||
0x00000056,0x00000057,0x00000054,0x0003003e,0x0000004e,0x00000058,0x000100fd,0x00010038
|
||||
0x00000004,0x0006002c,0x00000014,0x00000047,0x00000024,0x00000024,0x00000024,0x0004002b,
|
||||
0x0000001d,0x0000004a,0x00000003,0x00040020,0x00000050,0x00000003,0x00000007,0x0004003b,
|
||||
0x00000050,0x00000051,0x00000003,0x00040015,0x00000053,0x00000020,0x00000000,0x0004002b,
|
||||
0x00000053,0x00000054,0x00000003,0x00040020,0x00000055,0x00000007,0x00000006,0x00050036,
|
||||
0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,0x00000008,
|
||||
0x00000009,0x00000007,0x0004003b,0x00000015,0x00000016,0x00000007,0x0004003b,0x00000015,
|
||||
0x00000036,0x00000007,0x0004003d,0x0000000b,0x0000000e,0x0000000d,0x0004003d,0x0000000f,
|
||||
0x00000012,0x00000011,0x00050057,0x00000007,0x00000013,0x0000000e,0x00000012,0x0003003e,
|
||||
0x00000009,0x00000013,0x0004003d,0x00000007,0x00000017,0x00000009,0x0008004f,0x00000014,
|
||||
0x00000018,0x00000017,0x00000017,0x00000000,0x00000001,0x00000002,0x0003003e,0x00000016,
|
||||
0x00000018,0x0004003d,0x00000014,0x00000019,0x00000016,0x00050041,0x0000001f,0x00000020,
|
||||
0x0000001c,0x0000001e,0x0004003d,0x00000006,0x00000021,0x00000020,0x00060050,0x00000014,
|
||||
0x00000022,0x00000021,0x00000021,0x00000021,0x00050081,0x00000014,0x00000023,0x00000019,
|
||||
0x00000022,0x00060050,0x00000014,0x00000026,0x00000024,0x00000024,0x00000024,0x00060050,
|
||||
0x00000014,0x00000027,0x00000025,0x00000025,0x00000025,0x0008000c,0x00000014,0x00000028,
|
||||
0x00000001,0x0000002b,0x00000023,0x00000026,0x00000027,0x0003003e,0x00000016,0x00000028,
|
||||
0x0004003d,0x00000014,0x00000029,0x00000016,0x00060050,0x00000014,0x0000002b,0x0000002a,
|
||||
0x0000002a,0x0000002a,0x00050083,0x00000014,0x0000002c,0x00000029,0x0000002b,0x00050041,
|
||||
0x0000001f,0x0000002e,0x0000001c,0x0000002d,0x0004003d,0x00000006,0x0000002f,0x0000002e,
|
||||
0x00050081,0x00000006,0x00000030,0x0000002f,0x00000025,0x0008000c,0x00000006,0x00000032,
|
||||
0x00000001,0x0000002b,0x00000030,0x0000002a,0x00000031,0x0005008e,0x00000014,0x00000033,
|
||||
0x0000002c,0x00000032,0x00060050,0x00000014,0x00000034,0x0000002a,0x0000002a,0x0000002a,
|
||||
0x00050081,0x00000014,0x00000035,0x00000033,0x00000034,0x0003003e,0x00000016,0x00000035,
|
||||
0x0004003d,0x00000014,0x00000037,0x00000016,0x00050094,0x00000006,0x0000003c,0x00000037,
|
||||
0x0000003b,0x00060050,0x00000014,0x0000003d,0x0000003c,0x0000003c,0x0000003c,0x0003003e,
|
||||
0x00000036,0x0000003d,0x0004003d,0x00000014,0x0000003e,0x00000036,0x0004003d,0x00000014,
|
||||
0x0000003f,0x00000016,0x00050041,0x0000001f,0x00000041,0x0000001c,0x00000040,0x0004003d,
|
||||
0x00000006,0x00000042,0x00000041,0x0008000c,0x00000006,0x00000043,0x00000001,0x0000002b,
|
||||
0x00000042,0x00000024,0x00000031,0x00060050,0x00000014,0x00000044,0x00000043,0x00000043,
|
||||
0x00000043,0x0008000c,0x00000014,0x00000045,0x00000001,0x0000002e,0x0000003e,0x0000003f,
|
||||
0x00000044,0x0003003e,0x00000016,0x00000045,0x0004003d,0x00000014,0x00000046,0x00000016,
|
||||
0x0007000c,0x00000014,0x00000048,0x00000001,0x00000028,0x00000046,0x00000047,0x0003003e,
|
||||
0x00000016,0x00000048,0x0004003d,0x00000014,0x00000049,0x00000016,0x00050041,0x0000001f,
|
||||
0x0000004b,0x0000001c,0x0000004a,0x0004003d,0x00000006,0x0000004c,0x0000004b,0x00050088,
|
||||
0x00000006,0x0000004d,0x00000025,0x0000004c,0x00060050,0x00000014,0x0000004e,0x0000004d,
|
||||
0x0000004d,0x0000004d,0x0007000c,0x00000014,0x0000004f,0x00000001,0x0000001a,0x00000049,
|
||||
0x0000004e,0x0003003e,0x00000016,0x0000004f,0x0004003d,0x00000014,0x00000052,0x00000016,
|
||||
0x00050041,0x00000055,0x00000056,0x00000009,0x00000054,0x0004003d,0x00000006,0x00000057,
|
||||
0x00000056,0x00050051,0x00000006,0x00000058,0x00000052,0x00000000,0x00050051,0x00000006,
|
||||
0x00000059,0x00000052,0x00000001,0x00050051,0x00000006,0x0000005a,0x00000052,0x00000002,
|
||||
0x00070050,0x00000007,0x0000005b,0x00000058,0x00000059,0x0000005a,0x00000057,0x0003003e,
|
||||
0x00000051,0x0000005b,0x000100fd,0x00010038
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
#version 450
|
||||
|
||||
// =============================================================================
|
||||
// CRT (chromatic aberration + scanlines) post effect.
|
||||
//
|
||||
// Ported verbatim from the OpenGL CRTEffect.java shader. GL sampled with the
|
||||
// varying vUV; here fragTexCoord IS that uv. All constants unchanged. Runs LAST
|
||||
// in the canonical chain (the physical tube emulation, after NTSC's analog
|
||||
// signal). Does not need the resolution, but the PC carries it for a uniform
|
||||
// effect-PC layout.
|
||||
//
|
||||
// Conventions match upscale.vert: combined-image-sampler at binding 0, the
|
||||
// push-constant block leads with vec4 ndc (offset 0), fragTexCoord in [0,1].
|
||||
// =============================================================================
|
||||
|
||||
layout(binding = 0) uniform sampler2D InputTexture;
|
||||
|
||||
layout(push_constant) uniform PC {
|
||||
vec4 ndc; // quad NDC rect, consumed by upscale.vert (offset 0)
|
||||
vec2 resolution; // input texture size in px (unused; layout uniformity)
|
||||
} pc;
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
#define CA_AMOUNT 1.0025
|
||||
#define SCANLINE_INTENSITY_X 0.125
|
||||
#define SCANLINE_INTENSITY_Y 0.375
|
||||
#define SCANLINE_SIZE 1024.0
|
||||
|
||||
void main() {
|
||||
vec2 vUV = fragTexCoord;
|
||||
vec4 finalColor = texture(InputTexture, vUV);
|
||||
finalColor.rgb = vec3(
|
||||
texture(InputTexture, (vUV - 0.5) * CA_AMOUNT + 0.5).r,
|
||||
finalColor.g,
|
||||
texture(InputTexture, (vUV - 0.5) / CA_AMOUNT + 0.5).b
|
||||
);
|
||||
float scanlineX = abs(sin(vUV.x * SCANLINE_SIZE) * 0.5 * SCANLINE_INTENSITY_X);
|
||||
float scanlineY = abs(sin(vUV.y * SCANLINE_SIZE) * 0.5 * SCANLINE_INTENSITY_Y);
|
||||
outColor = vec4(mix(finalColor.rgb, vec3(0.0), scanlineX + scanlineY), finalColor.a);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
#version 450
|
||||
|
||||
// =============================================================================
|
||||
// Debanding / dither - terminal post pass.
|
||||
//
|
||||
// Adds sub-LSB triangular-PDF (TPDF) noise just before the final 8-bit
|
||||
// swapchain quantization, so smooth gradients (dark skies, fog, bloom
|
||||
// falloff, vignettes) stop showing 8-bit "stair-step" banding. Especially
|
||||
// visible on AMOLED panels in dark scenes.
|
||||
//
|
||||
// This is the LAST pass in the effect chain and always writes the swapchain,
|
||||
// so the dither matches the display quantizer. The whole compositor chain is
|
||||
// R8G8B8A8_UNORM and the swapchain has no _SRGB view, i.e. values are already
|
||||
// display(gamma)-encoded here - so we dither in display space, ~1 LSB = 1/255,
|
||||
// which is where AMOLED banding is worst (the darks).
|
||||
//
|
||||
// Noise = interleaved gradient noise (Jimenez 2014, public technique), two
|
||||
// screen-locked samples summed for a triangular PDF (flat noise spectrum, no
|
||||
// DC bias). Screen-locked (gl_FragCoord) so the pattern is static = no shimmer.
|
||||
// Float-only hash (no floatBitsToInt / bvec / bitwise) = Adreno-compile-safe.
|
||||
//
|
||||
// Conventions match upscale.vert / cas.frag: combined-image-sampler at binding
|
||||
// 0, push-constant block leads with vec4 ndc (offset 0), fragTexCoord in [0,1].
|
||||
//
|
||||
// CPU side (planUpscaleFrame) maps the UI strength slider to LSB units:
|
||||
// strength = slider / 100 (slider 100 -> 1.0 LSB, the default)
|
||||
// =============================================================================
|
||||
|
||||
layout(binding = 0) uniform sampler2D InputTexture;
|
||||
|
||||
layout(push_constant) uniform PC {
|
||||
vec4 ndc; // quad NDC rect, consumed by upscale.vert (offset 0)
|
||||
vec2 resolution; // input texture size in pixels (unused here, kept for layout parity)
|
||||
float strength; // dither amplitude in LSBs (1.0 = +/-1/255 triangular)
|
||||
} pc;
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
// Interleaved gradient noise - returns [0,1), float-only, Adreno-safe.
|
||||
float ign(vec2 p) {
|
||||
return fract(52.9829189 * fract(dot(p, vec2(0.06711056, 0.00583715))));
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec3 col = texture(InputTexture, fragTexCoord).rgb;
|
||||
|
||||
// Two decorrelated samples -> triangular PDF in (-1, 1).
|
||||
float n1 = ign(gl_FragCoord.xy);
|
||||
float n2 = ign(gl_FragCoord.xy + vec2(11.0, 17.0));
|
||||
float tri = (n1 + n2) - 1.0;
|
||||
|
||||
col += vec3(tri * (pc.strength / 255.0));
|
||||
|
||||
outColor = vec4(col, 1.0);
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
#version 450
|
||||
|
||||
// =============================================================================
|
||||
// AMD FidelityFX Super Resolution 1.0 - EASU (Edge-Adaptive Spatial Upsampling).
|
||||
//
|
||||
// Algorithm (FsrEasuF / FsrEasuTapF / FsrEasuSetF) ported verbatim from AMD's
|
||||
// reference header: GPUOpen-Effects/FidelityFX-FSR ffx-fsr/ffx_fsr1.h
|
||||
//
|
||||
// Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
//
|
||||
// Full license text is included in THIRD_PARTY_NOTICES.txt and packaged
|
||||
// in the APK at assets/licenses/graphics/THIRD_PARTY_NOTICES.txt.
|
||||
//
|
||||
// Adapted for the Winlator native Vulkan compositor:
|
||||
// - fp32-only path (the AF1/AU1 portability macros below replace ffx_a.h)
|
||||
// - con0..con3 are computed CPU-side (FsrEasuCon) and delivered via push const
|
||||
// - output pixel position comes from window.vert's fragTexCoord * outputSize
|
||||
// - input sampled via textureGather on a CLAMP_TO_EDGE / linear sampler
|
||||
// =============================================================================
|
||||
|
||||
// ---- minimal ffx_a.h fp32 portability layer -------------------------------
|
||||
#define AF1 float
|
||||
#define AF2 vec2
|
||||
#define AF3 vec3
|
||||
#define AF4 vec4
|
||||
#define AU1 uint
|
||||
#define AU2 uvec2
|
||||
#define AU4 uvec4
|
||||
#define ASU2 ivec2
|
||||
#define AP1 bool
|
||||
#define AF1_(a) float(a)
|
||||
#define AF2_(a) vec2(AF1_(a))
|
||||
#define AF3_(a) vec3(AF1_(a))
|
||||
#define AF4_(a) vec4(AF1_(a))
|
||||
#define AF2_AU2(x) uintBitsToFloat(uvec2(x))
|
||||
#define AF1_AU1(x) uintBitsToFloat(uint(x))
|
||||
float ARcpF1(float x) { return 1.0 / x; }
|
||||
float APrxLoRcpF1(float x) { return 1.0 / x; }
|
||||
float APrxMedRcpF1(float x){ return 1.0 / x; }
|
||||
float APrxLoRsqF1(float x) { return inversesqrt(x); }
|
||||
float ASatF1(float x) { return clamp(x, 0.0, 1.0); }
|
||||
vec3 AMin3F3(vec3 a, vec3 b, vec3 c) { return min(a, min(b, c)); }
|
||||
vec3 AMax3F3(vec3 a, vec3 b, vec3 c) { return max(a, max(b, c)); }
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
layout(binding = 0) uniform sampler2D InputTexture;
|
||||
|
||||
layout(push_constant) uniform PC {
|
||||
vec4 ndc; // quad NDC rect, consumed by window.vert (offset 0)
|
||||
uvec4 con0;
|
||||
uvec4 con1;
|
||||
uvec4 con2;
|
||||
uvec4 con3;
|
||||
vec2 outputSize; // EASU output (this pass's render-target) size in pixels
|
||||
} pc;
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
AF4 FsrEasuRF(AF2 p) { return textureGather(InputTexture, p, 0); }
|
||||
AF4 FsrEasuGF(AF2 p) { return textureGather(InputTexture, p, 1); }
|
||||
AF4 FsrEasuBF(AF2 p) { return textureGather(InputTexture, p, 2); }
|
||||
|
||||
void FsrEasuTapF(
|
||||
inout AF3 aC,
|
||||
inout AF1 aW,
|
||||
AF2 off,
|
||||
AF2 dir,
|
||||
AF2 len,
|
||||
AF1 lob,
|
||||
AF1 clp,
|
||||
AF3 c){
|
||||
AF2 v;
|
||||
v.x=(off.x*( dir.x))+(off.y*dir.y);
|
||||
v.y=(off.x*(-dir.y))+(off.y*dir.x);
|
||||
v*=len;
|
||||
AF1 d2=v.x*v.x+v.y*v.y;
|
||||
d2=min(d2,clp);
|
||||
AF1 wB=AF1_(2.0/5.0)*d2+AF1_(-1.0);
|
||||
AF1 wA=lob*d2+AF1_(-1.0);
|
||||
wB*=wB;
|
||||
wA*=wA;
|
||||
wB=AF1_(25.0/16.0)*wB+AF1_(-(25.0/16.0-1.0));
|
||||
AF1 w=wB*wA;
|
||||
aC+=c*w;aW+=w;}
|
||||
|
||||
void FsrEasuSetF(
|
||||
inout AF2 dir,
|
||||
inout AF1 len,
|
||||
AF2 pp,
|
||||
AP1 biS,AP1 biT,AP1 biU,AP1 biV,
|
||||
AF1 lA,AF1 lB,AF1 lC,AF1 lD,AF1 lE){
|
||||
AF1 w = AF1_(0.0);
|
||||
if(biS)w=(AF1_(1.0)-pp.x)*(AF1_(1.0)-pp.y);
|
||||
if(biT)w= pp.x *(AF1_(1.0)-pp.y);
|
||||
if(biU)w=(AF1_(1.0)-pp.x)* pp.y ;
|
||||
if(biV)w= pp.x * pp.y ;
|
||||
AF1 dc=lD-lC;
|
||||
AF1 cb=lC-lB;
|
||||
AF1 lenX=max(abs(dc),abs(cb));
|
||||
lenX=lenX>0.0?APrxLoRcpF1(lenX):AF1_(0.0);
|
||||
AF1 dirX=lD-lB;
|
||||
dir.x+=dirX*w;
|
||||
lenX=ASatF1(abs(dirX)*lenX);
|
||||
lenX*=lenX;
|
||||
len+=lenX*w;
|
||||
AF1 ec=lE-lC;
|
||||
AF1 ca=lC-lA;
|
||||
AF1 lenY=max(abs(ec),abs(ca));
|
||||
lenY=lenY>0.0?APrxLoRcpF1(lenY):AF1_(0.0);
|
||||
AF1 dirY=lE-lA;
|
||||
dir.y+=dirY*w;
|
||||
lenY=ASatF1(abs(dirY)*lenY);
|
||||
lenY*=lenY;
|
||||
len+=lenY*w;}
|
||||
|
||||
void FsrEasuF(
|
||||
out AF3 pix,
|
||||
AU2 ip,
|
||||
AU4 con0,
|
||||
AU4 con1,
|
||||
AU4 con2,
|
||||
AU4 con3){
|
||||
AF2 pp=AF2(ip)*AF2_AU2(con0.xy)+AF2_AU2(con0.zw);
|
||||
AF2 fp=floor(pp);
|
||||
pp-=fp;
|
||||
AF2 p0=fp*AF2_AU2(con1.xy)+AF2_AU2(con1.zw);
|
||||
AF2 p1=p0+AF2_AU2(con2.xy);
|
||||
AF2 p2=p0+AF2_AU2(con2.zw);
|
||||
AF2 p3=p0+AF2_AU2(con3.xy);
|
||||
AF4 bczzR=FsrEasuRF(p0);
|
||||
AF4 bczzG=FsrEasuGF(p0);
|
||||
AF4 bczzB=FsrEasuBF(p0);
|
||||
AF4 ijfeR=FsrEasuRF(p1);
|
||||
AF4 ijfeG=FsrEasuGF(p1);
|
||||
AF4 ijfeB=FsrEasuBF(p1);
|
||||
AF4 klhgR=FsrEasuRF(p2);
|
||||
AF4 klhgG=FsrEasuGF(p2);
|
||||
AF4 klhgB=FsrEasuBF(p2);
|
||||
AF4 zzonR=FsrEasuRF(p3);
|
||||
AF4 zzonG=FsrEasuGF(p3);
|
||||
AF4 zzonB=FsrEasuBF(p3);
|
||||
AF4 bczzL=bczzB*AF4_(0.5)+(bczzR*AF4_(0.5)+bczzG);
|
||||
AF4 ijfeL=ijfeB*AF4_(0.5)+(ijfeR*AF4_(0.5)+ijfeG);
|
||||
AF4 klhgL=klhgB*AF4_(0.5)+(klhgR*AF4_(0.5)+klhgG);
|
||||
AF4 zzonL=zzonB*AF4_(0.5)+(zzonR*AF4_(0.5)+zzonG);
|
||||
AF1 bL=bczzL.x;
|
||||
AF1 cL=bczzL.y;
|
||||
AF1 iL=ijfeL.x;
|
||||
AF1 jL=ijfeL.y;
|
||||
AF1 fL=ijfeL.z;
|
||||
AF1 eL=ijfeL.w;
|
||||
AF1 kL=klhgL.x;
|
||||
AF1 lL=klhgL.y;
|
||||
AF1 hL=klhgL.z;
|
||||
AF1 gL=klhgL.w;
|
||||
AF1 oL=zzonL.z;
|
||||
AF1 nL=zzonL.w;
|
||||
AF2 dir=AF2_(0.0);
|
||||
AF1 len=AF1_(0.0);
|
||||
FsrEasuSetF(dir,len,pp,true, false,false,false,bL,eL,fL,gL,jL);
|
||||
FsrEasuSetF(dir,len,pp,false,true ,false,false,cL,fL,gL,hL,kL);
|
||||
FsrEasuSetF(dir,len,pp,false,false,true ,false,fL,iL,jL,kL,nL);
|
||||
FsrEasuSetF(dir,len,pp,false,false,false,true ,gL,jL,kL,lL,oL);
|
||||
AF2 dir2=dir*dir;
|
||||
AF1 dirR=dir2.x+dir2.y;
|
||||
AP1 zro=dirR<AF1_(1.0/32768.0);
|
||||
dirR=APrxLoRsqF1(dirR);
|
||||
dirR=zro?AF1_(1.0):dirR;
|
||||
dir.x=zro?AF1_(1.0):dir.x;
|
||||
dir*=AF2_(dirR);
|
||||
len=len*AF1_(0.5);
|
||||
len*=len;
|
||||
AF1 stretch=(dir.x*dir.x+dir.y*dir.y)*APrxLoRcpF1(max(abs(dir.x),abs(dir.y)));
|
||||
AF2 len2=AF2(AF1_(1.0)+(stretch-AF1_(1.0))*len,AF1_(1.0)+AF1_(-0.5)*len);
|
||||
AF1 lob=AF1_(0.5)+AF1_((1.0/4.0-0.04)-0.5)*len;
|
||||
AF1 clp=APrxLoRcpF1(lob);
|
||||
AF3 min4=min(AMin3F3(AF3(ijfeR.z,ijfeG.z,ijfeB.z),AF3(klhgR.w,klhgG.w,klhgB.w),AF3(ijfeR.y,ijfeG.y,ijfeB.y)),
|
||||
AF3(klhgR.x,klhgG.x,klhgB.x));
|
||||
AF3 max4=max(AMax3F3(AF3(ijfeR.z,ijfeG.z,ijfeB.z),AF3(klhgR.w,klhgG.w,klhgB.w),AF3(ijfeR.y,ijfeG.y,ijfeB.y)),
|
||||
AF3(klhgR.x,klhgG.x,klhgB.x));
|
||||
AF3 aC=AF3_(0.0);
|
||||
AF1 aW=AF1_(0.0);
|
||||
FsrEasuTapF(aC,aW,AF2( 0.0,-1.0)-pp,dir,len2,lob,clp,AF3(bczzR.x,bczzG.x,bczzB.x));
|
||||
FsrEasuTapF(aC,aW,AF2( 1.0,-1.0)-pp,dir,len2,lob,clp,AF3(bczzR.y,bczzG.y,bczzB.y));
|
||||
FsrEasuTapF(aC,aW,AF2(-1.0, 1.0)-pp,dir,len2,lob,clp,AF3(ijfeR.x,ijfeG.x,ijfeB.x));
|
||||
FsrEasuTapF(aC,aW,AF2( 0.0, 1.0)-pp,dir,len2,lob,clp,AF3(ijfeR.y,ijfeG.y,ijfeB.y));
|
||||
FsrEasuTapF(aC,aW,AF2( 0.0, 0.0)-pp,dir,len2,lob,clp,AF3(ijfeR.z,ijfeG.z,ijfeB.z));
|
||||
FsrEasuTapF(aC,aW,AF2(-1.0, 0.0)-pp,dir,len2,lob,clp,AF3(ijfeR.w,ijfeG.w,ijfeB.w));
|
||||
FsrEasuTapF(aC,aW,AF2( 1.0, 1.0)-pp,dir,len2,lob,clp,AF3(klhgR.x,klhgG.x,klhgB.x));
|
||||
FsrEasuTapF(aC,aW,AF2( 2.0, 1.0)-pp,dir,len2,lob,clp,AF3(klhgR.y,klhgG.y,klhgB.y));
|
||||
FsrEasuTapF(aC,aW,AF2( 2.0, 0.0)-pp,dir,len2,lob,clp,AF3(klhgR.z,klhgG.z,klhgB.z));
|
||||
FsrEasuTapF(aC,aW,AF2( 1.0, 0.0)-pp,dir,len2,lob,clp,AF3(klhgR.w,klhgG.w,klhgB.w));
|
||||
FsrEasuTapF(aC,aW,AF2( 1.0, 2.0)-pp,dir,len2,lob,clp,AF3(zzonR.z,zzonG.z,zzonB.z));
|
||||
FsrEasuTapF(aC,aW,AF2( 0.0, 2.0)-pp,dir,len2,lob,clp,AF3(zzonR.w,zzonG.w,zzonB.w));
|
||||
pix=min(max4,max(min4,aC*AF3_(ARcpF1(aW))));}
|
||||
|
||||
void main() {
|
||||
uvec2 ip = uvec2(fragTexCoord * pc.outputSize);
|
||||
vec3 c;
|
||||
FsrEasuF(c, ip, pc.con0, pc.con1, pc.con2, pc.con3);
|
||||
outColor = vec4(c, 1.0);
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,134 @@
|
||||
#version 450
|
||||
|
||||
// =============================================================================
|
||||
// AMD FidelityFX Super Resolution 1.0 - RCAS (Robust Contrast-Adaptive Sharpen).
|
||||
//
|
||||
// Algorithm (FsrRcasF) ported verbatim from AMD's reference header:
|
||||
// GPUOpen-Effects/FidelityFX-FSR ffx-fsr/ffx_fsr1.h
|
||||
//
|
||||
// Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
//
|
||||
// Full license text is included in THIRD_PARTY_NOTICES.txt and packaged
|
||||
// in the APK at assets/licenses/graphics/THIRD_PARTY_NOTICES.txt.
|
||||
//
|
||||
// Adapted for the Winlator native Vulkan compositor:
|
||||
// - fp32-only path (the AF1/AU1 portability macros below replace ffx_a.h)
|
||||
// - the sharpness constant is computed CPU-side (FsrRcasCon) -> push const con
|
||||
// - input is the EASU output (already at output resolution), read 1:1 via
|
||||
// texelFetch with edge clamping for robustness
|
||||
// =============================================================================
|
||||
|
||||
// ---- minimal ffx_a.h fp32 portability layer -------------------------------
|
||||
#define AF1 float
|
||||
#define AF2 vec2
|
||||
#define AF3 vec3
|
||||
#define AF4 vec4
|
||||
#define AU2 uvec2
|
||||
#define AU4 uvec4
|
||||
#define ASU2 ivec2
|
||||
#define AF1_(a) float(a)
|
||||
#define AF1_AU1(x) uintBitsToFloat(uint(x))
|
||||
float ARcpF1(float x) { return 1.0 / x; }
|
||||
float APrxMedRcpF1(float x){ return 1.0 / x; }
|
||||
float ASatF1(float x) { return clamp(x, 0.0, 1.0); }
|
||||
float AMin3F1(float a, float b, float c) { return min(a, min(b, c)); }
|
||||
float AMax3F1(float a, float b, float c) { return max(a, max(b, c)); }
|
||||
#define FSR_RCAS_LIMIT (0.25 - (1.0 / 16.0))
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
layout(binding = 0) uniform sampler2D InputTexture; // EASU output, output res
|
||||
|
||||
layout(push_constant) uniform PC {
|
||||
vec4 ndc; // quad NDC rect, consumed by window.vert (offset 0)
|
||||
uvec4 con; // con.x = bit-packed sharpness (FsrRcasCon)
|
||||
vec2 outputSize; // pass output size in pixels
|
||||
} pc;
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
AF4 FsrRcasLoadF(ASU2 p) {
|
||||
ivec2 sz = textureSize(InputTexture, 0);
|
||||
return texelFetch(InputTexture, clamp(p, ivec2(0), sz - ivec2(1)), 0);
|
||||
}
|
||||
void FsrRcasInputF(inout AF1 r, inout AF1 g, inout AF1 b) {}
|
||||
|
||||
void FsrRcasF(
|
||||
out AF1 pixR,
|
||||
out AF1 pixG,
|
||||
out AF1 pixB,
|
||||
AU2 ip,
|
||||
AU4 con){
|
||||
ASU2 sp=ASU2(ip);
|
||||
AF3 b=FsrRcasLoadF(sp+ASU2( 0,-1)).rgb;
|
||||
AF3 d=FsrRcasLoadF(sp+ASU2(-1, 0)).rgb;
|
||||
AF3 e=FsrRcasLoadF(sp).rgb;
|
||||
AF3 f=FsrRcasLoadF(sp+ASU2( 1, 0)).rgb;
|
||||
AF3 h=FsrRcasLoadF(sp+ASU2( 0, 1)).rgb;
|
||||
AF1 bR=b.r;
|
||||
AF1 bG=b.g;
|
||||
AF1 bB=b.b;
|
||||
AF1 dR=d.r;
|
||||
AF1 dG=d.g;
|
||||
AF1 dB=d.b;
|
||||
AF1 eR=e.r;
|
||||
AF1 eG=e.g;
|
||||
AF1 eB=e.b;
|
||||
AF1 fR=f.r;
|
||||
AF1 fG=f.g;
|
||||
AF1 fB=f.b;
|
||||
AF1 hR=h.r;
|
||||
AF1 hG=h.g;
|
||||
AF1 hB=h.b;
|
||||
FsrRcasInputF(bR,bG,bB);
|
||||
FsrRcasInputF(dR,dG,dB);
|
||||
FsrRcasInputF(eR,eG,eB);
|
||||
FsrRcasInputF(fR,fG,fB);
|
||||
FsrRcasInputF(hR,hG,hB);
|
||||
AF1 bL=bB*AF1_(0.5)+(bR*AF1_(0.5)+bG);
|
||||
AF1 dL=dB*AF1_(0.5)+(dR*AF1_(0.5)+dG);
|
||||
AF1 eL=eB*AF1_(0.5)+(eR*AF1_(0.5)+eG);
|
||||
AF1 fL=fB*AF1_(0.5)+(fR*AF1_(0.5)+fG);
|
||||
AF1 hL=hB*AF1_(0.5)+(hR*AF1_(0.5)+hG);
|
||||
AF1 nz=AF1_(0.25)*bL+AF1_(0.25)*dL+AF1_(0.25)*fL+AF1_(0.25)*hL-eL;
|
||||
nz=ASatF1(abs(nz)*APrxMedRcpF1(AMax3F1(AMax3F1(bL,dL,eL),fL,hL)-AMin3F1(AMin3F1(bL,dL,eL),fL,hL)));
|
||||
nz=AF1_(-0.5)*nz+AF1_(1.0);
|
||||
AF1 mn4R=min(AMin3F1(bR,dR,fR),hR);
|
||||
AF1 mn4G=min(AMin3F1(bG,dG,fG),hG);
|
||||
AF1 mn4B=min(AMin3F1(bB,dB,fB),hB);
|
||||
AF1 mx4R=max(AMax3F1(bR,dR,fR),hR);
|
||||
AF1 mx4G=max(AMax3F1(bG,dG,fG),hG);
|
||||
AF1 mx4B=max(AMax3F1(bB,dB,fB),hB);
|
||||
AF2 peakC=AF2(1.0,-1.0*4.0);
|
||||
AF1 denMinR=AF1_(4.0)*mx4R;
|
||||
AF1 denMinG=AF1_(4.0)*mx4G;
|
||||
AF1 denMinB=AF1_(4.0)*mx4B;
|
||||
AF1 denMaxR=AF1_(4.0)*mn4R+peakC.y;
|
||||
AF1 denMaxG=AF1_(4.0)*mn4G+peakC.y;
|
||||
AF1 denMaxB=AF1_(4.0)*mn4B+peakC.y;
|
||||
AF1 hitMinR=denMinR>0.0?min(mn4R,eR)/denMinR:AF1_(0.0);
|
||||
AF1 hitMinG=denMinG>0.0?min(mn4G,eG)/denMinG:AF1_(0.0);
|
||||
AF1 hitMinB=denMinB>0.0?min(mn4B,eB)/denMinB:AF1_(0.0);
|
||||
AF1 numMaxR=peakC.x-max(mx4R,eR);
|
||||
AF1 numMaxG=peakC.x-max(mx4G,eG);
|
||||
AF1 numMaxB=peakC.x-max(mx4B,eB);
|
||||
AF1 hitMaxR=abs(denMaxR)>1e-6?numMaxR/denMaxR:AF1_(0.0);
|
||||
AF1 hitMaxG=abs(denMaxG)>1e-6?numMaxG/denMaxG:AF1_(0.0);
|
||||
AF1 hitMaxB=abs(denMaxB)>1e-6?numMaxB/denMaxB:AF1_(0.0);
|
||||
AF1 lobeR=max(-hitMinR,hitMaxR);
|
||||
AF1 lobeG=max(-hitMinG,hitMaxG);
|
||||
AF1 lobeB=max(-hitMinB,hitMaxB);
|
||||
AF1 lobe=max(AF1_(-FSR_RCAS_LIMIT),min(AMax3F1(lobeR,lobeG,lobeB),AF1_(0.0)))*AF1_AU1(con.x);
|
||||
AF1 rcpL=APrxMedRcpF1(AF1_(4.0)*lobe+AF1_(1.0));
|
||||
pixR=(lobe*bR+lobe*dR+lobe*hR+lobe*fR+eR)*rcpL;
|
||||
pixG=(lobe*bG+lobe*dG+lobe*hG+lobe*fG+eG)*rcpL;
|
||||
pixB=(lobe*bB+lobe*dB+lobe*hB+lobe*fB+eB)*rcpL;
|
||||
return;}
|
||||
|
||||
void main() {
|
||||
uvec2 ip = uvec2(fragTexCoord * pc.outputSize);
|
||||
vec3 c;
|
||||
FsrRcasF(c.r, c.g, c.b, ip, pc.con);
|
||||
outColor = vec4(c, 1.0);
|
||||
}
|
||||
@@ -1,468 +1,503 @@
|
||||
// 1116.3.0
|
||||
#pragma once
|
||||
const uint32_t fsr_rcas_code[] = {
|
||||
0x07230203,0x00010000,0x0008000b,0x0000025e,0x00000000,0x00020011,0x00000001,0x00020011,
|
||||
0x07230203,0x00010000,0x0008000b,0x0000028c,0x00000000,0x00020011,0x00000001,0x00020011,
|
||||
0x00000032,0x0006000b,0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,
|
||||
0x00000000,0x00000001,0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000023b,
|
||||
0x00000258,0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,
|
||||
0x00000004,0x6e69616d,0x00000000,0x00050005,0x0000000a,0x70635241,0x66283146,0x00003b31,
|
||||
0x00030005,0x00000009,0x00000078,0x00070005,0x0000000d,0x78725041,0x5264654d,0x31467063,
|
||||
0x3b316628,0x00000000,0x00030005,0x0000000c,0x00000078,0x00050005,0x00000010,0x74615341,
|
||||
0x66283146,0x00003b31,0x00030005,0x0000000f,0x00000078,0x00070005,0x00000016,0x6e694d41,
|
||||
0x28314633,0x663b3166,0x31663b31,0x0000003b,0x00030005,0x00000013,0x00000061,0x00030005,
|
||||
0x00000014,0x00000062,0x00030005,0x00000015,0x00000063,0x00070005,0x0000001b,0x78614d41,
|
||||
0x28314633,0x663b3166,0x31663b31,0x0000003b,0x00030005,0x00000018,0x00000061,0x00030005,
|
||||
0x00000019,0x00000062,0x00030005,0x0000001a,0x00000063,0x00070005,0x00000023,0x52727346,
|
||||
0x4c736163,0x4664616f,0x32697628,0x0000003b,0x00030005,0x00000022,0x00000070,0x00080005,
|
||||
0x00000029,0x52727346,0x49736163,0x7475706e,0x31662846,0x3b31663b,0x003b3166,0x00030005,
|
||||
0x00000026,0x00000072,0x00030005,0x00000027,0x00000067,0x00030005,0x00000028,0x00000062,
|
||||
0x00090005,0x00000036,0x52727346,0x46736163,0x3b316628,0x663b3166,0x75763b31,0x75763b32,
|
||||
0x00003b34,0x00040005,0x00000031,0x52786970,0x00000000,0x00040005,0x00000032,0x47786970,
|
||||
0x00000000,0x00040005,0x00000033,0x42786970,0x00000000,0x00030005,0x00000034,0x00007069,
|
||||
0x00030005,0x00000035,0x006e6f63,0x00030005,0x00000054,0x00007a73,0x00060005,0x00000058,
|
||||
0x75706e49,0x78655474,0x65727574,0x00000000,0x00030005,0x00000069,0x00007073,0x00030005,
|
||||
0x0000006e,0x00000062,0x00040005,0x00000073,0x61726170,0x0000006d,0x00030005,0x00000076,
|
||||
0x00000064,0x00040005,0x0000007a,0x61726170,0x0000006d,0x00030005,0x0000007d,0x00000065,
|
||||
0x00040005,0x0000007e,0x61726170,0x0000006d,0x00030005,0x00000082,0x00000066,0x00040005,
|
||||
0x00000086,0x61726170,0x0000006d,0x00030005,0x00000089,0x00000068,0x00040005,0x0000008d,
|
||||
0x61726170,0x0000006d,0x00030005,0x00000090,0x00005262,0x00030005,0x00000094,0x00004762,
|
||||
0x00030005,0x00000098,0x00004262,0x00030005,0x0000009c,0x00005264,0x00030005,0x0000009f,
|
||||
0x00004764,0x00030005,0x000000a2,0x00004264,0x00030005,0x000000a5,0x00005265,0x00030005,
|
||||
0x000000a8,0x00004765,0x00030005,0x000000ab,0x00004265,0x00030005,0x000000ae,0x00005266,
|
||||
0x00030005,0x000000b1,0x00004766,0x00030005,0x000000b4,0x00004266,0x00030005,0x000000b7,
|
||||
0x00005268,0x00030005,0x000000ba,0x00004768,0x00030005,0x000000bd,0x00004268,0x00040005,
|
||||
0x000000c0,0x61726170,0x0000006d,0x00040005,0x000000c2,0x61726170,0x0000006d,0x00040005,
|
||||
0x000000c4,0x61726170,0x0000006d,0x00040005,0x000000ca,0x61726170,0x0000006d,0x00040005,
|
||||
0x000000cc,0x61726170,0x0000006d,0x00040005,0x000000ce,0x61726170,0x0000006d,0x00040005,
|
||||
0x000000d4,0x61726170,0x0000006d,0x00040005,0x000000d6,0x61726170,0x0000006d,0x00040005,
|
||||
0x000000d8,0x61726170,0x0000006d,0x00040005,0x000000de,0x61726170,0x0000006d,0x00040005,
|
||||
0x000000e0,0x61726170,0x0000006d,0x00040005,0x000000e2,0x61726170,0x0000006d,0x00040005,
|
||||
0x000000e8,0x61726170,0x0000006d,0x00040005,0x000000ea,0x61726170,0x0000006d,0x00040005,
|
||||
0x000000ec,0x61726170,0x0000006d,0x00030005,0x000000f2,0x00004c62,0x00030005,0x000000fb,
|
||||
0x00004c64,0x00030005,0x00000103,0x00004c65,0x00030005,0x0000010b,0x00004c66,0x00030005,
|
||||
0x00000113,0x00004c68,0x00030005,0x0000011b,0x00007a6e,0x00040005,0x0000012c,0x61726170,
|
||||
0x0000006d,0x00040005,0x0000012e,0x61726170,0x0000006d,0x00040005,0x00000130,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000133,0x61726170,0x0000006d,0x00040005,0x00000134,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000136,0x61726170,0x0000006d,0x00040005,0x00000139,0x61726170,
|
||||
0x0000006d,0x00040005,0x0000013b,0x61726170,0x0000006d,0x00040005,0x0000013d,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000140,0x61726170,0x0000006d,0x00040005,0x00000141,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000143,0x61726170,0x0000006d,0x00040005,0x00000147,0x61726170,
|
||||
0x0000006d,0x00040005,0x0000014a,0x61726170,0x0000006d,0x00040005,0x00000150,0x52346e6d,
|
||||
0x00000000,0x00040005,0x00000151,0x61726170,0x0000006d,0x00040005,0x00000153,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000155,0x61726170,0x0000006d,0x00040005,0x0000015a,0x47346e6d,
|
||||
0x00000000,0x00040005,0x0000015b,0x61726170,0x0000006d,0x00040005,0x0000015d,0x61726170,
|
||||
0x0000006d,0x00040005,0x0000015f,0x61726170,0x0000006d,0x00040005,0x00000164,0x42346e6d,
|
||||
0x00000000,0x00040005,0x00000165,0x61726170,0x0000006d,0x00040005,0x00000167,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000169,0x61726170,0x0000006d,0x00040005,0x0000016e,0x5234786d,
|
||||
0x00000000,0x00040005,0x0000016f,0x61726170,0x0000006d,0x00040005,0x00000171,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000173,0x61726170,0x0000006d,0x00040005,0x00000178,0x4734786d,
|
||||
0x00000000,0x00040005,0x00000179,0x61726170,0x0000006d,0x00040005,0x0000017b,0x61726170,
|
||||
0x0000006d,0x00040005,0x0000017d,0x61726170,0x0000006d,0x00040005,0x00000182,0x4234786d,
|
||||
0x00000000,0x00040005,0x00000183,0x61726170,0x0000006d,0x00040005,0x00000185,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000187,0x61726170,0x0000006d,0x00040005,0x0000018e,0x6b616570,
|
||||
0x00000043,0x00040005,0x00000191,0x4d746968,0x00526e69,0x00040005,0x00000198,0x61726170,
|
||||
0x0000006d,0x00040005,0x0000019b,0x4d746968,0x00476e69,0x00040005,0x000001a1,0x61726170,
|
||||
0x0000006d,0x00040005,0x000001a4,0x4d746968,0x00426e69,0x00040005,0x000001aa,0x61726170,
|
||||
0x0000006d,0x00040005,0x000001ad,0x4d746968,0x00527861,0x00040005,0x000001b9,0x61726170,
|
||||
0x0000006d,0x00040005,0x000001bc,0x4d746968,0x00477861,0x00040005,0x000001c8,0x61726170,
|
||||
0x0000006d,0x00040005,0x000001cb,0x4d746968,0x00427861,0x00040005,0x000001d7,0x61726170,
|
||||
0x0000006d,0x00040005,0x000001da,0x65626f6c,0x00000052,0x00040005,0x000001df,0x65626f6c,
|
||||
0x00000047,0x00040005,0x000001e4,0x65626f6c,0x00000042,0x00040005,0x000001e9,0x65626f6c,
|
||||
0x00000000,0x00040005,0x000001eb,0x61726170,0x0000006d,0x00040005,0x000001ed,0x61726170,
|
||||
0x0000006d,0x00040005,0x000001ef,0x61726170,0x0000006d,0x00040005,0x000001f9,0x4c706372,
|
||||
0x00000000,0x00040005,0x000001fd,0x61726170,0x0000006d,0x00030005,0x00000239,0x00007069,
|
||||
0x00060005,0x0000023b,0x67617266,0x43786554,0x64726f6f,0x00000000,0x00030005,0x0000023d,
|
||||
0x00004350,0x00040006,0x0000023d,0x00000000,0x0063646e,0x00040006,0x0000023d,0x00000001,
|
||||
0x006e6f63,0x00060006,0x0000023d,0x00000002,0x7074756f,0x69537475,0x0000657a,0x00030005,
|
||||
0x0000023f,0x00006370,0x00030005,0x00000246,0x00000063,0x00040005,0x00000247,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000248,0x61726170,0x0000006d,0x00040005,0x00000249,0x61726170,
|
||||
0x0000006d,0x00040005,0x0000024a,0x61726170,0x0000006d,0x00040005,0x0000024c,0x61726170,
|
||||
0x0000006d,0x00050005,0x00000258,0x4374756f,0x726f6c6f,0x00000000,0x00040047,0x00000058,
|
||||
0x00000021,0x00000000,0x00040047,0x00000058,0x00000022,0x00000000,0x00040047,0x0000023b,
|
||||
0x0000001e,0x00000000,0x00030047,0x0000023d,0x00000002,0x00050048,0x0000023d,0x00000000,
|
||||
0x00000023,0x00000000,0x00050048,0x0000023d,0x00000001,0x00000023,0x00000010,0x00050048,
|
||||
0x0000023d,0x00000002,0x00000023,0x00000020,0x00040047,0x00000258,0x0000001e,0x00000000,
|
||||
0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,
|
||||
0x00040020,0x00000007,0x00000007,0x00000006,0x00040021,0x00000008,0x00000006,0x00000007,
|
||||
0x00060021,0x00000012,0x00000006,0x00000007,0x00000007,0x00000007,0x00040015,0x0000001d,
|
||||
0x00000020,0x00000001,0x00040017,0x0000001e,0x0000001d,0x00000002,0x00040020,0x0000001f,
|
||||
0x00000007,0x0000001e,0x00040017,0x00000020,0x00000006,0x00000004,0x00040021,0x00000021,
|
||||
0x00000020,0x0000001f,0x00060021,0x00000025,0x00000002,0x00000007,0x00000007,0x00000007,
|
||||
0x00040015,0x0000002b,0x00000020,0x00000000,0x00040017,0x0000002c,0x0000002b,0x00000002,
|
||||
0x00040020,0x0000002d,0x00000007,0x0000002c,0x00040017,0x0000002e,0x0000002b,0x00000004,
|
||||
0x00040020,0x0000002f,0x00000007,0x0000002e,0x00080021,0x00000030,0x00000002,0x00000007,
|
||||
0x00000007,0x00000007,0x0000002d,0x0000002f,0x0004002b,0x00000006,0x00000038,0x3f800000,
|
||||
0x0004002b,0x00000006,0x00000042,0x00000000,0x00090019,0x00000055,0x00000006,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x00000056,0x00000055,
|
||||
0x00040020,0x00000057,0x00000000,0x00000056,0x0004003b,0x00000057,0x00000058,0x00000000,
|
||||
0x0004002b,0x0000001d,0x0000005a,0x00000000,0x0005002c,0x0000001e,0x0000005f,0x0000005a,
|
||||
0x0000005a,0x0004002b,0x0000001d,0x00000061,0x00000001,0x0005002c,0x0000001e,0x00000062,
|
||||
0x00000061,0x00000061,0x00040017,0x0000006c,0x00000006,0x00000003,0x00040020,0x0000006d,
|
||||
0x00000007,0x0000006c,0x0004002b,0x0000001d,0x00000070,0xffffffff,0x0005002c,0x0000001e,
|
||||
0x00000071,0x0000005a,0x00000070,0x0005002c,0x0000001e,0x00000078,0x00000070,0x0000005a,
|
||||
0x0005002c,0x0000001e,0x00000084,0x00000061,0x0000005a,0x0005002c,0x0000001e,0x0000008b,
|
||||
0x0000005a,0x00000061,0x0004002b,0x0000002b,0x00000091,0x00000000,0x0004002b,0x0000002b,
|
||||
0x00000095,0x00000001,0x0004002b,0x0000002b,0x00000099,0x00000002,0x0004002b,0x00000006,
|
||||
0x000000f4,0x3f000000,0x0004002b,0x00000006,0x0000011c,0x3e800000,0x0004002b,0x00000006,
|
||||
0x0000014c,0xbf000000,0x00040017,0x0000018c,0x00000006,0x00000002,0x00040020,0x0000018d,
|
||||
0x00000007,0x0000018c,0x0004002b,0x00000006,0x0000018f,0xc0800000,0x0005002c,0x0000018c,
|
||||
0x00000190,0x00000038,0x0000018f,0x0004002b,0x00000006,0x00000195,0x40800000,0x0004002b,
|
||||
0x00000006,0x000001ea,0xbe400000,0x00040020,0x000001f4,0x00000007,0x0000002b,0x00040020,
|
||||
0x0000023a,0x00000001,0x0000018c,0x0004003b,0x0000023a,0x0000023b,0x00000001,0x0005001e,
|
||||
0x0000023d,0x00000020,0x0000002e,0x0000018c,0x00040020,0x0000023e,0x00000009,0x0000023d,
|
||||
0x0004003b,0x0000023e,0x0000023f,0x00000009,0x0004002b,0x0000001d,0x00000240,0x00000002,
|
||||
0x00040020,0x00000241,0x00000009,0x0000018c,0x00040020,0x0000024d,0x00000009,0x0000002e,
|
||||
0x00040020,0x00000257,0x00000003,0x00000020,0x0004003b,0x00000257,0x00000258,0x00000003,
|
||||
0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,
|
||||
0x0000002d,0x00000239,0x00000007,0x0004003b,0x0000006d,0x00000246,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000247,0x00000007,0x0004003b,0x00000007,0x00000248,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000249,0x00000007,0x0004003b,0x0000002d,0x0000024a,0x00000007,0x0004003b,
|
||||
0x0000002f,0x0000024c,0x00000007,0x0004003d,0x0000018c,0x0000023c,0x0000023b,0x00050041,
|
||||
0x00000241,0x00000242,0x0000023f,0x00000240,0x0004003d,0x0000018c,0x00000243,0x00000242,
|
||||
0x00050085,0x0000018c,0x00000244,0x0000023c,0x00000243,0x0004006d,0x0000002c,0x00000245,
|
||||
0x00000244,0x0003003e,0x00000239,0x00000245,0x0004003d,0x0000002c,0x0000024b,0x00000239,
|
||||
0x0003003e,0x0000024a,0x0000024b,0x00050041,0x0000024d,0x0000024e,0x0000023f,0x00000061,
|
||||
0x0004003d,0x0000002e,0x0000024f,0x0000024e,0x0003003e,0x0000024c,0x0000024f,0x00090039,
|
||||
0x00000002,0x00000250,0x00000036,0x00000247,0x00000248,0x00000249,0x0000024a,0x0000024c,
|
||||
0x0004003d,0x00000006,0x00000251,0x00000247,0x00050041,0x00000007,0x00000252,0x00000246,
|
||||
0x00000091,0x0003003e,0x00000252,0x00000251,0x0004003d,0x00000006,0x00000253,0x00000248,
|
||||
0x00050041,0x00000007,0x00000254,0x00000246,0x00000095,0x0003003e,0x00000254,0x00000253,
|
||||
0x0004003d,0x00000006,0x00000255,0x00000249,0x00050041,0x00000007,0x00000256,0x00000246,
|
||||
0x00000099,0x0003003e,0x00000256,0x00000255,0x0004003d,0x0000006c,0x00000259,0x00000246,
|
||||
0x00050051,0x00000006,0x0000025a,0x00000259,0x00000000,0x00050051,0x00000006,0x0000025b,
|
||||
0x00000259,0x00000001,0x00050051,0x00000006,0x0000025c,0x00000259,0x00000002,0x00070050,
|
||||
0x00000020,0x0000025d,0x0000025a,0x0000025b,0x0000025c,0x00000038,0x0003003e,0x00000258,
|
||||
0x0000025d,0x000100fd,0x00010038,0x00050036,0x00000006,0x0000000a,0x00000000,0x00000008,
|
||||
0x00030037,0x00000007,0x00000009,0x000200f8,0x0000000b,0x0004003d,0x00000006,0x00000039,
|
||||
0x00000009,0x00050088,0x00000006,0x0000003a,0x00000038,0x00000039,0x000200fe,0x0000003a,
|
||||
0x00010038,0x00050036,0x00000006,0x0000000d,0x00000000,0x00000008,0x00030037,0x00000007,
|
||||
0x0000000c,0x000200f8,0x0000000e,0x0004003d,0x00000006,0x0000003d,0x0000000c,0x00050088,
|
||||
0x00000006,0x0000003e,0x00000038,0x0000003d,0x000200fe,0x0000003e,0x00010038,0x00050036,
|
||||
0x00000006,0x00000010,0x00000000,0x00000008,0x00030037,0x00000007,0x0000000f,0x000200f8,
|
||||
0x00000011,0x0004003d,0x00000006,0x00000041,0x0000000f,0x0008000c,0x00000006,0x00000043,
|
||||
0x00000001,0x0000002b,0x00000041,0x00000042,0x00000038,0x000200fe,0x00000043,0x00010038,
|
||||
0x00050036,0x00000006,0x00000016,0x00000000,0x00000012,0x00030037,0x00000007,0x00000013,
|
||||
0x00030037,0x00000007,0x00000014,0x00030037,0x00000007,0x00000015,0x000200f8,0x00000017,
|
||||
0x0004003d,0x00000006,0x00000046,0x00000013,0x0004003d,0x00000006,0x00000047,0x00000014,
|
||||
0x0004003d,0x00000006,0x00000048,0x00000015,0x0007000c,0x00000006,0x00000049,0x00000001,
|
||||
0x00000025,0x00000047,0x00000048,0x0007000c,0x00000006,0x0000004a,0x00000001,0x00000025,
|
||||
0x00000046,0x00000049,0x000200fe,0x0000004a,0x00010038,0x00050036,0x00000006,0x0000001b,
|
||||
0x00000000,0x00000012,0x00030037,0x00000007,0x00000018,0x00030037,0x00000007,0x00000019,
|
||||
0x00030037,0x00000007,0x0000001a,0x000200f8,0x0000001c,0x0004003d,0x00000006,0x0000004d,
|
||||
0x00000018,0x0004003d,0x00000006,0x0000004e,0x00000019,0x0004003d,0x00000006,0x0000004f,
|
||||
0x0000001a,0x0007000c,0x00000006,0x00000050,0x00000001,0x00000028,0x0000004e,0x0000004f,
|
||||
0x0007000c,0x00000006,0x00000051,0x00000001,0x00000028,0x0000004d,0x00000050,0x000200fe,
|
||||
0x00000051,0x00010038,0x00050036,0x00000020,0x00000023,0x00000000,0x00000021,0x00030037,
|
||||
0x0000001f,0x00000022,0x000200f8,0x00000024,0x0004003b,0x0000001f,0x00000054,0x00000007,
|
||||
0x0004003d,0x00000056,0x00000059,0x00000058,0x00040064,0x00000055,0x0000005b,0x00000059,
|
||||
0x00050067,0x0000001e,0x0000005c,0x0000005b,0x0000005a,0x0003003e,0x00000054,0x0000005c,
|
||||
0x0004003d,0x00000056,0x0000005d,0x00000058,0x0004003d,0x0000001e,0x0000005e,0x00000022,
|
||||
0x0004003d,0x0000001e,0x00000060,0x00000054,0x00050082,0x0000001e,0x00000063,0x00000060,
|
||||
0x00000062,0x0008000c,0x0000001e,0x00000064,0x00000001,0x0000002d,0x0000005e,0x0000005f,
|
||||
0x00000063,0x00040064,0x00000055,0x00000065,0x0000005d,0x0007005f,0x00000020,0x00000066,
|
||||
0x00000065,0x00000064,0x00000002,0x0000005a,0x000200fe,0x00000066,0x00010038,0x00050036,
|
||||
0x00000002,0x00000029,0x00000000,0x00000025,0x00030037,0x00000007,0x00000026,0x00030037,
|
||||
0x00000007,0x00000027,0x00030037,0x00000007,0x00000028,0x000200f8,0x0000002a,0x000100fd,
|
||||
0x00010038,0x00050036,0x00000002,0x00000036,0x00000000,0x00000030,0x00030037,0x00000007,
|
||||
0x00000031,0x00030037,0x00000007,0x00000032,0x00030037,0x00000007,0x00000033,0x00030037,
|
||||
0x0000002d,0x00000034,0x00030037,0x0000002f,0x00000035,0x000200f8,0x00000037,0x0004003b,
|
||||
0x0000001f,0x00000069,0x00000007,0x0004003b,0x0000006d,0x0000006e,0x00000007,0x0004003b,
|
||||
0x0000001f,0x00000073,0x00000007,0x0004003b,0x0000006d,0x00000076,0x00000007,0x0004003b,
|
||||
0x0000001f,0x0000007a,0x00000007,0x0004003b,0x0000006d,0x0000007d,0x00000007,0x0004003b,
|
||||
0x0000001f,0x0000007e,0x00000007,0x0004003b,0x0000006d,0x00000082,0x00000007,0x0004003b,
|
||||
0x0000001f,0x00000086,0x00000007,0x0004003b,0x0000006d,0x00000089,0x00000007,0x0004003b,
|
||||
0x0000001f,0x0000008d,0x00000007,0x0004003b,0x00000007,0x00000090,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000094,0x00000007,0x0004003b,0x00000007,0x00000098,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000009c,0x00000007,0x0004003b,0x00000007,0x0000009f,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000a2,0x00000007,0x0004003b,0x00000007,0x000000a5,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000a8,0x00000007,0x0004003b,0x00000007,0x000000ab,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000ae,0x00000007,0x0004003b,0x00000007,0x000000b1,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000b4,0x00000007,0x0004003b,0x00000007,0x000000b7,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000ba,0x00000007,0x0004003b,0x00000007,0x000000bd,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000c0,0x00000007,0x0004003b,0x00000007,0x000000c2,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000c4,0x00000007,0x0004003b,0x00000007,0x000000ca,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000cc,0x00000007,0x0004003b,0x00000007,0x000000ce,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000d4,0x00000007,0x0004003b,0x00000007,0x000000d6,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000d8,0x00000007,0x0004003b,0x00000007,0x000000de,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000e0,0x00000007,0x0004003b,0x00000007,0x000000e2,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000e8,0x00000007,0x0004003b,0x00000007,0x000000ea,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000ec,0x00000007,0x0004003b,0x00000007,0x000000f2,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000fb,0x00000007,0x0004003b,0x00000007,0x00000103,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000010b,0x00000007,0x0004003b,0x00000007,0x00000113,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000011b,0x00000007,0x0004003b,0x00000007,0x0000012c,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000012e,0x00000007,0x0004003b,0x00000007,0x00000130,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000133,0x00000007,0x0004003b,0x00000007,0x00000134,0x00000007,0x0004003b,
|
||||
0x00000000,0x00000001,0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000269,
|
||||
0x00000286,0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,
|
||||
0x00000004,0x6e69616d,0x00000000,0x00070005,0x0000000a,0x78725041,0x5264654d,0x31467063,
|
||||
0x3b316628,0x00000000,0x00030005,0x00000009,0x00000078,0x00050005,0x0000000d,0x74615341,
|
||||
0x66283146,0x00003b31,0x00030005,0x0000000c,0x00000078,0x00070005,0x00000013,0x6e694d41,
|
||||
0x28314633,0x663b3166,0x31663b31,0x0000003b,0x00030005,0x00000010,0x00000061,0x00030005,
|
||||
0x00000011,0x00000062,0x00030005,0x00000012,0x00000063,0x00070005,0x00000018,0x78614d41,
|
||||
0x28314633,0x663b3166,0x31663b31,0x0000003b,0x00030005,0x00000015,0x00000061,0x00030005,
|
||||
0x00000016,0x00000062,0x00030005,0x00000017,0x00000063,0x00070005,0x00000020,0x52727346,
|
||||
0x4c736163,0x4664616f,0x32697628,0x0000003b,0x00030005,0x0000001f,0x00000070,0x00080005,
|
||||
0x00000026,0x52727346,0x49736163,0x7475706e,0x31662846,0x3b31663b,0x003b3166,0x00030005,
|
||||
0x00000023,0x00000072,0x00030005,0x00000024,0x00000067,0x00030005,0x00000025,0x00000062,
|
||||
0x00090005,0x00000033,0x52727346,0x46736163,0x3b316628,0x663b3166,0x75763b31,0x75763b32,
|
||||
0x00003b34,0x00040005,0x0000002e,0x52786970,0x00000000,0x00040005,0x0000002f,0x47786970,
|
||||
0x00000000,0x00040005,0x00000030,0x42786970,0x00000000,0x00030005,0x00000031,0x00007069,
|
||||
0x00030005,0x00000032,0x006e6f63,0x00030005,0x0000004d,0x00007a73,0x00060005,0x00000051,
|
||||
0x75706e49,0x78655474,0x65727574,0x00000000,0x00030005,0x00000062,0x00007073,0x00030005,
|
||||
0x00000067,0x00000062,0x00040005,0x0000006c,0x61726170,0x0000006d,0x00030005,0x0000006f,
|
||||
0x00000064,0x00040005,0x00000073,0x61726170,0x0000006d,0x00030005,0x00000076,0x00000065,
|
||||
0x00040005,0x00000077,0x61726170,0x0000006d,0x00030005,0x0000007b,0x00000066,0x00040005,
|
||||
0x0000007f,0x61726170,0x0000006d,0x00030005,0x00000082,0x00000068,0x00040005,0x00000086,
|
||||
0x61726170,0x0000006d,0x00030005,0x00000089,0x00005262,0x00030005,0x0000008d,0x00004762,
|
||||
0x00030005,0x00000091,0x00004262,0x00030005,0x00000095,0x00005264,0x00030005,0x00000098,
|
||||
0x00004764,0x00030005,0x0000009b,0x00004264,0x00030005,0x0000009e,0x00005265,0x00030005,
|
||||
0x000000a1,0x00004765,0x00030005,0x000000a4,0x00004265,0x00030005,0x000000a7,0x00005266,
|
||||
0x00030005,0x000000aa,0x00004766,0x00030005,0x000000ad,0x00004266,0x00030005,0x000000b0,
|
||||
0x00005268,0x00030005,0x000000b3,0x00004768,0x00030005,0x000000b6,0x00004268,0x00040005,
|
||||
0x000000b9,0x61726170,0x0000006d,0x00040005,0x000000bb,0x61726170,0x0000006d,0x00040005,
|
||||
0x000000bd,0x61726170,0x0000006d,0x00040005,0x000000c3,0x61726170,0x0000006d,0x00040005,
|
||||
0x000000c5,0x61726170,0x0000006d,0x00040005,0x000000c7,0x61726170,0x0000006d,0x00040005,
|
||||
0x000000cd,0x61726170,0x0000006d,0x00040005,0x000000cf,0x61726170,0x0000006d,0x00040005,
|
||||
0x000000d1,0x61726170,0x0000006d,0x00040005,0x000000d7,0x61726170,0x0000006d,0x00040005,
|
||||
0x000000d9,0x61726170,0x0000006d,0x00040005,0x000000db,0x61726170,0x0000006d,0x00040005,
|
||||
0x000000e1,0x61726170,0x0000006d,0x00040005,0x000000e3,0x61726170,0x0000006d,0x00040005,
|
||||
0x000000e5,0x61726170,0x0000006d,0x00030005,0x000000eb,0x00004c62,0x00030005,0x000000f4,
|
||||
0x00004c64,0x00030005,0x000000fc,0x00004c65,0x00030005,0x00000104,0x00004c66,0x00030005,
|
||||
0x0000010c,0x00004c68,0x00030005,0x00000114,0x00007a6e,0x00040005,0x00000125,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000127,0x61726170,0x0000006d,0x00040005,0x00000129,0x61726170,
|
||||
0x0000006d,0x00040005,0x0000012c,0x61726170,0x0000006d,0x00040005,0x0000012d,0x61726170,
|
||||
0x0000006d,0x00040005,0x0000012f,0x61726170,0x0000006d,0x00040005,0x00000132,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000134,0x61726170,0x0000006d,0x00040005,0x00000136,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000139,0x61726170,0x0000006d,0x00040005,0x0000013a,0x61726170,
|
||||
0x0000006d,0x00040005,0x0000013c,0x61726170,0x0000006d,0x00040005,0x00000140,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000143,0x61726170,0x0000006d,0x00040005,0x00000149,0x52346e6d,
|
||||
0x00000000,0x00040005,0x0000014a,0x61726170,0x0000006d,0x00040005,0x0000014c,0x61726170,
|
||||
0x0000006d,0x00040005,0x0000014e,0x61726170,0x0000006d,0x00040005,0x00000153,0x47346e6d,
|
||||
0x00000000,0x00040005,0x00000154,0x61726170,0x0000006d,0x00040005,0x00000156,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000158,0x61726170,0x0000006d,0x00040005,0x0000015d,0x42346e6d,
|
||||
0x00000000,0x00040005,0x0000015e,0x61726170,0x0000006d,0x00040005,0x00000160,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000162,0x61726170,0x0000006d,0x00040005,0x00000167,0x5234786d,
|
||||
0x00000000,0x00040005,0x00000168,0x61726170,0x0000006d,0x00040005,0x0000016a,0x61726170,
|
||||
0x0000006d,0x00040005,0x0000016c,0x61726170,0x0000006d,0x00040005,0x00000171,0x4734786d,
|
||||
0x00000000,0x00040005,0x00000172,0x61726170,0x0000006d,0x00040005,0x00000174,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000176,0x61726170,0x0000006d,0x00040005,0x0000017b,0x4234786d,
|
||||
0x00000000,0x00040005,0x0000017c,0x61726170,0x0000006d,0x00040005,0x0000017e,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000180,0x61726170,0x0000006d,0x00040005,0x00000187,0x6b616570,
|
||||
0x00000043,0x00040005,0x0000018a,0x4d6e6564,0x00526e69,0x00040005,0x0000018e,0x4d6e6564,
|
||||
0x00476e69,0x00040005,0x00000191,0x4d6e6564,0x00426e69,0x00040005,0x00000194,0x4d6e6564,
|
||||
0x00527861,0x00040005,0x0000019a,0x4d6e6564,0x00477861,0x00040005,0x000001a0,0x4d6e6564,
|
||||
0x00427861,0x00040005,0x000001a6,0x4d746968,0x00526e69,0x00040005,0x000001b4,0x4d746968,
|
||||
0x00476e69,0x00040005,0x000001c1,0x4d746968,0x00426e69,0x00040005,0x000001ce,0x4d6d756e,
|
||||
0x00527861,0x00040005,0x000001d5,0x4d6d756e,0x00477861,0x00040005,0x000001dc,0x4d6d756e,
|
||||
0x00427861,0x00040005,0x000001e3,0x4d746968,0x00527861,0x00040005,0x000001f0,0x4d746968,
|
||||
0x00477861,0x00040005,0x000001fc,0x4d746968,0x00427861,0x00040005,0x00000208,0x65626f6c,
|
||||
0x00000052,0x00040005,0x0000020d,0x65626f6c,0x00000047,0x00040005,0x00000212,0x65626f6c,
|
||||
0x00000042,0x00040005,0x00000217,0x65626f6c,0x00000000,0x00040005,0x00000219,0x61726170,
|
||||
0x0000006d,0x00040005,0x0000021b,0x61726170,0x0000006d,0x00040005,0x0000021d,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000227,0x4c706372,0x00000000,0x00040005,0x0000022b,0x61726170,
|
||||
0x0000006d,0x00030005,0x00000267,0x00007069,0x00060005,0x00000269,0x67617266,0x43786554,
|
||||
0x64726f6f,0x00000000,0x00030005,0x0000026b,0x00004350,0x00040006,0x0000026b,0x00000000,
|
||||
0x0063646e,0x00040006,0x0000026b,0x00000001,0x006e6f63,0x00060006,0x0000026b,0x00000002,
|
||||
0x7074756f,0x69537475,0x0000657a,0x00030005,0x0000026d,0x00006370,0x00030005,0x00000274,
|
||||
0x00000063,0x00040005,0x00000275,0x61726170,0x0000006d,0x00040005,0x00000276,0x61726170,
|
||||
0x0000006d,0x00040005,0x00000277,0x61726170,0x0000006d,0x00040005,0x00000278,0x61726170,
|
||||
0x0000006d,0x00040005,0x0000027a,0x61726170,0x0000006d,0x00050005,0x00000286,0x4374756f,
|
||||
0x726f6c6f,0x00000000,0x00040047,0x00000051,0x00000021,0x00000000,0x00040047,0x00000051,
|
||||
0x00000022,0x00000000,0x00040047,0x00000269,0x0000001e,0x00000000,0x00030047,0x0000026b,
|
||||
0x00000002,0x00050048,0x0000026b,0x00000000,0x00000023,0x00000000,0x00050048,0x0000026b,
|
||||
0x00000001,0x00000023,0x00000010,0x00050048,0x0000026b,0x00000002,0x00000023,0x00000020,
|
||||
0x00040047,0x00000286,0x0000001e,0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,
|
||||
0x00000002,0x00030016,0x00000006,0x00000020,0x00040020,0x00000007,0x00000007,0x00000006,
|
||||
0x00040021,0x00000008,0x00000006,0x00000007,0x00060021,0x0000000f,0x00000006,0x00000007,
|
||||
0x00000007,0x00000007,0x00040015,0x0000001a,0x00000020,0x00000001,0x00040017,0x0000001b,
|
||||
0x0000001a,0x00000002,0x00040020,0x0000001c,0x00000007,0x0000001b,0x00040017,0x0000001d,
|
||||
0x00000006,0x00000004,0x00040021,0x0000001e,0x0000001d,0x0000001c,0x00060021,0x00000022,
|
||||
0x00000002,0x00000007,0x00000007,0x00000007,0x00040015,0x00000028,0x00000020,0x00000000,
|
||||
0x00040017,0x00000029,0x00000028,0x00000002,0x00040020,0x0000002a,0x00000007,0x00000029,
|
||||
0x00040017,0x0000002b,0x00000028,0x00000004,0x00040020,0x0000002c,0x00000007,0x0000002b,
|
||||
0x00080021,0x0000002d,0x00000002,0x00000007,0x00000007,0x00000007,0x0000002a,0x0000002c,
|
||||
0x0004002b,0x00000006,0x00000035,0x3f800000,0x0004002b,0x00000006,0x0000003b,0x00000000,
|
||||
0x00090019,0x0000004e,0x00000006,0x00000001,0x00000000,0x00000000,0x00000000,0x00000001,
|
||||
0x00000000,0x0003001b,0x0000004f,0x0000004e,0x00040020,0x00000050,0x00000000,0x0000004f,
|
||||
0x0004003b,0x00000050,0x00000051,0x00000000,0x0004002b,0x0000001a,0x00000053,0x00000000,
|
||||
0x0005002c,0x0000001b,0x00000058,0x00000053,0x00000053,0x0004002b,0x0000001a,0x0000005a,
|
||||
0x00000001,0x0005002c,0x0000001b,0x0000005b,0x0000005a,0x0000005a,0x00040017,0x00000065,
|
||||
0x00000006,0x00000003,0x00040020,0x00000066,0x00000007,0x00000065,0x0004002b,0x0000001a,
|
||||
0x00000069,0xffffffff,0x0005002c,0x0000001b,0x0000006a,0x00000053,0x00000069,0x0005002c,
|
||||
0x0000001b,0x00000071,0x00000069,0x00000053,0x0005002c,0x0000001b,0x0000007d,0x0000005a,
|
||||
0x00000053,0x0005002c,0x0000001b,0x00000084,0x00000053,0x0000005a,0x0004002b,0x00000028,
|
||||
0x0000008a,0x00000000,0x0004002b,0x00000028,0x0000008e,0x00000001,0x0004002b,0x00000028,
|
||||
0x00000092,0x00000002,0x0004002b,0x00000006,0x000000ed,0x3f000000,0x0004002b,0x00000006,
|
||||
0x00000115,0x3e800000,0x0004002b,0x00000006,0x00000145,0xbf000000,0x00040017,0x00000185,
|
||||
0x00000006,0x00000002,0x00040020,0x00000186,0x00000007,0x00000185,0x0004002b,0x00000006,
|
||||
0x00000188,0xc0800000,0x0005002c,0x00000185,0x00000189,0x00000035,0x00000188,0x0004002b,
|
||||
0x00000006,0x0000018b,0x40800000,0x00020014,0x000001a8,0x0004002b,0x00000006,0x000001e6,
|
||||
0x358637bd,0x0004002b,0x00000006,0x00000218,0xbe400000,0x00040020,0x00000222,0x00000007,
|
||||
0x00000028,0x00040020,0x00000268,0x00000001,0x00000185,0x0004003b,0x00000268,0x00000269,
|
||||
0x00000001,0x0005001e,0x0000026b,0x0000001d,0x0000002b,0x00000185,0x00040020,0x0000026c,
|
||||
0x00000009,0x0000026b,0x0004003b,0x0000026c,0x0000026d,0x00000009,0x0004002b,0x0000001a,
|
||||
0x0000026e,0x00000002,0x00040020,0x0000026f,0x00000009,0x00000185,0x00040020,0x0000027b,
|
||||
0x00000009,0x0000002b,0x00040020,0x00000285,0x00000003,0x0000001d,0x0004003b,0x00000285,
|
||||
0x00000286,0x00000003,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,
|
||||
0x00000005,0x0004003b,0x0000002a,0x00000267,0x00000007,0x0004003b,0x00000066,0x00000274,
|
||||
0x00000007,0x0004003b,0x00000007,0x00000275,0x00000007,0x0004003b,0x00000007,0x00000276,
|
||||
0x00000007,0x0004003b,0x00000007,0x00000277,0x00000007,0x0004003b,0x0000002a,0x00000278,
|
||||
0x00000007,0x0004003b,0x0000002c,0x0000027a,0x00000007,0x0004003d,0x00000185,0x0000026a,
|
||||
0x00000269,0x00050041,0x0000026f,0x00000270,0x0000026d,0x0000026e,0x0004003d,0x00000185,
|
||||
0x00000271,0x00000270,0x00050085,0x00000185,0x00000272,0x0000026a,0x00000271,0x0004006d,
|
||||
0x00000029,0x00000273,0x00000272,0x0003003e,0x00000267,0x00000273,0x0004003d,0x00000029,
|
||||
0x00000279,0x00000267,0x0003003e,0x00000278,0x00000279,0x00050041,0x0000027b,0x0000027c,
|
||||
0x0000026d,0x0000005a,0x0004003d,0x0000002b,0x0000027d,0x0000027c,0x0003003e,0x0000027a,
|
||||
0x0000027d,0x00090039,0x00000002,0x0000027e,0x00000033,0x00000275,0x00000276,0x00000277,
|
||||
0x00000278,0x0000027a,0x0004003d,0x00000006,0x0000027f,0x00000275,0x00050041,0x00000007,
|
||||
0x00000280,0x00000274,0x0000008a,0x0003003e,0x00000280,0x0000027f,0x0004003d,0x00000006,
|
||||
0x00000281,0x00000276,0x00050041,0x00000007,0x00000282,0x00000274,0x0000008e,0x0003003e,
|
||||
0x00000282,0x00000281,0x0004003d,0x00000006,0x00000283,0x00000277,0x00050041,0x00000007,
|
||||
0x00000284,0x00000274,0x00000092,0x0003003e,0x00000284,0x00000283,0x0004003d,0x00000065,
|
||||
0x00000287,0x00000274,0x00050051,0x00000006,0x00000288,0x00000287,0x00000000,0x00050051,
|
||||
0x00000006,0x00000289,0x00000287,0x00000001,0x00050051,0x00000006,0x0000028a,0x00000287,
|
||||
0x00000002,0x00070050,0x0000001d,0x0000028b,0x00000288,0x00000289,0x0000028a,0x00000035,
|
||||
0x0003003e,0x00000286,0x0000028b,0x000100fd,0x00010038,0x00050036,0x00000006,0x0000000a,
|
||||
0x00000000,0x00000008,0x00030037,0x00000007,0x00000009,0x000200f8,0x0000000b,0x0004003d,
|
||||
0x00000006,0x00000036,0x00000009,0x00050088,0x00000006,0x00000037,0x00000035,0x00000036,
|
||||
0x000200fe,0x00000037,0x00010038,0x00050036,0x00000006,0x0000000d,0x00000000,0x00000008,
|
||||
0x00030037,0x00000007,0x0000000c,0x000200f8,0x0000000e,0x0004003d,0x00000006,0x0000003a,
|
||||
0x0000000c,0x0008000c,0x00000006,0x0000003c,0x00000001,0x0000002b,0x0000003a,0x0000003b,
|
||||
0x00000035,0x000200fe,0x0000003c,0x00010038,0x00050036,0x00000006,0x00000013,0x00000000,
|
||||
0x0000000f,0x00030037,0x00000007,0x00000010,0x00030037,0x00000007,0x00000011,0x00030037,
|
||||
0x00000007,0x00000012,0x000200f8,0x00000014,0x0004003d,0x00000006,0x0000003f,0x00000010,
|
||||
0x0004003d,0x00000006,0x00000040,0x00000011,0x0004003d,0x00000006,0x00000041,0x00000012,
|
||||
0x0007000c,0x00000006,0x00000042,0x00000001,0x00000025,0x00000040,0x00000041,0x0007000c,
|
||||
0x00000006,0x00000043,0x00000001,0x00000025,0x0000003f,0x00000042,0x000200fe,0x00000043,
|
||||
0x00010038,0x00050036,0x00000006,0x00000018,0x00000000,0x0000000f,0x00030037,0x00000007,
|
||||
0x00000015,0x00030037,0x00000007,0x00000016,0x00030037,0x00000007,0x00000017,0x000200f8,
|
||||
0x00000019,0x0004003d,0x00000006,0x00000046,0x00000015,0x0004003d,0x00000006,0x00000047,
|
||||
0x00000016,0x0004003d,0x00000006,0x00000048,0x00000017,0x0007000c,0x00000006,0x00000049,
|
||||
0x00000001,0x00000028,0x00000047,0x00000048,0x0007000c,0x00000006,0x0000004a,0x00000001,
|
||||
0x00000028,0x00000046,0x00000049,0x000200fe,0x0000004a,0x00010038,0x00050036,0x0000001d,
|
||||
0x00000020,0x00000000,0x0000001e,0x00030037,0x0000001c,0x0000001f,0x000200f8,0x00000021,
|
||||
0x0004003b,0x0000001c,0x0000004d,0x00000007,0x0004003d,0x0000004f,0x00000052,0x00000051,
|
||||
0x00040064,0x0000004e,0x00000054,0x00000052,0x00050067,0x0000001b,0x00000055,0x00000054,
|
||||
0x00000053,0x0003003e,0x0000004d,0x00000055,0x0004003d,0x0000004f,0x00000056,0x00000051,
|
||||
0x0004003d,0x0000001b,0x00000057,0x0000001f,0x0004003d,0x0000001b,0x00000059,0x0000004d,
|
||||
0x00050082,0x0000001b,0x0000005c,0x00000059,0x0000005b,0x0008000c,0x0000001b,0x0000005d,
|
||||
0x00000001,0x0000002d,0x00000057,0x00000058,0x0000005c,0x00040064,0x0000004e,0x0000005e,
|
||||
0x00000056,0x0007005f,0x0000001d,0x0000005f,0x0000005e,0x0000005d,0x00000002,0x00000053,
|
||||
0x000200fe,0x0000005f,0x00010038,0x00050036,0x00000002,0x00000026,0x00000000,0x00000022,
|
||||
0x00030037,0x00000007,0x00000023,0x00030037,0x00000007,0x00000024,0x00030037,0x00000007,
|
||||
0x00000025,0x000200f8,0x00000027,0x000100fd,0x00010038,0x00050036,0x00000002,0x00000033,
|
||||
0x00000000,0x0000002d,0x00030037,0x00000007,0x0000002e,0x00030037,0x00000007,0x0000002f,
|
||||
0x00030037,0x00000007,0x00000030,0x00030037,0x0000002a,0x00000031,0x00030037,0x0000002c,
|
||||
0x00000032,0x000200f8,0x00000034,0x0004003b,0x0000001c,0x00000062,0x00000007,0x0004003b,
|
||||
0x00000066,0x00000067,0x00000007,0x0004003b,0x0000001c,0x0000006c,0x00000007,0x0004003b,
|
||||
0x00000066,0x0000006f,0x00000007,0x0004003b,0x0000001c,0x00000073,0x00000007,0x0004003b,
|
||||
0x00000066,0x00000076,0x00000007,0x0004003b,0x0000001c,0x00000077,0x00000007,0x0004003b,
|
||||
0x00000066,0x0000007b,0x00000007,0x0004003b,0x0000001c,0x0000007f,0x00000007,0x0004003b,
|
||||
0x00000066,0x00000082,0x00000007,0x0004003b,0x0000001c,0x00000086,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000089,0x00000007,0x0004003b,0x00000007,0x0000008d,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000091,0x00000007,0x0004003b,0x00000007,0x00000095,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000098,0x00000007,0x0004003b,0x00000007,0x0000009b,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000009e,0x00000007,0x0004003b,0x00000007,0x000000a1,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000a4,0x00000007,0x0004003b,0x00000007,0x000000a7,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000aa,0x00000007,0x0004003b,0x00000007,0x000000ad,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000b0,0x00000007,0x0004003b,0x00000007,0x000000b3,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000b6,0x00000007,0x0004003b,0x00000007,0x000000b9,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000bb,0x00000007,0x0004003b,0x00000007,0x000000bd,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000c3,0x00000007,0x0004003b,0x00000007,0x000000c5,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000c7,0x00000007,0x0004003b,0x00000007,0x000000cd,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000cf,0x00000007,0x0004003b,0x00000007,0x000000d1,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000d7,0x00000007,0x0004003b,0x00000007,0x000000d9,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000db,0x00000007,0x0004003b,0x00000007,0x000000e1,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000e3,0x00000007,0x0004003b,0x00000007,0x000000e5,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000eb,0x00000007,0x0004003b,0x00000007,0x000000f4,0x00000007,0x0004003b,
|
||||
0x00000007,0x000000fc,0x00000007,0x0004003b,0x00000007,0x00000104,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000010c,0x00000007,0x0004003b,0x00000007,0x00000114,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000125,0x00000007,0x0004003b,0x00000007,0x00000127,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000129,0x00000007,0x0004003b,0x00000007,0x0000012c,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000012d,0x00000007,0x0004003b,0x00000007,0x0000012f,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000132,0x00000007,0x0004003b,0x00000007,0x00000134,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000136,0x00000007,0x0004003b,0x00000007,0x00000139,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000013b,0x00000007,0x0004003b,0x00000007,0x0000013d,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000140,0x00000007,0x0004003b,0x00000007,0x00000141,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000143,0x00000007,0x0004003b,0x00000007,0x00000147,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000014a,0x00000007,0x0004003b,0x00000007,0x00000150,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000151,0x00000007,0x0004003b,0x00000007,0x00000153,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000155,0x00000007,0x0004003b,0x00000007,0x0000015a,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000015b,0x00000007,0x0004003b,0x00000007,0x0000015d,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000015f,0x00000007,0x0004003b,0x00000007,0x00000164,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000165,0x00000007,0x0004003b,0x00000007,0x00000167,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000169,0x00000007,0x0004003b,0x00000007,0x0000016e,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000016f,0x00000007,0x0004003b,0x00000007,0x00000171,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000173,0x00000007,0x0004003b,0x00000007,0x00000178,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000179,0x00000007,0x0004003b,0x00000007,0x0000017b,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000017d,0x00000007,0x0004003b,0x00000007,0x00000182,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000183,0x00000007,0x0004003b,0x00000007,0x00000185,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000187,0x00000007,0x0004003b,0x0000018d,0x0000018e,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000191,0x00000007,0x0004003b,0x00000007,0x00000198,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000019b,0x00000007,0x0004003b,0x00000007,0x000001a1,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001a4,0x00000007,0x0004003b,0x00000007,0x000001aa,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001ad,0x00000007,0x0004003b,0x00000007,0x000001b9,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001bc,0x00000007,0x0004003b,0x00000007,0x000001c8,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001cb,0x00000007,0x0004003b,0x00000007,0x000001d7,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001da,0x00000007,0x0004003b,0x00000007,0x000001df,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001e4,0x00000007,0x0004003b,0x00000007,0x000001e9,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001eb,0x00000007,0x0004003b,0x00000007,0x000001ed,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001ef,0x00000007,0x0004003b,0x00000007,0x000001f9,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001fd,0x00000007,0x0004003d,0x0000002c,0x0000006a,0x00000034,0x0004007c,
|
||||
0x0000001e,0x0000006b,0x0000006a,0x0003003e,0x00000069,0x0000006b,0x0004003d,0x0000001e,
|
||||
0x0000006f,0x00000069,0x00050080,0x0000001e,0x00000072,0x0000006f,0x00000071,0x0003003e,
|
||||
0x00000073,0x00000072,0x00050039,0x00000020,0x00000074,0x00000023,0x00000073,0x0008004f,
|
||||
0x0000006c,0x00000075,0x00000074,0x00000074,0x00000000,0x00000001,0x00000002,0x0003003e,
|
||||
0x0000006e,0x00000075,0x0004003d,0x0000001e,0x00000077,0x00000069,0x00050080,0x0000001e,
|
||||
0x00000079,0x00000077,0x00000078,0x0003003e,0x0000007a,0x00000079,0x00050039,0x00000020,
|
||||
0x0000007b,0x00000023,0x0000007a,0x0008004f,0x0000006c,0x0000007c,0x0000007b,0x0000007b,
|
||||
0x00000000,0x00000001,0x00000002,0x0003003e,0x00000076,0x0000007c,0x0004003d,0x0000001e,
|
||||
0x0000007f,0x00000069,0x0003003e,0x0000007e,0x0000007f,0x00050039,0x00000020,0x00000080,
|
||||
0x00000023,0x0000007e,0x0008004f,0x0000006c,0x00000081,0x00000080,0x00000080,0x00000000,
|
||||
0x00000001,0x00000002,0x0003003e,0x0000007d,0x00000081,0x0004003d,0x0000001e,0x00000083,
|
||||
0x00000069,0x00050080,0x0000001e,0x00000085,0x00000083,0x00000084,0x0003003e,0x00000086,
|
||||
0x00000085,0x00050039,0x00000020,0x00000087,0x00000023,0x00000086,0x0008004f,0x0000006c,
|
||||
0x00000088,0x00000087,0x00000087,0x00000000,0x00000001,0x00000002,0x0003003e,0x00000082,
|
||||
0x00000088,0x0004003d,0x0000001e,0x0000008a,0x00000069,0x00050080,0x0000001e,0x0000008c,
|
||||
0x0000008a,0x0000008b,0x0003003e,0x0000008d,0x0000008c,0x00050039,0x00000020,0x0000008e,
|
||||
0x00000023,0x0000008d,0x0008004f,0x0000006c,0x0000008f,0x0000008e,0x0000008e,0x00000000,
|
||||
0x00000001,0x00000002,0x0003003e,0x00000089,0x0000008f,0x00050041,0x00000007,0x00000092,
|
||||
0x0000006e,0x00000091,0x0004003d,0x00000006,0x00000093,0x00000092,0x0003003e,0x00000090,
|
||||
0x00000093,0x00050041,0x00000007,0x00000096,0x0000006e,0x00000095,0x0004003d,0x00000006,
|
||||
0x00000097,0x00000096,0x0003003e,0x00000094,0x00000097,0x00050041,0x00000007,0x0000009a,
|
||||
0x0000006e,0x00000099,0x0004003d,0x00000006,0x0000009b,0x0000009a,0x0003003e,0x00000098,
|
||||
0x0000009b,0x00050041,0x00000007,0x0000009d,0x00000076,0x00000091,0x0004003d,0x00000006,
|
||||
0x0000009e,0x0000009d,0x0003003e,0x0000009c,0x0000009e,0x00050041,0x00000007,0x000000a0,
|
||||
0x00000076,0x00000095,0x0004003d,0x00000006,0x000000a1,0x000000a0,0x0003003e,0x0000009f,
|
||||
0x000000a1,0x00050041,0x00000007,0x000000a3,0x00000076,0x00000099,0x0004003d,0x00000006,
|
||||
0x000000a4,0x000000a3,0x0003003e,0x000000a2,0x000000a4,0x00050041,0x00000007,0x000000a6,
|
||||
0x0000007d,0x00000091,0x0004003d,0x00000006,0x000000a7,0x000000a6,0x0003003e,0x000000a5,
|
||||
0x000000a7,0x00050041,0x00000007,0x000000a9,0x0000007d,0x00000095,0x0004003d,0x00000006,
|
||||
0x000000aa,0x000000a9,0x0003003e,0x000000a8,0x000000aa,0x00050041,0x00000007,0x000000ac,
|
||||
0x0000007d,0x00000099,0x0004003d,0x00000006,0x000000ad,0x000000ac,0x0003003e,0x000000ab,
|
||||
0x000000ad,0x00050041,0x00000007,0x000000af,0x00000082,0x00000091,0x0004003d,0x00000006,
|
||||
0x000000b0,0x000000af,0x0003003e,0x000000ae,0x000000b0,0x00050041,0x00000007,0x000000b2,
|
||||
0x00000082,0x00000095,0x0004003d,0x00000006,0x000000b3,0x000000b2,0x0003003e,0x000000b1,
|
||||
0x000000b3,0x00050041,0x00000007,0x000000b5,0x00000082,0x00000099,0x0004003d,0x00000006,
|
||||
0x000000b6,0x000000b5,0x0003003e,0x000000b4,0x000000b6,0x00050041,0x00000007,0x000000b8,
|
||||
0x00000089,0x00000091,0x0004003d,0x00000006,0x000000b9,0x000000b8,0x0003003e,0x000000b7,
|
||||
0x000000b9,0x00050041,0x00000007,0x000000bb,0x00000089,0x00000095,0x0004003d,0x00000006,
|
||||
0x000000bc,0x000000bb,0x0003003e,0x000000ba,0x000000bc,0x00050041,0x00000007,0x000000be,
|
||||
0x00000089,0x00000099,0x0004003d,0x00000006,0x000000bf,0x000000be,0x0003003e,0x000000bd,
|
||||
0x000000bf,0x0004003d,0x00000006,0x000000c1,0x00000090,0x0003003e,0x000000c0,0x000000c1,
|
||||
0x0004003d,0x00000006,0x000000c3,0x00000094,0x0003003e,0x000000c2,0x000000c3,0x0004003d,
|
||||
0x00000006,0x000000c5,0x00000098,0x0003003e,0x000000c4,0x000000c5,0x00070039,0x00000002,
|
||||
0x000000c6,0x00000029,0x000000c0,0x000000c2,0x000000c4,0x0004003d,0x00000006,0x000000c7,
|
||||
0x000000c0,0x0003003e,0x00000090,0x000000c7,0x0004003d,0x00000006,0x000000c8,0x000000c2,
|
||||
0x0003003e,0x00000094,0x000000c8,0x0004003d,0x00000006,0x000000c9,0x000000c4,0x0003003e,
|
||||
0x00000098,0x000000c9,0x0004003d,0x00000006,0x000000cb,0x0000009c,0x0003003e,0x000000ca,
|
||||
0x000000cb,0x0004003d,0x00000006,0x000000cd,0x0000009f,0x0003003e,0x000000cc,0x000000cd,
|
||||
0x0004003d,0x00000006,0x000000cf,0x000000a2,0x0003003e,0x000000ce,0x000000cf,0x00070039,
|
||||
0x00000002,0x000000d0,0x00000029,0x000000ca,0x000000cc,0x000000ce,0x0004003d,0x00000006,
|
||||
0x000000d1,0x000000ca,0x0003003e,0x0000009c,0x000000d1,0x0004003d,0x00000006,0x000000d2,
|
||||
0x000000cc,0x0003003e,0x0000009f,0x000000d2,0x0004003d,0x00000006,0x000000d3,0x000000ce,
|
||||
0x0003003e,0x000000a2,0x000000d3,0x0004003d,0x00000006,0x000000d5,0x000000a5,0x0003003e,
|
||||
0x000000d4,0x000000d5,0x0004003d,0x00000006,0x000000d7,0x000000a8,0x0003003e,0x000000d6,
|
||||
0x000000d7,0x0004003d,0x00000006,0x000000d9,0x000000ab,0x0003003e,0x000000d8,0x000000d9,
|
||||
0x00070039,0x00000002,0x000000da,0x00000029,0x000000d4,0x000000d6,0x000000d8,0x0004003d,
|
||||
0x00000006,0x000000db,0x000000d4,0x0003003e,0x000000a5,0x000000db,0x0004003d,0x00000006,
|
||||
0x000000dc,0x000000d6,0x0003003e,0x000000a8,0x000000dc,0x0004003d,0x00000006,0x000000dd,
|
||||
0x000000d8,0x0003003e,0x000000ab,0x000000dd,0x0004003d,0x00000006,0x000000df,0x000000ae,
|
||||
0x0003003e,0x000000de,0x000000df,0x0004003d,0x00000006,0x000000e1,0x000000b1,0x0003003e,
|
||||
0x000000e0,0x000000e1,0x0004003d,0x00000006,0x000000e3,0x000000b4,0x0003003e,0x000000e2,
|
||||
0x000000e3,0x00070039,0x00000002,0x000000e4,0x00000029,0x000000de,0x000000e0,0x000000e2,
|
||||
0x0004003d,0x00000006,0x000000e5,0x000000de,0x0003003e,0x000000ae,0x000000e5,0x0004003d,
|
||||
0x00000006,0x000000e6,0x000000e0,0x0003003e,0x000000b1,0x000000e6,0x0004003d,0x00000006,
|
||||
0x000000e7,0x000000e2,0x0003003e,0x000000b4,0x000000e7,0x0004003d,0x00000006,0x000000e9,
|
||||
0x000000b7,0x0003003e,0x000000e8,0x000000e9,0x0004003d,0x00000006,0x000000eb,0x000000ba,
|
||||
0x0003003e,0x000000ea,0x000000eb,0x0004003d,0x00000006,0x000000ed,0x000000bd,0x0003003e,
|
||||
0x000000ec,0x000000ed,0x00070039,0x00000002,0x000000ee,0x00000029,0x000000e8,0x000000ea,
|
||||
0x000000ec,0x0004003d,0x00000006,0x000000ef,0x000000e8,0x0003003e,0x000000b7,0x000000ef,
|
||||
0x0004003d,0x00000006,0x000000f0,0x000000ea,0x0003003e,0x000000ba,0x000000f0,0x0004003d,
|
||||
0x00000006,0x000000f1,0x000000ec,0x0003003e,0x000000bd,0x000000f1,0x0004003d,0x00000006,
|
||||
0x000000f3,0x00000098,0x00050085,0x00000006,0x000000f5,0x000000f3,0x000000f4,0x0004003d,
|
||||
0x00000006,0x000000f6,0x00000090,0x00050085,0x00000006,0x000000f7,0x000000f6,0x000000f4,
|
||||
0x0004003d,0x00000006,0x000000f8,0x00000094,0x00050081,0x00000006,0x000000f9,0x000000f7,
|
||||
0x000000f8,0x00050081,0x00000006,0x000000fa,0x000000f5,0x000000f9,0x0003003e,0x000000f2,
|
||||
0x000000fa,0x0004003d,0x00000006,0x000000fc,0x000000a2,0x00050085,0x00000006,0x000000fd,
|
||||
0x000000fc,0x000000f4,0x0004003d,0x00000006,0x000000fe,0x0000009c,0x00050085,0x00000006,
|
||||
0x000000ff,0x000000fe,0x000000f4,0x0004003d,0x00000006,0x00000100,0x0000009f,0x00050081,
|
||||
0x00000006,0x00000101,0x000000ff,0x00000100,0x00050081,0x00000006,0x00000102,0x000000fd,
|
||||
0x00000101,0x0003003e,0x000000fb,0x00000102,0x0004003d,0x00000006,0x00000104,0x000000ab,
|
||||
0x00050085,0x00000006,0x00000105,0x00000104,0x000000f4,0x0004003d,0x00000006,0x00000106,
|
||||
0x000000a5,0x00050085,0x00000006,0x00000107,0x00000106,0x000000f4,0x0004003d,0x00000006,
|
||||
0x00000108,0x000000a8,0x00050081,0x00000006,0x00000109,0x00000107,0x00000108,0x00050081,
|
||||
0x00000006,0x0000010a,0x00000105,0x00000109,0x0003003e,0x00000103,0x0000010a,0x0004003d,
|
||||
0x00000006,0x0000010c,0x000000b4,0x00050085,0x00000006,0x0000010d,0x0000010c,0x000000f4,
|
||||
0x0004003d,0x00000006,0x0000010e,0x000000ae,0x00050085,0x00000006,0x0000010f,0x0000010e,
|
||||
0x000000f4,0x0004003d,0x00000006,0x00000110,0x000000b1,0x00050081,0x00000006,0x00000111,
|
||||
0x0000010f,0x00000110,0x00050081,0x00000006,0x00000112,0x0000010d,0x00000111,0x0003003e,
|
||||
0x0000010b,0x00000112,0x0004003d,0x00000006,0x00000114,0x000000bd,0x00050085,0x00000006,
|
||||
0x00000115,0x00000114,0x000000f4,0x0004003d,0x00000006,0x00000116,0x000000b7,0x00050085,
|
||||
0x00000006,0x00000117,0x00000116,0x000000f4,0x0004003d,0x00000006,0x00000118,0x000000ba,
|
||||
0x00050081,0x00000006,0x00000119,0x00000117,0x00000118,0x00050081,0x00000006,0x0000011a,
|
||||
0x00000115,0x00000119,0x0003003e,0x00000113,0x0000011a,0x0004003d,0x00000006,0x0000011d,
|
||||
0x000000f2,0x00050085,0x00000006,0x0000011e,0x0000011c,0x0000011d,0x0004003d,0x00000006,
|
||||
0x0000011f,0x000000fb,0x00050085,0x00000006,0x00000120,0x0000011c,0x0000011f,0x00050081,
|
||||
0x00000006,0x00000121,0x0000011e,0x00000120,0x0004003d,0x00000006,0x00000122,0x0000010b,
|
||||
0x00050085,0x00000006,0x00000123,0x0000011c,0x00000122,0x00050081,0x00000006,0x00000124,
|
||||
0x00000121,0x00000123,0x0004003d,0x00000006,0x00000125,0x00000113,0x00050085,0x00000006,
|
||||
0x00000126,0x0000011c,0x00000125,0x00050081,0x00000006,0x00000127,0x00000124,0x00000126,
|
||||
0x0004003d,0x00000006,0x00000128,0x00000103,0x00050083,0x00000006,0x00000129,0x00000127,
|
||||
0x00000128,0x0003003e,0x0000011b,0x00000129,0x0004003d,0x00000006,0x0000012a,0x0000011b,
|
||||
0x0006000c,0x00000006,0x0000012b,0x00000001,0x00000004,0x0000012a,0x0004003d,0x00000006,
|
||||
0x0000012d,0x000000f2,0x0003003e,0x0000012c,0x0000012d,0x0004003d,0x00000006,0x0000012f,
|
||||
0x000000fb,0x0003003e,0x0000012e,0x0000012f,0x0004003d,0x00000006,0x00000131,0x00000103,
|
||||
0x0003003e,0x00000130,0x00000131,0x00070039,0x00000006,0x00000132,0x0000001b,0x0000012c,
|
||||
0x0000012e,0x00000130,0x0003003e,0x00000133,0x00000132,0x0004003d,0x00000006,0x00000135,
|
||||
0x0000010b,0x0003003e,0x00000134,0x00000135,0x0004003d,0x00000006,0x00000137,0x00000113,
|
||||
0x0003003e,0x00000136,0x00000137,0x00070039,0x00000006,0x00000138,0x0000001b,0x00000133,
|
||||
0x00000134,0x00000136,0x0004003d,0x00000006,0x0000013a,0x000000f2,0x0003003e,0x00000139,
|
||||
0x0000013a,0x0004003d,0x00000006,0x0000013c,0x000000fb,0x0003003e,0x0000013b,0x0000013c,
|
||||
0x0004003d,0x00000006,0x0000013e,0x00000103,0x0003003e,0x0000013d,0x0000013e,0x00070039,
|
||||
0x00000006,0x0000013f,0x00000016,0x00000139,0x0000013b,0x0000013d,0x0003003e,0x00000140,
|
||||
0x0000013f,0x0004003d,0x00000006,0x00000142,0x0000010b,0x0003003e,0x00000141,0x00000142,
|
||||
0x0004003d,0x00000006,0x00000144,0x00000113,0x0003003e,0x00000143,0x00000144,0x00070039,
|
||||
0x00000006,0x00000145,0x00000016,0x00000140,0x00000141,0x00000143,0x00050083,0x00000006,
|
||||
0x00000146,0x00000138,0x00000145,0x0003003e,0x00000147,0x00000146,0x00050039,0x00000006,
|
||||
0x00000148,0x0000000d,0x00000147,0x00050085,0x00000006,0x00000149,0x0000012b,0x00000148,
|
||||
0x0003003e,0x0000014a,0x00000149,0x00050039,0x00000006,0x0000014b,0x00000010,0x0000014a,
|
||||
0x0003003e,0x0000011b,0x0000014b,0x0004003d,0x00000006,0x0000014d,0x0000011b,0x00050085,
|
||||
0x00000006,0x0000014e,0x0000014c,0x0000014d,0x00050081,0x00000006,0x0000014f,0x0000014e,
|
||||
0x00000038,0x0003003e,0x0000011b,0x0000014f,0x0004003d,0x00000006,0x00000152,0x00000090,
|
||||
0x0003003e,0x00000151,0x00000152,0x0004003d,0x00000006,0x00000154,0x0000009c,0x0003003e,
|
||||
0x00000153,0x00000154,0x0004003d,0x00000006,0x00000156,0x000000ae,0x0003003e,0x00000155,
|
||||
0x00000156,0x00070039,0x00000006,0x00000157,0x00000016,0x00000151,0x00000153,0x00000155,
|
||||
0x0004003d,0x00000006,0x00000158,0x000000b7,0x0007000c,0x00000006,0x00000159,0x00000001,
|
||||
0x00000025,0x00000157,0x00000158,0x0003003e,0x00000150,0x00000159,0x0004003d,0x00000006,
|
||||
0x0000015c,0x00000094,0x0003003e,0x0000015b,0x0000015c,0x0004003d,0x00000006,0x0000015e,
|
||||
0x0000009f,0x0003003e,0x0000015d,0x0000015e,0x0004003d,0x00000006,0x00000160,0x000000b1,
|
||||
0x0003003e,0x0000015f,0x00000160,0x00070039,0x00000006,0x00000161,0x00000016,0x0000015b,
|
||||
0x0000015d,0x0000015f,0x0004003d,0x00000006,0x00000162,0x000000ba,0x0007000c,0x00000006,
|
||||
0x00000163,0x00000001,0x00000025,0x00000161,0x00000162,0x0003003e,0x0000015a,0x00000163,
|
||||
0x0004003d,0x00000006,0x00000166,0x00000098,0x0003003e,0x00000165,0x00000166,0x0004003d,
|
||||
0x00000006,0x00000168,0x000000a2,0x0003003e,0x00000167,0x00000168,0x0004003d,0x00000006,
|
||||
0x0000016a,0x000000b4,0x0003003e,0x00000169,0x0000016a,0x00070039,0x00000006,0x0000016b,
|
||||
0x00000016,0x00000165,0x00000167,0x00000169,0x0004003d,0x00000006,0x0000016c,0x000000bd,
|
||||
0x0007000c,0x00000006,0x0000016d,0x00000001,0x00000025,0x0000016b,0x0000016c,0x0003003e,
|
||||
0x00000164,0x0000016d,0x0004003d,0x00000006,0x00000170,0x00000090,0x0003003e,0x0000016f,
|
||||
0x00000170,0x0004003d,0x00000006,0x00000172,0x0000009c,0x0003003e,0x00000171,0x00000172,
|
||||
0x0004003d,0x00000006,0x00000174,0x000000ae,0x0003003e,0x00000173,0x00000174,0x00070039,
|
||||
0x00000006,0x00000175,0x0000001b,0x0000016f,0x00000171,0x00000173,0x0004003d,0x00000006,
|
||||
0x00000176,0x000000b7,0x0007000c,0x00000006,0x00000177,0x00000001,0x00000028,0x00000175,
|
||||
0x00000176,0x0003003e,0x0000016e,0x00000177,0x0004003d,0x00000006,0x0000017a,0x00000094,
|
||||
0x0003003e,0x00000179,0x0000017a,0x0004003d,0x00000006,0x0000017c,0x0000009f,0x0003003e,
|
||||
0x0000017b,0x0000017c,0x0004003d,0x00000006,0x0000017e,0x000000b1,0x0003003e,0x0000017d,
|
||||
0x0000017e,0x00070039,0x00000006,0x0000017f,0x0000001b,0x00000179,0x0000017b,0x0000017d,
|
||||
0x0004003d,0x00000006,0x00000180,0x000000ba,0x0007000c,0x00000006,0x00000181,0x00000001,
|
||||
0x00000028,0x0000017f,0x00000180,0x0003003e,0x00000178,0x00000181,0x0004003d,0x00000006,
|
||||
0x00000184,0x00000098,0x0003003e,0x00000183,0x00000184,0x0004003d,0x00000006,0x00000186,
|
||||
0x000000a2,0x0003003e,0x00000185,0x00000186,0x0004003d,0x00000006,0x00000188,0x000000b4,
|
||||
0x0003003e,0x00000187,0x00000188,0x00070039,0x00000006,0x00000189,0x0000001b,0x00000183,
|
||||
0x00000185,0x00000187,0x0004003d,0x00000006,0x0000018a,0x000000bd,0x0007000c,0x00000006,
|
||||
0x0000018b,0x00000001,0x00000028,0x00000189,0x0000018a,0x0003003e,0x00000182,0x0000018b,
|
||||
0x0003003e,0x0000018e,0x00000190,0x0004003d,0x00000006,0x00000192,0x00000150,0x0004003d,
|
||||
0x00000006,0x00000193,0x000000a5,0x0007000c,0x00000006,0x00000194,0x00000001,0x00000025,
|
||||
0x00000192,0x00000193,0x0004003d,0x00000006,0x00000196,0x0000016e,0x00050085,0x00000006,
|
||||
0x00000197,0x00000195,0x00000196,0x0003003e,0x00000198,0x00000197,0x00050039,0x00000006,
|
||||
0x00000199,0x0000000a,0x00000198,0x00050085,0x00000006,0x0000019a,0x00000194,0x00000199,
|
||||
0x0003003e,0x00000191,0x0000019a,0x0004003d,0x00000006,0x0000019c,0x0000015a,0x0004003d,
|
||||
0x00000006,0x0000019d,0x000000a8,0x0007000c,0x00000006,0x0000019e,0x00000001,0x00000025,
|
||||
0x0000019c,0x0000019d,0x0004003d,0x00000006,0x0000019f,0x00000178,0x00050085,0x00000006,
|
||||
0x000001a0,0x00000195,0x0000019f,0x0003003e,0x000001a1,0x000001a0,0x00050039,0x00000006,
|
||||
0x000001a2,0x0000000a,0x000001a1,0x00050085,0x00000006,0x000001a3,0x0000019e,0x000001a2,
|
||||
0x0003003e,0x0000019b,0x000001a3,0x0004003d,0x00000006,0x000001a5,0x00000164,0x0004003d,
|
||||
0x00000006,0x000001a6,0x000000ab,0x0007000c,0x00000006,0x000001a7,0x00000001,0x00000025,
|
||||
0x000001a5,0x000001a6,0x0004003d,0x00000006,0x000001a8,0x00000182,0x00050085,0x00000006,
|
||||
0x000001a9,0x00000195,0x000001a8,0x0003003e,0x000001aa,0x000001a9,0x00050039,0x00000006,
|
||||
0x000001ab,0x0000000a,0x000001aa,0x00050085,0x00000006,0x000001ac,0x000001a7,0x000001ab,
|
||||
0x0003003e,0x000001a4,0x000001ac,0x00050041,0x00000007,0x000001ae,0x0000018e,0x00000091,
|
||||
0x0004003d,0x00000006,0x000001af,0x000001ae,0x0004003d,0x00000006,0x000001b0,0x0000016e,
|
||||
0x0004003d,0x00000006,0x000001b1,0x000000a5,0x0007000c,0x00000006,0x000001b2,0x00000001,
|
||||
0x00000028,0x000001b0,0x000001b1,0x00050083,0x00000006,0x000001b3,0x000001af,0x000001b2,
|
||||
0x0004003d,0x00000006,0x000001b4,0x00000150,0x00050085,0x00000006,0x000001b5,0x00000195,
|
||||
0x000001b4,0x00050041,0x00000007,0x000001b6,0x0000018e,0x00000095,0x0004003d,0x00000006,
|
||||
0x000001b7,0x000001b6,0x00050081,0x00000006,0x000001b8,0x000001b5,0x000001b7,0x0003003e,
|
||||
0x000001b9,0x000001b8,0x00050039,0x00000006,0x000001ba,0x0000000a,0x000001b9,0x00050085,
|
||||
0x00000006,0x000001bb,0x000001b3,0x000001ba,0x0003003e,0x000001ad,0x000001bb,0x00050041,
|
||||
0x00000007,0x000001bd,0x0000018e,0x00000091,0x0004003d,0x00000006,0x000001be,0x000001bd,
|
||||
0x0004003d,0x00000006,0x000001bf,0x00000178,0x0004003d,0x00000006,0x000001c0,0x000000a8,
|
||||
0x0007000c,0x00000006,0x000001c1,0x00000001,0x00000028,0x000001bf,0x000001c0,0x00050083,
|
||||
0x00000006,0x000001c2,0x000001be,0x000001c1,0x0004003d,0x00000006,0x000001c3,0x0000015a,
|
||||
0x00050085,0x00000006,0x000001c4,0x00000195,0x000001c3,0x00050041,0x00000007,0x000001c5,
|
||||
0x0000018e,0x00000095,0x0004003d,0x00000006,0x000001c6,0x000001c5,0x00050081,0x00000006,
|
||||
0x000001c7,0x000001c4,0x000001c6,0x0003003e,0x000001c8,0x000001c7,0x00050039,0x00000006,
|
||||
0x000001c9,0x0000000a,0x000001c8,0x00050085,0x00000006,0x000001ca,0x000001c2,0x000001c9,
|
||||
0x0003003e,0x000001bc,0x000001ca,0x00050041,0x00000007,0x000001cc,0x0000018e,0x00000091,
|
||||
0x0004003d,0x00000006,0x000001cd,0x000001cc,0x0004003d,0x00000006,0x000001ce,0x00000182,
|
||||
0x0004003d,0x00000006,0x000001cf,0x000000ab,0x0007000c,0x00000006,0x000001d0,0x00000001,
|
||||
0x00000028,0x000001ce,0x000001cf,0x00050083,0x00000006,0x000001d1,0x000001cd,0x000001d0,
|
||||
0x0004003d,0x00000006,0x000001d2,0x00000164,0x00050085,0x00000006,0x000001d3,0x00000195,
|
||||
0x000001d2,0x00050041,0x00000007,0x000001d4,0x0000018e,0x00000095,0x0004003d,0x00000006,
|
||||
0x000001d5,0x000001d4,0x00050081,0x00000006,0x000001d6,0x000001d3,0x000001d5,0x0003003e,
|
||||
0x000001d7,0x000001d6,0x00050039,0x00000006,0x000001d8,0x0000000a,0x000001d7,0x00050085,
|
||||
0x00000006,0x000001d9,0x000001d1,0x000001d8,0x0003003e,0x000001cb,0x000001d9,0x0004003d,
|
||||
0x00000006,0x000001db,0x00000191,0x0004007f,0x00000006,0x000001dc,0x000001db,0x0004003d,
|
||||
0x00000006,0x000001dd,0x000001ad,0x0007000c,0x00000006,0x000001de,0x00000001,0x00000028,
|
||||
0x000001dc,0x000001dd,0x0003003e,0x000001da,0x000001de,0x0004003d,0x00000006,0x000001e0,
|
||||
0x0000019b,0x0004007f,0x00000006,0x000001e1,0x000001e0,0x0004003d,0x00000006,0x000001e2,
|
||||
0x000001bc,0x0007000c,0x00000006,0x000001e3,0x00000001,0x00000028,0x000001e1,0x000001e2,
|
||||
0x0003003e,0x000001df,0x000001e3,0x0004003d,0x00000006,0x000001e5,0x000001a4,0x0004007f,
|
||||
0x00000006,0x000001e6,0x000001e5,0x0004003d,0x00000006,0x000001e7,0x000001cb,0x0007000c,
|
||||
0x00000006,0x000001e8,0x00000001,0x00000028,0x000001e6,0x000001e7,0x0003003e,0x000001e4,
|
||||
0x000001e8,0x0004003d,0x00000006,0x000001ec,0x000001da,0x0003003e,0x000001eb,0x000001ec,
|
||||
0x0004003d,0x00000006,0x000001ee,0x000001df,0x0003003e,0x000001ed,0x000001ee,0x0004003d,
|
||||
0x00000006,0x000001f0,0x000001e4,0x0003003e,0x000001ef,0x000001f0,0x00070039,0x00000006,
|
||||
0x000001f1,0x0000001b,0x000001eb,0x000001ed,0x000001ef,0x0007000c,0x00000006,0x000001f2,
|
||||
0x00000001,0x00000025,0x000001f1,0x00000042,0x0007000c,0x00000006,0x000001f3,0x00000001,
|
||||
0x00000028,0x000001ea,0x000001f2,0x00050041,0x000001f4,0x000001f5,0x00000035,0x00000091,
|
||||
0x0004003d,0x0000002b,0x000001f6,0x000001f5,0x0004007c,0x00000006,0x000001f7,0x000001f6,
|
||||
0x00050085,0x00000006,0x000001f8,0x000001f3,0x000001f7,0x0003003e,0x000001e9,0x000001f8,
|
||||
0x0004003d,0x00000006,0x000001fa,0x000001e9,0x00050085,0x00000006,0x000001fb,0x00000195,
|
||||
0x000001fa,0x00050081,0x00000006,0x000001fc,0x000001fb,0x00000038,0x0003003e,0x000001fd,
|
||||
0x000001fc,0x00050039,0x00000006,0x000001fe,0x0000000d,0x000001fd,0x0003003e,0x000001f9,
|
||||
0x000001fe,0x0004003d,0x00000006,0x000001ff,0x000001e9,0x0004003d,0x00000006,0x00000200,
|
||||
0x00000090,0x00050085,0x00000006,0x00000201,0x000001ff,0x00000200,0x0004003d,0x00000006,
|
||||
0x00000202,0x000001e9,0x0004003d,0x00000006,0x00000203,0x0000009c,0x00050085,0x00000006,
|
||||
0x00000204,0x00000202,0x00000203,0x00050081,0x00000006,0x00000205,0x00000201,0x00000204,
|
||||
0x0004003d,0x00000006,0x00000206,0x000001e9,0x0004003d,0x00000006,0x00000207,0x000000b7,
|
||||
0x00050085,0x00000006,0x00000208,0x00000206,0x00000207,0x00050081,0x00000006,0x00000209,
|
||||
0x00000205,0x00000208,0x0004003d,0x00000006,0x0000020a,0x000001e9,0x0004003d,0x00000006,
|
||||
0x0000020b,0x000000ae,0x00050085,0x00000006,0x0000020c,0x0000020a,0x0000020b,0x00050081,
|
||||
0x00000006,0x0000020d,0x00000209,0x0000020c,0x0004003d,0x00000006,0x0000020e,0x000000a5,
|
||||
0x00050081,0x00000006,0x0000020f,0x0000020d,0x0000020e,0x0004003d,0x00000006,0x00000210,
|
||||
0x000001f9,0x00050085,0x00000006,0x00000211,0x0000020f,0x00000210,0x0003003e,0x00000031,
|
||||
0x00000211,0x0004003d,0x00000006,0x00000212,0x000001e9,0x0004003d,0x00000006,0x00000213,
|
||||
0x00000094,0x00050085,0x00000006,0x00000214,0x00000212,0x00000213,0x0004003d,0x00000006,
|
||||
0x00000215,0x000001e9,0x0004003d,0x00000006,0x00000216,0x0000009f,0x00050085,0x00000006,
|
||||
0x00000217,0x00000215,0x00000216,0x00050081,0x00000006,0x00000218,0x00000214,0x00000217,
|
||||
0x0004003d,0x00000006,0x00000219,0x000001e9,0x0004003d,0x00000006,0x0000021a,0x000000ba,
|
||||
0x00050085,0x00000006,0x0000021b,0x00000219,0x0000021a,0x00050081,0x00000006,0x0000021c,
|
||||
0x00000218,0x0000021b,0x0004003d,0x00000006,0x0000021d,0x000001e9,0x0004003d,0x00000006,
|
||||
0x0000021e,0x000000b1,0x00050085,0x00000006,0x0000021f,0x0000021d,0x0000021e,0x00050081,
|
||||
0x00000006,0x00000220,0x0000021c,0x0000021f,0x0004003d,0x00000006,0x00000221,0x000000a8,
|
||||
0x00050081,0x00000006,0x00000222,0x00000220,0x00000221,0x0004003d,0x00000006,0x00000223,
|
||||
0x000001f9,0x00050085,0x00000006,0x00000224,0x00000222,0x00000223,0x0003003e,0x00000032,
|
||||
0x00000224,0x0004003d,0x00000006,0x00000225,0x000001e9,0x0004003d,0x00000006,0x00000226,
|
||||
0x00000098,0x00050085,0x00000006,0x00000227,0x00000225,0x00000226,0x0004003d,0x00000006,
|
||||
0x00000228,0x000001e9,0x0004003d,0x00000006,0x00000229,0x000000a2,0x00050085,0x00000006,
|
||||
0x0000022a,0x00000228,0x00000229,0x00050081,0x00000006,0x0000022b,0x00000227,0x0000022a,
|
||||
0x0004003d,0x00000006,0x0000022c,0x000001e9,0x0004003d,0x00000006,0x0000022d,0x000000bd,
|
||||
0x00050085,0x00000006,0x0000022e,0x0000022c,0x0000022d,0x00050081,0x00000006,0x0000022f,
|
||||
0x0000022b,0x0000022e,0x0004003d,0x00000006,0x00000230,0x000001e9,0x0004003d,0x00000006,
|
||||
0x00000231,0x000000b4,0x00050085,0x00000006,0x00000232,0x00000230,0x00000231,0x00050081,
|
||||
0x00000006,0x00000233,0x0000022f,0x00000232,0x0004003d,0x00000006,0x00000234,0x000000ab,
|
||||
0x00050081,0x00000006,0x00000235,0x00000233,0x00000234,0x0004003d,0x00000006,0x00000236,
|
||||
0x000001f9,0x00050085,0x00000006,0x00000237,0x00000235,0x00000236,0x0003003e,0x00000033,
|
||||
0x00000237,0x000100fd,0x00010038
|
||||
0x00000007,0x0000013a,0x00000007,0x0004003b,0x00000007,0x0000013c,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000140,0x00000007,0x0004003b,0x00000007,0x00000143,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000149,0x00000007,0x0004003b,0x00000007,0x0000014a,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000014c,0x00000007,0x0004003b,0x00000007,0x0000014e,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000153,0x00000007,0x0004003b,0x00000007,0x00000154,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000156,0x00000007,0x0004003b,0x00000007,0x00000158,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000015d,0x00000007,0x0004003b,0x00000007,0x0000015e,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000160,0x00000007,0x0004003b,0x00000007,0x00000162,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000167,0x00000007,0x0004003b,0x00000007,0x00000168,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000016a,0x00000007,0x0004003b,0x00000007,0x0000016c,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000171,0x00000007,0x0004003b,0x00000007,0x00000172,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000174,0x00000007,0x0004003b,0x00000007,0x00000176,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000017b,0x00000007,0x0004003b,0x00000007,0x0000017c,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000017e,0x00000007,0x0004003b,0x00000007,0x00000180,0x00000007,0x0004003b,
|
||||
0x00000186,0x00000187,0x00000007,0x0004003b,0x00000007,0x0000018a,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000018e,0x00000007,0x0004003b,0x00000007,0x00000191,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000194,0x00000007,0x0004003b,0x00000007,0x0000019a,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001a0,0x00000007,0x0004003b,0x00000007,0x000001a6,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001aa,0x00000007,0x0004003b,0x00000007,0x000001b4,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001b7,0x00000007,0x0004003b,0x00000007,0x000001c1,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001c4,0x00000007,0x0004003b,0x00000007,0x000001ce,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001d5,0x00000007,0x0004003b,0x00000007,0x000001dc,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001e3,0x00000007,0x0004003b,0x00000007,0x000001e8,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001f0,0x00000007,0x0004003b,0x00000007,0x000001f4,0x00000007,0x0004003b,
|
||||
0x00000007,0x000001fc,0x00000007,0x0004003b,0x00000007,0x00000200,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000208,0x00000007,0x0004003b,0x00000007,0x0000020d,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000212,0x00000007,0x0004003b,0x00000007,0x00000217,0x00000007,0x0004003b,
|
||||
0x00000007,0x00000219,0x00000007,0x0004003b,0x00000007,0x0000021b,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000021d,0x00000007,0x0004003b,0x00000007,0x00000227,0x00000007,0x0004003b,
|
||||
0x00000007,0x0000022b,0x00000007,0x0004003d,0x00000029,0x00000063,0x00000031,0x0004007c,
|
||||
0x0000001b,0x00000064,0x00000063,0x0003003e,0x00000062,0x00000064,0x0004003d,0x0000001b,
|
||||
0x00000068,0x00000062,0x00050080,0x0000001b,0x0000006b,0x00000068,0x0000006a,0x0003003e,
|
||||
0x0000006c,0x0000006b,0x00050039,0x0000001d,0x0000006d,0x00000020,0x0000006c,0x0008004f,
|
||||
0x00000065,0x0000006e,0x0000006d,0x0000006d,0x00000000,0x00000001,0x00000002,0x0003003e,
|
||||
0x00000067,0x0000006e,0x0004003d,0x0000001b,0x00000070,0x00000062,0x00050080,0x0000001b,
|
||||
0x00000072,0x00000070,0x00000071,0x0003003e,0x00000073,0x00000072,0x00050039,0x0000001d,
|
||||
0x00000074,0x00000020,0x00000073,0x0008004f,0x00000065,0x00000075,0x00000074,0x00000074,
|
||||
0x00000000,0x00000001,0x00000002,0x0003003e,0x0000006f,0x00000075,0x0004003d,0x0000001b,
|
||||
0x00000078,0x00000062,0x0003003e,0x00000077,0x00000078,0x00050039,0x0000001d,0x00000079,
|
||||
0x00000020,0x00000077,0x0008004f,0x00000065,0x0000007a,0x00000079,0x00000079,0x00000000,
|
||||
0x00000001,0x00000002,0x0003003e,0x00000076,0x0000007a,0x0004003d,0x0000001b,0x0000007c,
|
||||
0x00000062,0x00050080,0x0000001b,0x0000007e,0x0000007c,0x0000007d,0x0003003e,0x0000007f,
|
||||
0x0000007e,0x00050039,0x0000001d,0x00000080,0x00000020,0x0000007f,0x0008004f,0x00000065,
|
||||
0x00000081,0x00000080,0x00000080,0x00000000,0x00000001,0x00000002,0x0003003e,0x0000007b,
|
||||
0x00000081,0x0004003d,0x0000001b,0x00000083,0x00000062,0x00050080,0x0000001b,0x00000085,
|
||||
0x00000083,0x00000084,0x0003003e,0x00000086,0x00000085,0x00050039,0x0000001d,0x00000087,
|
||||
0x00000020,0x00000086,0x0008004f,0x00000065,0x00000088,0x00000087,0x00000087,0x00000000,
|
||||
0x00000001,0x00000002,0x0003003e,0x00000082,0x00000088,0x00050041,0x00000007,0x0000008b,
|
||||
0x00000067,0x0000008a,0x0004003d,0x00000006,0x0000008c,0x0000008b,0x0003003e,0x00000089,
|
||||
0x0000008c,0x00050041,0x00000007,0x0000008f,0x00000067,0x0000008e,0x0004003d,0x00000006,
|
||||
0x00000090,0x0000008f,0x0003003e,0x0000008d,0x00000090,0x00050041,0x00000007,0x00000093,
|
||||
0x00000067,0x00000092,0x0004003d,0x00000006,0x00000094,0x00000093,0x0003003e,0x00000091,
|
||||
0x00000094,0x00050041,0x00000007,0x00000096,0x0000006f,0x0000008a,0x0004003d,0x00000006,
|
||||
0x00000097,0x00000096,0x0003003e,0x00000095,0x00000097,0x00050041,0x00000007,0x00000099,
|
||||
0x0000006f,0x0000008e,0x0004003d,0x00000006,0x0000009a,0x00000099,0x0003003e,0x00000098,
|
||||
0x0000009a,0x00050041,0x00000007,0x0000009c,0x0000006f,0x00000092,0x0004003d,0x00000006,
|
||||
0x0000009d,0x0000009c,0x0003003e,0x0000009b,0x0000009d,0x00050041,0x00000007,0x0000009f,
|
||||
0x00000076,0x0000008a,0x0004003d,0x00000006,0x000000a0,0x0000009f,0x0003003e,0x0000009e,
|
||||
0x000000a0,0x00050041,0x00000007,0x000000a2,0x00000076,0x0000008e,0x0004003d,0x00000006,
|
||||
0x000000a3,0x000000a2,0x0003003e,0x000000a1,0x000000a3,0x00050041,0x00000007,0x000000a5,
|
||||
0x00000076,0x00000092,0x0004003d,0x00000006,0x000000a6,0x000000a5,0x0003003e,0x000000a4,
|
||||
0x000000a6,0x00050041,0x00000007,0x000000a8,0x0000007b,0x0000008a,0x0004003d,0x00000006,
|
||||
0x000000a9,0x000000a8,0x0003003e,0x000000a7,0x000000a9,0x00050041,0x00000007,0x000000ab,
|
||||
0x0000007b,0x0000008e,0x0004003d,0x00000006,0x000000ac,0x000000ab,0x0003003e,0x000000aa,
|
||||
0x000000ac,0x00050041,0x00000007,0x000000ae,0x0000007b,0x00000092,0x0004003d,0x00000006,
|
||||
0x000000af,0x000000ae,0x0003003e,0x000000ad,0x000000af,0x00050041,0x00000007,0x000000b1,
|
||||
0x00000082,0x0000008a,0x0004003d,0x00000006,0x000000b2,0x000000b1,0x0003003e,0x000000b0,
|
||||
0x000000b2,0x00050041,0x00000007,0x000000b4,0x00000082,0x0000008e,0x0004003d,0x00000006,
|
||||
0x000000b5,0x000000b4,0x0003003e,0x000000b3,0x000000b5,0x00050041,0x00000007,0x000000b7,
|
||||
0x00000082,0x00000092,0x0004003d,0x00000006,0x000000b8,0x000000b7,0x0003003e,0x000000b6,
|
||||
0x000000b8,0x0004003d,0x00000006,0x000000ba,0x00000089,0x0003003e,0x000000b9,0x000000ba,
|
||||
0x0004003d,0x00000006,0x000000bc,0x0000008d,0x0003003e,0x000000bb,0x000000bc,0x0004003d,
|
||||
0x00000006,0x000000be,0x00000091,0x0003003e,0x000000bd,0x000000be,0x00070039,0x00000002,
|
||||
0x000000bf,0x00000026,0x000000b9,0x000000bb,0x000000bd,0x0004003d,0x00000006,0x000000c0,
|
||||
0x000000b9,0x0003003e,0x00000089,0x000000c0,0x0004003d,0x00000006,0x000000c1,0x000000bb,
|
||||
0x0003003e,0x0000008d,0x000000c1,0x0004003d,0x00000006,0x000000c2,0x000000bd,0x0003003e,
|
||||
0x00000091,0x000000c2,0x0004003d,0x00000006,0x000000c4,0x00000095,0x0003003e,0x000000c3,
|
||||
0x000000c4,0x0004003d,0x00000006,0x000000c6,0x00000098,0x0003003e,0x000000c5,0x000000c6,
|
||||
0x0004003d,0x00000006,0x000000c8,0x0000009b,0x0003003e,0x000000c7,0x000000c8,0x00070039,
|
||||
0x00000002,0x000000c9,0x00000026,0x000000c3,0x000000c5,0x000000c7,0x0004003d,0x00000006,
|
||||
0x000000ca,0x000000c3,0x0003003e,0x00000095,0x000000ca,0x0004003d,0x00000006,0x000000cb,
|
||||
0x000000c5,0x0003003e,0x00000098,0x000000cb,0x0004003d,0x00000006,0x000000cc,0x000000c7,
|
||||
0x0003003e,0x0000009b,0x000000cc,0x0004003d,0x00000006,0x000000ce,0x0000009e,0x0003003e,
|
||||
0x000000cd,0x000000ce,0x0004003d,0x00000006,0x000000d0,0x000000a1,0x0003003e,0x000000cf,
|
||||
0x000000d0,0x0004003d,0x00000006,0x000000d2,0x000000a4,0x0003003e,0x000000d1,0x000000d2,
|
||||
0x00070039,0x00000002,0x000000d3,0x00000026,0x000000cd,0x000000cf,0x000000d1,0x0004003d,
|
||||
0x00000006,0x000000d4,0x000000cd,0x0003003e,0x0000009e,0x000000d4,0x0004003d,0x00000006,
|
||||
0x000000d5,0x000000cf,0x0003003e,0x000000a1,0x000000d5,0x0004003d,0x00000006,0x000000d6,
|
||||
0x000000d1,0x0003003e,0x000000a4,0x000000d6,0x0004003d,0x00000006,0x000000d8,0x000000a7,
|
||||
0x0003003e,0x000000d7,0x000000d8,0x0004003d,0x00000006,0x000000da,0x000000aa,0x0003003e,
|
||||
0x000000d9,0x000000da,0x0004003d,0x00000006,0x000000dc,0x000000ad,0x0003003e,0x000000db,
|
||||
0x000000dc,0x00070039,0x00000002,0x000000dd,0x00000026,0x000000d7,0x000000d9,0x000000db,
|
||||
0x0004003d,0x00000006,0x000000de,0x000000d7,0x0003003e,0x000000a7,0x000000de,0x0004003d,
|
||||
0x00000006,0x000000df,0x000000d9,0x0003003e,0x000000aa,0x000000df,0x0004003d,0x00000006,
|
||||
0x000000e0,0x000000db,0x0003003e,0x000000ad,0x000000e0,0x0004003d,0x00000006,0x000000e2,
|
||||
0x000000b0,0x0003003e,0x000000e1,0x000000e2,0x0004003d,0x00000006,0x000000e4,0x000000b3,
|
||||
0x0003003e,0x000000e3,0x000000e4,0x0004003d,0x00000006,0x000000e6,0x000000b6,0x0003003e,
|
||||
0x000000e5,0x000000e6,0x00070039,0x00000002,0x000000e7,0x00000026,0x000000e1,0x000000e3,
|
||||
0x000000e5,0x0004003d,0x00000006,0x000000e8,0x000000e1,0x0003003e,0x000000b0,0x000000e8,
|
||||
0x0004003d,0x00000006,0x000000e9,0x000000e3,0x0003003e,0x000000b3,0x000000e9,0x0004003d,
|
||||
0x00000006,0x000000ea,0x000000e5,0x0003003e,0x000000b6,0x000000ea,0x0004003d,0x00000006,
|
||||
0x000000ec,0x00000091,0x00050085,0x00000006,0x000000ee,0x000000ec,0x000000ed,0x0004003d,
|
||||
0x00000006,0x000000ef,0x00000089,0x00050085,0x00000006,0x000000f0,0x000000ef,0x000000ed,
|
||||
0x0004003d,0x00000006,0x000000f1,0x0000008d,0x00050081,0x00000006,0x000000f2,0x000000f0,
|
||||
0x000000f1,0x00050081,0x00000006,0x000000f3,0x000000ee,0x000000f2,0x0003003e,0x000000eb,
|
||||
0x000000f3,0x0004003d,0x00000006,0x000000f5,0x0000009b,0x00050085,0x00000006,0x000000f6,
|
||||
0x000000f5,0x000000ed,0x0004003d,0x00000006,0x000000f7,0x00000095,0x00050085,0x00000006,
|
||||
0x000000f8,0x000000f7,0x000000ed,0x0004003d,0x00000006,0x000000f9,0x00000098,0x00050081,
|
||||
0x00000006,0x000000fa,0x000000f8,0x000000f9,0x00050081,0x00000006,0x000000fb,0x000000f6,
|
||||
0x000000fa,0x0003003e,0x000000f4,0x000000fb,0x0004003d,0x00000006,0x000000fd,0x000000a4,
|
||||
0x00050085,0x00000006,0x000000fe,0x000000fd,0x000000ed,0x0004003d,0x00000006,0x000000ff,
|
||||
0x0000009e,0x00050085,0x00000006,0x00000100,0x000000ff,0x000000ed,0x0004003d,0x00000006,
|
||||
0x00000101,0x000000a1,0x00050081,0x00000006,0x00000102,0x00000100,0x00000101,0x00050081,
|
||||
0x00000006,0x00000103,0x000000fe,0x00000102,0x0003003e,0x000000fc,0x00000103,0x0004003d,
|
||||
0x00000006,0x00000105,0x000000ad,0x00050085,0x00000006,0x00000106,0x00000105,0x000000ed,
|
||||
0x0004003d,0x00000006,0x00000107,0x000000a7,0x00050085,0x00000006,0x00000108,0x00000107,
|
||||
0x000000ed,0x0004003d,0x00000006,0x00000109,0x000000aa,0x00050081,0x00000006,0x0000010a,
|
||||
0x00000108,0x00000109,0x00050081,0x00000006,0x0000010b,0x00000106,0x0000010a,0x0003003e,
|
||||
0x00000104,0x0000010b,0x0004003d,0x00000006,0x0000010d,0x000000b6,0x00050085,0x00000006,
|
||||
0x0000010e,0x0000010d,0x000000ed,0x0004003d,0x00000006,0x0000010f,0x000000b0,0x00050085,
|
||||
0x00000006,0x00000110,0x0000010f,0x000000ed,0x0004003d,0x00000006,0x00000111,0x000000b3,
|
||||
0x00050081,0x00000006,0x00000112,0x00000110,0x00000111,0x00050081,0x00000006,0x00000113,
|
||||
0x0000010e,0x00000112,0x0003003e,0x0000010c,0x00000113,0x0004003d,0x00000006,0x00000116,
|
||||
0x000000eb,0x00050085,0x00000006,0x00000117,0x00000115,0x00000116,0x0004003d,0x00000006,
|
||||
0x00000118,0x000000f4,0x00050085,0x00000006,0x00000119,0x00000115,0x00000118,0x00050081,
|
||||
0x00000006,0x0000011a,0x00000117,0x00000119,0x0004003d,0x00000006,0x0000011b,0x00000104,
|
||||
0x00050085,0x00000006,0x0000011c,0x00000115,0x0000011b,0x00050081,0x00000006,0x0000011d,
|
||||
0x0000011a,0x0000011c,0x0004003d,0x00000006,0x0000011e,0x0000010c,0x00050085,0x00000006,
|
||||
0x0000011f,0x00000115,0x0000011e,0x00050081,0x00000006,0x00000120,0x0000011d,0x0000011f,
|
||||
0x0004003d,0x00000006,0x00000121,0x000000fc,0x00050083,0x00000006,0x00000122,0x00000120,
|
||||
0x00000121,0x0003003e,0x00000114,0x00000122,0x0004003d,0x00000006,0x00000123,0x00000114,
|
||||
0x0006000c,0x00000006,0x00000124,0x00000001,0x00000004,0x00000123,0x0004003d,0x00000006,
|
||||
0x00000126,0x000000eb,0x0003003e,0x00000125,0x00000126,0x0004003d,0x00000006,0x00000128,
|
||||
0x000000f4,0x0003003e,0x00000127,0x00000128,0x0004003d,0x00000006,0x0000012a,0x000000fc,
|
||||
0x0003003e,0x00000129,0x0000012a,0x00070039,0x00000006,0x0000012b,0x00000018,0x00000125,
|
||||
0x00000127,0x00000129,0x0003003e,0x0000012c,0x0000012b,0x0004003d,0x00000006,0x0000012e,
|
||||
0x00000104,0x0003003e,0x0000012d,0x0000012e,0x0004003d,0x00000006,0x00000130,0x0000010c,
|
||||
0x0003003e,0x0000012f,0x00000130,0x00070039,0x00000006,0x00000131,0x00000018,0x0000012c,
|
||||
0x0000012d,0x0000012f,0x0004003d,0x00000006,0x00000133,0x000000eb,0x0003003e,0x00000132,
|
||||
0x00000133,0x0004003d,0x00000006,0x00000135,0x000000f4,0x0003003e,0x00000134,0x00000135,
|
||||
0x0004003d,0x00000006,0x00000137,0x000000fc,0x0003003e,0x00000136,0x00000137,0x00070039,
|
||||
0x00000006,0x00000138,0x00000013,0x00000132,0x00000134,0x00000136,0x0003003e,0x00000139,
|
||||
0x00000138,0x0004003d,0x00000006,0x0000013b,0x00000104,0x0003003e,0x0000013a,0x0000013b,
|
||||
0x0004003d,0x00000006,0x0000013d,0x0000010c,0x0003003e,0x0000013c,0x0000013d,0x00070039,
|
||||
0x00000006,0x0000013e,0x00000013,0x00000139,0x0000013a,0x0000013c,0x00050083,0x00000006,
|
||||
0x0000013f,0x00000131,0x0000013e,0x0003003e,0x00000140,0x0000013f,0x00050039,0x00000006,
|
||||
0x00000141,0x0000000a,0x00000140,0x00050085,0x00000006,0x00000142,0x00000124,0x00000141,
|
||||
0x0003003e,0x00000143,0x00000142,0x00050039,0x00000006,0x00000144,0x0000000d,0x00000143,
|
||||
0x0003003e,0x00000114,0x00000144,0x0004003d,0x00000006,0x00000146,0x00000114,0x00050085,
|
||||
0x00000006,0x00000147,0x00000145,0x00000146,0x00050081,0x00000006,0x00000148,0x00000147,
|
||||
0x00000035,0x0003003e,0x00000114,0x00000148,0x0004003d,0x00000006,0x0000014b,0x00000089,
|
||||
0x0003003e,0x0000014a,0x0000014b,0x0004003d,0x00000006,0x0000014d,0x00000095,0x0003003e,
|
||||
0x0000014c,0x0000014d,0x0004003d,0x00000006,0x0000014f,0x000000a7,0x0003003e,0x0000014e,
|
||||
0x0000014f,0x00070039,0x00000006,0x00000150,0x00000013,0x0000014a,0x0000014c,0x0000014e,
|
||||
0x0004003d,0x00000006,0x00000151,0x000000b0,0x0007000c,0x00000006,0x00000152,0x00000001,
|
||||
0x00000025,0x00000150,0x00000151,0x0003003e,0x00000149,0x00000152,0x0004003d,0x00000006,
|
||||
0x00000155,0x0000008d,0x0003003e,0x00000154,0x00000155,0x0004003d,0x00000006,0x00000157,
|
||||
0x00000098,0x0003003e,0x00000156,0x00000157,0x0004003d,0x00000006,0x00000159,0x000000aa,
|
||||
0x0003003e,0x00000158,0x00000159,0x00070039,0x00000006,0x0000015a,0x00000013,0x00000154,
|
||||
0x00000156,0x00000158,0x0004003d,0x00000006,0x0000015b,0x000000b3,0x0007000c,0x00000006,
|
||||
0x0000015c,0x00000001,0x00000025,0x0000015a,0x0000015b,0x0003003e,0x00000153,0x0000015c,
|
||||
0x0004003d,0x00000006,0x0000015f,0x00000091,0x0003003e,0x0000015e,0x0000015f,0x0004003d,
|
||||
0x00000006,0x00000161,0x0000009b,0x0003003e,0x00000160,0x00000161,0x0004003d,0x00000006,
|
||||
0x00000163,0x000000ad,0x0003003e,0x00000162,0x00000163,0x00070039,0x00000006,0x00000164,
|
||||
0x00000013,0x0000015e,0x00000160,0x00000162,0x0004003d,0x00000006,0x00000165,0x000000b6,
|
||||
0x0007000c,0x00000006,0x00000166,0x00000001,0x00000025,0x00000164,0x00000165,0x0003003e,
|
||||
0x0000015d,0x00000166,0x0004003d,0x00000006,0x00000169,0x00000089,0x0003003e,0x00000168,
|
||||
0x00000169,0x0004003d,0x00000006,0x0000016b,0x00000095,0x0003003e,0x0000016a,0x0000016b,
|
||||
0x0004003d,0x00000006,0x0000016d,0x000000a7,0x0003003e,0x0000016c,0x0000016d,0x00070039,
|
||||
0x00000006,0x0000016e,0x00000018,0x00000168,0x0000016a,0x0000016c,0x0004003d,0x00000006,
|
||||
0x0000016f,0x000000b0,0x0007000c,0x00000006,0x00000170,0x00000001,0x00000028,0x0000016e,
|
||||
0x0000016f,0x0003003e,0x00000167,0x00000170,0x0004003d,0x00000006,0x00000173,0x0000008d,
|
||||
0x0003003e,0x00000172,0x00000173,0x0004003d,0x00000006,0x00000175,0x00000098,0x0003003e,
|
||||
0x00000174,0x00000175,0x0004003d,0x00000006,0x00000177,0x000000aa,0x0003003e,0x00000176,
|
||||
0x00000177,0x00070039,0x00000006,0x00000178,0x00000018,0x00000172,0x00000174,0x00000176,
|
||||
0x0004003d,0x00000006,0x00000179,0x000000b3,0x0007000c,0x00000006,0x0000017a,0x00000001,
|
||||
0x00000028,0x00000178,0x00000179,0x0003003e,0x00000171,0x0000017a,0x0004003d,0x00000006,
|
||||
0x0000017d,0x00000091,0x0003003e,0x0000017c,0x0000017d,0x0004003d,0x00000006,0x0000017f,
|
||||
0x0000009b,0x0003003e,0x0000017e,0x0000017f,0x0004003d,0x00000006,0x00000181,0x000000ad,
|
||||
0x0003003e,0x00000180,0x00000181,0x00070039,0x00000006,0x00000182,0x00000018,0x0000017c,
|
||||
0x0000017e,0x00000180,0x0004003d,0x00000006,0x00000183,0x000000b6,0x0007000c,0x00000006,
|
||||
0x00000184,0x00000001,0x00000028,0x00000182,0x00000183,0x0003003e,0x0000017b,0x00000184,
|
||||
0x0003003e,0x00000187,0x00000189,0x0004003d,0x00000006,0x0000018c,0x00000167,0x00050085,
|
||||
0x00000006,0x0000018d,0x0000018b,0x0000018c,0x0003003e,0x0000018a,0x0000018d,0x0004003d,
|
||||
0x00000006,0x0000018f,0x00000171,0x00050085,0x00000006,0x00000190,0x0000018b,0x0000018f,
|
||||
0x0003003e,0x0000018e,0x00000190,0x0004003d,0x00000006,0x00000192,0x0000017b,0x00050085,
|
||||
0x00000006,0x00000193,0x0000018b,0x00000192,0x0003003e,0x00000191,0x00000193,0x0004003d,
|
||||
0x00000006,0x00000195,0x00000149,0x00050085,0x00000006,0x00000196,0x0000018b,0x00000195,
|
||||
0x00050041,0x00000007,0x00000197,0x00000187,0x0000008e,0x0004003d,0x00000006,0x00000198,
|
||||
0x00000197,0x00050081,0x00000006,0x00000199,0x00000196,0x00000198,0x0003003e,0x00000194,
|
||||
0x00000199,0x0004003d,0x00000006,0x0000019b,0x00000153,0x00050085,0x00000006,0x0000019c,
|
||||
0x0000018b,0x0000019b,0x00050041,0x00000007,0x0000019d,0x00000187,0x0000008e,0x0004003d,
|
||||
0x00000006,0x0000019e,0x0000019d,0x00050081,0x00000006,0x0000019f,0x0000019c,0x0000019e,
|
||||
0x0003003e,0x0000019a,0x0000019f,0x0004003d,0x00000006,0x000001a1,0x0000015d,0x00050085,
|
||||
0x00000006,0x000001a2,0x0000018b,0x000001a1,0x00050041,0x00000007,0x000001a3,0x00000187,
|
||||
0x0000008e,0x0004003d,0x00000006,0x000001a4,0x000001a3,0x00050081,0x00000006,0x000001a5,
|
||||
0x000001a2,0x000001a4,0x0003003e,0x000001a0,0x000001a5,0x0004003d,0x00000006,0x000001a7,
|
||||
0x0000018a,0x000500ba,0x000001a8,0x000001a9,0x000001a7,0x0000003b,0x000300f7,0x000001ac,
|
||||
0x00000000,0x000400fa,0x000001a9,0x000001ab,0x000001b2,0x000200f8,0x000001ab,0x0004003d,
|
||||
0x00000006,0x000001ad,0x00000149,0x0004003d,0x00000006,0x000001ae,0x0000009e,0x0007000c,
|
||||
0x00000006,0x000001af,0x00000001,0x00000025,0x000001ad,0x000001ae,0x0004003d,0x00000006,
|
||||
0x000001b0,0x0000018a,0x00050088,0x00000006,0x000001b1,0x000001af,0x000001b0,0x0003003e,
|
||||
0x000001aa,0x000001b1,0x000200f9,0x000001ac,0x000200f8,0x000001b2,0x0003003e,0x000001aa,
|
||||
0x0000003b,0x000200f9,0x000001ac,0x000200f8,0x000001ac,0x0004003d,0x00000006,0x000001b3,
|
||||
0x000001aa,0x0003003e,0x000001a6,0x000001b3,0x0004003d,0x00000006,0x000001b5,0x0000018e,
|
||||
0x000500ba,0x000001a8,0x000001b6,0x000001b5,0x0000003b,0x000300f7,0x000001b9,0x00000000,
|
||||
0x000400fa,0x000001b6,0x000001b8,0x000001bf,0x000200f8,0x000001b8,0x0004003d,0x00000006,
|
||||
0x000001ba,0x00000153,0x0004003d,0x00000006,0x000001bb,0x000000a1,0x0007000c,0x00000006,
|
||||
0x000001bc,0x00000001,0x00000025,0x000001ba,0x000001bb,0x0004003d,0x00000006,0x000001bd,
|
||||
0x0000018e,0x00050088,0x00000006,0x000001be,0x000001bc,0x000001bd,0x0003003e,0x000001b7,
|
||||
0x000001be,0x000200f9,0x000001b9,0x000200f8,0x000001bf,0x0003003e,0x000001b7,0x0000003b,
|
||||
0x000200f9,0x000001b9,0x000200f8,0x000001b9,0x0004003d,0x00000006,0x000001c0,0x000001b7,
|
||||
0x0003003e,0x000001b4,0x000001c0,0x0004003d,0x00000006,0x000001c2,0x00000191,0x000500ba,
|
||||
0x000001a8,0x000001c3,0x000001c2,0x0000003b,0x000300f7,0x000001c6,0x00000000,0x000400fa,
|
||||
0x000001c3,0x000001c5,0x000001cc,0x000200f8,0x000001c5,0x0004003d,0x00000006,0x000001c7,
|
||||
0x0000015d,0x0004003d,0x00000006,0x000001c8,0x000000a4,0x0007000c,0x00000006,0x000001c9,
|
||||
0x00000001,0x00000025,0x000001c7,0x000001c8,0x0004003d,0x00000006,0x000001ca,0x00000191,
|
||||
0x00050088,0x00000006,0x000001cb,0x000001c9,0x000001ca,0x0003003e,0x000001c4,0x000001cb,
|
||||
0x000200f9,0x000001c6,0x000200f8,0x000001cc,0x0003003e,0x000001c4,0x0000003b,0x000200f9,
|
||||
0x000001c6,0x000200f8,0x000001c6,0x0004003d,0x00000006,0x000001cd,0x000001c4,0x0003003e,
|
||||
0x000001c1,0x000001cd,0x00050041,0x00000007,0x000001cf,0x00000187,0x0000008a,0x0004003d,
|
||||
0x00000006,0x000001d0,0x000001cf,0x0004003d,0x00000006,0x000001d1,0x00000167,0x0004003d,
|
||||
0x00000006,0x000001d2,0x0000009e,0x0007000c,0x00000006,0x000001d3,0x00000001,0x00000028,
|
||||
0x000001d1,0x000001d2,0x00050083,0x00000006,0x000001d4,0x000001d0,0x000001d3,0x0003003e,
|
||||
0x000001ce,0x000001d4,0x00050041,0x00000007,0x000001d6,0x00000187,0x0000008a,0x0004003d,
|
||||
0x00000006,0x000001d7,0x000001d6,0x0004003d,0x00000006,0x000001d8,0x00000171,0x0004003d,
|
||||
0x00000006,0x000001d9,0x000000a1,0x0007000c,0x00000006,0x000001da,0x00000001,0x00000028,
|
||||
0x000001d8,0x000001d9,0x00050083,0x00000006,0x000001db,0x000001d7,0x000001da,0x0003003e,
|
||||
0x000001d5,0x000001db,0x00050041,0x00000007,0x000001dd,0x00000187,0x0000008a,0x0004003d,
|
||||
0x00000006,0x000001de,0x000001dd,0x0004003d,0x00000006,0x000001df,0x0000017b,0x0004003d,
|
||||
0x00000006,0x000001e0,0x000000a4,0x0007000c,0x00000006,0x000001e1,0x00000001,0x00000028,
|
||||
0x000001df,0x000001e0,0x00050083,0x00000006,0x000001e2,0x000001de,0x000001e1,0x0003003e,
|
||||
0x000001dc,0x000001e2,0x0004003d,0x00000006,0x000001e4,0x00000194,0x0006000c,0x00000006,
|
||||
0x000001e5,0x00000001,0x00000004,0x000001e4,0x000500ba,0x000001a8,0x000001e7,0x000001e5,
|
||||
0x000001e6,0x000300f7,0x000001ea,0x00000000,0x000400fa,0x000001e7,0x000001e9,0x000001ee,
|
||||
0x000200f8,0x000001e9,0x0004003d,0x00000006,0x000001eb,0x000001ce,0x0004003d,0x00000006,
|
||||
0x000001ec,0x00000194,0x00050088,0x00000006,0x000001ed,0x000001eb,0x000001ec,0x0003003e,
|
||||
0x000001e8,0x000001ed,0x000200f9,0x000001ea,0x000200f8,0x000001ee,0x0003003e,0x000001e8,
|
||||
0x0000003b,0x000200f9,0x000001ea,0x000200f8,0x000001ea,0x0004003d,0x00000006,0x000001ef,
|
||||
0x000001e8,0x0003003e,0x000001e3,0x000001ef,0x0004003d,0x00000006,0x000001f1,0x0000019a,
|
||||
0x0006000c,0x00000006,0x000001f2,0x00000001,0x00000004,0x000001f1,0x000500ba,0x000001a8,
|
||||
0x000001f3,0x000001f2,0x000001e6,0x000300f7,0x000001f6,0x00000000,0x000400fa,0x000001f3,
|
||||
0x000001f5,0x000001fa,0x000200f8,0x000001f5,0x0004003d,0x00000006,0x000001f7,0x000001d5,
|
||||
0x0004003d,0x00000006,0x000001f8,0x0000019a,0x00050088,0x00000006,0x000001f9,0x000001f7,
|
||||
0x000001f8,0x0003003e,0x000001f4,0x000001f9,0x000200f9,0x000001f6,0x000200f8,0x000001fa,
|
||||
0x0003003e,0x000001f4,0x0000003b,0x000200f9,0x000001f6,0x000200f8,0x000001f6,0x0004003d,
|
||||
0x00000006,0x000001fb,0x000001f4,0x0003003e,0x000001f0,0x000001fb,0x0004003d,0x00000006,
|
||||
0x000001fd,0x000001a0,0x0006000c,0x00000006,0x000001fe,0x00000001,0x00000004,0x000001fd,
|
||||
0x000500ba,0x000001a8,0x000001ff,0x000001fe,0x000001e6,0x000300f7,0x00000202,0x00000000,
|
||||
0x000400fa,0x000001ff,0x00000201,0x00000206,0x000200f8,0x00000201,0x0004003d,0x00000006,
|
||||
0x00000203,0x000001dc,0x0004003d,0x00000006,0x00000204,0x000001a0,0x00050088,0x00000006,
|
||||
0x00000205,0x00000203,0x00000204,0x0003003e,0x00000200,0x00000205,0x000200f9,0x00000202,
|
||||
0x000200f8,0x00000206,0x0003003e,0x00000200,0x0000003b,0x000200f9,0x00000202,0x000200f8,
|
||||
0x00000202,0x0004003d,0x00000006,0x00000207,0x00000200,0x0003003e,0x000001fc,0x00000207,
|
||||
0x0004003d,0x00000006,0x00000209,0x000001a6,0x0004007f,0x00000006,0x0000020a,0x00000209,
|
||||
0x0004003d,0x00000006,0x0000020b,0x000001e3,0x0007000c,0x00000006,0x0000020c,0x00000001,
|
||||
0x00000028,0x0000020a,0x0000020b,0x0003003e,0x00000208,0x0000020c,0x0004003d,0x00000006,
|
||||
0x0000020e,0x000001b4,0x0004007f,0x00000006,0x0000020f,0x0000020e,0x0004003d,0x00000006,
|
||||
0x00000210,0x000001f0,0x0007000c,0x00000006,0x00000211,0x00000001,0x00000028,0x0000020f,
|
||||
0x00000210,0x0003003e,0x0000020d,0x00000211,0x0004003d,0x00000006,0x00000213,0x000001c1,
|
||||
0x0004007f,0x00000006,0x00000214,0x00000213,0x0004003d,0x00000006,0x00000215,0x000001fc,
|
||||
0x0007000c,0x00000006,0x00000216,0x00000001,0x00000028,0x00000214,0x00000215,0x0003003e,
|
||||
0x00000212,0x00000216,0x0004003d,0x00000006,0x0000021a,0x00000208,0x0003003e,0x00000219,
|
||||
0x0000021a,0x0004003d,0x00000006,0x0000021c,0x0000020d,0x0003003e,0x0000021b,0x0000021c,
|
||||
0x0004003d,0x00000006,0x0000021e,0x00000212,0x0003003e,0x0000021d,0x0000021e,0x00070039,
|
||||
0x00000006,0x0000021f,0x00000018,0x00000219,0x0000021b,0x0000021d,0x0007000c,0x00000006,
|
||||
0x00000220,0x00000001,0x00000025,0x0000021f,0x0000003b,0x0007000c,0x00000006,0x00000221,
|
||||
0x00000001,0x00000028,0x00000218,0x00000220,0x00050041,0x00000222,0x00000223,0x00000032,
|
||||
0x0000008a,0x0004003d,0x00000028,0x00000224,0x00000223,0x0004007c,0x00000006,0x00000225,
|
||||
0x00000224,0x00050085,0x00000006,0x00000226,0x00000221,0x00000225,0x0003003e,0x00000217,
|
||||
0x00000226,0x0004003d,0x00000006,0x00000228,0x00000217,0x00050085,0x00000006,0x00000229,
|
||||
0x0000018b,0x00000228,0x00050081,0x00000006,0x0000022a,0x00000229,0x00000035,0x0003003e,
|
||||
0x0000022b,0x0000022a,0x00050039,0x00000006,0x0000022c,0x0000000a,0x0000022b,0x0003003e,
|
||||
0x00000227,0x0000022c,0x0004003d,0x00000006,0x0000022d,0x00000217,0x0004003d,0x00000006,
|
||||
0x0000022e,0x00000089,0x00050085,0x00000006,0x0000022f,0x0000022d,0x0000022e,0x0004003d,
|
||||
0x00000006,0x00000230,0x00000217,0x0004003d,0x00000006,0x00000231,0x00000095,0x00050085,
|
||||
0x00000006,0x00000232,0x00000230,0x00000231,0x00050081,0x00000006,0x00000233,0x0000022f,
|
||||
0x00000232,0x0004003d,0x00000006,0x00000234,0x00000217,0x0004003d,0x00000006,0x00000235,
|
||||
0x000000b0,0x00050085,0x00000006,0x00000236,0x00000234,0x00000235,0x00050081,0x00000006,
|
||||
0x00000237,0x00000233,0x00000236,0x0004003d,0x00000006,0x00000238,0x00000217,0x0004003d,
|
||||
0x00000006,0x00000239,0x000000a7,0x00050085,0x00000006,0x0000023a,0x00000238,0x00000239,
|
||||
0x00050081,0x00000006,0x0000023b,0x00000237,0x0000023a,0x0004003d,0x00000006,0x0000023c,
|
||||
0x0000009e,0x00050081,0x00000006,0x0000023d,0x0000023b,0x0000023c,0x0004003d,0x00000006,
|
||||
0x0000023e,0x00000227,0x00050085,0x00000006,0x0000023f,0x0000023d,0x0000023e,0x0003003e,
|
||||
0x0000002e,0x0000023f,0x0004003d,0x00000006,0x00000240,0x00000217,0x0004003d,0x00000006,
|
||||
0x00000241,0x0000008d,0x00050085,0x00000006,0x00000242,0x00000240,0x00000241,0x0004003d,
|
||||
0x00000006,0x00000243,0x00000217,0x0004003d,0x00000006,0x00000244,0x00000098,0x00050085,
|
||||
0x00000006,0x00000245,0x00000243,0x00000244,0x00050081,0x00000006,0x00000246,0x00000242,
|
||||
0x00000245,0x0004003d,0x00000006,0x00000247,0x00000217,0x0004003d,0x00000006,0x00000248,
|
||||
0x000000b3,0x00050085,0x00000006,0x00000249,0x00000247,0x00000248,0x00050081,0x00000006,
|
||||
0x0000024a,0x00000246,0x00000249,0x0004003d,0x00000006,0x0000024b,0x00000217,0x0004003d,
|
||||
0x00000006,0x0000024c,0x000000aa,0x00050085,0x00000006,0x0000024d,0x0000024b,0x0000024c,
|
||||
0x00050081,0x00000006,0x0000024e,0x0000024a,0x0000024d,0x0004003d,0x00000006,0x0000024f,
|
||||
0x000000a1,0x00050081,0x00000006,0x00000250,0x0000024e,0x0000024f,0x0004003d,0x00000006,
|
||||
0x00000251,0x00000227,0x00050085,0x00000006,0x00000252,0x00000250,0x00000251,0x0003003e,
|
||||
0x0000002f,0x00000252,0x0004003d,0x00000006,0x00000253,0x00000217,0x0004003d,0x00000006,
|
||||
0x00000254,0x00000091,0x00050085,0x00000006,0x00000255,0x00000253,0x00000254,0x0004003d,
|
||||
0x00000006,0x00000256,0x00000217,0x0004003d,0x00000006,0x00000257,0x0000009b,0x00050085,
|
||||
0x00000006,0x00000258,0x00000256,0x00000257,0x00050081,0x00000006,0x00000259,0x00000255,
|
||||
0x00000258,0x0004003d,0x00000006,0x0000025a,0x00000217,0x0004003d,0x00000006,0x0000025b,
|
||||
0x000000b6,0x00050085,0x00000006,0x0000025c,0x0000025a,0x0000025b,0x00050081,0x00000006,
|
||||
0x0000025d,0x00000259,0x0000025c,0x0004003d,0x00000006,0x0000025e,0x00000217,0x0004003d,
|
||||
0x00000006,0x0000025f,0x000000ad,0x00050085,0x00000006,0x00000260,0x0000025e,0x0000025f,
|
||||
0x00050081,0x00000006,0x00000261,0x0000025d,0x00000260,0x0004003d,0x00000006,0x00000262,
|
||||
0x000000a4,0x00050081,0x00000006,0x00000263,0x00000261,0x00000262,0x0004003d,0x00000006,
|
||||
0x00000264,0x00000227,0x00050085,0x00000006,0x00000265,0x00000263,0x00000264,0x0003003e,
|
||||
0x00000030,0x00000265,0x000100fd,0x00010038
|
||||
};
|
||||
@@ -0,0 +1,67 @@
|
||||
#version 450
|
||||
|
||||
// =============================================================================
|
||||
// FXAA (Fast Approximate Anti-Aliasing) post effect.
|
||||
//
|
||||
// Ported verbatim from the OpenGL FXAAEffect.java shader so the Vulkan
|
||||
// compositor's post-process pipeline applies the SAME anti-aliasing the GL
|
||||
// renderer's "FXAA" toggle does. GL sampled with gl_FragCoord.xy*invResolution;
|
||||
// here fragTexCoord already spans [0,1] across the output, so it IS that uv.
|
||||
//
|
||||
// Conventions match upscale.vert: combined-image-sampler at binding 0, the
|
||||
// push-constant block leads with vec4 ndc (offset 0), fragTexCoord in [0,1].
|
||||
// Runs FIRST in the canonical post chain (AA on the clean composited image).
|
||||
// =============================================================================
|
||||
|
||||
layout(binding = 0) uniform sampler2D InputTexture;
|
||||
|
||||
layout(push_constant) uniform PC {
|
||||
vec4 ndc; // quad NDC rect, consumed by upscale.vert (offset 0)
|
||||
vec2 resolution; // input texture size in px
|
||||
} pc;
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
#define FXAA_MIN_REDUCE (1.0 / 128.0)
|
||||
#define FXAA_MUL_REDUCE (1.0 / 8.0)
|
||||
#define MAX_SPAN 8.0
|
||||
const vec3 luma = vec3(0.299, 0.587, 0.114);
|
||||
|
||||
void main() {
|
||||
vec2 invResolution = 1.0 / pc.resolution;
|
||||
vec2 uv = fragTexCoord;
|
||||
|
||||
vec3 rgbNW = texture(InputTexture, uv + vec2(-1.0, -1.0) * invResolution).rgb;
|
||||
vec3 rgbNE = texture(InputTexture, uv + vec2( 1.0, -1.0) * invResolution).rgb;
|
||||
vec3 rgbSW = texture(InputTexture, uv + vec2(-1.0, 1.0) * invResolution).rgb;
|
||||
vec3 rgbSE = texture(InputTexture, uv + vec2( 1.0, 1.0) * invResolution).rgb;
|
||||
vec3 rgbM = texture(InputTexture, uv).rgb;
|
||||
|
||||
float lumaNW = dot(rgbNW, luma);
|
||||
float lumaNE = dot(rgbNE, luma);
|
||||
float lumaSW = dot(rgbSW, luma);
|
||||
float lumaSE = dot(rgbSE, luma);
|
||||
float lumaM = dot(rgbM, luma);
|
||||
|
||||
float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
|
||||
float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
|
||||
|
||||
vec2 dir;
|
||||
dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
|
||||
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
|
||||
|
||||
float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * 0.25 * FXAA_MUL_REDUCE, FXAA_MIN_REDUCE);
|
||||
float minDirFactor = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
|
||||
dir = clamp(dir * minDirFactor, vec2(-MAX_SPAN), vec2(MAX_SPAN)) * invResolution;
|
||||
|
||||
vec4 rgbA = 0.5 * (
|
||||
texture(InputTexture, uv + dir * (1.0 / 3.0 - 0.5)) +
|
||||
texture(InputTexture, uv + dir * (2.0 / 3.0 - 0.5)));
|
||||
vec4 rgbB = rgbA * 0.5 + 0.25 * (
|
||||
texture(InputTexture, uv + dir * -0.5) +
|
||||
texture(InputTexture, uv + dir * 0.5));
|
||||
|
||||
float lumaB = dot(rgbB, vec4(luma, 0.0));
|
||||
outColor = (lumaB < lumaMin || lumaB > lumaMax) ? rgbA : rgbB;
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
#version 450
|
||||
|
||||
layout(binding = 0) uniform sampler2D InputTexture;
|
||||
|
||||
layout(push_constant) uniform PC {
|
||||
vec4 ndc;
|
||||
vec2 resolution;
|
||||
} pc;
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
#define FXAA_MIN_REDUCE (1.0 / 128.0)
|
||||
#define FXAA_MUL_REDUCE (1.0 / 8.0)
|
||||
#define MAX_SPAN 8.0
|
||||
|
||||
const vec3 luma = vec3(0.299, 0.587, 0.114);
|
||||
|
||||
void main() {
|
||||
vec2 invResolution = 1.0 / pc.resolution;
|
||||
vec2 uv = fragTexCoord;
|
||||
|
||||
vec3 rgbNW = texture(InputTexture, uv + vec2(-1.0, -1.0) * invResolution).rgb;
|
||||
vec3 rgbNE = texture(InputTexture, uv + vec2( 1.0, -1.0) * invResolution).rgb;
|
||||
vec3 rgbSW = texture(InputTexture, uv + vec2(-1.0, 1.0) * invResolution).rgb;
|
||||
vec3 rgbSE = texture(InputTexture, uv + vec2( 1.0, 1.0) * invResolution).rgb;
|
||||
vec3 rgbM = texture(InputTexture, uv).rgb;
|
||||
|
||||
float lumaNW = dot(rgbNW, luma);
|
||||
float lumaNE = dot(rgbNE, luma);
|
||||
float lumaSW = dot(rgbSW, luma);
|
||||
float lumaSE = dot(rgbSE, luma);
|
||||
float lumaM = dot(rgbM, luma);
|
||||
|
||||
float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
|
||||
float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
|
||||
|
||||
vec2 dir;
|
||||
dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
|
||||
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
|
||||
|
||||
float dirReduce = max(
|
||||
(lumaNW + lumaNE + lumaSW + lumaSE) * 0.25 * FXAA_MUL_REDUCE,
|
||||
FXAA_MIN_REDUCE);
|
||||
float minDirFactor = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
|
||||
dir = clamp(dir * minDirFactor, vec2(-MAX_SPAN), vec2(MAX_SPAN)) * invResolution;
|
||||
|
||||
vec4 rgbA = 0.5 * (
|
||||
texture(InputTexture, uv + dir * (1.0 / 3.0 - 0.5)) +
|
||||
texture(InputTexture, uv + dir * (2.0 / 3.0 - 0.5)));
|
||||
vec4 rgbB = rgbA * 0.5 + 0.25 * (
|
||||
texture(InputTexture, uv + dir * -0.5) +
|
||||
texture(InputTexture, uv + dir * 0.5));
|
||||
|
||||
vec4 fxaaColor = dot(rgbB, vec4(luma, 0.0)) < lumaMin ||
|
||||
dot(rgbB, vec4(luma, 0.0)) > lumaMax ? rgbA : rgbB;
|
||||
|
||||
// Approximate Toon edges using only FXAA's existing five samples.
|
||||
vec3 colorLeft = 0.5 * (rgbNW + rgbSW);
|
||||
vec3 colorRight = 0.5 * (rgbNE + rgbSE);
|
||||
vec3 colorUp = 0.5 * (rgbNW + rgbNE);
|
||||
vec3 colorDown = 0.5 * (rgbSW + rgbSE);
|
||||
|
||||
float diffHorizontal = length(colorRight - colorLeft);
|
||||
float diffVertical = length(colorUp - colorDown);
|
||||
float edgeFactor = step(0.2, diffHorizontal + diffVertical);
|
||||
|
||||
outColor = vec4(mix(fxaaColor.rgb, vec3(0.0), edgeFactor), 1.0);
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
// 1116.3.0
|
||||
#pragma once
|
||||
const uint32_t fxaa_toon_code[] = {
|
||||
0x07230203,0x00010000,0x0008000b,0x00000115,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000018,0x0000010a,0x00030010,
|
||||
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d,
|
||||
0x00000000,0x00060005,0x00000009,0x52766e69,0x6c6f7365,0x6f697475,0x0000006e,0x00030005,
|
||||
0x0000000c,0x00004350,0x00040006,0x0000000c,0x00000000,0x0063646e,0x00060006,0x0000000c,
|
||||
0x00000001,0x6f736572,0x6974756c,0x00006e6f,0x00030005,0x0000000e,0x00006370,0x00030005,
|
||||
0x00000016,0x00007675,0x00060005,0x00000018,0x67617266,0x43786554,0x64726f6f,0x00000000,
|
||||
0x00040005,0x0000001c,0x4e626772,0x00000057,0x00060005,0x00000020,0x75706e49,0x78655474,
|
||||
0x65727574,0x00000000,0x00040005,0x0000002a,0x4e626772,0x00000045,0x00040005,0x00000033,
|
||||
0x53626772,0x00000057,0x00040005,0x0000003c,0x53626772,0x00000045,0x00040005,0x00000045,
|
||||
0x4d626772,0x00000000,0x00040005,0x0000004b,0x616d756c,0x0000574e,0x00040005,0x00000052,
|
||||
0x616d756c,0x0000454e,0x00040005,0x00000055,0x616d756c,0x00005753,0x00040005,0x00000058,
|
||||
0x616d756c,0x00004553,0x00040005,0x0000005b,0x616d756c,0x0000004d,0x00040005,0x0000005e,
|
||||
0x616d756c,0x006e694d,0x00040005,0x00000068,0x616d756c,0x0078614d,0x00030005,0x00000072,
|
||||
0x00726964,0x00050005,0x00000087,0x52726964,0x63756465,0x00000065,0x00060005,0x00000095,
|
||||
0x446e696d,0x61467269,0x726f7463,0x00000000,0x00040005,0x000000ab,0x41626772,0x00000000,
|
||||
0x00040005,0x000000bd,0x42626772,0x00000000,0x00050005,0x000000d0,0x61617866,0x6f6c6f43,
|
||||
0x00000072,0x00050005,0x000000e5,0x6f6c6f63,0x66654c72,0x00000074,0x00050005,0x000000ea,
|
||||
0x6f6c6f63,0x67695272,0x00007468,0x00040005,0x000000ef,0x6f6c6f63,0x00705572,0x00050005,
|
||||
0x000000f4,0x6f6c6f63,0x776f4472,0x0000006e,0x00060005,0x000000f9,0x66666964,0x69726f48,
|
||||
0x746e6f7a,0x00006c61,0x00060005,0x000000fe,0x66666964,0x74726556,0x6c616369,0x00000000,
|
||||
0x00050005,0x00000103,0x65676465,0x74636146,0x0000726f,0x00050005,0x0000010a,0x4374756f,
|
||||
0x726f6c6f,0x00000000,0x00030047,0x0000000c,0x00000002,0x00050048,0x0000000c,0x00000000,
|
||||
0x00000023,0x00000000,0x00050048,0x0000000c,0x00000001,0x00000023,0x00000010,0x00040047,
|
||||
0x00000018,0x0000001e,0x00000000,0x00040047,0x00000020,0x00000021,0x00000000,0x00040047,
|
||||
0x00000020,0x00000022,0x00000000,0x00040047,0x0000010a,0x0000001e,0x00000000,0x00020013,
|
||||
0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,
|
||||
0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,0x00000007,0x00000007,0x0004002b,
|
||||
0x00000006,0x0000000a,0x3f800000,0x00040017,0x0000000b,0x00000006,0x00000004,0x0004001e,
|
||||
0x0000000c,0x0000000b,0x00000007,0x00040020,0x0000000d,0x00000009,0x0000000c,0x0004003b,
|
||||
0x0000000d,0x0000000e,0x00000009,0x00040015,0x0000000f,0x00000020,0x00000001,0x0004002b,
|
||||
0x0000000f,0x00000010,0x00000001,0x00040020,0x00000011,0x00000009,0x00000007,0x00040020,
|
||||
0x00000017,0x00000001,0x00000007,0x0004003b,0x00000017,0x00000018,0x00000001,0x00040017,
|
||||
0x0000001a,0x00000006,0x00000003,0x00040020,0x0000001b,0x00000007,0x0000001a,0x00090019,
|
||||
0x0000001d,0x00000006,0x00000001,0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,
|
||||
0x0003001b,0x0000001e,0x0000001d,0x00040020,0x0000001f,0x00000000,0x0000001e,0x0004003b,
|
||||
0x0000001f,0x00000020,0x00000000,0x0004002b,0x00000006,0x00000023,0xbf800000,0x0005002c,
|
||||
0x00000007,0x00000024,0x00000023,0x00000023,0x0005002c,0x00000007,0x0000002d,0x0000000a,
|
||||
0x00000023,0x0005002c,0x00000007,0x00000036,0x00000023,0x0000000a,0x0005002c,0x00000007,
|
||||
0x0000003f,0x0000000a,0x0000000a,0x00040020,0x0000004a,0x00000007,0x00000006,0x0004002b,
|
||||
0x00000006,0x0000004d,0x3e991687,0x0004002b,0x00000006,0x0000004e,0x3f1645a2,0x0004002b,
|
||||
0x00000006,0x0000004f,0x3de978d5,0x0006002c,0x0000001a,0x00000050,0x0000004d,0x0000004e,
|
||||
0x0000004f,0x00040015,0x0000007b,0x00000020,0x00000000,0x0004002b,0x0000007b,0x0000007c,
|
||||
0x00000000,0x0004002b,0x0000007b,0x00000085,0x00000001,0x0004002b,0x00000006,0x0000008f,
|
||||
0x3e800000,0x0004002b,0x00000006,0x00000091,0x3e000000,0x0004002b,0x00000006,0x00000093,
|
||||
0x3c000000,0x0004002b,0x00000006,0x000000a3,0xc1000000,0x0005002c,0x00000007,0x000000a4,
|
||||
0x000000a3,0x000000a3,0x0004002b,0x00000006,0x000000a5,0x41000000,0x0005002c,0x00000007,
|
||||
0x000000a6,0x000000a5,0x000000a5,0x00040020,0x000000aa,0x00000007,0x0000000b,0x0004002b,
|
||||
0x00000006,0x000000ac,0x3f000000,0x0004002b,0x00000006,0x000000b0,0xbe2aaaab,0x0004002b,
|
||||
0x00000006,0x000000b7,0x3e2aaaab,0x0004002b,0x00000006,0x000000c3,0xbf000000,0x00020014,
|
||||
0x000000d1,0x0004002b,0x00000006,0x000000d3,0x00000000,0x0007002c,0x0000000b,0x000000d4,
|
||||
0x0000004d,0x0000004e,0x0000004f,0x000000d3,0x00040017,0x000000e2,0x000000d1,0x00000004,
|
||||
0x0004002b,0x00000006,0x00000104,0x3e4ccccd,0x00040020,0x00000109,0x00000003,0x0000000b,
|
||||
0x0004003b,0x00000109,0x0000010a,0x00000003,0x0006002c,0x0000001a,0x0000010d,0x000000d3,
|
||||
0x000000d3,0x000000d3,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,
|
||||
0x00000005,0x0004003b,0x00000008,0x00000009,0x00000007,0x0004003b,0x00000008,0x00000016,
|
||||
0x00000007,0x0004003b,0x0000001b,0x0000001c,0x00000007,0x0004003b,0x0000001b,0x0000002a,
|
||||
0x00000007,0x0004003b,0x0000001b,0x00000033,0x00000007,0x0004003b,0x0000001b,0x0000003c,
|
||||
0x00000007,0x0004003b,0x0000001b,0x00000045,0x00000007,0x0004003b,0x0000004a,0x0000004b,
|
||||
0x00000007,0x0004003b,0x0000004a,0x00000052,0x00000007,0x0004003b,0x0000004a,0x00000055,
|
||||
0x00000007,0x0004003b,0x0000004a,0x00000058,0x00000007,0x0004003b,0x0000004a,0x0000005b,
|
||||
0x00000007,0x0004003b,0x0000004a,0x0000005e,0x00000007,0x0004003b,0x0000004a,0x00000068,
|
||||
0x00000007,0x0004003b,0x00000008,0x00000072,0x00000007,0x0004003b,0x0000004a,0x00000087,
|
||||
0x00000007,0x0004003b,0x0000004a,0x00000095,0x00000007,0x0004003b,0x000000aa,0x000000ab,
|
||||
0x00000007,0x0004003b,0x000000aa,0x000000bd,0x00000007,0x0004003b,0x000000aa,0x000000d0,
|
||||
0x00000007,0x0004003b,0x0000001b,0x000000e5,0x00000007,0x0004003b,0x0000001b,0x000000ea,
|
||||
0x00000007,0x0004003b,0x0000001b,0x000000ef,0x00000007,0x0004003b,0x0000001b,0x000000f4,
|
||||
0x00000007,0x0004003b,0x0000004a,0x000000f9,0x00000007,0x0004003b,0x0000004a,0x000000fe,
|
||||
0x00000007,0x0004003b,0x0000004a,0x00000103,0x00000007,0x00050041,0x00000011,0x00000012,
|
||||
0x0000000e,0x00000010,0x0004003d,0x00000007,0x00000013,0x00000012,0x00050050,0x00000007,
|
||||
0x00000014,0x0000000a,0x0000000a,0x00050088,0x00000007,0x00000015,0x00000014,0x00000013,
|
||||
0x0003003e,0x00000009,0x00000015,0x0004003d,0x00000007,0x00000019,0x00000018,0x0003003e,
|
||||
0x00000016,0x00000019,0x0004003d,0x0000001e,0x00000021,0x00000020,0x0004003d,0x00000007,
|
||||
0x00000022,0x00000016,0x0004003d,0x00000007,0x00000025,0x00000009,0x00050085,0x00000007,
|
||||
0x00000026,0x00000024,0x00000025,0x00050081,0x00000007,0x00000027,0x00000022,0x00000026,
|
||||
0x00050057,0x0000000b,0x00000028,0x00000021,0x00000027,0x0008004f,0x0000001a,0x00000029,
|
||||
0x00000028,0x00000028,0x00000000,0x00000001,0x00000002,0x0003003e,0x0000001c,0x00000029,
|
||||
0x0004003d,0x0000001e,0x0000002b,0x00000020,0x0004003d,0x00000007,0x0000002c,0x00000016,
|
||||
0x0004003d,0x00000007,0x0000002e,0x00000009,0x00050085,0x00000007,0x0000002f,0x0000002d,
|
||||
0x0000002e,0x00050081,0x00000007,0x00000030,0x0000002c,0x0000002f,0x00050057,0x0000000b,
|
||||
0x00000031,0x0000002b,0x00000030,0x0008004f,0x0000001a,0x00000032,0x00000031,0x00000031,
|
||||
0x00000000,0x00000001,0x00000002,0x0003003e,0x0000002a,0x00000032,0x0004003d,0x0000001e,
|
||||
0x00000034,0x00000020,0x0004003d,0x00000007,0x00000035,0x00000016,0x0004003d,0x00000007,
|
||||
0x00000037,0x00000009,0x00050085,0x00000007,0x00000038,0x00000036,0x00000037,0x00050081,
|
||||
0x00000007,0x00000039,0x00000035,0x00000038,0x00050057,0x0000000b,0x0000003a,0x00000034,
|
||||
0x00000039,0x0008004f,0x0000001a,0x0000003b,0x0000003a,0x0000003a,0x00000000,0x00000001,
|
||||
0x00000002,0x0003003e,0x00000033,0x0000003b,0x0004003d,0x0000001e,0x0000003d,0x00000020,
|
||||
0x0004003d,0x00000007,0x0000003e,0x00000016,0x0004003d,0x00000007,0x00000040,0x00000009,
|
||||
0x00050085,0x00000007,0x00000041,0x0000003f,0x00000040,0x00050081,0x00000007,0x00000042,
|
||||
0x0000003e,0x00000041,0x00050057,0x0000000b,0x00000043,0x0000003d,0x00000042,0x0008004f,
|
||||
0x0000001a,0x00000044,0x00000043,0x00000043,0x00000000,0x00000001,0x00000002,0x0003003e,
|
||||
0x0000003c,0x00000044,0x0004003d,0x0000001e,0x00000046,0x00000020,0x0004003d,0x00000007,
|
||||
0x00000047,0x00000016,0x00050057,0x0000000b,0x00000048,0x00000046,0x00000047,0x0008004f,
|
||||
0x0000001a,0x00000049,0x00000048,0x00000048,0x00000000,0x00000001,0x00000002,0x0003003e,
|
||||
0x00000045,0x00000049,0x0004003d,0x0000001a,0x0000004c,0x0000001c,0x00050094,0x00000006,
|
||||
0x00000051,0x0000004c,0x00000050,0x0003003e,0x0000004b,0x00000051,0x0004003d,0x0000001a,
|
||||
0x00000053,0x0000002a,0x00050094,0x00000006,0x00000054,0x00000053,0x00000050,0x0003003e,
|
||||
0x00000052,0x00000054,0x0004003d,0x0000001a,0x00000056,0x00000033,0x00050094,0x00000006,
|
||||
0x00000057,0x00000056,0x00000050,0x0003003e,0x00000055,0x00000057,0x0004003d,0x0000001a,
|
||||
0x00000059,0x0000003c,0x00050094,0x00000006,0x0000005a,0x00000059,0x00000050,0x0003003e,
|
||||
0x00000058,0x0000005a,0x0004003d,0x0000001a,0x0000005c,0x00000045,0x00050094,0x00000006,
|
||||
0x0000005d,0x0000005c,0x00000050,0x0003003e,0x0000005b,0x0000005d,0x0004003d,0x00000006,
|
||||
0x0000005f,0x0000005b,0x0004003d,0x00000006,0x00000060,0x0000004b,0x0004003d,0x00000006,
|
||||
0x00000061,0x00000052,0x0007000c,0x00000006,0x00000062,0x00000001,0x00000025,0x00000060,
|
||||
0x00000061,0x0004003d,0x00000006,0x00000063,0x00000055,0x0004003d,0x00000006,0x00000064,
|
||||
0x00000058,0x0007000c,0x00000006,0x00000065,0x00000001,0x00000025,0x00000063,0x00000064,
|
||||
0x0007000c,0x00000006,0x00000066,0x00000001,0x00000025,0x00000062,0x00000065,0x0007000c,
|
||||
0x00000006,0x00000067,0x00000001,0x00000025,0x0000005f,0x00000066,0x0003003e,0x0000005e,
|
||||
0x00000067,0x0004003d,0x00000006,0x00000069,0x0000005b,0x0004003d,0x00000006,0x0000006a,
|
||||
0x0000004b,0x0004003d,0x00000006,0x0000006b,0x00000052,0x0007000c,0x00000006,0x0000006c,
|
||||
0x00000001,0x00000028,0x0000006a,0x0000006b,0x0004003d,0x00000006,0x0000006d,0x00000055,
|
||||
0x0004003d,0x00000006,0x0000006e,0x00000058,0x0007000c,0x00000006,0x0000006f,0x00000001,
|
||||
0x00000028,0x0000006d,0x0000006e,0x0007000c,0x00000006,0x00000070,0x00000001,0x00000028,
|
||||
0x0000006c,0x0000006f,0x0007000c,0x00000006,0x00000071,0x00000001,0x00000028,0x00000069,
|
||||
0x00000070,0x0003003e,0x00000068,0x00000071,0x0004003d,0x00000006,0x00000073,0x0000004b,
|
||||
0x0004003d,0x00000006,0x00000074,0x00000052,0x00050081,0x00000006,0x00000075,0x00000073,
|
||||
0x00000074,0x0004003d,0x00000006,0x00000076,0x00000055,0x0004003d,0x00000006,0x00000077,
|
||||
0x00000058,0x00050081,0x00000006,0x00000078,0x00000076,0x00000077,0x00050083,0x00000006,
|
||||
0x00000079,0x00000075,0x00000078,0x0004007f,0x00000006,0x0000007a,0x00000079,0x00050041,
|
||||
0x0000004a,0x0000007d,0x00000072,0x0000007c,0x0003003e,0x0000007d,0x0000007a,0x0004003d,
|
||||
0x00000006,0x0000007e,0x0000004b,0x0004003d,0x00000006,0x0000007f,0x00000055,0x00050081,
|
||||
0x00000006,0x00000080,0x0000007e,0x0000007f,0x0004003d,0x00000006,0x00000081,0x00000052,
|
||||
0x0004003d,0x00000006,0x00000082,0x00000058,0x00050081,0x00000006,0x00000083,0x00000081,
|
||||
0x00000082,0x00050083,0x00000006,0x00000084,0x00000080,0x00000083,0x00050041,0x0000004a,
|
||||
0x00000086,0x00000072,0x00000085,0x0003003e,0x00000086,0x00000084,0x0004003d,0x00000006,
|
||||
0x00000088,0x0000004b,0x0004003d,0x00000006,0x00000089,0x00000052,0x00050081,0x00000006,
|
||||
0x0000008a,0x00000088,0x00000089,0x0004003d,0x00000006,0x0000008b,0x00000055,0x00050081,
|
||||
0x00000006,0x0000008c,0x0000008a,0x0000008b,0x0004003d,0x00000006,0x0000008d,0x00000058,
|
||||
0x00050081,0x00000006,0x0000008e,0x0000008c,0x0000008d,0x00050085,0x00000006,0x00000090,
|
||||
0x0000008e,0x0000008f,0x00050085,0x00000006,0x00000092,0x00000090,0x00000091,0x0007000c,
|
||||
0x00000006,0x00000094,0x00000001,0x00000028,0x00000092,0x00000093,0x0003003e,0x00000087,
|
||||
0x00000094,0x00050041,0x0000004a,0x00000096,0x00000072,0x0000007c,0x0004003d,0x00000006,
|
||||
0x00000097,0x00000096,0x0006000c,0x00000006,0x00000098,0x00000001,0x00000004,0x00000097,
|
||||
0x00050041,0x0000004a,0x00000099,0x00000072,0x00000085,0x0004003d,0x00000006,0x0000009a,
|
||||
0x00000099,0x0006000c,0x00000006,0x0000009b,0x00000001,0x00000004,0x0000009a,0x0007000c,
|
||||
0x00000006,0x0000009c,0x00000001,0x00000025,0x00000098,0x0000009b,0x0004003d,0x00000006,
|
||||
0x0000009d,0x00000087,0x00050081,0x00000006,0x0000009e,0x0000009c,0x0000009d,0x00050088,
|
||||
0x00000006,0x0000009f,0x0000000a,0x0000009e,0x0003003e,0x00000095,0x0000009f,0x0004003d,
|
||||
0x00000007,0x000000a0,0x00000072,0x0004003d,0x00000006,0x000000a1,0x00000095,0x0005008e,
|
||||
0x00000007,0x000000a2,0x000000a0,0x000000a1,0x0008000c,0x00000007,0x000000a7,0x00000001,
|
||||
0x0000002b,0x000000a2,0x000000a4,0x000000a6,0x0004003d,0x00000007,0x000000a8,0x00000009,
|
||||
0x00050085,0x00000007,0x000000a9,0x000000a7,0x000000a8,0x0003003e,0x00000072,0x000000a9,
|
||||
0x0004003d,0x0000001e,0x000000ad,0x00000020,0x0004003d,0x00000007,0x000000ae,0x00000016,
|
||||
0x0004003d,0x00000007,0x000000af,0x00000072,0x0005008e,0x00000007,0x000000b1,0x000000af,
|
||||
0x000000b0,0x00050081,0x00000007,0x000000b2,0x000000ae,0x000000b1,0x00050057,0x0000000b,
|
||||
0x000000b3,0x000000ad,0x000000b2,0x0004003d,0x0000001e,0x000000b4,0x00000020,0x0004003d,
|
||||
0x00000007,0x000000b5,0x00000016,0x0004003d,0x00000007,0x000000b6,0x00000072,0x0005008e,
|
||||
0x00000007,0x000000b8,0x000000b6,0x000000b7,0x00050081,0x00000007,0x000000b9,0x000000b5,
|
||||
0x000000b8,0x00050057,0x0000000b,0x000000ba,0x000000b4,0x000000b9,0x00050081,0x0000000b,
|
||||
0x000000bb,0x000000b3,0x000000ba,0x0005008e,0x0000000b,0x000000bc,0x000000bb,0x000000ac,
|
||||
0x0003003e,0x000000ab,0x000000bc,0x0004003d,0x0000000b,0x000000be,0x000000ab,0x0005008e,
|
||||
0x0000000b,0x000000bf,0x000000be,0x000000ac,0x0004003d,0x0000001e,0x000000c0,0x00000020,
|
||||
0x0004003d,0x00000007,0x000000c1,0x00000016,0x0004003d,0x00000007,0x000000c2,0x00000072,
|
||||
0x0005008e,0x00000007,0x000000c4,0x000000c2,0x000000c3,0x00050081,0x00000007,0x000000c5,
|
||||
0x000000c1,0x000000c4,0x00050057,0x0000000b,0x000000c6,0x000000c0,0x000000c5,0x0004003d,
|
||||
0x0000001e,0x000000c7,0x00000020,0x0004003d,0x00000007,0x000000c8,0x00000016,0x0004003d,
|
||||
0x00000007,0x000000c9,0x00000072,0x0005008e,0x00000007,0x000000ca,0x000000c9,0x000000ac,
|
||||
0x00050081,0x00000007,0x000000cb,0x000000c8,0x000000ca,0x00050057,0x0000000b,0x000000cc,
|
||||
0x000000c7,0x000000cb,0x00050081,0x0000000b,0x000000cd,0x000000c6,0x000000cc,0x0005008e,
|
||||
0x0000000b,0x000000ce,0x000000cd,0x0000008f,0x00050081,0x0000000b,0x000000cf,0x000000bf,
|
||||
0x000000ce,0x0003003e,0x000000bd,0x000000cf,0x0004003d,0x0000000b,0x000000d2,0x000000bd,
|
||||
0x00050094,0x00000006,0x000000d5,0x000000d2,0x000000d4,0x0004003d,0x00000006,0x000000d6,
|
||||
0x0000005e,0x000500b8,0x000000d1,0x000000d7,0x000000d5,0x000000d6,0x000400a8,0x000000d1,
|
||||
0x000000d8,0x000000d7,0x000300f7,0x000000da,0x00000000,0x000400fa,0x000000d8,0x000000d9,
|
||||
0x000000da,0x000200f8,0x000000d9,0x0004003d,0x0000000b,0x000000db,0x000000bd,0x00050094,
|
||||
0x00000006,0x000000dc,0x000000db,0x000000d4,0x0004003d,0x00000006,0x000000dd,0x00000068,
|
||||
0x000500ba,0x000000d1,0x000000de,0x000000dc,0x000000dd,0x000200f9,0x000000da,0x000200f8,
|
||||
0x000000da,0x000700f5,0x000000d1,0x000000df,0x000000d7,0x00000005,0x000000de,0x000000d9,
|
||||
0x0004003d,0x0000000b,0x000000e0,0x000000ab,0x0004003d,0x0000000b,0x000000e1,0x000000bd,
|
||||
0x00070050,0x000000e2,0x000000e3,0x000000df,0x000000df,0x000000df,0x000000df,0x000600a9,
|
||||
0x0000000b,0x000000e4,0x000000e3,0x000000e0,0x000000e1,0x0003003e,0x000000d0,0x000000e4,
|
||||
0x0004003d,0x0000001a,0x000000e6,0x0000001c,0x0004003d,0x0000001a,0x000000e7,0x00000033,
|
||||
0x00050081,0x0000001a,0x000000e8,0x000000e6,0x000000e7,0x0005008e,0x0000001a,0x000000e9,
|
||||
0x000000e8,0x000000ac,0x0003003e,0x000000e5,0x000000e9,0x0004003d,0x0000001a,0x000000eb,
|
||||
0x0000002a,0x0004003d,0x0000001a,0x000000ec,0x0000003c,0x00050081,0x0000001a,0x000000ed,
|
||||
0x000000eb,0x000000ec,0x0005008e,0x0000001a,0x000000ee,0x000000ed,0x000000ac,0x0003003e,
|
||||
0x000000ea,0x000000ee,0x0004003d,0x0000001a,0x000000f0,0x0000001c,0x0004003d,0x0000001a,
|
||||
0x000000f1,0x0000002a,0x00050081,0x0000001a,0x000000f2,0x000000f0,0x000000f1,0x0005008e,
|
||||
0x0000001a,0x000000f3,0x000000f2,0x000000ac,0x0003003e,0x000000ef,0x000000f3,0x0004003d,
|
||||
0x0000001a,0x000000f5,0x00000033,0x0004003d,0x0000001a,0x000000f6,0x0000003c,0x00050081,
|
||||
0x0000001a,0x000000f7,0x000000f5,0x000000f6,0x0005008e,0x0000001a,0x000000f8,0x000000f7,
|
||||
0x000000ac,0x0003003e,0x000000f4,0x000000f8,0x0004003d,0x0000001a,0x000000fa,0x000000ea,
|
||||
0x0004003d,0x0000001a,0x000000fb,0x000000e5,0x00050083,0x0000001a,0x000000fc,0x000000fa,
|
||||
0x000000fb,0x0006000c,0x00000006,0x000000fd,0x00000001,0x00000042,0x000000fc,0x0003003e,
|
||||
0x000000f9,0x000000fd,0x0004003d,0x0000001a,0x000000ff,0x000000ef,0x0004003d,0x0000001a,
|
||||
0x00000100,0x000000f4,0x00050083,0x0000001a,0x00000101,0x000000ff,0x00000100,0x0006000c,
|
||||
0x00000006,0x00000102,0x00000001,0x00000042,0x00000101,0x0003003e,0x000000fe,0x00000102,
|
||||
0x0004003d,0x00000006,0x00000105,0x000000f9,0x0004003d,0x00000006,0x00000106,0x000000fe,
|
||||
0x00050081,0x00000006,0x00000107,0x00000105,0x00000106,0x0007000c,0x00000006,0x00000108,
|
||||
0x00000001,0x00000030,0x00000104,0x00000107,0x0003003e,0x00000103,0x00000108,0x0004003d,
|
||||
0x0000000b,0x0000010b,0x000000d0,0x0008004f,0x0000001a,0x0000010c,0x0000010b,0x0000010b,
|
||||
0x00000000,0x00000001,0x00000002,0x0004003d,0x00000006,0x0000010e,0x00000103,0x00060050,
|
||||
0x0000001a,0x0000010f,0x0000010e,0x0000010e,0x0000010e,0x0008000c,0x0000001a,0x00000110,
|
||||
0x00000001,0x0000002e,0x0000010c,0x0000010d,0x0000010f,0x00050051,0x00000006,0x00000111,
|
||||
0x00000110,0x00000000,0x00050051,0x00000006,0x00000112,0x00000110,0x00000001,0x00050051,
|
||||
0x00000006,0x00000113,0x00000110,0x00000002,0x00070050,0x0000000b,0x00000114,0x00000111,
|
||||
0x00000112,0x00000113,0x0000000a,0x0003003e,0x0000010a,0x00000114,0x000100fd,0x00010038
|
||||
};
|
||||
Executable
+55
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
# =============================================================================
|
||||
# Regenerate the committed SPIR-V headers (*_frag.h / *_vert.h) for the native
|
||||
# Vulkan compositor's post-process shaders.
|
||||
#
|
||||
# The Android NDK build does NOT compile GLSL; instead every *.frag / *.vert in
|
||||
# this directory is pre-compiled to a SPIR-V uint32 array header that is #included
|
||||
# by VulkanRendererContext.cpp. Run this whenever you edit a shader, then commit
|
||||
# the regenerated *.h alongside the *.frag/*.vert source.
|
||||
#
|
||||
# Requires glslangValidator on PATH (e.g. the Vulkan SDK or the termux package).
|
||||
#
|
||||
# Usage: ./gen_shaders.sh # regenerate all shaders
|
||||
# ./gen_shaders.sh nis crt # regenerate only the named shaders
|
||||
# =============================================================================
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
if ! command -v glslangValidator >/dev/null 2>&1; then
|
||||
echo "error: glslangValidator not found on PATH" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
gen() {
|
||||
local src="$1" # e.g. nis.frag
|
||||
local base="${src%.*}" # nis
|
||||
local ext="${src##*.}" # frag | vert
|
||||
local vn="${base}_code"
|
||||
if [ "$ext" = "vert" ]; then
|
||||
vn="${base}_vert_code"
|
||||
fi
|
||||
local out="${base}_${ext}.h"
|
||||
echo " ${src} -> ${out} (--vn ${vn})"
|
||||
glslangValidator -V "${src}" --vn "${vn}" -o "${out}"
|
||||
}
|
||||
|
||||
shaders=()
|
||||
if [ "$#" -gt 0 ]; then
|
||||
for name in "$@"; do
|
||||
for f in "${name}.frag" "${name}.vert"; do
|
||||
[ -f "$f" ] && shaders+=("$f")
|
||||
done
|
||||
done
|
||||
else
|
||||
for f in *.frag *.vert; do
|
||||
[ -f "$f" ] && shaders+=("$f")
|
||||
done
|
||||
fi
|
||||
|
||||
for s in "${shaders[@]}"; do
|
||||
gen "$s"
|
||||
done
|
||||
|
||||
echo "done."
|
||||
@@ -0,0 +1,64 @@
|
||||
#version 450
|
||||
|
||||
// =============================================================================
|
||||
// Fake-HDR (dual-radius bloom + contrast lift) post effect.
|
||||
//
|
||||
// Ported from the OpenGL HDREffect.java shader so the Vulkan compositor's
|
||||
// post-process pipeline applies the SAME fake-HDR the GL renderer's "HDR"
|
||||
// toggle does. Binary on/off; HDRPower fixed at 1.30. Composable: runs at any
|
||||
// resolution, after the optional scaling and CAS passes.
|
||||
//
|
||||
// Conventions match upscale.vert: combined-image-sampler at binding 0, the
|
||||
// push-constant block leads with vec4 ndc (offset 0), fragTexCoord in [0,1].
|
||||
// =============================================================================
|
||||
|
||||
layout(binding = 0) uniform sampler2D InputTexture;
|
||||
|
||||
layout(push_constant) uniform PC {
|
||||
vec4 ndc; // quad NDC rect, consumed by upscale.vert (offset 0)
|
||||
vec2 resolution; // input texture size in pixels
|
||||
} pc;
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
const float HDRPower = 1.30;
|
||||
const float radius1 = 0.793;
|
||||
const float radius2 = 0.870;
|
||||
|
||||
void main() {
|
||||
vec2 texcoord = fragTexCoord;
|
||||
vec2 px = 1.0 / pc.resolution;
|
||||
|
||||
vec3 color = texture(InputTexture, texcoord).rgb;
|
||||
|
||||
// --- BLOOM PASS 1 (radius1) ---
|
||||
vec3 bloom_sum1 = texture(InputTexture, texcoord + vec2( 1.5, -1.5) * radius1 * px).rgb;
|
||||
bloom_sum1 += texture(InputTexture, texcoord + vec2(-1.5, -1.5) * radius1 * px).rgb;
|
||||
bloom_sum1 += texture(InputTexture, texcoord + vec2( 1.5, 1.5) * radius1 * px).rgb;
|
||||
bloom_sum1 += texture(InputTexture, texcoord + vec2(-1.5, 1.5) * radius1 * px).rgb;
|
||||
bloom_sum1 += texture(InputTexture, texcoord + vec2( 0.0, -2.5) * radius1 * px).rgb;
|
||||
bloom_sum1 += texture(InputTexture, texcoord + vec2( 0.0, 2.5) * radius1 * px).rgb;
|
||||
bloom_sum1 += texture(InputTexture, texcoord + vec2(-2.5, 0.0) * radius1 * px).rgb;
|
||||
bloom_sum1 += texture(InputTexture, texcoord + vec2( 2.5, 0.0) * radius1 * px).rgb;
|
||||
bloom_sum1 *= 0.005;
|
||||
|
||||
// --- BLOOM PASS 2 (radius2) ---
|
||||
vec3 bloom_sum2 = texture(InputTexture, texcoord + vec2( 1.5, -1.5) * radius2 * px).rgb;
|
||||
bloom_sum2 += texture(InputTexture, texcoord + vec2(-1.5, -1.5) * radius2 * px).rgb;
|
||||
bloom_sum2 += texture(InputTexture, texcoord + vec2( 1.5, 1.5) * radius2 * px).rgb;
|
||||
bloom_sum2 += texture(InputTexture, texcoord + vec2(-1.5, 1.5) * radius2 * px).rgb;
|
||||
bloom_sum2 += texture(InputTexture, texcoord + vec2( 0.0, -2.5) * radius2 * px).rgb;
|
||||
bloom_sum2 += texture(InputTexture, texcoord + vec2( 0.0, 2.5) * radius2 * px).rgb;
|
||||
bloom_sum2 += texture(InputTexture, texcoord + vec2(-2.5, 0.0) * radius2 * px).rgb;
|
||||
bloom_sum2 += texture(InputTexture, texcoord + vec2( 2.5, 0.0) * radius2 * px).rgb;
|
||||
bloom_sum2 *= 0.010;
|
||||
|
||||
// --- FAKE HDR ---
|
||||
float dist = radius2 - radius1;
|
||||
vec3 HDR = (color + (bloom_sum2 - bloom_sum1)) * dist;
|
||||
vec3 blend = HDR + color;
|
||||
color = pow(abs(blend), vec3(abs(HDRPower))) + HDR;
|
||||
|
||||
outColor = vec4(clamp(color, 0.0, 1.0), 1.0);
|
||||
}
|
||||
@@ -0,0 +1,448 @@
|
||||
#version 450
|
||||
|
||||
// =============================================================================
|
||||
// NVIDIA Image Scaling (NIS) - NVScaler spatial upscaler + adaptive sharpen.
|
||||
//
|
||||
// Ported from NVIDIA's reference NVScaler:
|
||||
// NVIDIAGameWorks/NVIDIAImageScaling NIS/NIS_Scaler.h (+ NIS_Config.h)
|
||||
//
|
||||
// The MIT License (MIT)
|
||||
// Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
//
|
||||
// Adapted for the Winlator native Vulkan compositor:
|
||||
// - #version 450 (Vulkan GLSL), single-pass FRAGMENT shader (the reference is
|
||||
// an LDS-tiled compute shader). The block/LDS cooperative tile loads are
|
||||
// replaced with direct per-fragment texture() fetches of the 6x6 luma
|
||||
// support, and the edge map is computed inline from that support. The math
|
||||
// (edge detection + 6-tap directional scale/USM blend) is the reference's.
|
||||
// - The kPhaseCount x 6 scaler/USM coefficient banks (coef_scale, coef_usm,
|
||||
// fp32 path) are BAKED below as const arrays - no second descriptor binding
|
||||
// (the post dsLayout has ONE sampler at binding 0 shared by all pipelines).
|
||||
// - Config-UBO reads are replaced by push constants + baked SDR constants; the
|
||||
// sharpness-derived params are recomputed in-shader exactly as
|
||||
// NVScalerUpdateConfig does, driven by the existing "Sharpness" slider.
|
||||
// - fp32 only (NOT the fp16/bit-packed NIS_USE_HALF_PRECISION path) so there
|
||||
// are no bitwise/bvec ops - Adreno-compile-safe.
|
||||
// - HDR mode = None (SDR). The whole compositor chain is R8G8B8A8_UNORM and
|
||||
// values are display(gamma)-encoded here, matching NIS LDR expectations.
|
||||
// - Reuses upscale.vert: fragTexCoord spans [0,1] across the destination rect
|
||||
// (= normalised output position). With kScaleX = inputW/outputW, the source
|
||||
// sample position reduces to srcX = fragTexCoord.x*inputW - 0.5 (so the
|
||||
// output viewport origin/size cancel out and are never needed here).
|
||||
//
|
||||
// Conventions match sgsr.frag / cas.frag: combined-image-sampler at binding 0,
|
||||
// push-constant block leads with vec4 ndc (offset 0, consumed by upscale.vert),
|
||||
// then ViewportInfo (xy = 1/inputSize texel size, zw = inputSize px) + sharpness.
|
||||
// =============================================================================
|
||||
|
||||
layout(binding = 0) uniform sampler2D InputTexture;
|
||||
|
||||
layout(push_constant) uniform PC {
|
||||
vec4 ndc; // quad NDC rect, consumed by upscale.vert (offset 0)
|
||||
vec4 ViewportInfo; // xy = 1/inputSize (texel size), zw = inputSize in pixels
|
||||
float sharpness; // "Sharpness" slider mapped to [0..1] (NIS sharpness)
|
||||
} pc;
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
// ---- SDR (HDR mode None) constants, from NVScalerUpdateConfig -----------------
|
||||
const float kDetectRatio = 2.0 * 1127.0 / 1024.0; // 2.201171875
|
||||
const float kDetectThres = 64.0 / 1024.0; // 0.0625
|
||||
const float kMinContrastRatio = 2.0;
|
||||
const float kMaxContrastRatio = 10.0;
|
||||
const float kRatioNorm = 1.0 / (kMaxContrastRatio - kMinContrastRatio); // 0.125
|
||||
const float kContrastBoost = 1.0;
|
||||
const float kEps = 1.0 / 255.0;
|
||||
const float kSharpStartY = 0.45;
|
||||
const float kSharpEndY = 0.9;
|
||||
const float kSharpScaleY = 1.0 / (kSharpEndY - kSharpStartY); // 2.222...
|
||||
const int kPhaseCount = 64;
|
||||
|
||||
// Sharpness-derived params (recomputed in main from pc.sharpness, read here).
|
||||
float gSharpStrengthMin;
|
||||
float gSharpStrengthScale;
|
||||
float gSharpLimitMin;
|
||||
float gSharpLimitScale;
|
||||
|
||||
const float coefScale[384] = float[384](
|
||||
0.0, 0.0, 1.0000, 0.0, 0.0, 0.0, // phase 0
|
||||
0.0029, -0.0127, 1.0000, 0.0132, -0.0034, 0.0, // phase 1
|
||||
0.0063, -0.0249, 0.9985, 0.0269, -0.0068, 0.0, // phase 2
|
||||
0.0088, -0.0361, 0.9956, 0.0415, -0.0103, 0.0005, // phase 3
|
||||
0.0117, -0.0474, 0.9932, 0.0562, -0.0142, 0.0005, // phase 4
|
||||
0.0142, -0.0576, 0.9897, 0.0713, -0.0181, 0.0005, // phase 5
|
||||
0.0166, -0.0674, 0.9844, 0.0874, -0.0220, 0.0010, // phase 6
|
||||
0.0186, -0.0762, 0.9785, 0.1040, -0.0264, 0.0015, // phase 7
|
||||
0.0205, -0.0850, 0.9727, 0.1206, -0.0308, 0.0020, // phase 8
|
||||
0.0225, -0.0928, 0.9648, 0.1382, -0.0352, 0.0024, // phase 9
|
||||
0.0239, -0.1006, 0.9575, 0.1558, -0.0396, 0.0029, // phase 10
|
||||
0.0254, -0.1074, 0.9487, 0.1738, -0.0439, 0.0034, // phase 11
|
||||
0.0264, -0.1138, 0.9390, 0.1929, -0.0488, 0.0044, // phase 12
|
||||
0.0278, -0.1191, 0.9282, 0.2119, -0.0537, 0.0049, // phase 13
|
||||
0.0288, -0.1245, 0.9170, 0.2310, -0.0581, 0.0059, // phase 14
|
||||
0.0293, -0.1294, 0.9058, 0.2510, -0.0630, 0.0063, // phase 15
|
||||
0.0303, -0.1333, 0.8926, 0.2710, -0.0679, 0.0073, // phase 16
|
||||
0.0308, -0.1367, 0.8789, 0.2915, -0.0728, 0.0083, // phase 17
|
||||
0.0308, -0.1401, 0.8657, 0.3120, -0.0776, 0.0093, // phase 18
|
||||
0.0313, -0.1426, 0.8506, 0.3330, -0.0825, 0.0103, // phase 19
|
||||
0.0313, -0.1445, 0.8354, 0.3540, -0.0874, 0.0112, // phase 20
|
||||
0.0313, -0.1460, 0.8193, 0.3755, -0.0923, 0.0122, // phase 21
|
||||
0.0313, -0.1470, 0.8022, 0.3965, -0.0967, 0.0137, // phase 22
|
||||
0.0308, -0.1479, 0.7856, 0.4185, -0.1016, 0.0146, // phase 23
|
||||
0.0303, -0.1479, 0.7681, 0.4399, -0.1060, 0.0156, // phase 24
|
||||
0.0298, -0.1479, 0.7505, 0.4614, -0.1104, 0.0166, // phase 25
|
||||
0.0293, -0.1470, 0.7314, 0.4829, -0.1147, 0.0181, // phase 26
|
||||
0.0288, -0.1460, 0.7119, 0.5049, -0.1187, 0.0190, // phase 27
|
||||
0.0278, -0.1445, 0.6929, 0.5264, -0.1226, 0.0200, // phase 28
|
||||
0.0273, -0.1431, 0.6724, 0.5479, -0.1260, 0.0215, // phase 29
|
||||
0.0264, -0.1411, 0.6528, 0.5693, -0.1299, 0.0225, // phase 30
|
||||
0.0254, -0.1387, 0.6323, 0.5903, -0.1328, 0.0234, // phase 31
|
||||
0.0244, -0.1357, 0.6113, 0.6113, -0.1357, 0.0244, // phase 32
|
||||
0.0234, -0.1328, 0.5903, 0.6323, -0.1387, 0.0254, // phase 33
|
||||
0.0225, -0.1299, 0.5693, 0.6528, -0.1411, 0.0264, // phase 34
|
||||
0.0215, -0.1260, 0.5479, 0.6724, -0.1431, 0.0273, // phase 35
|
||||
0.0200, -0.1226, 0.5264, 0.6929, -0.1445, 0.0278, // phase 36
|
||||
0.0190, -0.1187, 0.5049, 0.7119, -0.1460, 0.0288, // phase 37
|
||||
0.0181, -0.1147, 0.4829, 0.7314, -0.1470, 0.0293, // phase 38
|
||||
0.0166, -0.1104, 0.4614, 0.7505, -0.1479, 0.0298, // phase 39
|
||||
0.0156, -0.1060, 0.4399, 0.7681, -0.1479, 0.0303, // phase 40
|
||||
0.0146, -0.1016, 0.4185, 0.7856, -0.1479, 0.0308, // phase 41
|
||||
0.0137, -0.0967, 0.3965, 0.8022, -0.1470, 0.0313, // phase 42
|
||||
0.0122, -0.0923, 0.3755, 0.8193, -0.1460, 0.0313, // phase 43
|
||||
0.0112, -0.0874, 0.3540, 0.8354, -0.1445, 0.0313, // phase 44
|
||||
0.0103, -0.0825, 0.3330, 0.8506, -0.1426, 0.0313, // phase 45
|
||||
0.0093, -0.0776, 0.3120, 0.8657, -0.1401, 0.0308, // phase 46
|
||||
0.0083, -0.0728, 0.2915, 0.8789, -0.1367, 0.0308, // phase 47
|
||||
0.0073, -0.0679, 0.2710, 0.8926, -0.1333, 0.0303, // phase 48
|
||||
0.0063, -0.0630, 0.2510, 0.9058, -0.1294, 0.0293, // phase 49
|
||||
0.0059, -0.0581, 0.2310, 0.9170, -0.1245, 0.0288, // phase 50
|
||||
0.0049, -0.0537, 0.2119, 0.9282, -0.1191, 0.0278, // phase 51
|
||||
0.0044, -0.0488, 0.1929, 0.9390, -0.1138, 0.0264, // phase 52
|
||||
0.0034, -0.0439, 0.1738, 0.9487, -0.1074, 0.0254, // phase 53
|
||||
0.0029, -0.0396, 0.1558, 0.9575, -0.1006, 0.0239, // phase 54
|
||||
0.0024, -0.0352, 0.1382, 0.9648, -0.0928, 0.0225, // phase 55
|
||||
0.0020, -0.0308, 0.1206, 0.9727, -0.0850, 0.0205, // phase 56
|
||||
0.0015, -0.0264, 0.1040, 0.9785, -0.0762, 0.0186, // phase 57
|
||||
0.0010, -0.0220, 0.0874, 0.9844, -0.0674, 0.0166, // phase 58
|
||||
0.0005, -0.0181, 0.0713, 0.9897, -0.0576, 0.0142, // phase 59
|
||||
0.0005, -0.0142, 0.0562, 0.9932, -0.0474, 0.0117, // phase 60
|
||||
0.0005, -0.0103, 0.0415, 0.9956, -0.0361, 0.0088, // phase 61
|
||||
0.0, -0.0068, 0.0269, 0.9985, -0.0249, 0.0063, // phase 62
|
||||
0.0, -0.0034, 0.0132, 1.0000, -0.0127, 0.0029 // phase 63
|
||||
);
|
||||
|
||||
const float coefUsm[384] = float[384](
|
||||
0.0, -0.6001, 1.2002, -0.6001, 0.0, 0.0, // phase 0
|
||||
0.0029, -0.6084, 1.1987, -0.5903, -0.0029, 0.0, // phase 1
|
||||
0.0049, -0.6147, 1.1958, -0.5791, -0.0068, 0.0005, // phase 2
|
||||
0.0073, -0.6196, 1.1890, -0.5659, -0.0103, 0.0, // phase 3
|
||||
0.0093, -0.6235, 1.1802, -0.5513, -0.0151, 0.0, // phase 4
|
||||
0.0112, -0.6265, 1.1699, -0.5352, -0.0195, 0.0005, // phase 5
|
||||
0.0122, -0.6270, 1.1582, -0.5181, -0.0259, 0.0005, // phase 6
|
||||
0.0142, -0.6284, 1.1455, -0.5005, -0.0317, 0.0005, // phase 7
|
||||
0.0156, -0.6265, 1.1274, -0.4790, -0.0386, 0.0005, // phase 8
|
||||
0.0166, -0.6235, 1.1089, -0.4570, -0.0454, 0.0010, // phase 9
|
||||
0.0176, -0.6187, 1.0879, -0.4346, -0.0532, 0.0010, // phase 10
|
||||
0.0181, -0.6138, 1.0659, -0.4102, -0.0615, 0.0015, // phase 11
|
||||
0.0190, -0.6069, 1.0405, -0.3843, -0.0698, 0.0015, // phase 12
|
||||
0.0195, -0.6006, 1.0161, -0.3574, -0.0796, 0.0020, // phase 13
|
||||
0.0200, -0.5928, 0.9893, -0.3286, -0.0898, 0.0024, // phase 14
|
||||
0.0200, -0.5820, 0.9580, -0.2988, -0.1001, 0.0029, // phase 15
|
||||
0.0200, -0.5728, 0.9292, -0.2690, -0.1104, 0.0034, // phase 16
|
||||
0.0200, -0.5620, 0.8975, -0.2368, -0.1226, 0.0039, // phase 17
|
||||
0.0205, -0.5498, 0.8643, -0.2046, -0.1343, 0.0044, // phase 18
|
||||
0.0200, -0.5371, 0.8301, -0.1709, -0.1465, 0.0049, // phase 19
|
||||
0.0195, -0.5239, 0.7944, -0.1367, -0.1587, 0.0054, // phase 20
|
||||
0.0195, -0.5107, 0.7598, -0.1021, -0.1724, 0.0059, // phase 21
|
||||
0.0190, -0.4966, 0.7231, -0.0649, -0.1865, 0.0063, // phase 22
|
||||
0.0186, -0.4819, 0.6846, -0.0288, -0.1997, 0.0068, // phase 23
|
||||
0.0186, -0.4668, 0.6460, 0.0093, -0.2144, 0.0073, // phase 24
|
||||
0.0176, -0.4507, 0.6055, 0.0479, -0.2290, 0.0083, // phase 25
|
||||
0.0171, -0.4370, 0.5693, 0.0859, -0.2446, 0.0088, // phase 26
|
||||
0.0161, -0.4199, 0.5283, 0.1255, -0.2598, 0.0098, // phase 27
|
||||
0.0161, -0.4048, 0.4883, 0.1655, -0.2754, 0.0103, // phase 28
|
||||
0.0151, -0.3887, 0.4497, 0.2041, -0.2910, 0.0107, // phase 29
|
||||
0.0142, -0.3711, 0.4072, 0.2446, -0.3066, 0.0117, // phase 30
|
||||
0.0137, -0.3555, 0.3672, 0.2852, -0.3228, 0.0122, // phase 31
|
||||
0.0132, -0.3394, 0.3262, 0.3262, -0.3394, 0.0132, // phase 32
|
||||
0.0122, -0.3228, 0.2852, 0.3672, -0.3555, 0.0137, // phase 33
|
||||
0.0117, -0.3066, 0.2446, 0.4072, -0.3711, 0.0142, // phase 34
|
||||
0.0107, -0.2910, 0.2041, 0.4497, -0.3887, 0.0151, // phase 35
|
||||
0.0103, -0.2754, 0.1655, 0.4883, -0.4048, 0.0161, // phase 36
|
||||
0.0098, -0.2598, 0.1255, 0.5283, -0.4199, 0.0161, // phase 37
|
||||
0.0088, -0.2446, 0.0859, 0.5693, -0.4370, 0.0171, // phase 38
|
||||
0.0083, -0.2290, 0.0479, 0.6055, -0.4507, 0.0176, // phase 39
|
||||
0.0073, -0.2144, 0.0093, 0.6460, -0.4668, 0.0186, // phase 40
|
||||
0.0068, -0.1997, -0.0288, 0.6846, -0.4819, 0.0186, // phase 41
|
||||
0.0063, -0.1865, -0.0649, 0.7231, -0.4966, 0.0190, // phase 42
|
||||
0.0059, -0.1724, -0.1021, 0.7598, -0.5107, 0.0195, // phase 43
|
||||
0.0054, -0.1587, -0.1367, 0.7944, -0.5239, 0.0195, // phase 44
|
||||
0.0049, -0.1465, -0.1709, 0.8301, -0.5371, 0.0200, // phase 45
|
||||
0.0044, -0.1343, -0.2046, 0.8643, -0.5498, 0.0205, // phase 46
|
||||
0.0039, -0.1226, -0.2368, 0.8975, -0.5620, 0.0200, // phase 47
|
||||
0.0034, -0.1104, -0.2690, 0.9292, -0.5728, 0.0200, // phase 48
|
||||
0.0029, -0.1001, -0.2988, 0.9580, -0.5820, 0.0200, // phase 49
|
||||
0.0024, -0.0898, -0.3286, 0.9893, -0.5928, 0.0200, // phase 50
|
||||
0.0020, -0.0796, -0.3574, 1.0161, -0.6006, 0.0195, // phase 51
|
||||
0.0015, -0.0698, -0.3843, 1.0405, -0.6069, 0.0190, // phase 52
|
||||
0.0015, -0.0615, -0.4102, 1.0659, -0.6138, 0.0181, // phase 53
|
||||
0.0010, -0.0532, -0.4346, 1.0879, -0.6187, 0.0176, // phase 54
|
||||
0.0010, -0.0454, -0.4570, 1.1089, -0.6235, 0.0166, // phase 55
|
||||
0.0005, -0.0386, -0.4790, 1.1274, -0.6265, 0.0156, // phase 56
|
||||
0.0005, -0.0317, -0.5005, 1.1455, -0.6284, 0.0142, // phase 57
|
||||
0.0005, -0.0259, -0.5181, 1.1582, -0.6270, 0.0122, // phase 58
|
||||
0.0005, -0.0195, -0.5352, 1.1699, -0.6265, 0.0112, // phase 59
|
||||
0.0, -0.0151, -0.5513, 1.1802, -0.6235, 0.0093, // phase 60
|
||||
0.0, -0.0103, -0.5659, 1.1890, -0.6196, 0.0073, // phase 61
|
||||
0.0005, -0.0068, -0.5791, 1.1958, -0.6147, 0.0049, // phase 62
|
||||
0.0, -0.0029, -0.5903, 1.1987, -0.6084, 0.0029 // phase 63
|
||||
);
|
||||
|
||||
float getY(vec3 rgb) {
|
||||
return dot(rgb, vec3(0.2126, 0.7152, 0.0722));
|
||||
}
|
||||
|
||||
// GetEdgeMap on a 3x3 luma window (pRC: R=row 0=top, C=col 0=left).
|
||||
vec4 edgeAt(float p00, float p01, float p02,
|
||||
float p10, float p11, float p12,
|
||||
float p20, float p21, float p22) {
|
||||
float g_0 = abs(p00 + p01 + p02 - p20 - p21 - p22);
|
||||
float g_45 = abs(p10 + p00 + p01 - p21 - p22 - p12);
|
||||
float g_90 = abs(p00 + p10 + p20 - p02 - p12 - p22);
|
||||
float g_135 = abs(p10 + p20 + p21 - p01 - p02 - p12);
|
||||
|
||||
float g_0_90_max = max(g_0, g_90);
|
||||
float g_0_90_min = min(g_0, g_90);
|
||||
float g_45_135_max = max(g_45, g_135);
|
||||
float g_45_135_min = min(g_45, g_135);
|
||||
|
||||
if (g_0_90_max + g_45_135_max == 0.0) {
|
||||
return vec4(0.0);
|
||||
}
|
||||
|
||||
float e_0_90 = g_0_90_max / (g_0_90_max + g_45_135_max);
|
||||
float e_45_135 = 1.0 - e_0_90;
|
||||
|
||||
bool c_0_90 = (g_0_90_max > (g_0_90_min * kDetectRatio)) && (g_0_90_max > kDetectThres) && (g_0_90_max > g_45_135_min);
|
||||
bool c_45_135 = (g_45_135_max > (g_45_135_min * kDetectRatio)) && (g_45_135_max > kDetectThres) && (g_45_135_max > g_0_90_min);
|
||||
bool c_g_0_90 = (g_0_90_max == g_0);
|
||||
bool c_g_45_135= (g_45_135_max == g_45);
|
||||
|
||||
float f_e_0_90 = (c_0_90 && c_45_135) ? e_0_90 : 1.0;
|
||||
float f_e_45_135 = (c_0_90 && c_45_135) ? e_45_135 : 1.0;
|
||||
|
||||
float w0 = (c_0_90 && c_g_0_90) ? f_e_0_90 : 0.0;
|
||||
float w90 = (c_0_90 && !c_g_0_90) ? f_e_0_90 : 0.0;
|
||||
float w45 = (c_45_135 && c_g_45_135) ? f_e_45_135 : 0.0;
|
||||
float w135 = (c_45_135 && !c_g_45_135)? f_e_45_135 : 0.0;
|
||||
|
||||
return vec4(w0, w90, w45, w135);
|
||||
}
|
||||
|
||||
vec4 getInterpEdgeMap(vec4 e00, vec4 e01, vec4 e10, vec4 e11, float fx, float fy) {
|
||||
vec4 h0 = mix(e00, e01, fx);
|
||||
vec4 h1 = mix(e10, e11, fx);
|
||||
return mix(h0, h1, fy);
|
||||
}
|
||||
|
||||
float calcLTI(float p0, float p1, float p2, float p3, float p4, float p5, int phase_index) {
|
||||
bool selector = (phase_index <= kPhaseCount / 2);
|
||||
float sel = selector ? p0 : p3;
|
||||
float a_min = min(min(p1, p2), sel);
|
||||
float a_max = max(max(p1, p2), sel);
|
||||
sel = selector ? p2 : p5;
|
||||
float b_min = min(min(p3, p4), sel);
|
||||
float b_max = max(max(p3, p4), sel);
|
||||
|
||||
float a_cont = a_max - a_min;
|
||||
float b_cont = b_max - b_min;
|
||||
|
||||
float cont_ratio = max(a_cont, b_cont) / (min(a_cont, b_cont) + kEps);
|
||||
return (1.0 - clamp((cont_ratio - kMinContrastRatio) * kRatioNorm, 0.0, 1.0)) * kContrastBoost;
|
||||
}
|
||||
|
||||
float evalPoly6(float pxl[6], int phase_int) {
|
||||
phase_int = clamp(phase_int, 0, 63);
|
||||
float y = 0.0;
|
||||
float y_usm = 0.0;
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
y += coefScale[phase_int * 6 + i] * pxl[i];
|
||||
y_usm += coefUsm[phase_int * 6 + i] * pxl[i];
|
||||
}
|
||||
|
||||
// piece-wise ramp based on luma (NIS_SCALE_FLOAT == 1)
|
||||
float y_scale = 1.0 - clamp((y - kSharpStartY) * kSharpScaleY, 0.0, 1.0);
|
||||
float y_sharpness = y_scale * gSharpStrengthScale + gSharpStrengthMin;
|
||||
y_usm *= y_sharpness;
|
||||
|
||||
float y_sharpness_limit = (y_scale * gSharpLimitScale + gSharpLimitMin) * y;
|
||||
y_usm = min(y_sharpness_limit, max(-y_sharpness_limit, y_usm));
|
||||
y_usm *= calcLTI(pxl[0], pxl[1], pxl[2], pxl[3], pxl[4], pxl[5], phase_int);
|
||||
|
||||
return y + y_usm;
|
||||
}
|
||||
|
||||
float filterNormal(float p[6][6], int phase_x_int, int phase_y_int) {
|
||||
phase_x_int = clamp(phase_x_int, 0, 63);
|
||||
phase_y_int = clamp(phase_y_int, 0, 63);
|
||||
float h_acc = 0.0;
|
||||
for (int j = 0; j < 6; ++j) {
|
||||
float v_acc = 0.0;
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
v_acc += p[i][j] * coefScale[phase_y_int * 6 + i];
|
||||
}
|
||||
h_acc += v_acc * coefScale[phase_x_int * 6 + j];
|
||||
}
|
||||
return h_acc;
|
||||
}
|
||||
|
||||
float addDirFilters(float p[6][6], float phase_x_frac, float phase_y_frac,
|
||||
int phase_x_frac_int, int phase_y_frac_int, vec4 w) {
|
||||
float f = 0.0;
|
||||
if (w.x > 0.0) {
|
||||
// 0 deg filter
|
||||
float interp0Deg[6];
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
interp0Deg[i] = mix(p[i][2], p[i][3], phase_x_frac);
|
||||
}
|
||||
f += evalPoly6(interp0Deg, phase_y_frac_int) * w.x;
|
||||
}
|
||||
if (w.y > 0.0) {
|
||||
// 90 deg filter
|
||||
float interp90Deg[6];
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
interp90Deg[i] = mix(p[2][i], p[3][i], phase_y_frac);
|
||||
}
|
||||
f += evalPoly6(interp90Deg, phase_x_frac_int) * w.y;
|
||||
}
|
||||
if (w.z > 0.0) {
|
||||
// 45 deg filter
|
||||
float pphase_b45 = 0.5 + 0.5 * (phase_x_frac - phase_y_frac);
|
||||
|
||||
float temp_interp45Deg[7];
|
||||
temp_interp45Deg[1] = mix(p[2][1], p[1][2], pphase_b45);
|
||||
temp_interp45Deg[3] = mix(p[3][2], p[2][3], pphase_b45);
|
||||
temp_interp45Deg[5] = mix(p[4][3], p[3][4], pphase_b45);
|
||||
{
|
||||
pphase_b45 = pphase_b45 - 0.5;
|
||||
float a = (pphase_b45 >= 0.0) ? p[0][2] : p[2][0];
|
||||
float b = (pphase_b45 >= 0.0) ? p[1][3] : p[3][1];
|
||||
float c = (pphase_b45 >= 0.0) ? p[2][4] : p[4][2];
|
||||
float d = (pphase_b45 >= 0.0) ? p[3][5] : p[5][3];
|
||||
temp_interp45Deg[0] = mix(p[1][1], a, abs(pphase_b45));
|
||||
temp_interp45Deg[2] = mix(p[2][2], b, abs(pphase_b45));
|
||||
temp_interp45Deg[4] = mix(p[3][3], c, abs(pphase_b45));
|
||||
temp_interp45Deg[6] = mix(p[4][4], d, abs(pphase_b45));
|
||||
}
|
||||
|
||||
float interp45Deg[6];
|
||||
float pphase_p45 = phase_x_frac + phase_y_frac;
|
||||
if (pphase_p45 >= 1.0) {
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
interp45Deg[i] = temp_interp45Deg[i + 1];
|
||||
}
|
||||
pphase_p45 = pphase_p45 - 1.0;
|
||||
} else {
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
interp45Deg[i] = temp_interp45Deg[i];
|
||||
}
|
||||
}
|
||||
|
||||
f += evalPoly6(interp45Deg, int(pphase_p45 * 64.0)) * w.z;
|
||||
}
|
||||
if (w.w > 0.0) {
|
||||
// 135 deg filter
|
||||
float pphase_b135 = 0.5 * (phase_x_frac + phase_y_frac);
|
||||
|
||||
float temp_interp135Deg[7];
|
||||
temp_interp135Deg[1] = mix(p[3][1], p[4][2], pphase_b135);
|
||||
temp_interp135Deg[3] = mix(p[2][2], p[3][3], pphase_b135);
|
||||
temp_interp135Deg[5] = mix(p[1][3], p[2][4], pphase_b135);
|
||||
{
|
||||
pphase_b135 = pphase_b135 - 0.5;
|
||||
float a = (pphase_b135 >= 0.0) ? p[5][2] : p[3][0];
|
||||
float b = (pphase_b135 >= 0.0) ? p[4][3] : p[2][1];
|
||||
float c = (pphase_b135 >= 0.0) ? p[3][4] : p[1][2];
|
||||
float d = (pphase_b135 >= 0.0) ? p[2][5] : p[0][3];
|
||||
temp_interp135Deg[0] = mix(p[4][1], a, abs(pphase_b135));
|
||||
temp_interp135Deg[2] = mix(p[3][2], b, abs(pphase_b135));
|
||||
temp_interp135Deg[4] = mix(p[2][3], c, abs(pphase_b135));
|
||||
temp_interp135Deg[6] = mix(p[1][4], d, abs(pphase_b135));
|
||||
}
|
||||
|
||||
float interp135Deg[6];
|
||||
float pphase_p135 = 1.0 + (phase_x_frac - phase_y_frac);
|
||||
if (pphase_p135 >= 1.0) {
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
interp135Deg[i] = temp_interp135Deg[i + 1];
|
||||
}
|
||||
pphase_p135 = pphase_p135 - 1.0;
|
||||
} else {
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
interp135Deg[i] = temp_interp135Deg[i];
|
||||
}
|
||||
}
|
||||
|
||||
f += evalPoly6(interp135Deg, int(pphase_p135 * 64.0)) * w.w;
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
void main() {
|
||||
// Sharpness-derived params - mirror NVScalerUpdateConfig (SDR path).
|
||||
float sharpness = clamp(pc.sharpness, 0.0, 1.0);
|
||||
float sharpen_slider = sharpness - 0.5;
|
||||
float MaxScale = (sharpen_slider >= 0.0) ? 1.25 : 1.75;
|
||||
float MinScale = (sharpen_slider >= 0.0) ? 1.25 : 1.0;
|
||||
float LimitScale = MinScale;
|
||||
|
||||
gSharpStrengthMin = max(0.0, 0.4 + sharpen_slider * MinScale * 1.2);
|
||||
float sharpStrengthMax = 1.6 + sharpen_slider * MaxScale * 1.8;
|
||||
gSharpStrengthScale = sharpStrengthMax - gSharpStrengthMin;
|
||||
gSharpLimitMin = max(0.1, 0.14 + sharpen_slider * LimitScale * 0.32);
|
||||
float sharpLimitMax = 0.5 + sharpen_slider * LimitScale * 0.6;
|
||||
gSharpLimitScale = sharpLimitMax - gSharpLimitMin;
|
||||
|
||||
vec2 inSize = pc.ViewportInfo.zw;
|
||||
vec2 invIn = pc.ViewportInfo.xy;
|
||||
|
||||
// Source sample position in input-pixel space (output viewport cancels out).
|
||||
float srcX = fragTexCoord.x * inSize.x - 0.5;
|
||||
float srcY = fragTexCoord.y * inSize.y - 0.5;
|
||||
float fsx = floor(srcX);
|
||||
float fsy = floor(srcY);
|
||||
float fx = srcX - fsx;
|
||||
float fy = srcY - fsy;
|
||||
int fx_int = int(fx * float(kPhaseCount));
|
||||
int fy_int = int(fy * float(kPhaseCount));
|
||||
|
||||
// 6x6 luma support: p[i][j] = luma at source texel (fsx + j - 2, fsy + i - 2).
|
||||
float p[6][6];
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
for (int j = 0; j < 6; ++j) {
|
||||
vec2 tc = (vec2(fsx + float(j) - 2.0, fsy + float(i) - 2.0) + 0.5) * invIn;
|
||||
p[i][j] = getY(textureLod(InputTexture, tc, 0.0).rgb);
|
||||
}
|
||||
}
|
||||
|
||||
// 2x2 edge map around the source pixel (3x3 luma window per corner).
|
||||
vec4 e00 = edgeAt(p[1][1], p[1][2], p[1][3], p[2][1], p[2][2], p[2][3], p[3][1], p[3][2], p[3][3]);
|
||||
vec4 e01 = edgeAt(p[1][2], p[1][3], p[1][4], p[2][2], p[2][3], p[2][4], p[3][2], p[3][3], p[3][4]);
|
||||
vec4 e10 = edgeAt(p[2][1], p[2][2], p[2][3], p[3][1], p[3][2], p[3][3], p[4][1], p[4][2], p[4][3]);
|
||||
vec4 e11 = edgeAt(p[2][2], p[2][3], p[2][4], p[3][2], p[3][3], p[3][4], p[4][2], p[4][3], p[4][4]);
|
||||
vec4 w = getInterpEdgeMap(e00, e01, e10, e11, fx, fy); // * NIS_SCALE_INT (==1)
|
||||
|
||||
float baseWeight = 1.0 - w.x - w.y - w.z - w.w; // NIS_SCALE_FLOAT - sum
|
||||
float opY = filterNormal(p, fx_int, fy_int) * baseWeight;
|
||||
opY += addDirFilters(p, fx, fy, fx_int, fy_int, w);
|
||||
|
||||
// Bilinear color tap (coord reduces to fragTexCoord) + luma correction.
|
||||
vec4 op = texture(InputTexture, fragTexCoord);
|
||||
float y = getY(op.rgb);
|
||||
float corr = opY - y; // * (1/NIS_SCALE_FLOAT) == 1
|
||||
op.rgb += vec3(corr);
|
||||
|
||||
outColor = vec4(clamp(op.rgb, 0.0, 1.0), 1.0);
|
||||
}
|
||||
+1175
-1188
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,73 @@
|
||||
#version 450
|
||||
|
||||
// =============================================================================
|
||||
// NTSC composite-signal artifacts (YIQ chroma modulation + chromatic
|
||||
// aberration + scanlines + subtle barrel warp) post effect.
|
||||
//
|
||||
// Ported verbatim from the OpenGL NTSCCombinedEffect.java shader. GL sampled
|
||||
// with the varying vUV; here fragTexCoord IS that uv. GL's TextureSize and
|
||||
// resolution uniforms were both the screen size -> we feed both from pc.resolution.
|
||||
// Chroma offsets are fixed; this effect does not animate its color phase.
|
||||
//
|
||||
// Conventions match upscale.vert: combined-image-sampler at binding 0, the
|
||||
// push-constant block leads with vec4 ndc (offset 0), fragTexCoord in [0,1].
|
||||
// Runs after HDR, before CRT in the canonical chain (analog signal, then tube).
|
||||
// =============================================================================
|
||||
|
||||
layout(binding = 0) uniform sampler2D InputTexture;
|
||||
|
||||
layout(push_constant) uniform PC {
|
||||
vec4 ndc; // quad NDC rect, consumed by upscale.vert (offset 0)
|
||||
vec2 resolution; // screen size in px (= TextureSize = resolution in GL)
|
||||
} pc;
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
#define PI 3.14159265
|
||||
#define SCANLINE_INTENSITY 0.35
|
||||
#define CHROMA_OFFSET 0.005
|
||||
#define BLUR_RADIUS 0.002
|
||||
#define WARP_AMOUNT 0.01
|
||||
#define SCANLINE_DARKEN 0.5
|
||||
|
||||
const mat3 yiq_mat = mat3(
|
||||
0.299, 0.587, 0.114,
|
||||
0.596, -0.275, -0.321,
|
||||
0.212, -0.523, 0.311
|
||||
);
|
||||
const mat3 yiq2rgb_mat = mat3(
|
||||
1.0, 0.956, 0.621,
|
||||
1.0, -0.272, -0.647,
|
||||
1.0, -1.106, 1.705
|
||||
);
|
||||
|
||||
vec3 applyNTSC(vec2 uv) {
|
||||
return vec3(
|
||||
texture(InputTexture, uv + vec2(CHROMA_OFFSET, 0.0)).r,
|
||||
texture(InputTexture, uv + vec2(0.0, BLUR_RADIUS)).g,
|
||||
texture(InputTexture, uv - vec2(CHROMA_OFFSET, 0.0)).b
|
||||
);
|
||||
}
|
||||
|
||||
vec3 applyScanlines(vec2 uv, vec3 col) {
|
||||
float scanline = abs(sin(uv.y * pc.resolution.y * 2.0)) * SCANLINE_INTENSITY;
|
||||
col *= 1.0 - (scanline * SCANLINE_DARKEN);
|
||||
return col;
|
||||
}
|
||||
|
||||
vec2 applyWarp(vec2 uv) {
|
||||
uv = uv * 2.0 - 1.0;
|
||||
float r = sqrt(uv.x * uv.x + uv.y * uv.y);
|
||||
uv += uv * (r * r) * WARP_AMOUNT;
|
||||
return uv * 0.5 + 0.5;
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec2 warpedUV = applyWarp(fragTexCoord);
|
||||
vec3 centerColor = texture(InputTexture, warpedUV).rgb;
|
||||
vec3 ntscColor = applyNTSC(warpedUV);
|
||||
vec3 scanlineColor = applyScanlines(warpedUV, centerColor);
|
||||
vec3 finalColor = mix(ntscColor, scanlineColor, 0.7);
|
||||
outColor = vec4(finalColor, 1.0);
|
||||
}
|
||||
@@ -1,153 +1,126 @@
|
||||
// 1116.3.0
|
||||
#pragma once
|
||||
const uint32_t ntsc_code[] = {
|
||||
0x07230203,0x00010000,0x0008000b,0x000000d5,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x07230203,0x00010000,0x0008000b,0x000000af,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x000000bc,0x000000cf,0x00030010,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000077,0x00000091,0x00030010,
|
||||
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d,
|
||||
0x00000000,0x00060005,0x0000000c,0x6c707061,0x53544e79,0x66762843,0x00003b32,0x00030005,
|
||||
0x0000000b,0x00007675,0x00070005,0x0000000f,0x6c707061,0x61635379,0x6e696c6e,0x76287365,
|
||||
0x003b3266,0x00030005,0x0000000e,0x00007675,0x00060005,0x00000013,0x6c707061,0x72615779,
|
||||
0x66762870,0x00003b32,0x00030005,0x00000012,0x00007675,0x00030005,0x00000016,0x006c6f63,
|
||||
0x00060005,0x0000001a,0x75706e49,0x78655474,0x65727574,0x00000000,0x00030005,0x00000020,
|
||||
0x00716979,0x00050005,0x00000032,0x6f726863,0x6850616d,0x00657361,0x00030005,0x00000038,
|
||||
0x00004350,0x00040006,0x00000038,0x00000000,0x0063646e,0x00060006,0x00000038,0x00000001,
|
||||
0x6f736572,0x6974756c,0x00006e6f,0x00060006,0x00000038,0x00000002,0x6d617266,0x756f4365,
|
||||
0x0000746e,0x00030005,0x0000003a,0x00006370,0x00030005,0x00000058,0x00626772,0x00050005,
|
||||
0x00000066,0x616e6966,0x6c6f436c,0x0000726f,0x00030005,0x00000082,0x006c6f63,0x00050005,
|
||||
0x00000087,0x6e616373,0x656e696c,0x00000000,0x00030005,0x0000009e,0x00000072,0x00050005,
|
||||
0x000000ba,0x70726177,0x56556465,0x00000000,0x00060005,0x000000bc,0x67617266,0x43786554,
|
||||
0x64726f6f,0x00000000,0x00040005,0x000000bd,0x61726170,0x0000006d,0x00050005,0x000000c0,
|
||||
0x6373746e,0x6f6c6f43,0x00000072,0x00040005,0x000000c1,0x61726170,0x0000006d,0x00060005,
|
||||
0x000000c4,0x6e616373,0x656e696c,0x6f6c6f43,0x00000072,0x00040005,0x000000c5,0x61726170,
|
||||
0x0000006d,0x00050005,0x000000c8,0x616e6966,0x6c6f436c,0x0000726f,0x00050005,0x000000cf,
|
||||
0x4374756f,0x726f6c6f,0x00000000,0x00040047,0x0000001a,0x00000021,0x00000000,0x00040047,
|
||||
0x0000001a,0x00000022,0x00000000,0x00030047,0x00000038,0x00000002,0x00050048,0x00000038,
|
||||
0x00000000,0x00000023,0x00000000,0x00050048,0x00000038,0x00000001,0x00000023,0x00000010,
|
||||
0x00050048,0x00000038,0x00000002,0x00000023,0x00000018,0x00040047,0x000000bc,0x0000001e,
|
||||
0x00000000,0x00040047,0x000000cf,0x0000001e,0x00000000,0x00020013,0x00000002,0x00030021,
|
||||
0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,
|
||||
0x00000002,0x00040020,0x00000008,0x00000007,0x00000007,0x00040017,0x00000009,0x00000006,
|
||||
0x00000003,0x00040021,0x0000000a,0x00000009,0x00000008,0x00040021,0x00000011,0x00000007,
|
||||
0x00000008,0x00040020,0x00000015,0x00000007,0x00000009,0x00090019,0x00000017,0x00000006,
|
||||
0x00000001,0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x00000018,
|
||||
0x00000017,0x00040020,0x00000019,0x00000000,0x00000018,0x0004003b,0x00000019,0x0000001a,
|
||||
0x00000000,0x00040017,0x0000001d,0x00000006,0x00000004,0x00040018,0x00000022,0x00000009,
|
||||
0x00000003,0x0004002b,0x00000006,0x00000023,0x3e991687,0x0004002b,0x00000006,0x00000024,
|
||||
0x3f1645a2,0x0004002b,0x00000006,0x00000025,0x3de978d5,0x0006002c,0x00000009,0x00000026,
|
||||
0x00000023,0x00000024,0x00000025,0x0004002b,0x00000006,0x00000027,0x3f189375,0x0004002b,
|
||||
0x00000006,0x00000028,0xbe8ccccd,0x0004002b,0x00000006,0x00000029,0xbea45a1d,0x0006002c,
|
||||
0x00000009,0x0000002a,0x00000027,0x00000028,0x00000029,0x0004002b,0x00000006,0x0000002b,
|
||||
0x3e591687,0x0004002b,0x00000006,0x0000002c,0xbf05e354,0x0004002b,0x00000006,0x0000002d,
|
||||
0x3e9f3b64,0x0006002c,0x00000009,0x0000002e,0x0000002b,0x0000002c,0x0000002d,0x0006002c,
|
||||
0x00000022,0x0000002f,0x00000026,0x0000002a,0x0000002e,0x00040020,0x00000031,0x00000007,
|
||||
0x00000006,0x0004002b,0x00000006,0x00000033,0x40490fdb,0x00040015,0x00000034,0x00000020,
|
||||
0x00000000,0x0004002b,0x00000034,0x00000035,0x00000001,0x0005001e,0x00000038,0x0000001d,
|
||||
0x00000007,0x00000006,0x00040020,0x00000039,0x00000009,0x00000038,0x0004003b,0x00000039,
|
||||
0x0000003a,0x00000009,0x00040015,0x0000003b,0x00000020,0x00000001,0x0004002b,0x0000003b,
|
||||
0x0000003c,0x00000001,0x00040020,0x0000003d,0x00000009,0x00000006,0x0004002b,0x00000006,
|
||||
0x00000041,0x40000000,0x0004002b,0x0000003b,0x00000043,0x00000002,0x0004002b,0x00000006,
|
||||
0x00000049,0x3f000000,0x0004002b,0x00000034,0x00000053,0x00000002,0x0004002b,0x00000006,
|
||||
0x0000005a,0x3f800000,0x0004002b,0x00000006,0x0000005b,0x3f74bc6a,0x0004002b,0x00000006,
|
||||
0x0000005c,0x3f1ef9db,0x0006002c,0x00000009,0x0000005d,0x0000005a,0x0000005b,0x0000005c,
|
||||
0x0004002b,0x00000006,0x0000005e,0xbe8b4396,0x0004002b,0x00000006,0x0000005f,0xbf25a1cb,
|
||||
0x0006002c,0x00000009,0x00000060,0x0000005a,0x0000005e,0x0000005f,0x0004002b,0x00000006,
|
||||
0x00000061,0xbf8d9168,0x0004002b,0x00000006,0x00000062,0x3fda3d71,0x0006002c,0x00000009,
|
||||
0x00000063,0x0000005a,0x00000061,0x00000062,0x0006002c,0x00000022,0x00000064,0x0000005d,
|
||||
0x00000060,0x00000063,0x0004002b,0x00000006,0x00000069,0x3ba3d70a,0x0004002b,0x00000006,
|
||||
0x0000006a,0x00000000,0x0005002c,0x00000007,0x0000006b,0x00000069,0x0000006a,0x0004002b,
|
||||
0x00000034,0x0000006e,0x00000000,0x0004002b,0x00000006,0x00000073,0x3b03126f,0x0005002c,
|
||||
0x00000007,0x00000074,0x0000006a,0x00000073,0x0004002b,0x00000006,0x00000090,0x3eb33333,
|
||||
0x0004002b,0x00000006,0x000000b0,0x3c23d70a,0x00040020,0x000000bb,0x00000001,0x00000007,
|
||||
0x0004003b,0x000000bb,0x000000bc,0x00000001,0x0004002b,0x00000006,0x000000cb,0x3f333333,
|
||||
0x00040020,0x000000ce,0x00000003,0x0000001d,0x0004003b,0x000000ce,0x000000cf,0x00000003,
|
||||
0x0000000b,0x00007675,0x00080005,0x00000012,0x6c707061,0x61635379,0x6e696c6e,0x76287365,
|
||||
0x763b3266,0x003b3366,0x00030005,0x00000010,0x00007675,0x00030005,0x00000011,0x006c6f63,
|
||||
0x00060005,0x00000016,0x6c707061,0x72615779,0x66762870,0x00003b32,0x00030005,0x00000015,
|
||||
0x00007675,0x00060005,0x0000001b,0x75706e49,0x78655474,0x65727574,0x00000000,0x00050005,
|
||||
0x00000039,0x6e616373,0x656e696c,0x00000000,0x00030005,0x0000003c,0x00004350,0x00040006,
|
||||
0x0000003c,0x00000000,0x0063646e,0x00060006,0x0000003c,0x00000001,0x6f736572,0x6974756c,
|
||||
0x00006e6f,0x00030005,0x0000003e,0x00006370,0x00030005,0x00000059,0x00000072,0x00050005,
|
||||
0x00000075,0x70726177,0x56556465,0x00000000,0x00060005,0x00000077,0x67617266,0x43786554,
|
||||
0x64726f6f,0x00000000,0x00040005,0x00000078,0x61726170,0x0000006d,0x00050005,0x0000007b,
|
||||
0x746e6563,0x6f437265,0x00726f6c,0x00050005,0x00000080,0x6373746e,0x6f6c6f43,0x00000072,
|
||||
0x00040005,0x00000081,0x61726170,0x0000006d,0x00060005,0x00000084,0x6e616373,0x656e696c,
|
||||
0x6f6c6f43,0x00000072,0x00040005,0x00000085,0x61726170,0x0000006d,0x00040005,0x00000087,
|
||||
0x61726170,0x0000006d,0x00050005,0x0000008a,0x616e6966,0x6c6f436c,0x0000726f,0x00050005,
|
||||
0x00000091,0x4374756f,0x726f6c6f,0x00000000,0x00040047,0x0000001b,0x00000021,0x00000000,
|
||||
0x00040047,0x0000001b,0x00000022,0x00000000,0x00030047,0x0000003c,0x00000002,0x00050048,
|
||||
0x0000003c,0x00000000,0x00000023,0x00000000,0x00050048,0x0000003c,0x00000001,0x00000023,
|
||||
0x00000010,0x00040047,0x00000077,0x0000001e,0x00000000,0x00040047,0x00000091,0x0000001e,
|
||||
0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,
|
||||
0x00000020,0x00040017,0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,0x00000007,
|
||||
0x00000007,0x00040017,0x00000009,0x00000006,0x00000003,0x00040021,0x0000000a,0x00000009,
|
||||
0x00000008,0x00040020,0x0000000e,0x00000007,0x00000009,0x00050021,0x0000000f,0x00000009,
|
||||
0x00000008,0x0000000e,0x00040021,0x00000014,0x00000007,0x00000008,0x00090019,0x00000018,
|
||||
0x00000006,0x00000001,0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,
|
||||
0x00000019,0x00000018,0x00040020,0x0000001a,0x00000000,0x00000019,0x0004003b,0x0000001a,
|
||||
0x0000001b,0x00000000,0x0004002b,0x00000006,0x0000001e,0x3ba3d70a,0x0004002b,0x00000006,
|
||||
0x0000001f,0x00000000,0x0005002c,0x00000007,0x00000020,0x0000001e,0x0000001f,0x00040017,
|
||||
0x00000022,0x00000006,0x00000004,0x00040015,0x00000024,0x00000020,0x00000000,0x0004002b,
|
||||
0x00000024,0x00000025,0x00000000,0x0004002b,0x00000006,0x00000029,0x3b03126f,0x0005002c,
|
||||
0x00000007,0x0000002a,0x0000001f,0x00000029,0x0004002b,0x00000024,0x0000002d,0x00000001,
|
||||
0x0004002b,0x00000024,0x00000033,0x00000002,0x00040020,0x00000038,0x00000007,0x00000006,
|
||||
0x0004001e,0x0000003c,0x00000022,0x00000007,0x00040020,0x0000003d,0x00000009,0x0000003c,
|
||||
0x0004003b,0x0000003d,0x0000003e,0x00000009,0x00040015,0x0000003f,0x00000020,0x00000001,
|
||||
0x0004002b,0x0000003f,0x00000040,0x00000001,0x00040020,0x00000041,0x00000009,0x00000006,
|
||||
0x0004002b,0x00000006,0x00000045,0x40000000,0x0004002b,0x00000006,0x00000049,0x3eb33333,
|
||||
0x0004002b,0x00000006,0x0000004b,0x3f800000,0x0004002b,0x00000006,0x0000004d,0x3f000000,
|
||||
0x0004002b,0x00000006,0x0000006b,0x3c23d70a,0x00040020,0x00000076,0x00000001,0x00000007,
|
||||
0x0004003b,0x00000076,0x00000077,0x00000001,0x0004002b,0x00000006,0x0000008d,0x3f333333,
|
||||
0x00040020,0x00000090,0x00000003,0x00000022,0x0004003b,0x00000090,0x00000091,0x00000003,
|
||||
0x00040018,0x00000097,0x00000009,0x00000003,0x0004002b,0x00000006,0x00000098,0x3e991687,
|
||||
0x0004002b,0x00000006,0x00000099,0x3f1645a2,0x0004002b,0x00000006,0x0000009a,0x3de978d5,
|
||||
0x0006002c,0x00000009,0x0000009b,0x00000098,0x00000099,0x0000009a,0x0004002b,0x00000006,
|
||||
0x0000009c,0x3f189375,0x0004002b,0x00000006,0x0000009d,0xbe8ccccd,0x0004002b,0x00000006,
|
||||
0x0000009e,0xbea45a1d,0x0006002c,0x00000009,0x0000009f,0x0000009c,0x0000009d,0x0000009e,
|
||||
0x0004002b,0x00000006,0x000000a0,0x3e591687,0x0004002b,0x00000006,0x000000a1,0xbf05e354,
|
||||
0x0004002b,0x00000006,0x000000a2,0x3e9f3b64,0x0006002c,0x00000009,0x000000a3,0x000000a0,
|
||||
0x000000a1,0x000000a2,0x0006002c,0x00000097,0x000000a4,0x0000009b,0x0000009f,0x000000a3,
|
||||
0x0004002b,0x00000006,0x000000a5,0x3f74bc6a,0x0004002b,0x00000006,0x000000a6,0x3f1ef9db,
|
||||
0x0006002c,0x00000009,0x000000a7,0x0000004b,0x000000a5,0x000000a6,0x0004002b,0x00000006,
|
||||
0x000000a8,0xbe8b4396,0x0004002b,0x00000006,0x000000a9,0xbf25a1cb,0x0006002c,0x00000009,
|
||||
0x000000aa,0x0000004b,0x000000a8,0x000000a9,0x0004002b,0x00000006,0x000000ab,0xbf8d9168,
|
||||
0x0004002b,0x00000006,0x000000ac,0x3fda3d71,0x0006002c,0x00000009,0x000000ad,0x0000004b,
|
||||
0x000000ab,0x000000ac,0x0006002c,0x00000097,0x000000ae,0x000000a7,0x000000aa,0x000000ad,
|
||||
0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,
|
||||
0x00000008,0x000000ba,0x00000007,0x0004003b,0x00000008,0x000000bd,0x00000007,0x0004003b,
|
||||
0x00000015,0x000000c0,0x00000007,0x0004003b,0x00000008,0x000000c1,0x00000007,0x0004003b,
|
||||
0x00000015,0x000000c4,0x00000007,0x0004003b,0x00000008,0x000000c5,0x00000007,0x0004003b,
|
||||
0x00000015,0x000000c8,0x00000007,0x0004003d,0x00000007,0x000000be,0x000000bc,0x0003003e,
|
||||
0x000000bd,0x000000be,0x00050039,0x00000007,0x000000bf,0x00000013,0x000000bd,0x0003003e,
|
||||
0x000000ba,0x000000bf,0x0004003d,0x00000007,0x000000c2,0x000000ba,0x0003003e,0x000000c1,
|
||||
0x000000c2,0x00050039,0x00000009,0x000000c3,0x0000000c,0x000000c1,0x0003003e,0x000000c0,
|
||||
0x000000c3,0x0004003d,0x00000007,0x000000c6,0x000000ba,0x0003003e,0x000000c5,0x000000c6,
|
||||
0x00050039,0x00000009,0x000000c7,0x0000000f,0x000000c5,0x0003003e,0x000000c4,0x000000c7,
|
||||
0x0004003d,0x00000009,0x000000c9,0x000000c0,0x0004003d,0x00000009,0x000000ca,0x000000c4,
|
||||
0x00060050,0x00000009,0x000000cc,0x000000cb,0x000000cb,0x000000cb,0x0008000c,0x00000009,
|
||||
0x000000cd,0x00000001,0x0000002e,0x000000c9,0x000000ca,0x000000cc,0x0003003e,0x000000c8,
|
||||
0x000000cd,0x0004003d,0x00000009,0x000000d0,0x000000c8,0x00050051,0x00000006,0x000000d1,
|
||||
0x000000d0,0x00000000,0x00050051,0x00000006,0x000000d2,0x000000d0,0x00000001,0x00050051,
|
||||
0x00000006,0x000000d3,0x000000d0,0x00000002,0x00070050,0x0000001d,0x000000d4,0x000000d1,
|
||||
0x000000d2,0x000000d3,0x0000005a,0x0003003e,0x000000cf,0x000000d4,0x000100fd,0x00010038,
|
||||
0x00000008,0x00000075,0x00000007,0x0004003b,0x00000008,0x00000078,0x00000007,0x0004003b,
|
||||
0x0000000e,0x0000007b,0x00000007,0x0004003b,0x0000000e,0x00000080,0x00000007,0x0004003b,
|
||||
0x00000008,0x00000081,0x00000007,0x0004003b,0x0000000e,0x00000084,0x00000007,0x0004003b,
|
||||
0x00000008,0x00000085,0x00000007,0x0004003b,0x0000000e,0x00000087,0x00000007,0x0004003b,
|
||||
0x0000000e,0x0000008a,0x00000007,0x0004003d,0x00000007,0x00000079,0x00000077,0x0003003e,
|
||||
0x00000078,0x00000079,0x00050039,0x00000007,0x0000007a,0x00000016,0x00000078,0x0003003e,
|
||||
0x00000075,0x0000007a,0x0004003d,0x00000019,0x0000007c,0x0000001b,0x0004003d,0x00000007,
|
||||
0x0000007d,0x00000075,0x00050057,0x00000022,0x0000007e,0x0000007c,0x0000007d,0x0008004f,
|
||||
0x00000009,0x0000007f,0x0000007e,0x0000007e,0x00000000,0x00000001,0x00000002,0x0003003e,
|
||||
0x0000007b,0x0000007f,0x0004003d,0x00000007,0x00000082,0x00000075,0x0003003e,0x00000081,
|
||||
0x00000082,0x00050039,0x00000009,0x00000083,0x0000000c,0x00000081,0x0003003e,0x00000080,
|
||||
0x00000083,0x0004003d,0x00000007,0x00000086,0x00000075,0x0003003e,0x00000085,0x00000086,
|
||||
0x0004003d,0x00000009,0x00000088,0x0000007b,0x0003003e,0x00000087,0x00000088,0x00060039,
|
||||
0x00000009,0x00000089,0x00000012,0x00000085,0x00000087,0x0003003e,0x00000084,0x00000089,
|
||||
0x0004003d,0x00000009,0x0000008b,0x00000080,0x0004003d,0x00000009,0x0000008c,0x00000084,
|
||||
0x00060050,0x00000009,0x0000008e,0x0000008d,0x0000008d,0x0000008d,0x0008000c,0x00000009,
|
||||
0x0000008f,0x00000001,0x0000002e,0x0000008b,0x0000008c,0x0000008e,0x0003003e,0x0000008a,
|
||||
0x0000008f,0x0004003d,0x00000009,0x00000092,0x0000008a,0x00050051,0x00000006,0x00000093,
|
||||
0x00000092,0x00000000,0x00050051,0x00000006,0x00000094,0x00000092,0x00000001,0x00050051,
|
||||
0x00000006,0x00000095,0x00000092,0x00000002,0x00070050,0x00000022,0x00000096,0x00000093,
|
||||
0x00000094,0x00000095,0x0000004b,0x0003003e,0x00000091,0x00000096,0x000100fd,0x00010038,
|
||||
0x00050036,0x00000009,0x0000000c,0x00000000,0x0000000a,0x00030037,0x00000008,0x0000000b,
|
||||
0x000200f8,0x0000000d,0x0004003b,0x00000015,0x00000016,0x00000007,0x0004003b,0x00000015,
|
||||
0x00000020,0x00000007,0x0004003b,0x00000031,0x00000032,0x00000007,0x0004003b,0x00000015,
|
||||
0x00000058,0x00000007,0x0004003b,0x00000015,0x00000066,0x00000007,0x0004003d,0x00000018,
|
||||
0x0000001b,0x0000001a,0x0004003d,0x00000007,0x0000001c,0x0000000b,0x00050057,0x0000001d,
|
||||
0x0000001e,0x0000001b,0x0000001c,0x0008004f,0x00000009,0x0000001f,0x0000001e,0x0000001e,
|
||||
0x00000000,0x00000001,0x00000002,0x0003003e,0x00000016,0x0000001f,0x0004003d,0x00000009,
|
||||
0x00000021,0x00000016,0x00050090,0x00000009,0x00000030,0x00000021,0x0000002f,0x0003003e,
|
||||
0x00000020,0x00000030,0x00050041,0x00000031,0x00000036,0x0000000b,0x00000035,0x0004003d,
|
||||
0x00000006,0x00000037,0x00000036,0x00060041,0x0000003d,0x0000003e,0x0000003a,0x0000003c,
|
||||
0x00000035,0x0004003d,0x00000006,0x0000003f,0x0000003e,0x00050085,0x00000006,0x00000040,
|
||||
0x00000037,0x0000003f,0x0005008d,0x00000006,0x00000042,0x00000040,0x00000041,0x00050041,
|
||||
0x0000003d,0x00000044,0x0000003a,0x00000043,0x0004003d,0x00000006,0x00000045,0x00000044,
|
||||
0x00050081,0x00000006,0x00000046,0x00000042,0x00000045,0x00050085,0x00000006,0x00000047,
|
||||
0x00000033,0x00000046,0x0003003e,0x00000032,0x00000047,0x0004003d,0x00000006,0x00000048,
|
||||
0x00000032,0x00050085,0x00000006,0x0000004a,0x00000048,0x00000049,0x0006000c,0x00000006,
|
||||
0x0000004b,0x00000001,0x0000000e,0x0000004a,0x00050041,0x00000031,0x0000004c,0x00000020,
|
||||
0x00000035,0x0004003d,0x00000006,0x0000004d,0x0000004c,0x00050085,0x00000006,0x0000004e,
|
||||
0x0000004d,0x0000004b,0x00050041,0x00000031,0x0000004f,0x00000020,0x00000035,0x0003003e,
|
||||
0x0000004f,0x0000004e,0x0004003d,0x00000006,0x00000050,0x00000032,0x00050085,0x00000006,
|
||||
0x00000051,0x00000050,0x00000049,0x0006000c,0x00000006,0x00000052,0x00000001,0x0000000d,
|
||||
0x00000051,0x00050041,0x00000031,0x00000054,0x00000020,0x00000053,0x0004003d,0x00000006,
|
||||
0x00000055,0x00000054,0x00050085,0x00000006,0x00000056,0x00000055,0x00000052,0x00050041,
|
||||
0x00000031,0x00000057,0x00000020,0x00000053,0x0003003e,0x00000057,0x00000056,0x0004003d,
|
||||
0x00000009,0x00000059,0x00000020,0x00050090,0x00000009,0x00000065,0x00000059,0x00000064,
|
||||
0x0003003e,0x00000058,0x00000065,0x0004003d,0x00000018,0x00000067,0x0000001a,0x0004003d,
|
||||
0x00000007,0x00000068,0x0000000b,0x00050081,0x00000007,0x0000006c,0x00000068,0x0000006b,
|
||||
0x00050057,0x0000001d,0x0000006d,0x00000067,0x0000006c,0x00050051,0x00000006,0x0000006f,
|
||||
0x0000006d,0x00000000,0x00050041,0x00000031,0x00000070,0x00000066,0x0000006e,0x0003003e,
|
||||
0x00000070,0x0000006f,0x0004003d,0x00000018,0x00000071,0x0000001a,0x0004003d,0x00000007,
|
||||
0x00000072,0x0000000b,0x00050081,0x00000007,0x00000075,0x00000072,0x00000074,0x00050057,
|
||||
0x0000001d,0x00000076,0x00000071,0x00000075,0x00050051,0x00000006,0x00000077,0x00000076,
|
||||
0x00000001,0x00050041,0x00000031,0x00000078,0x00000066,0x00000035,0x0003003e,0x00000078,
|
||||
0x00000077,0x0004003d,0x00000018,0x00000079,0x0000001a,0x0004003d,0x00000007,0x0000007a,
|
||||
0x0000000b,0x00050083,0x00000007,0x0000007b,0x0000007a,0x0000006b,0x00050057,0x0000001d,
|
||||
0x0000007c,0x00000079,0x0000007b,0x00050051,0x00000006,0x0000007d,0x0000007c,0x00000002,
|
||||
0x00050041,0x00000031,0x0000007e,0x00000066,0x00000053,0x0003003e,0x0000007e,0x0000007d,
|
||||
0x0004003d,0x00000009,0x0000007f,0x00000066,0x000200fe,0x0000007f,0x00010038,0x00050036,
|
||||
0x00000009,0x0000000f,0x00000000,0x0000000a,0x00030037,0x00000008,0x0000000e,0x000200f8,
|
||||
0x00000010,0x0004003b,0x00000015,0x00000082,0x00000007,0x0004003b,0x00000031,0x00000087,
|
||||
0x00000007,0x0004003d,0x00000018,0x00000083,0x0000001a,0x0004003d,0x00000007,0x00000084,
|
||||
0x0000000e,0x00050057,0x0000001d,0x00000085,0x00000083,0x00000084,0x0008004f,0x00000009,
|
||||
0x00000086,0x00000085,0x00000085,0x00000000,0x00000001,0x00000002,0x0003003e,0x00000082,
|
||||
0x00000086,0x00050041,0x00000031,0x00000088,0x0000000e,0x00000035,0x0004003d,0x00000006,
|
||||
0x00000089,0x00000088,0x00060041,0x0000003d,0x0000008a,0x0000003a,0x0000003c,0x00000035,
|
||||
0x0004003d,0x00000006,0x0000008b,0x0000008a,0x00050085,0x00000006,0x0000008c,0x00000089,
|
||||
0x0000008b,0x00050085,0x00000006,0x0000008d,0x0000008c,0x00000041,0x0006000c,0x00000006,
|
||||
0x0000008e,0x00000001,0x0000000d,0x0000008d,0x0006000c,0x00000006,0x0000008f,0x00000001,
|
||||
0x00000004,0x0000008e,0x00050085,0x00000006,0x00000091,0x0000008f,0x00000090,0x0003003e,
|
||||
0x00000087,0x00000091,0x0004003d,0x00000006,0x00000092,0x00000087,0x00050085,0x00000006,
|
||||
0x00000093,0x00000092,0x00000049,0x00050083,0x00000006,0x00000094,0x0000005a,0x00000093,
|
||||
0x0004003d,0x00000009,0x00000095,0x00000082,0x0005008e,0x00000009,0x00000096,0x00000095,
|
||||
0x00000094,0x0003003e,0x00000082,0x00000096,0x0004003d,0x00000009,0x00000097,0x00000082,
|
||||
0x000200fe,0x00000097,0x00010038,0x00050036,0x00000007,0x00000013,0x00000000,0x00000011,
|
||||
0x00030037,0x00000008,0x00000012,0x000200f8,0x00000014,0x0004003b,0x00000031,0x0000009e,
|
||||
0x00000007,0x0004003d,0x00000007,0x0000009a,0x00000012,0x0005008e,0x00000007,0x0000009b,
|
||||
0x0000009a,0x00000041,0x00050050,0x00000007,0x0000009c,0x0000005a,0x0000005a,0x00050083,
|
||||
0x00000007,0x0000009d,0x0000009b,0x0000009c,0x0003003e,0x00000012,0x0000009d,0x00050041,
|
||||
0x00000031,0x0000009f,0x00000012,0x0000006e,0x0004003d,0x00000006,0x000000a0,0x0000009f,
|
||||
0x00050041,0x00000031,0x000000a1,0x00000012,0x0000006e,0x0004003d,0x00000006,0x000000a2,
|
||||
0x000000a1,0x00050085,0x00000006,0x000000a3,0x000000a0,0x000000a2,0x00050041,0x00000031,
|
||||
0x000000a4,0x00000012,0x00000035,0x0004003d,0x00000006,0x000000a5,0x000000a4,0x00050041,
|
||||
0x00000031,0x000000a6,0x00000012,0x00000035,0x0004003d,0x00000006,0x000000a7,0x000000a6,
|
||||
0x00050085,0x00000006,0x000000a8,0x000000a5,0x000000a7,0x00050081,0x00000006,0x000000a9,
|
||||
0x000000a3,0x000000a8,0x0006000c,0x00000006,0x000000aa,0x00000001,0x0000001f,0x000000a9,
|
||||
0x0003003e,0x0000009e,0x000000aa,0x0004003d,0x00000007,0x000000ab,0x00000012,0x0004003d,
|
||||
0x00000006,0x000000ac,0x0000009e,0x0004003d,0x00000006,0x000000ad,0x0000009e,0x00050085,
|
||||
0x00000006,0x000000ae,0x000000ac,0x000000ad,0x0005008e,0x00000007,0x000000af,0x000000ab,
|
||||
0x000000ae,0x0005008e,0x00000007,0x000000b1,0x000000af,0x000000b0,0x0004003d,0x00000007,
|
||||
0x000000b2,0x00000012,0x00050081,0x00000007,0x000000b3,0x000000b2,0x000000b1,0x0003003e,
|
||||
0x00000012,0x000000b3,0x0004003d,0x00000007,0x000000b4,0x00000012,0x0005008e,0x00000007,
|
||||
0x000000b5,0x000000b4,0x00000049,0x00050050,0x00000007,0x000000b6,0x00000049,0x00000049,
|
||||
0x00050081,0x00000007,0x000000b7,0x000000b5,0x000000b6,0x000200fe,0x000000b7,0x00010038
|
||||
0x000200f8,0x0000000d,0x0004003d,0x00000019,0x0000001c,0x0000001b,0x0004003d,0x00000007,
|
||||
0x0000001d,0x0000000b,0x00050081,0x00000007,0x00000021,0x0000001d,0x00000020,0x00050057,
|
||||
0x00000022,0x00000023,0x0000001c,0x00000021,0x00050051,0x00000006,0x00000026,0x00000023,
|
||||
0x00000000,0x0004003d,0x00000019,0x00000027,0x0000001b,0x0004003d,0x00000007,0x00000028,
|
||||
0x0000000b,0x00050081,0x00000007,0x0000002b,0x00000028,0x0000002a,0x00050057,0x00000022,
|
||||
0x0000002c,0x00000027,0x0000002b,0x00050051,0x00000006,0x0000002e,0x0000002c,0x00000001,
|
||||
0x0004003d,0x00000019,0x0000002f,0x0000001b,0x0004003d,0x00000007,0x00000030,0x0000000b,
|
||||
0x00050083,0x00000007,0x00000031,0x00000030,0x00000020,0x00050057,0x00000022,0x00000032,
|
||||
0x0000002f,0x00000031,0x00050051,0x00000006,0x00000034,0x00000032,0x00000002,0x00060050,
|
||||
0x00000009,0x00000035,0x00000026,0x0000002e,0x00000034,0x000200fe,0x00000035,0x00010038,
|
||||
0x00050036,0x00000009,0x00000012,0x00000000,0x0000000f,0x00030037,0x00000008,0x00000010,
|
||||
0x00030037,0x0000000e,0x00000011,0x000200f8,0x00000013,0x0004003b,0x00000038,0x00000039,
|
||||
0x00000007,0x00050041,0x00000038,0x0000003a,0x00000010,0x0000002d,0x0004003d,0x00000006,
|
||||
0x0000003b,0x0000003a,0x00060041,0x00000041,0x00000042,0x0000003e,0x00000040,0x0000002d,
|
||||
0x0004003d,0x00000006,0x00000043,0x00000042,0x00050085,0x00000006,0x00000044,0x0000003b,
|
||||
0x00000043,0x00050085,0x00000006,0x00000046,0x00000044,0x00000045,0x0006000c,0x00000006,
|
||||
0x00000047,0x00000001,0x0000000d,0x00000046,0x0006000c,0x00000006,0x00000048,0x00000001,
|
||||
0x00000004,0x00000047,0x00050085,0x00000006,0x0000004a,0x00000048,0x00000049,0x0003003e,
|
||||
0x00000039,0x0000004a,0x0004003d,0x00000006,0x0000004c,0x00000039,0x00050085,0x00000006,
|
||||
0x0000004e,0x0000004c,0x0000004d,0x00050083,0x00000006,0x0000004f,0x0000004b,0x0000004e,
|
||||
0x0004003d,0x00000009,0x00000050,0x00000011,0x0005008e,0x00000009,0x00000051,0x00000050,
|
||||
0x0000004f,0x0003003e,0x00000011,0x00000051,0x0004003d,0x00000009,0x00000052,0x00000011,
|
||||
0x000200fe,0x00000052,0x00010038,0x00050036,0x00000007,0x00000016,0x00000000,0x00000014,
|
||||
0x00030037,0x00000008,0x00000015,0x000200f8,0x00000017,0x0004003b,0x00000038,0x00000059,
|
||||
0x00000007,0x0004003d,0x00000007,0x00000055,0x00000015,0x0005008e,0x00000007,0x00000056,
|
||||
0x00000055,0x00000045,0x00050050,0x00000007,0x00000057,0x0000004b,0x0000004b,0x00050083,
|
||||
0x00000007,0x00000058,0x00000056,0x00000057,0x0003003e,0x00000015,0x00000058,0x00050041,
|
||||
0x00000038,0x0000005a,0x00000015,0x00000025,0x0004003d,0x00000006,0x0000005b,0x0000005a,
|
||||
0x00050041,0x00000038,0x0000005c,0x00000015,0x00000025,0x0004003d,0x00000006,0x0000005d,
|
||||
0x0000005c,0x00050085,0x00000006,0x0000005e,0x0000005b,0x0000005d,0x00050041,0x00000038,
|
||||
0x0000005f,0x00000015,0x0000002d,0x0004003d,0x00000006,0x00000060,0x0000005f,0x00050041,
|
||||
0x00000038,0x00000061,0x00000015,0x0000002d,0x0004003d,0x00000006,0x00000062,0x00000061,
|
||||
0x00050085,0x00000006,0x00000063,0x00000060,0x00000062,0x00050081,0x00000006,0x00000064,
|
||||
0x0000005e,0x00000063,0x0006000c,0x00000006,0x00000065,0x00000001,0x0000001f,0x00000064,
|
||||
0x0003003e,0x00000059,0x00000065,0x0004003d,0x00000007,0x00000066,0x00000015,0x0004003d,
|
||||
0x00000006,0x00000067,0x00000059,0x0004003d,0x00000006,0x00000068,0x00000059,0x00050085,
|
||||
0x00000006,0x00000069,0x00000067,0x00000068,0x0005008e,0x00000007,0x0000006a,0x00000066,
|
||||
0x00000069,0x0005008e,0x00000007,0x0000006c,0x0000006a,0x0000006b,0x0004003d,0x00000007,
|
||||
0x0000006d,0x00000015,0x00050081,0x00000007,0x0000006e,0x0000006d,0x0000006c,0x0003003e,
|
||||
0x00000015,0x0000006e,0x0004003d,0x00000007,0x0000006f,0x00000015,0x0005008e,0x00000007,
|
||||
0x00000070,0x0000006f,0x0000004d,0x00050050,0x00000007,0x00000071,0x0000004d,0x0000004d,
|
||||
0x00050081,0x00000007,0x00000072,0x00000070,0x00000071,0x000200fe,0x00000072,0x00010038
|
||||
};
|
||||
@@ -0,0 +1,108 @@
|
||||
#version 450
|
||||
|
||||
// =============================================================================
|
||||
// Snapdragon Game Super Resolution (SGSR) 1.0 - spatial upscaler, mobile path.
|
||||
//
|
||||
// Ported from Qualcomm's reference shader:
|
||||
// SnapdragonStudios/snapdragon-gsr sgsr/v1/include/glsl/sgsr1_shader_mobile.frag
|
||||
//
|
||||
// Copyright (c) 2025, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
//
|
||||
// Adapted for the Winlator native Vulkan compositor:
|
||||
// - #version 450 (Vulkan GLSL)
|
||||
// - ViewportInfo passed via push constant instead of a uniform block
|
||||
// - specialised to OperationMode == 1 (RGBA); green channel is the edge luma
|
||||
// - reuses window.vert (full-screen quad; fragTexCoord in [0,1] over the
|
||||
// destination rect = normalised output position = normalised source position)
|
||||
// =============================================================================
|
||||
|
||||
layout(binding = 0) uniform sampler2D ps0;
|
||||
|
||||
layout(push_constant) uniform PC {
|
||||
vec4 ndc; // quad NDC rect, consumed by window.vert (offset 0)
|
||||
vec4 ViewportInfo; // xy = 1/inputSize (texel size), zw = inputSize in pixels
|
||||
float EdgeSharpness; // driven by the "Sharpness" slider (default 2.0)
|
||||
} pc;
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 out_Target0;
|
||||
|
||||
const float EdgeThreshold = 8.0 / 255.0;
|
||||
|
||||
float fastLanczos2(float x) {
|
||||
float wA = x - 4.0;
|
||||
float wB = x * wA - wA;
|
||||
wA *= wA;
|
||||
return wB * wA;
|
||||
}
|
||||
|
||||
vec2 weightY(float dx, float dy, float c, float std) {
|
||||
float x = ((dx * dx) + (dy * dy)) * 0.55 + clamp(abs(c) * std, 0.0, 1.0);
|
||||
float w = fastLanczos2(x);
|
||||
return vec2(w, w * c);
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec4 ViewportInfo = pc.ViewportInfo;
|
||||
vec2 uv = fragTexCoord;
|
||||
|
||||
vec4 color;
|
||||
color.xyz = textureLod(ps0, uv, 0.0).xyz;
|
||||
|
||||
vec2 imgCoord = ((uv * ViewportInfo.zw) + vec2(-0.5, 0.5));
|
||||
vec2 imgCoordPixel = floor(imgCoord);
|
||||
vec2 coord = (imgCoordPixel * ViewportInfo.xy);
|
||||
vec2 pl = (imgCoord + (-imgCoordPixel));
|
||||
vec4 left = textureGather(ps0, coord, 1);
|
||||
|
||||
float edgeVote = abs(left.z - left.y) + abs(color.y - left.y) + abs(color.y - left.z);
|
||||
if (edgeVote > EdgeThreshold) {
|
||||
coord.x += ViewportInfo.x;
|
||||
|
||||
vec4 right = textureGather(ps0, coord + vec2(ViewportInfo.x, 0.0), 1);
|
||||
vec4 upDown;
|
||||
upDown.xy = textureGather(ps0, coord + vec2(0.0, -ViewportInfo.y), 1).wz;
|
||||
upDown.zw = textureGather(ps0, coord + vec2(0.0, ViewportInfo.y), 1).yx;
|
||||
|
||||
float mean = (left.y + left.z + right.x + right.w) * 0.25;
|
||||
left = left - vec4(mean);
|
||||
right = right - vec4(mean);
|
||||
upDown = upDown - vec4(mean);
|
||||
color.w = color.y - mean;
|
||||
|
||||
float sum = (((((abs(left.x) + abs(left.y)) + abs(left.z)) + abs(left.w))
|
||||
+ (((abs(right.x) + abs(right.y)) + abs(right.z)) + abs(right.w)))
|
||||
+ (((abs(upDown.x) + abs(upDown.y)) + abs(upDown.z)) + abs(upDown.w)));
|
||||
float std = 2.181818 / sum;
|
||||
|
||||
vec2 aWY = weightY(pl.x, pl.y + 1.0, upDown.x, std);
|
||||
aWY += weightY(pl.x - 1.0, pl.y + 1.0, upDown.y, std);
|
||||
aWY += weightY(pl.x - 1.0, pl.y - 2.0, upDown.z, std);
|
||||
aWY += weightY(pl.x, pl.y - 2.0, upDown.w, std);
|
||||
aWY += weightY(pl.x + 1.0, pl.y - 1.0, left.x, std);
|
||||
aWY += weightY(pl.x, pl.y - 1.0, left.y, std);
|
||||
aWY += weightY(pl.x, pl.y, left.z, std);
|
||||
aWY += weightY(pl.x + 1.0, pl.y, left.w, std);
|
||||
aWY += weightY(pl.x - 1.0, pl.y - 1.0, right.x, std);
|
||||
aWY += weightY(pl.x - 2.0, pl.y - 1.0, right.y, std);
|
||||
aWY += weightY(pl.x - 2.0, pl.y, right.z, std);
|
||||
aWY += weightY(pl.x - 1.0, pl.y, right.w, std);
|
||||
|
||||
float finalY = aWY.y / aWY.x;
|
||||
|
||||
float maxY = max(max(left.y, left.z), max(right.x, right.w));
|
||||
float minY = min(min(left.y, left.z), min(right.x, right.w));
|
||||
finalY = clamp(pc.EdgeSharpness * finalY, minY, maxY);
|
||||
|
||||
float deltaY = finalY - color.w;
|
||||
deltaY = clamp(deltaY, -23.0 / 255.0, 23.0 / 255.0);
|
||||
|
||||
color.x = clamp((color.x + deltaY), 0.0, 1.0);
|
||||
color.y = clamp((color.y + deltaY), 0.0, 1.0);
|
||||
color.z = clamp((color.z + deltaY), 0.0, 1.0);
|
||||
}
|
||||
|
||||
color.w = 1.0; // alpha channel unused by the compositor blit
|
||||
out_Target0 = color;
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
#version 450
|
||||
|
||||
// =============================================================================
|
||||
// Snapdragon Game Super Resolution (SGSR) 1 - "Quality" variant (edge direction).
|
||||
//
|
||||
// Ported from Qualcomm's reference shader:
|
||||
// SnapdragonGameStudios/snapdragon-gsr
|
||||
// sgsr/v1/include/glsl/sgsr1_shader_mobile_edge_direction.frag
|
||||
//
|
||||
// Copyright (c) 2025, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
//
|
||||
// Same single pass, inputs and push constants as sgsr.frag (the mode-3 "SGSR"
|
||||
// shader, left untouched). Differences, both taken from the reference file:
|
||||
// - UseEdgeDirection: the Lanczos weights are stretched along the local edge
|
||||
// direction, so diagonal edges reconstruct cleaner ("minimal cost increase"
|
||||
// per Qualcomm).
|
||||
// - the reference's retuned contrast term: std = (10.14185 / sum)^2
|
||||
// (sgsr.frag keeps the older 2.181818 / sum).
|
||||
// Adapted for the Winlator native Vulkan compositor exactly like sgsr.frag:
|
||||
// - #version 450 (Vulkan GLSL), ViewportInfo via push constant
|
||||
// - specialised to OperationMode == 1 (RGBA); green channel is the edge luma
|
||||
// - reuses window.vert (full-screen quad over the destination rect)
|
||||
// =============================================================================
|
||||
|
||||
layout(binding = 0) uniform sampler2D ps0;
|
||||
|
||||
layout(push_constant) uniform PC {
|
||||
vec4 ndc; // quad NDC rect, consumed by window.vert (offset 0)
|
||||
vec4 ViewportInfo; // xy = 1/inputSize (texel size), zw = inputSize in pixels
|
||||
float EdgeSharpness; // driven by the "Sharpness" slider
|
||||
} pc;
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 out_Target0;
|
||||
|
||||
const float EdgeThreshold = 8.0 / 255.0;
|
||||
|
||||
float fastLanczos2(float x) {
|
||||
float wA = x - 4.0;
|
||||
float wB = x * wA - wA;
|
||||
wA *= wA;
|
||||
return wB * wA;
|
||||
}
|
||||
|
||||
// data.x = std, data.yz = normalised edge direction
|
||||
vec2 weightY(float dx, float dy, float c, vec3 data) {
|
||||
float std = data.x;
|
||||
vec2 dir = data.yz;
|
||||
float edgeDis = (dx * dir.y) + (dy * dir.x);
|
||||
float x = ((dx * dx) + (dy * dy))
|
||||
+ ((edgeDis * edgeDis) * ((clamp((c * c) * std, 0.0, 1.0) * 0.7) - 1.0));
|
||||
float w = fastLanczos2(x);
|
||||
return vec2(w, w * c);
|
||||
}
|
||||
|
||||
vec2 edgeDirection(vec4 left, vec4 right) {
|
||||
float RxLz = right.x - left.z;
|
||||
float RwLy = right.w - left.y;
|
||||
vec2 delta;
|
||||
delta.x = RxLz + RwLy;
|
||||
delta.y = RxLz - RwLy;
|
||||
float lengthInv = inversesqrt((delta.x * delta.x + 3.075740e-05) + (delta.y * delta.y));
|
||||
return delta * lengthInv;
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec4 ViewportInfo = pc.ViewportInfo;
|
||||
vec2 uv = fragTexCoord;
|
||||
|
||||
vec4 color;
|
||||
color.xyz = textureLod(ps0, uv, 0.0).xyz;
|
||||
|
||||
vec2 imgCoord = ((uv * ViewportInfo.zw) + vec2(-0.5, 0.5));
|
||||
vec2 imgCoordPixel = floor(imgCoord);
|
||||
vec2 coord = (imgCoordPixel * ViewportInfo.xy);
|
||||
vec2 pl = (imgCoord + (-imgCoordPixel));
|
||||
vec4 left = textureGather(ps0, coord, 1);
|
||||
|
||||
float edgeVote = abs(left.z - left.y) + abs(color.y - left.y) + abs(color.y - left.z);
|
||||
if (edgeVote > EdgeThreshold) {
|
||||
coord.x += ViewportInfo.x;
|
||||
|
||||
vec4 right = textureGather(ps0, coord + vec2(ViewportInfo.x, 0.0), 1);
|
||||
vec4 upDown;
|
||||
upDown.xy = textureGather(ps0, coord + vec2(0.0, -ViewportInfo.y), 1).wz;
|
||||
upDown.zw = textureGather(ps0, coord + vec2(0.0, ViewportInfo.y), 1).yx;
|
||||
|
||||
float mean = (left.y + left.z + right.x + right.w) * 0.25;
|
||||
left = left - vec4(mean);
|
||||
right = right - vec4(mean);
|
||||
upDown = upDown - vec4(mean);
|
||||
color.w = color.y - mean;
|
||||
|
||||
float sum = (((((abs(left.x) + abs(left.y)) + abs(left.z)) + abs(left.w))
|
||||
+ (((abs(right.x) + abs(right.y)) + abs(right.z)) + abs(right.w)))
|
||||
+ (((abs(upDown.x) + abs(upDown.y)) + abs(upDown.z)) + abs(upDown.w)));
|
||||
float sumMean = 1.014185e+01 / sum;
|
||||
float std = sumMean * sumMean;
|
||||
|
||||
vec3 data = vec3(std, edgeDirection(left, right));
|
||||
|
||||
vec2 aWY = weightY(pl.x, pl.y + 1.0, upDown.x, data);
|
||||
aWY += weightY(pl.x - 1.0, pl.y + 1.0, upDown.y, data);
|
||||
aWY += weightY(pl.x - 1.0, pl.y - 2.0, upDown.z, data);
|
||||
aWY += weightY(pl.x, pl.y - 2.0, upDown.w, data);
|
||||
aWY += weightY(pl.x + 1.0, pl.y - 1.0, left.x, data);
|
||||
aWY += weightY(pl.x, pl.y - 1.0, left.y, data);
|
||||
aWY += weightY(pl.x, pl.y, left.z, data);
|
||||
aWY += weightY(pl.x + 1.0, pl.y, left.w, data);
|
||||
aWY += weightY(pl.x - 1.0, pl.y - 1.0, right.x, data);
|
||||
aWY += weightY(pl.x - 2.0, pl.y - 1.0, right.y, data);
|
||||
aWY += weightY(pl.x - 2.0, pl.y, right.z, data);
|
||||
aWY += weightY(pl.x - 1.0, pl.y, right.w, data);
|
||||
|
||||
float finalY = aWY.y / aWY.x;
|
||||
|
||||
float maxY = max(max(left.y, left.z), max(right.x, right.w));
|
||||
float minY = min(min(left.y, left.z), min(right.x, right.w));
|
||||
finalY = clamp(pc.EdgeSharpness * finalY, minY, maxY);
|
||||
|
||||
float deltaY = finalY - color.w;
|
||||
deltaY = clamp(deltaY, -23.0 / 255.0, 23.0 / 255.0);
|
||||
|
||||
color.x = clamp((color.x + deltaY), 0.0, 1.0);
|
||||
color.y = clamp((color.y + deltaY), 0.0, 1.0);
|
||||
color.z = clamp((color.z + deltaY), 0.0, 1.0);
|
||||
}
|
||||
|
||||
color.w = 1.0; // alpha channel unused by the compositor blit
|
||||
out_Target0 = color;
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
#version 450
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
layout(set = 0, binding = 0) uniform sampler2D InputTexture;
|
||||
layout(push_constant) uniform Constants {
|
||||
vec4 ndc;
|
||||
vec2 resolution;
|
||||
float extra;
|
||||
float pad;
|
||||
} pc;
|
||||
|
||||
float luma(vec3 c) {
|
||||
return dot(c, vec3(0.2126, 0.7152, 0.0722));
|
||||
}
|
||||
|
||||
float edgeVertical(vec2 uv, vec2 px) {
|
||||
float a = luma(texture(InputTexture, uv - vec2(px.x, 0.0)).rgb);
|
||||
float b = luma(texture(InputTexture, uv + vec2(px.x, 0.0)).rgb);
|
||||
return abs(a - b);
|
||||
}
|
||||
|
||||
float edgeHorizontal(vec2 uv, vec2 px) {
|
||||
float a = luma(texture(InputTexture, uv - vec2(0.0, px.y)).rgb);
|
||||
float b = luma(texture(InputTexture, uv + vec2(0.0, px.y)).rgb);
|
||||
return abs(a - b);
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec2 px = 1.0 / max(pc.resolution, vec2(1.0));
|
||||
vec2 uv = clamp(fragTexCoord, px * 0.5, vec2(1.0) - px * 0.5);
|
||||
vec4 center = texture(InputTexture, uv);
|
||||
|
||||
float lc = luma(center.rgb);
|
||||
float ll = luma(texture(InputTexture, uv - vec2(px.x, 0.0)).rgb);
|
||||
float lr = luma(texture(InputTexture, uv + vec2(px.x, 0.0)).rgb);
|
||||
float lu = luma(texture(InputTexture, uv - vec2(0.0, px.y)).rgb);
|
||||
float ld = luma(texture(InputTexture, uv + vec2(0.0, px.y)).rgb);
|
||||
|
||||
float dL = abs(lc - ll);
|
||||
float dR = abs(lc - lr);
|
||||
float dU = abs(lc - lu);
|
||||
float dD = abs(lc - ld);
|
||||
float localMin = min(lc, min(min(ll, lr), min(lu, ld)));
|
||||
float localMax = max(lc, max(max(ll, lr), max(lu, ld)));
|
||||
float localContrast = localMax - localMin;
|
||||
float threshold = max(0.045, localContrast * 0.08);
|
||||
|
||||
float vertical = max(dL, dR);
|
||||
float horizontal = max(dU, dD);
|
||||
float strongest = max(vertical, horizontal);
|
||||
if (strongest <= threshold) {
|
||||
outColor = center;
|
||||
return;
|
||||
}
|
||||
|
||||
bool verticalEdge = vertical >= horizontal;
|
||||
vec2 tangent = verticalEdge ? vec2(0.0, px.y) : vec2(px.x, 0.0);
|
||||
vec2 normal = verticalEdge
|
||||
? vec2(dL >= dR ? -1.0 : 1.0, 0.0)
|
||||
: vec2(0.0, dU >= dD ? -1.0 : 1.0);
|
||||
|
||||
float negativeRun = 0.0;
|
||||
float positiveRun = 0.0;
|
||||
for (int i = 1; i <= 6; ++i) {
|
||||
vec2 offset = tangent * float(i);
|
||||
float edgeN = verticalEdge ? edgeVertical(uv - offset, px) : edgeHorizontal(uv - offset, px);
|
||||
float edgeP = verticalEdge ? edgeVertical(uv + offset, px) : edgeHorizontal(uv + offset, px);
|
||||
if (negativeRun == float(i - 1) && edgeN > threshold * 0.65) negativeRun = float(i);
|
||||
if (positiveRun == float(i - 1) && edgeP > threshold * 0.65) positiveRun = float(i);
|
||||
}
|
||||
|
||||
float span = negativeRun + positiveRun;
|
||||
float edgeConfidence = smoothstep(threshold, threshold * 2.5, strongest);
|
||||
|
||||
float nw = luma(texture(InputTexture, uv + vec2(-px.x, -px.y)).rgb);
|
||||
float ne = luma(texture(InputTexture, uv + vec2(px.x, -px.y)).rgb);
|
||||
float sw = luma(texture(InputTexture, uv + vec2(-px.x, px.y)).rgb);
|
||||
float se = luma(texture(InputTexture, uv + vec2(px.x, px.y)).rgb);
|
||||
float endpointPattern = clamp(abs(negativeRun - positiveRun) / max(span, 1.0), 0.0, 1.0);
|
||||
float endpointArea = endpointPattern / (1.0 + span * 0.055);
|
||||
float crossingA = verticalEdge ? abs(nw - ne) : abs(nw - sw);
|
||||
float crossingB = verticalEdge ? abs(sw - se) : abs(ne - se);
|
||||
float crossingContrast = abs(crossingA - crossingB);
|
||||
float crossingPattern = smoothstep(threshold, threshold * 2.5, crossingContrast);
|
||||
float areaWeight = 0.38 * crossingPattern * clamp(span / 4.0, 0.0, 1.0);
|
||||
float diagonalContrast = max(abs(nw - se), abs(ne - sw));
|
||||
float cornerFactor = 1.0 - 0.35 * smoothstep(threshold, threshold * 3.0, diagonalContrast);
|
||||
float baseWeight = areaWeight * endpointArea * edgeConfidence * cornerFactor;
|
||||
|
||||
float diagonalStrength = min(vertical, horizontal);
|
||||
float diagonalPattern = smoothstep(threshold, threshold * 2.5, diagonalStrength);
|
||||
float diagonalContinuity = smoothstep(1.0, 3.0, span);
|
||||
float diagonalFallback = 0.16 * diagonalPattern * edgeConfidence
|
||||
* cornerFactor * diagonalContinuity * crossingPattern;
|
||||
|
||||
float weight = clamp(max(baseWeight, diagonalFallback), 0.0, 0.42);
|
||||
vec3 across = texture(InputTexture, uv + normal * px).rgb;
|
||||
outColor = vec4(mix(center.rgb, across, weight), center.a);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#version 450
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
layout(set = 0, binding = 0) uniform sampler2D InputTexture;
|
||||
layout(set = 1, binding = 0) uniform sampler2D WeightTexture;
|
||||
layout(push_constant) uniform Constants {
|
||||
vec4 ndc;
|
||||
vec2 resolution;
|
||||
float extra;
|
||||
float pad;
|
||||
} pc;
|
||||
|
||||
void main() {
|
||||
vec2 px = 1.0 / max(pc.resolution, vec2(1.0));
|
||||
vec2 uv = clamp(fragTexCoord, px * 0.5, vec2(1.0) - px * 0.5);
|
||||
vec4 center = texture(InputTexture, uv);
|
||||
vec4 weights = texture(WeightTexture, uv);
|
||||
float weight = clamp(weights.r, 0.0, 0.42);
|
||||
|
||||
if (weight <= 0.001) {
|
||||
outColor = center;
|
||||
return;
|
||||
}
|
||||
|
||||
vec2 normal = weights.gb * 2.0 - 1.0;
|
||||
vec2 acrossUv = clamp(uv + normal * px, px * 0.5, vec2(1.0) - px * 0.5);
|
||||
vec3 across = texture(InputTexture, acrossUv).rgb;
|
||||
outColor = vec4(mix(center.rgb, across, weight), center.a);
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
// 1116.3.0
|
||||
#pragma once
|
||||
const uint32_t smaa_blend_code[] = {
|
||||
0x07230203,0x00010000,0x0008000b,0x0000006b,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000001a,0x00000041,0x00030010,
|
||||
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d,
|
||||
0x00000000,0x00030005,0x00000009,0x00007870,0x00050005,0x0000000c,0x736e6f43,0x746e6174,
|
||||
0x00000073,0x00040006,0x0000000c,0x00000000,0x0063646e,0x00060006,0x0000000c,0x00000001,
|
||||
0x6f736572,0x6974756c,0x00006e6f,0x00050006,0x0000000c,0x00000002,0x72747865,0x00000061,
|
||||
0x00040006,0x0000000c,0x00000003,0x00646170,0x00030005,0x0000000e,0x00006370,0x00030005,
|
||||
0x00000018,0x00007675,0x00060005,0x0000001a,0x67617266,0x43786554,0x64726f6f,0x00000000,
|
||||
0x00040005,0x00000024,0x746e6563,0x00007265,0x00060005,0x00000028,0x75706e49,0x78655474,
|
||||
0x65727574,0x00000000,0x00040005,0x0000002c,0x67696577,0x00737468,0x00060005,0x0000002d,
|
||||
0x67696557,0x65547468,0x72757478,0x00000065,0x00040005,0x00000032,0x67696577,0x00007468,
|
||||
0x00050005,0x00000041,0x4374756f,0x726f6c6f,0x00000000,0x00040005,0x00000044,0x6d726f6e,
|
||||
0x00006c61,0x00050005,0x0000004b,0x6f726361,0x76557373,0x00000000,0x00040005,0x00000059,
|
||||
0x6f726361,0x00007373,0x00030047,0x0000000c,0x00000002,0x00050048,0x0000000c,0x00000000,
|
||||
0x00000023,0x00000000,0x00050048,0x0000000c,0x00000001,0x00000023,0x00000010,0x00050048,
|
||||
0x0000000c,0x00000002,0x00000023,0x00000018,0x00050048,0x0000000c,0x00000003,0x00000023,
|
||||
0x0000001c,0x00040047,0x0000001a,0x0000001e,0x00000000,0x00040047,0x00000028,0x00000021,
|
||||
0x00000000,0x00040047,0x00000028,0x00000022,0x00000000,0x00040047,0x0000002d,0x00000021,
|
||||
0x00000000,0x00040047,0x0000002d,0x00000022,0x00000001,0x00040047,0x00000041,0x0000001e,
|
||||
0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,
|
||||
0x00000020,0x00040017,0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,0x00000007,
|
||||
0x00000007,0x0004002b,0x00000006,0x0000000a,0x3f800000,0x00040017,0x0000000b,0x00000006,
|
||||
0x00000004,0x0006001e,0x0000000c,0x0000000b,0x00000007,0x00000006,0x00000006,0x00040020,
|
||||
0x0000000d,0x00000009,0x0000000c,0x0004003b,0x0000000d,0x0000000e,0x00000009,0x00040015,
|
||||
0x0000000f,0x00000020,0x00000001,0x0004002b,0x0000000f,0x00000010,0x00000001,0x00040020,
|
||||
0x00000011,0x00000009,0x00000007,0x0005002c,0x00000007,0x00000014,0x0000000a,0x0000000a,
|
||||
0x00040020,0x00000019,0x00000001,0x00000007,0x0004003b,0x00000019,0x0000001a,0x00000001,
|
||||
0x0004002b,0x00000006,0x0000001d,0x3f000000,0x00040020,0x00000023,0x00000007,0x0000000b,
|
||||
0x00090019,0x00000025,0x00000006,0x00000001,0x00000000,0x00000000,0x00000000,0x00000001,
|
||||
0x00000000,0x0003001b,0x00000026,0x00000025,0x00040020,0x00000027,0x00000000,0x00000026,
|
||||
0x0004003b,0x00000027,0x00000028,0x00000000,0x0004003b,0x00000027,0x0000002d,0x00000000,
|
||||
0x00040020,0x00000031,0x00000007,0x00000006,0x00040015,0x00000033,0x00000020,0x00000000,
|
||||
0x0004002b,0x00000033,0x00000034,0x00000000,0x0004002b,0x00000006,0x00000037,0x00000000,
|
||||
0x0004002b,0x00000006,0x00000038,0x3ed70a3d,0x0004002b,0x00000006,0x0000003b,0x3a83126f,
|
||||
0x00020014,0x0000003c,0x00040020,0x00000040,0x00000003,0x0000000b,0x0004003b,0x00000040,
|
||||
0x00000041,0x00000003,0x0004002b,0x00000006,0x00000047,0x40000000,0x00040017,0x00000057,
|
||||
0x00000006,0x00000003,0x00040020,0x00000058,0x00000007,0x00000057,0x0004002b,0x00000033,
|
||||
0x00000064,0x00000003,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,
|
||||
0x00000005,0x0004003b,0x00000008,0x00000009,0x00000007,0x0004003b,0x00000008,0x00000018,
|
||||
0x00000007,0x0004003b,0x00000023,0x00000024,0x00000007,0x0004003b,0x00000023,0x0000002c,
|
||||
0x00000007,0x0004003b,0x00000031,0x00000032,0x00000007,0x0004003b,0x00000008,0x00000044,
|
||||
0x00000007,0x0004003b,0x00000008,0x0000004b,0x00000007,0x0004003b,0x00000058,0x00000059,
|
||||
0x00000007,0x00050041,0x00000011,0x00000012,0x0000000e,0x00000010,0x0004003d,0x00000007,
|
||||
0x00000013,0x00000012,0x0007000c,0x00000007,0x00000015,0x00000001,0x00000028,0x00000013,
|
||||
0x00000014,0x00050050,0x00000007,0x00000016,0x0000000a,0x0000000a,0x00050088,0x00000007,
|
||||
0x00000017,0x00000016,0x00000015,0x0003003e,0x00000009,0x00000017,0x0004003d,0x00000007,
|
||||
0x0000001b,0x0000001a,0x0004003d,0x00000007,0x0000001c,0x00000009,0x0005008e,0x00000007,
|
||||
0x0000001e,0x0000001c,0x0000001d,0x0004003d,0x00000007,0x0000001f,0x00000009,0x0005008e,
|
||||
0x00000007,0x00000020,0x0000001f,0x0000001d,0x00050083,0x00000007,0x00000021,0x00000014,
|
||||
0x00000020,0x0008000c,0x00000007,0x00000022,0x00000001,0x0000002b,0x0000001b,0x0000001e,
|
||||
0x00000021,0x0003003e,0x00000018,0x00000022,0x0004003d,0x00000026,0x00000029,0x00000028,
|
||||
0x0004003d,0x00000007,0x0000002a,0x00000018,0x00050057,0x0000000b,0x0000002b,0x00000029,
|
||||
0x0000002a,0x0003003e,0x00000024,0x0000002b,0x0004003d,0x00000026,0x0000002e,0x0000002d,
|
||||
0x0004003d,0x00000007,0x0000002f,0x00000018,0x00050057,0x0000000b,0x00000030,0x0000002e,
|
||||
0x0000002f,0x0003003e,0x0000002c,0x00000030,0x00050041,0x00000031,0x00000035,0x0000002c,
|
||||
0x00000034,0x0004003d,0x00000006,0x00000036,0x00000035,0x0008000c,0x00000006,0x00000039,
|
||||
0x00000001,0x0000002b,0x00000036,0x00000037,0x00000038,0x0003003e,0x00000032,0x00000039,
|
||||
0x0004003d,0x00000006,0x0000003a,0x00000032,0x000500bc,0x0000003c,0x0000003d,0x0000003a,
|
||||
0x0000003b,0x000300f7,0x0000003f,0x00000000,0x000400fa,0x0000003d,0x0000003e,0x0000003f,
|
||||
0x000200f8,0x0000003e,0x0004003d,0x0000000b,0x00000042,0x00000024,0x0003003e,0x00000041,
|
||||
0x00000042,0x000100fd,0x000200f8,0x0000003f,0x0004003d,0x0000000b,0x00000045,0x0000002c,
|
||||
0x0007004f,0x00000007,0x00000046,0x00000045,0x00000045,0x00000001,0x00000002,0x0005008e,
|
||||
0x00000007,0x00000048,0x00000046,0x00000047,0x00050050,0x00000007,0x00000049,0x0000000a,
|
||||
0x0000000a,0x00050083,0x00000007,0x0000004a,0x00000048,0x00000049,0x0003003e,0x00000044,
|
||||
0x0000004a,0x0004003d,0x00000007,0x0000004c,0x00000018,0x0004003d,0x00000007,0x0000004d,
|
||||
0x00000044,0x0004003d,0x00000007,0x0000004e,0x00000009,0x00050085,0x00000007,0x0000004f,
|
||||
0x0000004d,0x0000004e,0x00050081,0x00000007,0x00000050,0x0000004c,0x0000004f,0x0004003d,
|
||||
0x00000007,0x00000051,0x00000009,0x0005008e,0x00000007,0x00000052,0x00000051,0x0000001d,
|
||||
0x0004003d,0x00000007,0x00000053,0x00000009,0x0005008e,0x00000007,0x00000054,0x00000053,
|
||||
0x0000001d,0x00050083,0x00000007,0x00000055,0x00000014,0x00000054,0x0008000c,0x00000007,
|
||||
0x00000056,0x00000001,0x0000002b,0x00000050,0x00000052,0x00000055,0x0003003e,0x0000004b,
|
||||
0x00000056,0x0004003d,0x00000026,0x0000005a,0x00000028,0x0004003d,0x00000007,0x0000005b,
|
||||
0x0000004b,0x00050057,0x0000000b,0x0000005c,0x0000005a,0x0000005b,0x0008004f,0x00000057,
|
||||
0x0000005d,0x0000005c,0x0000005c,0x00000000,0x00000001,0x00000002,0x0003003e,0x00000059,
|
||||
0x0000005d,0x0004003d,0x0000000b,0x0000005e,0x00000024,0x0008004f,0x00000057,0x0000005f,
|
||||
0x0000005e,0x0000005e,0x00000000,0x00000001,0x00000002,0x0004003d,0x00000057,0x00000060,
|
||||
0x00000059,0x0004003d,0x00000006,0x00000061,0x00000032,0x00060050,0x00000057,0x00000062,
|
||||
0x00000061,0x00000061,0x00000061,0x0008000c,0x00000057,0x00000063,0x00000001,0x0000002e,
|
||||
0x0000005f,0x00000060,0x00000062,0x00050041,0x00000031,0x00000065,0x00000024,0x00000064,
|
||||
0x0004003d,0x00000006,0x00000066,0x00000065,0x00050051,0x00000006,0x00000067,0x00000063,
|
||||
0x00000000,0x00050051,0x00000006,0x00000068,0x00000063,0x00000001,0x00050051,0x00000006,
|
||||
0x00000069,0x00000063,0x00000002,0x00070050,0x0000000b,0x0000006a,0x00000067,0x00000068,
|
||||
0x00000069,0x00000066,0x0003003e,0x00000041,0x0000006a,0x000100fd,0x00010038
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
#version 450
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
layout(set = 0, binding = 0) uniform sampler2D InputTexture;
|
||||
layout(push_constant) uniform Constants {
|
||||
vec4 ndc;
|
||||
vec2 resolution;
|
||||
float extra;
|
||||
float pad;
|
||||
} pc;
|
||||
|
||||
float luma(vec3 c) {
|
||||
return dot(c, vec3(0.2126, 0.7152, 0.0722));
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec2 px = 1.0 / max(pc.resolution, vec2(1.0));
|
||||
vec2 uv = clamp(fragTexCoord, px * 0.5, vec2(1.0) - px * 0.5);
|
||||
float center = luma(texture(InputTexture, uv).rgb);
|
||||
float left = luma(texture(InputTexture, uv - vec2(px.x, 0.0)).rgb);
|
||||
float right = luma(texture(InputTexture, uv + vec2(px.x, 0.0)).rgb);
|
||||
float up = luma(texture(InputTexture, uv - vec2(0.0, px.y)).rgb);
|
||||
float down = luma(texture(InputTexture, uv + vec2(0.0, px.y)).rgb);
|
||||
|
||||
// Store directional edge strengths for the weight pass.
|
||||
outColor = vec4(abs(center - left), abs(center - right),
|
||||
abs(center - up), abs(center - down));
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
// 1116.3.0
|
||||
#pragma once
|
||||
const uint32_t smaa_edge_code[] = {
|
||||
0x07230203,0x00010000,0x0008000b,0x00000080,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000028,0x0000006e,0x00030010,
|
||||
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d,
|
||||
0x00000000,0x00050005,0x0000000b,0x616d756c,0x33667628,0x0000003b,0x00030005,0x0000000a,
|
||||
0x00000063,0x00030005,0x00000017,0x00007870,0x00050005,0x0000001a,0x736e6f43,0x746e6174,
|
||||
0x00000073,0x00040006,0x0000001a,0x00000000,0x0063646e,0x00060006,0x0000001a,0x00000001,
|
||||
0x6f736572,0x6974756c,0x00006e6f,0x00050006,0x0000001a,0x00000002,0x72747865,0x00000061,
|
||||
0x00040006,0x0000001a,0x00000003,0x00646170,0x00030005,0x0000001c,0x00006370,0x00030005,
|
||||
0x00000026,0x00007675,0x00060005,0x00000028,0x67617266,0x43786554,0x64726f6f,0x00000000,
|
||||
0x00040005,0x00000032,0x746e6563,0x00007265,0x00060005,0x00000036,0x75706e49,0x78655474,
|
||||
0x65727574,0x00000000,0x00040005,0x0000003a,0x61726170,0x0000006d,0x00040005,0x0000003d,
|
||||
0x7466656c,0x00000000,0x00040005,0x00000048,0x61726170,0x0000006d,0x00040005,0x0000004b,
|
||||
0x68676972,0x00000074,0x00040005,0x00000053,0x61726170,0x0000006d,0x00030005,0x00000056,
|
||||
0x00007075,0x00040005,0x0000005f,0x61726170,0x0000006d,0x00040005,0x00000062,0x6e776f64,
|
||||
0x00000000,0x00040005,0x0000006a,0x61726170,0x0000006d,0x00050005,0x0000006e,0x4374756f,
|
||||
0x726f6c6f,0x00000000,0x00030047,0x0000001a,0x00000002,0x00050048,0x0000001a,0x00000000,
|
||||
0x00000023,0x00000000,0x00050048,0x0000001a,0x00000001,0x00000023,0x00000010,0x00050048,
|
||||
0x0000001a,0x00000002,0x00000023,0x00000018,0x00050048,0x0000001a,0x00000003,0x00000023,
|
||||
0x0000001c,0x00040047,0x00000028,0x0000001e,0x00000000,0x00040047,0x00000036,0x00000021,
|
||||
0x00000000,0x00040047,0x00000036,0x00000022,0x00000000,0x00040047,0x0000006e,0x0000001e,
|
||||
0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,
|
||||
0x00000020,0x00040017,0x00000007,0x00000006,0x00000003,0x00040020,0x00000008,0x00000007,
|
||||
0x00000007,0x00040021,0x00000009,0x00000006,0x00000008,0x0004002b,0x00000006,0x0000000e,
|
||||
0x3e59b3d0,0x0004002b,0x00000006,0x0000000f,0x3f371759,0x0004002b,0x00000006,0x00000010,
|
||||
0x3d93dd98,0x0006002c,0x00000007,0x00000011,0x0000000e,0x0000000f,0x00000010,0x00040017,
|
||||
0x00000015,0x00000006,0x00000002,0x00040020,0x00000016,0x00000007,0x00000015,0x0004002b,
|
||||
0x00000006,0x00000018,0x3f800000,0x00040017,0x00000019,0x00000006,0x00000004,0x0006001e,
|
||||
0x0000001a,0x00000019,0x00000015,0x00000006,0x00000006,0x00040020,0x0000001b,0x00000009,
|
||||
0x0000001a,0x0004003b,0x0000001b,0x0000001c,0x00000009,0x00040015,0x0000001d,0x00000020,
|
||||
0x00000001,0x0004002b,0x0000001d,0x0000001e,0x00000001,0x00040020,0x0000001f,0x00000009,
|
||||
0x00000015,0x0005002c,0x00000015,0x00000022,0x00000018,0x00000018,0x00040020,0x00000027,
|
||||
0x00000001,0x00000015,0x0004003b,0x00000027,0x00000028,0x00000001,0x0004002b,0x00000006,
|
||||
0x0000002b,0x3f000000,0x00040020,0x00000031,0x00000007,0x00000006,0x00090019,0x00000033,
|
||||
0x00000006,0x00000001,0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,
|
||||
0x00000034,0x00000033,0x00040020,0x00000035,0x00000000,0x00000034,0x0004003b,0x00000035,
|
||||
0x00000036,0x00000000,0x00040015,0x00000040,0x00000020,0x00000000,0x0004002b,0x00000040,
|
||||
0x00000041,0x00000000,0x0004002b,0x00000006,0x00000044,0x00000000,0x0004002b,0x00000040,
|
||||
0x00000059,0x00000001,0x00040020,0x0000006d,0x00000003,0x00000019,0x0004003b,0x0000006d,
|
||||
0x0000006e,0x00000003,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,
|
||||
0x00000005,0x0004003b,0x00000016,0x00000017,0x00000007,0x0004003b,0x00000016,0x00000026,
|
||||
0x00000007,0x0004003b,0x00000031,0x00000032,0x00000007,0x0004003b,0x00000008,0x0000003a,
|
||||
0x00000007,0x0004003b,0x00000031,0x0000003d,0x00000007,0x0004003b,0x00000008,0x00000048,
|
||||
0x00000007,0x0004003b,0x00000031,0x0000004b,0x00000007,0x0004003b,0x00000008,0x00000053,
|
||||
0x00000007,0x0004003b,0x00000031,0x00000056,0x00000007,0x0004003b,0x00000008,0x0000005f,
|
||||
0x00000007,0x0004003b,0x00000031,0x00000062,0x00000007,0x0004003b,0x00000008,0x0000006a,
|
||||
0x00000007,0x00050041,0x0000001f,0x00000020,0x0000001c,0x0000001e,0x0004003d,0x00000015,
|
||||
0x00000021,0x00000020,0x0007000c,0x00000015,0x00000023,0x00000001,0x00000028,0x00000021,
|
||||
0x00000022,0x00050050,0x00000015,0x00000024,0x00000018,0x00000018,0x00050088,0x00000015,
|
||||
0x00000025,0x00000024,0x00000023,0x0003003e,0x00000017,0x00000025,0x0004003d,0x00000015,
|
||||
0x00000029,0x00000028,0x0004003d,0x00000015,0x0000002a,0x00000017,0x0005008e,0x00000015,
|
||||
0x0000002c,0x0000002a,0x0000002b,0x0004003d,0x00000015,0x0000002d,0x00000017,0x0005008e,
|
||||
0x00000015,0x0000002e,0x0000002d,0x0000002b,0x00050083,0x00000015,0x0000002f,0x00000022,
|
||||
0x0000002e,0x0008000c,0x00000015,0x00000030,0x00000001,0x0000002b,0x00000029,0x0000002c,
|
||||
0x0000002f,0x0003003e,0x00000026,0x00000030,0x0004003d,0x00000034,0x00000037,0x00000036,
|
||||
0x0004003d,0x00000015,0x00000038,0x00000026,0x00050057,0x00000019,0x00000039,0x00000037,
|
||||
0x00000038,0x0008004f,0x00000007,0x0000003b,0x00000039,0x00000039,0x00000000,0x00000001,
|
||||
0x00000002,0x0003003e,0x0000003a,0x0000003b,0x00050039,0x00000006,0x0000003c,0x0000000b,
|
||||
0x0000003a,0x0003003e,0x00000032,0x0000003c,0x0004003d,0x00000034,0x0000003e,0x00000036,
|
||||
0x0004003d,0x00000015,0x0000003f,0x00000026,0x00050041,0x00000031,0x00000042,0x00000017,
|
||||
0x00000041,0x0004003d,0x00000006,0x00000043,0x00000042,0x00050050,0x00000015,0x00000045,
|
||||
0x00000043,0x00000044,0x00050083,0x00000015,0x00000046,0x0000003f,0x00000045,0x00050057,
|
||||
0x00000019,0x00000047,0x0000003e,0x00000046,0x0008004f,0x00000007,0x00000049,0x00000047,
|
||||
0x00000047,0x00000000,0x00000001,0x00000002,0x0003003e,0x00000048,0x00000049,0x00050039,
|
||||
0x00000006,0x0000004a,0x0000000b,0x00000048,0x0003003e,0x0000003d,0x0000004a,0x0004003d,
|
||||
0x00000034,0x0000004c,0x00000036,0x0004003d,0x00000015,0x0000004d,0x00000026,0x00050041,
|
||||
0x00000031,0x0000004e,0x00000017,0x00000041,0x0004003d,0x00000006,0x0000004f,0x0000004e,
|
||||
0x00050050,0x00000015,0x00000050,0x0000004f,0x00000044,0x00050081,0x00000015,0x00000051,
|
||||
0x0000004d,0x00000050,0x00050057,0x00000019,0x00000052,0x0000004c,0x00000051,0x0008004f,
|
||||
0x00000007,0x00000054,0x00000052,0x00000052,0x00000000,0x00000001,0x00000002,0x0003003e,
|
||||
0x00000053,0x00000054,0x00050039,0x00000006,0x00000055,0x0000000b,0x00000053,0x0003003e,
|
||||
0x0000004b,0x00000055,0x0004003d,0x00000034,0x00000057,0x00000036,0x0004003d,0x00000015,
|
||||
0x00000058,0x00000026,0x00050041,0x00000031,0x0000005a,0x00000017,0x00000059,0x0004003d,
|
||||
0x00000006,0x0000005b,0x0000005a,0x00050050,0x00000015,0x0000005c,0x00000044,0x0000005b,
|
||||
0x00050083,0x00000015,0x0000005d,0x00000058,0x0000005c,0x00050057,0x00000019,0x0000005e,
|
||||
0x00000057,0x0000005d,0x0008004f,0x00000007,0x00000060,0x0000005e,0x0000005e,0x00000000,
|
||||
0x00000001,0x00000002,0x0003003e,0x0000005f,0x00000060,0x00050039,0x00000006,0x00000061,
|
||||
0x0000000b,0x0000005f,0x0003003e,0x00000056,0x00000061,0x0004003d,0x00000034,0x00000063,
|
||||
0x00000036,0x0004003d,0x00000015,0x00000064,0x00000026,0x00050041,0x00000031,0x00000065,
|
||||
0x00000017,0x00000059,0x0004003d,0x00000006,0x00000066,0x00000065,0x00050050,0x00000015,
|
||||
0x00000067,0x00000044,0x00000066,0x00050081,0x00000015,0x00000068,0x00000064,0x00000067,
|
||||
0x00050057,0x00000019,0x00000069,0x00000063,0x00000068,0x0008004f,0x00000007,0x0000006b,
|
||||
0x00000069,0x00000069,0x00000000,0x00000001,0x00000002,0x0003003e,0x0000006a,0x0000006b,
|
||||
0x00050039,0x00000006,0x0000006c,0x0000000b,0x0000006a,0x0003003e,0x00000062,0x0000006c,
|
||||
0x0004003d,0x00000006,0x0000006f,0x00000032,0x0004003d,0x00000006,0x00000070,0x0000003d,
|
||||
0x00050083,0x00000006,0x00000071,0x0000006f,0x00000070,0x0006000c,0x00000006,0x00000072,
|
||||
0x00000001,0x00000004,0x00000071,0x0004003d,0x00000006,0x00000073,0x00000032,0x0004003d,
|
||||
0x00000006,0x00000074,0x0000004b,0x00050083,0x00000006,0x00000075,0x00000073,0x00000074,
|
||||
0x0006000c,0x00000006,0x00000076,0x00000001,0x00000004,0x00000075,0x0004003d,0x00000006,
|
||||
0x00000077,0x00000032,0x0004003d,0x00000006,0x00000078,0x00000056,0x00050083,0x00000006,
|
||||
0x00000079,0x00000077,0x00000078,0x0006000c,0x00000006,0x0000007a,0x00000001,0x00000004,
|
||||
0x00000079,0x0004003d,0x00000006,0x0000007b,0x00000032,0x0004003d,0x00000006,0x0000007c,
|
||||
0x00000062,0x00050083,0x00000006,0x0000007d,0x0000007b,0x0000007c,0x0006000c,0x00000006,
|
||||
0x0000007e,0x00000001,0x00000004,0x0000007d,0x00070050,0x00000019,0x0000007f,0x00000072,
|
||||
0x00000076,0x0000007a,0x0000007e,0x0003003e,0x0000006e,0x0000007f,0x000100fd,0x00010038,
|
||||
0x00050036,0x00000006,0x0000000b,0x00000000,0x00000009,0x00030037,0x00000008,0x0000000a,
|
||||
0x000200f8,0x0000000c,0x0004003d,0x00000007,0x0000000d,0x0000000a,0x00050094,0x00000006,
|
||||
0x00000012,0x0000000d,0x00000011,0x000200fe,0x00000012,0x00010038
|
||||
};
|
||||
@@ -1,443 +0,0 @@
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint32_t smaa_code[] = {
|
||||
0x07230203u, 0x00010000u, 0x0008000bu, 0x00000251u, 0x00000000u, 0x00020011u, 0x00000001u, 0x0006000bu,
|
||||
0x00000001u, 0x4c534c47u, 0x6474732eu, 0x3035342eu, 0x00000000u, 0x0003000eu, 0x00000000u, 0x00000001u,
|
||||
0x0007000fu, 0x00000004u, 0x00000004u, 0x6e69616du, 0x00000000u, 0x00000072u, 0x000000f6u, 0x00030010u,
|
||||
0x00000004u, 0x00000007u, 0x00030003u, 0x00000002u, 0x000001c2u, 0x00040005u, 0x00000004u, 0x6e69616du,
|
||||
0x00000000u, 0x00050005u, 0x0000000bu, 0x616d756cu, 0x33667628u, 0x0000003bu, 0x00030005u, 0x0000000au,
|
||||
0x00000063u, 0x00080005u, 0x00000012u, 0x65676465u, 0x74726556u, 0x6c616369u, 0x32667628u, 0x3266763bu,
|
||||
0x0000003bu, 0x00030005u, 0x00000010u, 0x00007675u, 0x00030005u, 0x00000011u, 0x00007870u, 0x00080005u,
|
||||
0x00000016u, 0x65676465u, 0x69726f48u, 0x746e6f7au, 0x76286c61u, 0x763b3266u, 0x003b3266u, 0x00030005u,
|
||||
0x00000014u, 0x00007675u, 0x00030005u, 0x00000015u, 0x00007870u, 0x00030005u, 0x00000021u, 0x00000061u,
|
||||
0x00060005u, 0x00000025u, 0x75706e49u, 0x78655474u, 0x65727574u, 0x00000000u, 0x00040005u, 0x00000031u,
|
||||
0x61726170u, 0x0000006du, 0x00030005u, 0x00000034u, 0x00000062u, 0x00040005u, 0x0000003cu, 0x61726170u,
|
||||
0x0000006du, 0x00030005u, 0x00000045u, 0x00000061u, 0x00040005u, 0x0000004eu, 0x61726170u, 0x0000006du,
|
||||
0x00030005u, 0x00000051u, 0x00000062u, 0x00040005u, 0x00000059u, 0x61726170u, 0x0000006du, 0x00030005u,
|
||||
0x00000062u, 0x00007870u, 0x00050005u, 0x00000064u, 0x736e6f43u, 0x746e6174u, 0x00000073u, 0x00040006u,
|
||||
0x00000064u, 0x00000000u, 0x0063646eu, 0x00060006u, 0x00000064u, 0x00000001u, 0x6f736572u, 0x6974756cu,
|
||||
0x00006e6fu, 0x00050006u, 0x00000064u, 0x00000002u, 0x72747865u, 0x00000061u, 0x00040006u, 0x00000064u,
|
||||
0x00000003u, 0x00646170u, 0x00030005u, 0x00000066u, 0x00006370u, 0x00030005u, 0x00000070u, 0x00007675u,
|
||||
0x00060005u, 0x00000072u, 0x67617266u, 0x43786554u, 0x64726f6fu, 0x00000000u, 0x00040005u, 0x0000007cu,
|
||||
0x746e6563u, 0x00007265u, 0x00030005u, 0x00000080u, 0x0000636cu, 0x00040005u, 0x00000081u, 0x61726170u,
|
||||
0x0000006du, 0x00030005u, 0x00000085u, 0x00006c6cu, 0x00040005u, 0x0000008du, 0x61726170u, 0x0000006du,
|
||||
0x00030005u, 0x00000090u, 0x0000726cu, 0x00040005u, 0x00000098u, 0x61726170u, 0x0000006du, 0x00030005u,
|
||||
0x0000009bu, 0x0000756cu, 0x00040005u, 0x000000a3u, 0x61726170u, 0x0000006du, 0x00030005u, 0x000000a6u,
|
||||
0x0000646cu, 0x00040005u, 0x000000aeu, 0x61726170u, 0x0000006du, 0x00030005u, 0x000000b1u, 0x00004c64u,
|
||||
0x00030005u, 0x000000b6u, 0x00005264u, 0x00030005u, 0x000000bbu, 0x00005564u, 0x00030005u, 0x000000c0u,
|
||||
0x00004464u, 0x00050005u, 0x000000c5u, 0x61636f6cu, 0x6e694d6cu, 0x00000000u, 0x00050005u, 0x000000cfu,
|
||||
0x61636f6cu, 0x78614d6cu, 0x00000000u, 0x00060005u, 0x000000d9u, 0x61636f6cu, 0x6e6f436cu, 0x73617274u,
|
||||
0x00000074u, 0x00050005u, 0x000000ddu, 0x65726874u, 0x6c6f6873u, 0x00000064u, 0x00050005u, 0x000000e3u,
|
||||
0x74726576u, 0x6c616369u, 0x00000000u, 0x00050005u, 0x000000e7u, 0x69726f68u, 0x746e6f7au, 0x00006c61u,
|
||||
0x00050005u, 0x000000ebu, 0x6f727473u, 0x7365676eu, 0x00000074u, 0x00050005u, 0x000000f6u, 0x4374756fu,
|
||||
0x726f6c6fu, 0x00000000u, 0x00060005u, 0x000000fau, 0x74726576u, 0x6c616369u, 0x65676445u, 0x00000000u,
|
||||
0x00040005u, 0x000000feu, 0x676e6174u, 0x00746e65u, 0x00040005u, 0x0000010bu, 0x6d726f6eu, 0x00006c61u,
|
||||
0x00050005u, 0x0000011du, 0x6167656eu, 0x65766974u, 0x006e7552u, 0x00050005u, 0x0000011eu, 0x69736f70u,
|
||||
0x65766974u, 0x006e7552u, 0x00030005u, 0x00000120u, 0x00000069u, 0x00040005u, 0x00000129u, 0x7366666fu,
|
||||
0x00007465u, 0x00040005u, 0x0000012eu, 0x65676465u, 0x0000004eu, 0x00040005u, 0x00000136u, 0x61726170u,
|
||||
0x0000006du, 0x00040005u, 0x00000137u, 0x61726170u, 0x0000006du, 0x00040005u, 0x0000013eu, 0x61726170u,
|
||||
0x0000006du, 0x00040005u, 0x0000013fu, 0x61726170u, 0x0000006du, 0x00040005u, 0x00000143u, 0x65676465u,
|
||||
0x00000050u, 0x00040005u, 0x0000014bu, 0x61726170u, 0x0000006du, 0x00040005u, 0x0000014cu, 0x61726170u,
|
||||
0x0000006du, 0x00040005u, 0x00000153u, 0x61726170u, 0x0000006du, 0x00040005u, 0x00000154u, 0x61726170u,
|
||||
0x0000006du, 0x00040005u, 0x0000017bu, 0x6e617073u, 0x00000000u, 0x00060005u, 0x0000017fu, 0x65676465u,
|
||||
0x666e6f43u, 0x6e656469u, 0x00006563u, 0x00030005u, 0x00000186u, 0x0000776eu, 0x00040005u, 0x00000192u,
|
||||
0x61726170u, 0x0000006du, 0x00030005u, 0x00000195u, 0x0000656eu, 0x00040005u, 0x000001a0u, 0x61726170u,
|
||||
0x0000006du, 0x00030005u, 0x000001a3u, 0x00007773u, 0x00040005u, 0x000001aeu, 0x61726170u, 0x0000006du,
|
||||
0x00030005u, 0x000001b1u, 0x00006573u, 0x00040005u, 0x000001bbu, 0x61726170u, 0x0000006du, 0x00060005u,
|
||||
0x000001beu, 0x70646e65u, 0x746e696fu, 0x74746150u, 0x006e7265u, 0x00060005u, 0x000001c7u, 0x70646e65u,
|
||||
0x746e696fu, 0x61657241u, 0x00000000u, 0x00050005u, 0x000001ceu, 0x736f7263u, 0x676e6973u, 0x00000041u,
|
||||
0x00050005u, 0x000001ddu, 0x736f7263u, 0x676e6973u, 0x00000042u, 0x00070005u, 0x000001ecu, 0x736f7263u,
|
||||
0x676e6973u, 0x746e6f43u, 0x74736172u, 0x00000000u, 0x00060005u, 0x000001f1u, 0x736f7263u, 0x676e6973u,
|
||||
0x74746150u, 0x006e7265u, 0x00050005u, 0x000001f7u, 0x61657261u, 0x67696557u, 0x00007468u, 0x00070005u,
|
||||
0x00000200u, 0x67616964u, 0x6c616e6fu, 0x746e6f43u, 0x74736172u, 0x00000000u, 0x00060005u, 0x0000020au,
|
||||
0x6e726f63u, 0x61467265u, 0x726f7463u, 0x00000000u, 0x00050005u, 0x00000214u, 0x65736162u, 0x67696557u,
|
||||
0x00007468u, 0x00070005u, 0x0000021cu, 0x67616964u, 0x6c616e6fu, 0x65727453u, 0x6874676eu, 0x00000000u,
|
||||
0x00060005u, 0x00000220u, 0x67616964u, 0x6c616e6fu, 0x74746150u, 0x006e7265u, 0x00070005u, 0x00000226u,
|
||||
0x67616964u, 0x6c616e6fu, 0x746e6f43u, 0x69756e69u, 0x00007974u, 0x00070005u, 0x00000229u, 0x67616964u,
|
||||
0x6c616e6fu, 0x6c6c6146u, 0x6b636162u, 0x00000000u, 0x00040005u, 0x00000235u, 0x67696577u, 0x00007468u,
|
||||
0x00040005u, 0x0000023bu, 0x6f726361u, 0x00007373u, 0x00040047u, 0x00000025u, 0x00000021u, 0x00000000u,
|
||||
0x00040047u, 0x00000025u, 0x00000022u, 0x00000000u, 0x00030047u, 0x00000064u, 0x00000002u, 0x00050048u,
|
||||
0x00000064u, 0x00000000u, 0x00000023u, 0x00000000u, 0x00050048u, 0x00000064u, 0x00000001u, 0x00000023u,
|
||||
0x00000010u, 0x00050048u, 0x00000064u, 0x00000002u, 0x00000023u, 0x00000018u, 0x00050048u, 0x00000064u,
|
||||
0x00000003u, 0x00000023u, 0x0000001cu, 0x00040047u, 0x00000072u, 0x0000001eu, 0x00000000u, 0x00040047u,
|
||||
0x000000f6u, 0x0000001eu, 0x00000000u, 0x00020013u, 0x00000002u, 0x00030021u, 0x00000003u, 0x00000002u,
|
||||
0x00030016u, 0x00000006u, 0x00000020u, 0x00040017u, 0x00000007u, 0x00000006u, 0x00000003u, 0x00040020u,
|
||||
0x00000008u, 0x00000007u, 0x00000007u, 0x00040021u, 0x00000009u, 0x00000006u, 0x00000008u, 0x00040017u,
|
||||
0x0000000du, 0x00000006u, 0x00000002u, 0x00040020u, 0x0000000eu, 0x00000007u, 0x0000000du, 0x00050021u,
|
||||
0x0000000fu, 0x00000006u, 0x0000000eu, 0x0000000eu, 0x0004002bu, 0x00000006u, 0x00000019u, 0x3e59b3d0u,
|
||||
0x0004002bu, 0x00000006u, 0x0000001au, 0x3f371759u, 0x0004002bu, 0x00000006u, 0x0000001bu, 0x3d93dd98u,
|
||||
0x0006002cu, 0x00000007u, 0x0000001cu, 0x00000019u, 0x0000001au, 0x0000001bu, 0x00040020u, 0x00000020u,
|
||||
0x00000007u, 0x00000006u, 0x00090019u, 0x00000022u, 0x00000006u, 0x00000001u, 0x00000000u, 0x00000000u,
|
||||
0x00000000u, 0x00000001u, 0x00000000u, 0x0003001bu, 0x00000023u, 0x00000022u, 0x00040020u, 0x00000024u,
|
||||
0x00000000u, 0x00000023u, 0x0004003bu, 0x00000024u, 0x00000025u, 0x00000000u, 0x00040015u, 0x00000028u,
|
||||
0x00000020u, 0x00000000u, 0x0004002bu, 0x00000028u, 0x00000029u, 0x00000000u, 0x0004002bu, 0x00000006u,
|
||||
0x0000002cu, 0x00000000u, 0x00040017u, 0x0000002fu, 0x00000006u, 0x00000004u, 0x0004002bu, 0x00000028u,
|
||||
0x00000048u, 0x00000001u, 0x0004002bu, 0x00000006u, 0x00000063u, 0x3f800000u, 0x0006001eu, 0x00000064u,
|
||||
0x0000002fu, 0x0000000du, 0x00000006u, 0x00000006u, 0x00040020u, 0x00000065u, 0x00000009u, 0x00000064u,
|
||||
0x0004003bu, 0x00000065u, 0x00000066u, 0x00000009u, 0x00040015u, 0x00000067u, 0x00000020u, 0x00000001u,
|
||||
0x0004002bu, 0x00000067u, 0x00000068u, 0x00000001u, 0x00040020u, 0x00000069u, 0x00000009u, 0x0000000du,
|
||||
0x0005002cu, 0x0000000du, 0x0000006cu, 0x00000063u, 0x00000063u, 0x00040020u, 0x00000071u, 0x00000001u,
|
||||
0x0000000du, 0x0004003bu, 0x00000071u, 0x00000072u, 0x00000001u, 0x0004002bu, 0x00000006u, 0x00000075u,
|
||||
0x3f000000u, 0x00040020u, 0x0000007bu, 0x00000007u, 0x0000002fu, 0x0004002bu, 0x00000006u, 0x000000deu,
|
||||
0x3d3851ecu, 0x0004002bu, 0x00000006u, 0x000000e0u, 0x3da3d70au, 0x00020014u, 0x000000f1u, 0x00040020u,
|
||||
0x000000f5u, 0x00000003u, 0x0000002fu, 0x0004003bu, 0x000000f5u, 0x000000f6u, 0x00000003u, 0x00040020u,
|
||||
0x000000f9u, 0x00000007u, 0x000000f1u, 0x0004002bu, 0x00000006u, 0x00000113u, 0xbf800000u, 0x00040020u,
|
||||
0x0000011fu, 0x00000007u, 0x00000067u, 0x0004002bu, 0x00000067u, 0x00000127u, 0x00000006u, 0x0004002bu,
|
||||
0x00000006u, 0x00000161u, 0x3f266666u, 0x0004002bu, 0x00000006u, 0x00000182u, 0x40200000u, 0x0004002bu,
|
||||
0x00000006u, 0x000001cau, 0x3d6147aeu, 0x0004002bu, 0x00000006u, 0x000001f8u, 0x3ec28f5cu, 0x0004002bu,
|
||||
0x00000006u, 0x000001fcu, 0x40800000u, 0x0004002bu, 0x00000006u, 0x0000020bu, 0x3eb33333u, 0x0004002bu,
|
||||
0x00000006u, 0x0000020eu, 0x40400000u, 0x0004002bu, 0x00000006u, 0x0000022au, 0x3e23d70au, 0x0004002bu,
|
||||
0x00000006u, 0x00000239u, 0x3ed70a3du, 0x0004002bu, 0x00000028u, 0x0000024au, 0x00000003u, 0x00050036u,
|
||||
0x00000002u, 0x00000004u, 0x00000000u, 0x00000003u, 0x000200f8u, 0x00000005u, 0x0004003bu, 0x0000000eu,
|
||||
0x00000062u, 0x00000007u, 0x0004003bu, 0x0000000eu, 0x00000070u, 0x00000007u, 0x0004003bu, 0x0000007bu,
|
||||
0x0000007cu, 0x00000007u, 0x0004003bu, 0x00000020u, 0x00000080u, 0x00000007u, 0x0004003bu, 0x00000008u,
|
||||
0x00000081u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x00000085u, 0x00000007u, 0x0004003bu, 0x00000008u,
|
||||
0x0000008du, 0x00000007u, 0x0004003bu, 0x00000020u, 0x00000090u, 0x00000007u, 0x0004003bu, 0x00000008u,
|
||||
0x00000098u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x0000009bu, 0x00000007u, 0x0004003bu, 0x00000008u,
|
||||
0x000000a3u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x000000a6u, 0x00000007u, 0x0004003bu, 0x00000008u,
|
||||
0x000000aeu, 0x00000007u, 0x0004003bu, 0x00000020u, 0x000000b1u, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x000000b6u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x000000bbu, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x000000c0u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x000000c5u, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x000000cfu, 0x00000007u, 0x0004003bu, 0x00000020u, 0x000000d9u, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x000000ddu, 0x00000007u, 0x0004003bu, 0x00000020u, 0x000000e3u, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x000000e7u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x000000ebu, 0x00000007u, 0x0004003bu, 0x000000f9u,
|
||||
0x000000fau, 0x00000007u, 0x0004003bu, 0x0000000eu, 0x000000feu, 0x00000007u, 0x0004003bu, 0x0000000eu,
|
||||
0x00000100u, 0x00000007u, 0x0004003bu, 0x0000000eu, 0x0000010bu, 0x00000007u, 0x0004003bu, 0x0000000eu,
|
||||
0x0000010du, 0x00000007u, 0x0004003bu, 0x00000020u, 0x0000011du, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x0000011eu, 0x00000007u, 0x0004003bu, 0x0000011fu, 0x00000120u, 0x00000007u, 0x0004003bu, 0x0000000eu,
|
||||
0x00000129u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x0000012eu, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x00000130u, 0x00000007u, 0x0004003bu, 0x0000000eu, 0x00000136u, 0x00000007u, 0x0004003bu, 0x0000000eu,
|
||||
0x00000137u, 0x00000007u, 0x0004003bu, 0x0000000eu, 0x0000013eu, 0x00000007u, 0x0004003bu, 0x0000000eu,
|
||||
0x0000013fu, 0x00000007u, 0x0004003bu, 0x00000020u, 0x00000143u, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x00000145u, 0x00000007u, 0x0004003bu, 0x0000000eu, 0x0000014bu, 0x00000007u, 0x0004003bu, 0x0000000eu,
|
||||
0x0000014cu, 0x00000007u, 0x0004003bu, 0x0000000eu, 0x00000153u, 0x00000007u, 0x0004003bu, 0x0000000eu,
|
||||
0x00000154u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x0000017bu, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x0000017fu, 0x00000007u, 0x0004003bu, 0x00000020u, 0x00000186u, 0x00000007u, 0x0004003bu, 0x00000008u,
|
||||
0x00000192u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x00000195u, 0x00000007u, 0x0004003bu, 0x00000008u,
|
||||
0x000001a0u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x000001a3u, 0x00000007u, 0x0004003bu, 0x00000008u,
|
||||
0x000001aeu, 0x00000007u, 0x0004003bu, 0x00000020u, 0x000001b1u, 0x00000007u, 0x0004003bu, 0x00000008u,
|
||||
0x000001bbu, 0x00000007u, 0x0004003bu, 0x00000020u, 0x000001beu, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x000001c7u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x000001ceu, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x000001d0u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x000001ddu, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x000001dfu, 0x00000007u, 0x0004003bu, 0x00000020u, 0x000001ecu, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x000001f1u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x000001f7u, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x00000200u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x0000020au, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x00000214u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x0000021cu, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x00000220u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x00000226u, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x00000229u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x00000235u, 0x00000007u, 0x0004003bu, 0x00000008u,
|
||||
0x0000023bu, 0x00000007u, 0x00050041u, 0x00000069u, 0x0000006au, 0x00000066u, 0x00000068u, 0x0004003du,
|
||||
0x0000000du, 0x0000006bu, 0x0000006au, 0x0007000cu, 0x0000000du, 0x0000006du, 0x00000001u, 0x00000028u,
|
||||
0x0000006bu, 0x0000006cu, 0x00050050u, 0x0000000du, 0x0000006eu, 0x00000063u, 0x00000063u, 0x00050088u,
|
||||
0x0000000du, 0x0000006fu, 0x0000006eu, 0x0000006du, 0x0003003eu, 0x00000062u, 0x0000006fu, 0x0004003du,
|
||||
0x0000000du, 0x00000073u, 0x00000072u, 0x0004003du, 0x0000000du, 0x00000074u, 0x00000062u, 0x0005008eu,
|
||||
0x0000000du, 0x00000076u, 0x00000074u, 0x00000075u, 0x0004003du, 0x0000000du, 0x00000077u, 0x00000062u,
|
||||
0x0005008eu, 0x0000000du, 0x00000078u, 0x00000077u, 0x00000075u, 0x00050083u, 0x0000000du, 0x00000079u,
|
||||
0x0000006cu, 0x00000078u, 0x0008000cu, 0x0000000du, 0x0000007au, 0x00000001u, 0x0000002bu, 0x00000073u,
|
||||
0x00000076u, 0x00000079u, 0x0003003eu, 0x00000070u, 0x0000007au, 0x0004003du, 0x00000023u, 0x0000007du,
|
||||
0x00000025u, 0x0004003du, 0x0000000du, 0x0000007eu, 0x00000070u, 0x00050057u, 0x0000002fu, 0x0000007fu,
|
||||
0x0000007du, 0x0000007eu, 0x0003003eu, 0x0000007cu, 0x0000007fu, 0x0004003du, 0x0000002fu, 0x00000082u,
|
||||
0x0000007cu, 0x0008004fu, 0x00000007u, 0x00000083u, 0x00000082u, 0x00000082u, 0x00000000u, 0x00000001u,
|
||||
0x00000002u, 0x0003003eu, 0x00000081u, 0x00000083u, 0x00050039u, 0x00000006u, 0x00000084u, 0x0000000bu,
|
||||
0x00000081u, 0x0003003eu, 0x00000080u, 0x00000084u, 0x0004003du, 0x00000023u, 0x00000086u, 0x00000025u,
|
||||
0x0004003du, 0x0000000du, 0x00000087u, 0x00000070u, 0x00050041u, 0x00000020u, 0x00000088u, 0x00000062u,
|
||||
0x00000029u, 0x0004003du, 0x00000006u, 0x00000089u, 0x00000088u, 0x00050050u, 0x0000000du, 0x0000008au,
|
||||
0x00000089u, 0x0000002cu, 0x00050083u, 0x0000000du, 0x0000008bu, 0x00000087u, 0x0000008au, 0x00050057u,
|
||||
0x0000002fu, 0x0000008cu, 0x00000086u, 0x0000008bu, 0x0008004fu, 0x00000007u, 0x0000008eu, 0x0000008cu,
|
||||
0x0000008cu, 0x00000000u, 0x00000001u, 0x00000002u, 0x0003003eu, 0x0000008du, 0x0000008eu, 0x00050039u,
|
||||
0x00000006u, 0x0000008fu, 0x0000000bu, 0x0000008du, 0x0003003eu, 0x00000085u, 0x0000008fu, 0x0004003du,
|
||||
0x00000023u, 0x00000091u, 0x00000025u, 0x0004003du, 0x0000000du, 0x00000092u, 0x00000070u, 0x00050041u,
|
||||
0x00000020u, 0x00000093u, 0x00000062u, 0x00000029u, 0x0004003du, 0x00000006u, 0x00000094u, 0x00000093u,
|
||||
0x00050050u, 0x0000000du, 0x00000095u, 0x00000094u, 0x0000002cu, 0x00050081u, 0x0000000du, 0x00000096u,
|
||||
0x00000092u, 0x00000095u, 0x00050057u, 0x0000002fu, 0x00000097u, 0x00000091u, 0x00000096u, 0x0008004fu,
|
||||
0x00000007u, 0x00000099u, 0x00000097u, 0x00000097u, 0x00000000u, 0x00000001u, 0x00000002u, 0x0003003eu,
|
||||
0x00000098u, 0x00000099u, 0x00050039u, 0x00000006u, 0x0000009au, 0x0000000bu, 0x00000098u, 0x0003003eu,
|
||||
0x00000090u, 0x0000009au, 0x0004003du, 0x00000023u, 0x0000009cu, 0x00000025u, 0x0004003du, 0x0000000du,
|
||||
0x0000009du, 0x00000070u, 0x00050041u, 0x00000020u, 0x0000009eu, 0x00000062u, 0x00000048u, 0x0004003du,
|
||||
0x00000006u, 0x0000009fu, 0x0000009eu, 0x00050050u, 0x0000000du, 0x000000a0u, 0x0000002cu, 0x0000009fu,
|
||||
0x00050083u, 0x0000000du, 0x000000a1u, 0x0000009du, 0x000000a0u, 0x00050057u, 0x0000002fu, 0x000000a2u,
|
||||
0x0000009cu, 0x000000a1u, 0x0008004fu, 0x00000007u, 0x000000a4u, 0x000000a2u, 0x000000a2u, 0x00000000u,
|
||||
0x00000001u, 0x00000002u, 0x0003003eu, 0x000000a3u, 0x000000a4u, 0x00050039u, 0x00000006u, 0x000000a5u,
|
||||
0x0000000bu, 0x000000a3u, 0x0003003eu, 0x0000009bu, 0x000000a5u, 0x0004003du, 0x00000023u, 0x000000a7u,
|
||||
0x00000025u, 0x0004003du, 0x0000000du, 0x000000a8u, 0x00000070u, 0x00050041u, 0x00000020u, 0x000000a9u,
|
||||
0x00000062u, 0x00000048u, 0x0004003du, 0x00000006u, 0x000000aau, 0x000000a9u, 0x00050050u, 0x0000000du,
|
||||
0x000000abu, 0x0000002cu, 0x000000aau, 0x00050081u, 0x0000000du, 0x000000acu, 0x000000a8u, 0x000000abu,
|
||||
0x00050057u, 0x0000002fu, 0x000000adu, 0x000000a7u, 0x000000acu, 0x0008004fu, 0x00000007u, 0x000000afu,
|
||||
0x000000adu, 0x000000adu, 0x00000000u, 0x00000001u, 0x00000002u, 0x0003003eu, 0x000000aeu, 0x000000afu,
|
||||
0x00050039u, 0x00000006u, 0x000000b0u, 0x0000000bu, 0x000000aeu, 0x0003003eu, 0x000000a6u, 0x000000b0u,
|
||||
0x0004003du, 0x00000006u, 0x000000b2u, 0x00000080u, 0x0004003du, 0x00000006u, 0x000000b3u, 0x00000085u,
|
||||
0x00050083u, 0x00000006u, 0x000000b4u, 0x000000b2u, 0x000000b3u, 0x0006000cu, 0x00000006u, 0x000000b5u,
|
||||
0x00000001u, 0x00000004u, 0x000000b4u, 0x0003003eu, 0x000000b1u, 0x000000b5u, 0x0004003du, 0x00000006u,
|
||||
0x000000b7u, 0x00000080u, 0x0004003du, 0x00000006u, 0x000000b8u, 0x00000090u, 0x00050083u, 0x00000006u,
|
||||
0x000000b9u, 0x000000b7u, 0x000000b8u, 0x0006000cu, 0x00000006u, 0x000000bau, 0x00000001u, 0x00000004u,
|
||||
0x000000b9u, 0x0003003eu, 0x000000b6u, 0x000000bau, 0x0004003du, 0x00000006u, 0x000000bcu, 0x00000080u,
|
||||
0x0004003du, 0x00000006u, 0x000000bdu, 0x0000009bu, 0x00050083u, 0x00000006u, 0x000000beu, 0x000000bcu,
|
||||
0x000000bdu, 0x0006000cu, 0x00000006u, 0x000000bfu, 0x00000001u, 0x00000004u, 0x000000beu, 0x0003003eu,
|
||||
0x000000bbu, 0x000000bfu, 0x0004003du, 0x00000006u, 0x000000c1u, 0x00000080u, 0x0004003du, 0x00000006u,
|
||||
0x000000c2u, 0x000000a6u, 0x00050083u, 0x00000006u, 0x000000c3u, 0x000000c1u, 0x000000c2u, 0x0006000cu,
|
||||
0x00000006u, 0x000000c4u, 0x00000001u, 0x00000004u, 0x000000c3u, 0x0003003eu, 0x000000c0u, 0x000000c4u,
|
||||
0x0004003du, 0x00000006u, 0x000000c6u, 0x00000080u, 0x0004003du, 0x00000006u, 0x000000c7u, 0x00000085u,
|
||||
0x0004003du, 0x00000006u, 0x000000c8u, 0x00000090u, 0x0007000cu, 0x00000006u, 0x000000c9u, 0x00000001u,
|
||||
0x00000025u, 0x000000c7u, 0x000000c8u, 0x0004003du, 0x00000006u, 0x000000cau, 0x0000009bu, 0x0004003du,
|
||||
0x00000006u, 0x000000cbu, 0x000000a6u, 0x0007000cu, 0x00000006u, 0x000000ccu, 0x00000001u, 0x00000025u,
|
||||
0x000000cau, 0x000000cbu, 0x0007000cu, 0x00000006u, 0x000000cdu, 0x00000001u, 0x00000025u, 0x000000c9u,
|
||||
0x000000ccu, 0x0007000cu, 0x00000006u, 0x000000ceu, 0x00000001u, 0x00000025u, 0x000000c6u, 0x000000cdu,
|
||||
0x0003003eu, 0x000000c5u, 0x000000ceu, 0x0004003du, 0x00000006u, 0x000000d0u, 0x00000080u, 0x0004003du,
|
||||
0x00000006u, 0x000000d1u, 0x00000085u, 0x0004003du, 0x00000006u, 0x000000d2u, 0x00000090u, 0x0007000cu,
|
||||
0x00000006u, 0x000000d3u, 0x00000001u, 0x00000028u, 0x000000d1u, 0x000000d2u, 0x0004003du, 0x00000006u,
|
||||
0x000000d4u, 0x0000009bu, 0x0004003du, 0x00000006u, 0x000000d5u, 0x000000a6u, 0x0007000cu, 0x00000006u,
|
||||
0x000000d6u, 0x00000001u, 0x00000028u, 0x000000d4u, 0x000000d5u, 0x0007000cu, 0x00000006u, 0x000000d7u,
|
||||
0x00000001u, 0x00000028u, 0x000000d3u, 0x000000d6u, 0x0007000cu, 0x00000006u, 0x000000d8u, 0x00000001u,
|
||||
0x00000028u, 0x000000d0u, 0x000000d7u, 0x0003003eu, 0x000000cfu, 0x000000d8u, 0x0004003du, 0x00000006u,
|
||||
0x000000dau, 0x000000cfu, 0x0004003du, 0x00000006u, 0x000000dbu, 0x000000c5u, 0x00050083u, 0x00000006u,
|
||||
0x000000dcu, 0x000000dau, 0x000000dbu, 0x0003003eu, 0x000000d9u, 0x000000dcu, 0x0004003du, 0x00000006u,
|
||||
0x000000dfu, 0x000000d9u, 0x00050085u, 0x00000006u, 0x000000e1u, 0x000000dfu, 0x000000e0u, 0x0007000cu,
|
||||
0x00000006u, 0x000000e2u, 0x00000001u, 0x00000028u, 0x000000deu, 0x000000e1u, 0x0003003eu, 0x000000ddu,
|
||||
0x000000e2u, 0x0004003du, 0x00000006u, 0x000000e4u, 0x000000b1u, 0x0004003du, 0x00000006u, 0x000000e5u,
|
||||
0x000000b6u, 0x0007000cu, 0x00000006u, 0x000000e6u, 0x00000001u, 0x00000028u, 0x000000e4u, 0x000000e5u,
|
||||
0x0003003eu, 0x000000e3u, 0x000000e6u, 0x0004003du, 0x00000006u, 0x000000e8u, 0x000000bbu, 0x0004003du,
|
||||
0x00000006u, 0x000000e9u, 0x000000c0u, 0x0007000cu, 0x00000006u, 0x000000eau, 0x00000001u, 0x00000028u,
|
||||
0x000000e8u, 0x000000e9u, 0x0003003eu, 0x000000e7u, 0x000000eau, 0x0004003du, 0x00000006u, 0x000000ecu,
|
||||
0x000000e3u, 0x0004003du, 0x00000006u, 0x000000edu, 0x000000e7u, 0x0007000cu, 0x00000006u, 0x000000eeu,
|
||||
0x00000001u, 0x00000028u, 0x000000ecu, 0x000000edu, 0x0003003eu, 0x000000ebu, 0x000000eeu, 0x0004003du,
|
||||
0x00000006u, 0x000000efu, 0x000000ebu, 0x0004003du, 0x00000006u, 0x000000f0u, 0x000000ddu, 0x000500bcu,
|
||||
0x000000f1u, 0x000000f2u, 0x000000efu, 0x000000f0u, 0x000300f7u, 0x000000f4u, 0x00000000u, 0x000400fau,
|
||||
0x000000f2u, 0x000000f3u, 0x000000f4u, 0x000200f8u, 0x000000f3u, 0x0004003du, 0x0000002fu, 0x000000f7u,
|
||||
0x0000007cu, 0x0003003eu, 0x000000f6u, 0x000000f7u, 0x000100fdu, 0x000200f8u, 0x000000f4u, 0x0004003du,
|
||||
0x00000006u, 0x000000fbu, 0x000000e3u, 0x0004003du, 0x00000006u, 0x000000fcu, 0x000000e7u, 0x000500beu,
|
||||
0x000000f1u, 0x000000fdu, 0x000000fbu, 0x000000fcu, 0x0003003eu, 0x000000fau, 0x000000fdu, 0x0004003du,
|
||||
0x000000f1u, 0x000000ffu, 0x000000fau, 0x000300f7u, 0x00000102u, 0x00000000u, 0x000400fau, 0x000000ffu,
|
||||
0x00000101u, 0x00000106u, 0x000200f8u, 0x00000101u, 0x00050041u, 0x00000020u, 0x00000103u, 0x00000062u,
|
||||
0x00000048u, 0x0004003du, 0x00000006u, 0x00000104u, 0x00000103u, 0x00050050u, 0x0000000du, 0x00000105u,
|
||||
0x0000002cu, 0x00000104u, 0x0003003eu, 0x00000100u, 0x00000105u, 0x000200f9u, 0x00000102u, 0x000200f8u,
|
||||
0x00000106u, 0x00050041u, 0x00000020u, 0x00000107u, 0x00000062u, 0x00000029u, 0x0004003du, 0x00000006u,
|
||||
0x00000108u, 0x00000107u, 0x00050050u, 0x0000000du, 0x00000109u, 0x00000108u, 0x0000002cu, 0x0003003eu,
|
||||
0x00000100u, 0x00000109u, 0x000200f9u, 0x00000102u, 0x000200f8u, 0x00000102u, 0x0004003du, 0x0000000du,
|
||||
0x0000010au, 0x00000100u, 0x0003003eu, 0x000000feu, 0x0000010au, 0x0004003du, 0x000000f1u, 0x0000010cu,
|
||||
0x000000fau, 0x000300f7u, 0x0000010fu, 0x00000000u, 0x000400fau, 0x0000010cu, 0x0000010eu, 0x00000116u,
|
||||
0x000200f8u, 0x0000010eu, 0x0004003du, 0x00000006u, 0x00000110u, 0x000000b1u, 0x0004003du, 0x00000006u,
|
||||
0x00000111u, 0x000000b6u, 0x000500beu, 0x000000f1u, 0x00000112u, 0x00000110u, 0x00000111u, 0x000600a9u,
|
||||
0x00000006u, 0x00000114u, 0x00000112u, 0x00000113u, 0x00000063u, 0x00050050u, 0x0000000du, 0x00000115u,
|
||||
0x00000114u, 0x0000002cu, 0x0003003eu, 0x0000010du, 0x00000115u, 0x000200f9u, 0x0000010fu, 0x000200f8u,
|
||||
0x00000116u, 0x0004003du, 0x00000006u, 0x00000117u, 0x000000bbu, 0x0004003du, 0x00000006u, 0x00000118u,
|
||||
0x000000c0u, 0x000500beu, 0x000000f1u, 0x00000119u, 0x00000117u, 0x00000118u, 0x000600a9u, 0x00000006u,
|
||||
0x0000011au, 0x00000119u, 0x00000113u, 0x00000063u, 0x00050050u, 0x0000000du, 0x0000011bu, 0x0000002cu,
|
||||
0x0000011au, 0x0003003eu, 0x0000010du, 0x0000011bu, 0x000200f9u, 0x0000010fu, 0x000200f8u, 0x0000010fu,
|
||||
0x0004003du, 0x0000000du, 0x0000011cu, 0x0000010du, 0x0003003eu, 0x0000010bu, 0x0000011cu, 0x0003003eu,
|
||||
0x0000011du, 0x0000002cu, 0x0003003eu, 0x0000011eu, 0x0000002cu, 0x0003003eu, 0x00000120u, 0x00000068u,
|
||||
0x000200f9u, 0x00000121u, 0x000200f8u, 0x00000121u, 0x000400f6u, 0x00000123u, 0x00000124u, 0x00000000u,
|
||||
0x000200f9u, 0x00000125u, 0x000200f8u, 0x00000125u, 0x0004003du, 0x00000067u, 0x00000126u, 0x00000120u,
|
||||
0x000500b3u, 0x000000f1u, 0x00000128u, 0x00000126u, 0x00000127u, 0x000400fau, 0x00000128u, 0x00000122u,
|
||||
0x00000123u, 0x000200f8u, 0x00000122u, 0x0004003du, 0x0000000du, 0x0000012au, 0x000000feu, 0x0004003du,
|
||||
0x00000067u, 0x0000012bu, 0x00000120u, 0x0004006fu, 0x00000006u, 0x0000012cu, 0x0000012bu, 0x0005008eu,
|
||||
0x0000000du, 0x0000012du, 0x0000012au, 0x0000012cu, 0x0003003eu, 0x00000129u, 0x0000012du, 0x0004003du,
|
||||
0x000000f1u, 0x0000012fu, 0x000000fau, 0x000300f7u, 0x00000132u, 0x00000000u, 0x000400fau, 0x0000012fu,
|
||||
0x00000131u, 0x0000013au, 0x000200f8u, 0x00000131u, 0x0004003du, 0x0000000du, 0x00000133u, 0x00000070u,
|
||||
0x0004003du, 0x0000000du, 0x00000134u, 0x00000129u, 0x00050083u, 0x0000000du, 0x00000135u, 0x00000133u,
|
||||
0x00000134u, 0x0003003eu, 0x00000136u, 0x00000135u, 0x0004003du, 0x0000000du, 0x00000138u, 0x00000062u,
|
||||
0x0003003eu, 0x00000137u, 0x00000138u, 0x00060039u, 0x00000006u, 0x00000139u, 0x00000012u, 0x00000136u,
|
||||
0x00000137u, 0x0003003eu, 0x00000130u, 0x00000139u, 0x000200f9u, 0x00000132u, 0x000200f8u, 0x0000013au,
|
||||
0x0004003du, 0x0000000du, 0x0000013bu, 0x00000070u, 0x0004003du, 0x0000000du, 0x0000013cu, 0x00000129u,
|
||||
0x00050083u, 0x0000000du, 0x0000013du, 0x0000013bu, 0x0000013cu, 0x0003003eu, 0x0000013eu, 0x0000013du,
|
||||
0x0004003du, 0x0000000du, 0x00000140u, 0x00000062u, 0x0003003eu, 0x0000013fu, 0x00000140u, 0x00060039u,
|
||||
0x00000006u, 0x00000141u, 0x00000016u, 0x0000013eu, 0x0000013fu, 0x0003003eu, 0x00000130u, 0x00000141u,
|
||||
0x000200f9u, 0x00000132u, 0x000200f8u, 0x00000132u, 0x0004003du, 0x00000006u, 0x00000142u, 0x00000130u,
|
||||
0x0003003eu, 0x0000012eu, 0x00000142u, 0x0004003du, 0x000000f1u, 0x00000144u, 0x000000fau, 0x000300f7u,
|
||||
0x00000147u, 0x00000000u, 0x000400fau, 0x00000144u, 0x00000146u, 0x0000014fu, 0x000200f8u, 0x00000146u,
|
||||
0x0004003du, 0x0000000du, 0x00000148u, 0x00000070u, 0x0004003du, 0x0000000du, 0x00000149u, 0x00000129u,
|
||||
0x00050081u, 0x0000000du, 0x0000014au, 0x00000148u, 0x00000149u, 0x0003003eu, 0x0000014bu, 0x0000014au,
|
||||
0x0004003du, 0x0000000du, 0x0000014du, 0x00000062u, 0x0003003eu, 0x0000014cu, 0x0000014du, 0x00060039u,
|
||||
0x00000006u, 0x0000014eu, 0x00000012u, 0x0000014bu, 0x0000014cu, 0x0003003eu, 0x00000145u, 0x0000014eu,
|
||||
0x000200f9u, 0x00000147u, 0x000200f8u, 0x0000014fu, 0x0004003du, 0x0000000du, 0x00000150u, 0x00000070u,
|
||||
0x0004003du, 0x0000000du, 0x00000151u, 0x00000129u, 0x00050081u, 0x0000000du, 0x00000152u, 0x00000150u,
|
||||
0x00000151u, 0x0003003eu, 0x00000153u, 0x00000152u, 0x0004003du, 0x0000000du, 0x00000155u, 0x00000062u,
|
||||
0x0003003eu, 0x00000154u, 0x00000155u, 0x00060039u, 0x00000006u, 0x00000156u, 0x00000016u, 0x00000153u,
|
||||
0x00000154u, 0x0003003eu, 0x00000145u, 0x00000156u, 0x000200f9u, 0x00000147u, 0x000200f8u, 0x00000147u,
|
||||
0x0004003du, 0x00000006u, 0x00000157u, 0x00000145u, 0x0003003eu, 0x00000143u, 0x00000157u, 0x0004003du,
|
||||
0x00000006u, 0x00000158u, 0x0000011du, 0x0004003du, 0x00000067u, 0x00000159u, 0x00000120u, 0x00050082u,
|
||||
0x00000067u, 0x0000015au, 0x00000159u, 0x00000068u, 0x0004006fu, 0x00000006u, 0x0000015bu, 0x0000015au,
|
||||
0x000500b4u, 0x000000f1u, 0x0000015cu, 0x00000158u, 0x0000015bu, 0x000300f7u, 0x0000015eu, 0x00000000u,
|
||||
0x000400fau, 0x0000015cu, 0x0000015du, 0x0000015eu, 0x000200f8u, 0x0000015du, 0x0004003du, 0x00000006u,
|
||||
0x0000015fu, 0x0000012eu, 0x0004003du, 0x00000006u, 0x00000160u, 0x000000ddu, 0x00050085u, 0x00000006u,
|
||||
0x00000162u, 0x00000160u, 0x00000161u, 0x000500bau, 0x000000f1u, 0x00000163u, 0x0000015fu, 0x00000162u,
|
||||
0x000200f9u, 0x0000015eu, 0x000200f8u, 0x0000015eu, 0x000700f5u, 0x000000f1u, 0x00000164u, 0x0000015cu,
|
||||
0x00000147u, 0x00000163u, 0x0000015du, 0x000300f7u, 0x00000166u, 0x00000000u, 0x000400fau, 0x00000164u,
|
||||
0x00000165u, 0x00000166u, 0x000200f8u, 0x00000165u, 0x0004003du, 0x00000067u, 0x00000167u, 0x00000120u,
|
||||
0x0004006fu, 0x00000006u, 0x00000168u, 0x00000167u, 0x0003003eu, 0x0000011du, 0x00000168u, 0x000200f9u,
|
||||
0x00000166u, 0x000200f8u, 0x00000166u, 0x0004003du, 0x00000006u, 0x00000169u, 0x0000011eu, 0x0004003du,
|
||||
0x00000067u, 0x0000016au, 0x00000120u, 0x00050082u, 0x00000067u, 0x0000016bu, 0x0000016au, 0x00000068u,
|
||||
0x0004006fu, 0x00000006u, 0x0000016cu, 0x0000016bu, 0x000500b4u, 0x000000f1u, 0x0000016du, 0x00000169u,
|
||||
0x0000016cu, 0x000300f7u, 0x0000016fu, 0x00000000u, 0x000400fau, 0x0000016du, 0x0000016eu, 0x0000016fu,
|
||||
0x000200f8u, 0x0000016eu, 0x0004003du, 0x00000006u, 0x00000170u, 0x00000143u, 0x0004003du, 0x00000006u,
|
||||
0x00000171u, 0x000000ddu, 0x00050085u, 0x00000006u, 0x00000172u, 0x00000171u, 0x00000161u, 0x000500bau,
|
||||
0x000000f1u, 0x00000173u, 0x00000170u, 0x00000172u, 0x000200f9u, 0x0000016fu, 0x000200f8u, 0x0000016fu,
|
||||
0x000700f5u, 0x000000f1u, 0x00000174u, 0x0000016du, 0x00000166u, 0x00000173u, 0x0000016eu, 0x000300f7u,
|
||||
0x00000176u, 0x00000000u, 0x000400fau, 0x00000174u, 0x00000175u, 0x00000176u, 0x000200f8u, 0x00000175u,
|
||||
0x0004003du, 0x00000067u, 0x00000177u, 0x00000120u, 0x0004006fu, 0x00000006u, 0x00000178u, 0x00000177u,
|
||||
0x0003003eu, 0x0000011eu, 0x00000178u, 0x000200f9u, 0x00000176u, 0x000200f8u, 0x00000176u, 0x000200f9u,
|
||||
0x00000124u, 0x000200f8u, 0x00000124u, 0x0004003du, 0x00000067u, 0x00000179u, 0x00000120u, 0x00050080u,
|
||||
0x00000067u, 0x0000017au, 0x00000179u, 0x00000068u, 0x0003003eu, 0x00000120u, 0x0000017au, 0x000200f9u,
|
||||
0x00000121u, 0x000200f8u, 0x00000123u, 0x0004003du, 0x00000006u, 0x0000017cu, 0x0000011du, 0x0004003du,
|
||||
0x00000006u, 0x0000017du, 0x0000011eu, 0x00050081u, 0x00000006u, 0x0000017eu, 0x0000017cu, 0x0000017du,
|
||||
0x0003003eu, 0x0000017bu, 0x0000017eu, 0x0004003du, 0x00000006u, 0x00000180u, 0x000000ddu, 0x0004003du,
|
||||
0x00000006u, 0x00000181u, 0x000000ddu, 0x00050085u, 0x00000006u, 0x00000183u, 0x00000181u, 0x00000182u,
|
||||
0x0004003du, 0x00000006u, 0x00000184u, 0x000000ebu, 0x0008000cu, 0x00000006u, 0x00000185u, 0x00000001u,
|
||||
0x00000031u, 0x00000180u, 0x00000183u, 0x00000184u, 0x0003003eu, 0x0000017fu, 0x00000185u, 0x0004003du,
|
||||
0x00000023u, 0x00000187u, 0x00000025u, 0x0004003du, 0x0000000du, 0x00000188u, 0x00000070u, 0x00050041u,
|
||||
0x00000020u, 0x00000189u, 0x00000062u, 0x00000029u, 0x0004003du, 0x00000006u, 0x0000018au, 0x00000189u,
|
||||
0x0004007fu, 0x00000006u, 0x0000018bu, 0x0000018au, 0x00050041u, 0x00000020u, 0x0000018cu, 0x00000062u,
|
||||
0x00000048u, 0x0004003du, 0x00000006u, 0x0000018du, 0x0000018cu, 0x0004007fu, 0x00000006u, 0x0000018eu,
|
||||
0x0000018du, 0x00050050u, 0x0000000du, 0x0000018fu, 0x0000018bu, 0x0000018eu, 0x00050081u, 0x0000000du,
|
||||
0x00000190u, 0x00000188u, 0x0000018fu, 0x00050057u, 0x0000002fu, 0x00000191u, 0x00000187u, 0x00000190u,
|
||||
0x0008004fu, 0x00000007u, 0x00000193u, 0x00000191u, 0x00000191u, 0x00000000u, 0x00000001u, 0x00000002u,
|
||||
0x0003003eu, 0x00000192u, 0x00000193u, 0x00050039u, 0x00000006u, 0x00000194u, 0x0000000bu, 0x00000192u,
|
||||
0x0003003eu, 0x00000186u, 0x00000194u, 0x0004003du, 0x00000023u, 0x00000196u, 0x00000025u, 0x0004003du,
|
||||
0x0000000du, 0x00000197u, 0x00000070u, 0x00050041u, 0x00000020u, 0x00000198u, 0x00000062u, 0x00000029u,
|
||||
0x0004003du, 0x00000006u, 0x00000199u, 0x00000198u, 0x00050041u, 0x00000020u, 0x0000019au, 0x00000062u,
|
||||
0x00000048u, 0x0004003du, 0x00000006u, 0x0000019bu, 0x0000019au, 0x0004007fu, 0x00000006u, 0x0000019cu,
|
||||
0x0000019bu, 0x00050050u, 0x0000000du, 0x0000019du, 0x00000199u, 0x0000019cu, 0x00050081u, 0x0000000du,
|
||||
0x0000019eu, 0x00000197u, 0x0000019du, 0x00050057u, 0x0000002fu, 0x0000019fu, 0x00000196u, 0x0000019eu,
|
||||
0x0008004fu, 0x00000007u, 0x000001a1u, 0x0000019fu, 0x0000019fu, 0x00000000u, 0x00000001u, 0x00000002u,
|
||||
0x0003003eu, 0x000001a0u, 0x000001a1u, 0x00050039u, 0x00000006u, 0x000001a2u, 0x0000000bu, 0x000001a0u,
|
||||
0x0003003eu, 0x00000195u, 0x000001a2u, 0x0004003du, 0x00000023u, 0x000001a4u, 0x00000025u, 0x0004003du,
|
||||
0x0000000du, 0x000001a5u, 0x00000070u, 0x00050041u, 0x00000020u, 0x000001a6u, 0x00000062u, 0x00000029u,
|
||||
0x0004003du, 0x00000006u, 0x000001a7u, 0x000001a6u, 0x0004007fu, 0x00000006u, 0x000001a8u, 0x000001a7u,
|
||||
0x00050041u, 0x00000020u, 0x000001a9u, 0x00000062u, 0x00000048u, 0x0004003du, 0x00000006u, 0x000001aau,
|
||||
0x000001a9u, 0x00050050u, 0x0000000du, 0x000001abu, 0x000001a8u, 0x000001aau, 0x00050081u, 0x0000000du,
|
||||
0x000001acu, 0x000001a5u, 0x000001abu, 0x00050057u, 0x0000002fu, 0x000001adu, 0x000001a4u, 0x000001acu,
|
||||
0x0008004fu, 0x00000007u, 0x000001afu, 0x000001adu, 0x000001adu, 0x00000000u, 0x00000001u, 0x00000002u,
|
||||
0x0003003eu, 0x000001aeu, 0x000001afu, 0x00050039u, 0x00000006u, 0x000001b0u, 0x0000000bu, 0x000001aeu,
|
||||
0x0003003eu, 0x000001a3u, 0x000001b0u, 0x0004003du, 0x00000023u, 0x000001b2u, 0x00000025u, 0x0004003du,
|
||||
0x0000000du, 0x000001b3u, 0x00000070u, 0x00050041u, 0x00000020u, 0x000001b4u, 0x00000062u, 0x00000029u,
|
||||
0x0004003du, 0x00000006u, 0x000001b5u, 0x000001b4u, 0x00050041u, 0x00000020u, 0x000001b6u, 0x00000062u,
|
||||
0x00000048u, 0x0004003du, 0x00000006u, 0x000001b7u, 0x000001b6u, 0x00050050u, 0x0000000du, 0x000001b8u,
|
||||
0x000001b5u, 0x000001b7u, 0x00050081u, 0x0000000du, 0x000001b9u, 0x000001b3u, 0x000001b8u, 0x00050057u,
|
||||
0x0000002fu, 0x000001bau, 0x000001b2u, 0x000001b9u, 0x0008004fu, 0x00000007u, 0x000001bcu, 0x000001bau,
|
||||
0x000001bau, 0x00000000u, 0x00000001u, 0x00000002u, 0x0003003eu, 0x000001bbu, 0x000001bcu, 0x00050039u,
|
||||
0x00000006u, 0x000001bdu, 0x0000000bu, 0x000001bbu, 0x0003003eu, 0x000001b1u, 0x000001bdu, 0x0004003du,
|
||||
0x00000006u, 0x000001bfu, 0x0000011du, 0x0004003du, 0x00000006u, 0x000001c0u, 0x0000011eu, 0x00050083u,
|
||||
0x00000006u, 0x000001c1u, 0x000001bfu, 0x000001c0u, 0x0006000cu, 0x00000006u, 0x000001c2u, 0x00000001u,
|
||||
0x00000004u, 0x000001c1u, 0x0004003du, 0x00000006u, 0x000001c3u, 0x0000017bu, 0x0007000cu, 0x00000006u,
|
||||
0x000001c4u, 0x00000001u, 0x00000028u, 0x000001c3u, 0x00000063u, 0x00050088u, 0x00000006u, 0x000001c5u,
|
||||
0x000001c2u, 0x000001c4u, 0x0008000cu, 0x00000006u, 0x000001c6u, 0x00000001u, 0x0000002bu, 0x000001c5u,
|
||||
0x0000002cu, 0x00000063u, 0x0003003eu, 0x000001beu, 0x000001c6u, 0x0004003du, 0x00000006u, 0x000001c8u,
|
||||
0x000001beu, 0x0004003du, 0x00000006u, 0x000001c9u, 0x0000017bu, 0x00050085u, 0x00000006u, 0x000001cbu,
|
||||
0x000001c9u, 0x000001cau, 0x00050081u, 0x00000006u, 0x000001ccu, 0x00000063u, 0x000001cbu, 0x00050088u,
|
||||
0x00000006u, 0x000001cdu, 0x000001c8u, 0x000001ccu, 0x0003003eu, 0x000001c7u, 0x000001cdu, 0x0004003du,
|
||||
0x000000f1u, 0x000001cfu, 0x000000fau, 0x000300f7u, 0x000001d2u, 0x00000000u, 0x000400fau, 0x000001cfu,
|
||||
0x000001d1u, 0x000001d7u, 0x000200f8u, 0x000001d1u, 0x0004003du, 0x00000006u, 0x000001d3u, 0x00000186u,
|
||||
0x0004003du, 0x00000006u, 0x000001d4u, 0x00000195u, 0x00050083u, 0x00000006u, 0x000001d5u, 0x000001d3u,
|
||||
0x000001d4u, 0x0006000cu, 0x00000006u, 0x000001d6u, 0x00000001u, 0x00000004u, 0x000001d5u, 0x0003003eu,
|
||||
0x000001d0u, 0x000001d6u, 0x000200f9u, 0x000001d2u, 0x000200f8u, 0x000001d7u, 0x0004003du, 0x00000006u,
|
||||
0x000001d8u, 0x00000186u, 0x0004003du, 0x00000006u, 0x000001d9u, 0x000001a3u, 0x00050083u, 0x00000006u,
|
||||
0x000001dau, 0x000001d8u, 0x000001d9u, 0x0006000cu, 0x00000006u, 0x000001dbu, 0x00000001u, 0x00000004u,
|
||||
0x000001dau, 0x0003003eu, 0x000001d0u, 0x000001dbu, 0x000200f9u, 0x000001d2u, 0x000200f8u, 0x000001d2u,
|
||||
0x0004003du, 0x00000006u, 0x000001dcu, 0x000001d0u, 0x0003003eu, 0x000001ceu, 0x000001dcu, 0x0004003du,
|
||||
0x000000f1u, 0x000001deu, 0x000000fau, 0x000300f7u, 0x000001e1u, 0x00000000u, 0x000400fau, 0x000001deu,
|
||||
0x000001e0u, 0x000001e6u, 0x000200f8u, 0x000001e0u, 0x0004003du, 0x00000006u, 0x000001e2u, 0x000001a3u,
|
||||
0x0004003du, 0x00000006u, 0x000001e3u, 0x000001b1u, 0x00050083u, 0x00000006u, 0x000001e4u, 0x000001e2u,
|
||||
0x000001e3u, 0x0006000cu, 0x00000006u, 0x000001e5u, 0x00000001u, 0x00000004u, 0x000001e4u, 0x0003003eu,
|
||||
0x000001dfu, 0x000001e5u, 0x000200f9u, 0x000001e1u, 0x000200f8u, 0x000001e6u, 0x0004003du, 0x00000006u,
|
||||
0x000001e7u, 0x00000195u, 0x0004003du, 0x00000006u, 0x000001e8u, 0x000001b1u, 0x00050083u, 0x00000006u,
|
||||
0x000001e9u, 0x000001e7u, 0x000001e8u, 0x0006000cu, 0x00000006u, 0x000001eau, 0x00000001u, 0x00000004u,
|
||||
0x000001e9u, 0x0003003eu, 0x000001dfu, 0x000001eau, 0x000200f9u, 0x000001e1u, 0x000200f8u, 0x000001e1u,
|
||||
0x0004003du, 0x00000006u, 0x000001ebu, 0x000001dfu, 0x0003003eu, 0x000001ddu, 0x000001ebu, 0x0004003du,
|
||||
0x00000006u, 0x000001edu, 0x000001ceu, 0x0004003du, 0x00000006u, 0x000001eeu, 0x000001ddu, 0x00050083u,
|
||||
0x00000006u, 0x000001efu, 0x000001edu, 0x000001eeu, 0x0006000cu, 0x00000006u, 0x000001f0u, 0x00000001u,
|
||||
0x00000004u, 0x000001efu, 0x0003003eu, 0x000001ecu, 0x000001f0u, 0x0004003du, 0x00000006u, 0x000001f2u,
|
||||
0x000000ddu, 0x0004003du, 0x00000006u, 0x000001f3u, 0x000000ddu, 0x00050085u, 0x00000006u, 0x000001f4u,
|
||||
0x000001f3u, 0x00000182u, 0x0004003du, 0x00000006u, 0x000001f5u, 0x000001ecu, 0x0008000cu, 0x00000006u,
|
||||
0x000001f6u, 0x00000001u, 0x00000031u, 0x000001f2u, 0x000001f4u, 0x000001f5u, 0x0003003eu, 0x000001f1u,
|
||||
0x000001f6u, 0x0004003du, 0x00000006u, 0x000001f9u, 0x000001f1u, 0x00050085u, 0x00000006u, 0x000001fau,
|
||||
0x000001f8u, 0x000001f9u, 0x0004003du, 0x00000006u, 0x000001fbu, 0x0000017bu, 0x00050088u, 0x00000006u,
|
||||
0x000001fdu, 0x000001fbu, 0x000001fcu, 0x0008000cu, 0x00000006u, 0x000001feu, 0x00000001u, 0x0000002bu,
|
||||
0x000001fdu, 0x0000002cu, 0x00000063u, 0x00050085u, 0x00000006u, 0x000001ffu, 0x000001fau, 0x000001feu,
|
||||
0x0003003eu, 0x000001f7u, 0x000001ffu, 0x0004003du, 0x00000006u, 0x00000201u, 0x00000186u, 0x0004003du,
|
||||
0x00000006u, 0x00000202u, 0x000001b1u, 0x00050083u, 0x00000006u, 0x00000203u, 0x00000201u, 0x00000202u,
|
||||
0x0006000cu, 0x00000006u, 0x00000204u, 0x00000001u, 0x00000004u, 0x00000203u, 0x0004003du, 0x00000006u,
|
||||
0x00000205u, 0x00000195u, 0x0004003du, 0x00000006u, 0x00000206u, 0x000001a3u, 0x00050083u, 0x00000006u,
|
||||
0x00000207u, 0x00000205u, 0x00000206u, 0x0006000cu, 0x00000006u, 0x00000208u, 0x00000001u, 0x00000004u,
|
||||
0x00000207u, 0x0007000cu, 0x00000006u, 0x00000209u, 0x00000001u, 0x00000028u, 0x00000204u, 0x00000208u,
|
||||
0x0003003eu, 0x00000200u, 0x00000209u, 0x0004003du, 0x00000006u, 0x0000020cu, 0x000000ddu, 0x0004003du,
|
||||
0x00000006u, 0x0000020du, 0x000000ddu, 0x00050085u, 0x00000006u, 0x0000020fu, 0x0000020du, 0x0000020eu,
|
||||
0x0004003du, 0x00000006u, 0x00000210u, 0x00000200u, 0x0008000cu, 0x00000006u, 0x00000211u, 0x00000001u,
|
||||
0x00000031u, 0x0000020cu, 0x0000020fu, 0x00000210u, 0x00050085u, 0x00000006u, 0x00000212u, 0x0000020bu,
|
||||
0x00000211u, 0x00050083u, 0x00000006u, 0x00000213u, 0x00000063u, 0x00000212u, 0x0003003eu, 0x0000020au,
|
||||
0x00000213u, 0x0004003du, 0x00000006u, 0x00000215u, 0x000001f7u, 0x0004003du, 0x00000006u, 0x00000216u,
|
||||
0x000001c7u, 0x00050085u, 0x00000006u, 0x00000217u, 0x00000215u, 0x00000216u, 0x0004003du, 0x00000006u,
|
||||
0x00000218u, 0x0000017fu, 0x00050085u, 0x00000006u, 0x00000219u, 0x00000217u, 0x00000218u, 0x0004003du,
|
||||
0x00000006u, 0x0000021au, 0x0000020au, 0x00050085u, 0x00000006u, 0x0000021bu, 0x00000219u, 0x0000021au,
|
||||
0x0003003eu, 0x00000214u, 0x0000021bu, 0x0004003du, 0x00000006u, 0x0000021du, 0x000000e3u, 0x0004003du,
|
||||
0x00000006u, 0x0000021eu, 0x000000e7u, 0x0007000cu, 0x00000006u, 0x0000021fu, 0x00000001u, 0x00000025u,
|
||||
0x0000021du, 0x0000021eu, 0x0003003eu, 0x0000021cu, 0x0000021fu, 0x0004003du, 0x00000006u, 0x00000221u,
|
||||
0x000000ddu, 0x0004003du, 0x00000006u, 0x00000222u, 0x000000ddu, 0x00050085u, 0x00000006u, 0x00000223u,
|
||||
0x00000222u, 0x00000182u, 0x0004003du, 0x00000006u, 0x00000224u, 0x0000021cu, 0x0008000cu, 0x00000006u,
|
||||
0x00000225u, 0x00000001u, 0x00000031u, 0x00000221u, 0x00000223u, 0x00000224u, 0x0003003eu, 0x00000220u,
|
||||
0x00000225u, 0x0004003du, 0x00000006u, 0x00000227u, 0x0000017bu, 0x0008000cu, 0x00000006u, 0x00000228u,
|
||||
0x00000001u, 0x00000031u, 0x00000063u, 0x0000020eu, 0x00000227u, 0x0003003eu, 0x00000226u, 0x00000228u,
|
||||
0x0004003du, 0x00000006u, 0x0000022bu, 0x00000220u, 0x00050085u, 0x00000006u, 0x0000022cu, 0x0000022au,
|
||||
0x0000022bu, 0x0004003du, 0x00000006u, 0x0000022du, 0x0000017fu, 0x00050085u, 0x00000006u, 0x0000022eu,
|
||||
0x0000022cu, 0x0000022du, 0x0004003du, 0x00000006u, 0x0000022fu, 0x0000020au, 0x00050085u, 0x00000006u,
|
||||
0x00000230u, 0x0000022eu, 0x0000022fu, 0x0004003du, 0x00000006u, 0x00000231u, 0x00000226u, 0x00050085u,
|
||||
0x00000006u, 0x00000232u, 0x00000230u, 0x00000231u, 0x0004003du, 0x00000006u, 0x00000233u, 0x000001f1u,
|
||||
0x00050085u, 0x00000006u, 0x00000234u, 0x00000232u, 0x00000233u, 0x0003003eu, 0x00000229u, 0x00000234u,
|
||||
0x0004003du, 0x00000006u, 0x00000236u, 0x00000214u, 0x0004003du, 0x00000006u, 0x00000237u, 0x00000229u,
|
||||
0x0007000cu, 0x00000006u, 0x00000238u, 0x00000001u, 0x00000028u, 0x00000236u, 0x00000237u, 0x0008000cu,
|
||||
0x00000006u, 0x0000023au, 0x00000001u, 0x0000002bu, 0x00000238u, 0x0000002cu, 0x00000239u, 0x0003003eu,
|
||||
0x00000235u, 0x0000023au, 0x0004003du, 0x00000023u, 0x0000023cu, 0x00000025u, 0x0004003du, 0x0000000du,
|
||||
0x0000023du, 0x00000070u, 0x0004003du, 0x0000000du, 0x0000023eu, 0x0000010bu, 0x0004003du, 0x0000000du,
|
||||
0x0000023fu, 0x00000062u, 0x00050085u, 0x0000000du, 0x00000240u, 0x0000023eu, 0x0000023fu, 0x00050081u,
|
||||
0x0000000du, 0x00000241u, 0x0000023du, 0x00000240u, 0x00050057u, 0x0000002fu, 0x00000242u, 0x0000023cu,
|
||||
0x00000241u, 0x0008004fu, 0x00000007u, 0x00000243u, 0x00000242u, 0x00000242u, 0x00000000u, 0x00000001u,
|
||||
0x00000002u, 0x0003003eu, 0x0000023bu, 0x00000243u, 0x0004003du, 0x0000002fu, 0x00000244u, 0x0000007cu,
|
||||
0x0008004fu, 0x00000007u, 0x00000245u, 0x00000244u, 0x00000244u, 0x00000000u, 0x00000001u, 0x00000002u,
|
||||
0x0004003du, 0x00000007u, 0x00000246u, 0x0000023bu, 0x0004003du, 0x00000006u, 0x00000247u, 0x00000235u,
|
||||
0x00060050u, 0x00000007u, 0x00000248u, 0x00000247u, 0x00000247u, 0x00000247u, 0x0008000cu, 0x00000007u,
|
||||
0x00000249u, 0x00000001u, 0x0000002eu, 0x00000245u, 0x00000246u, 0x00000248u, 0x00050041u, 0x00000020u,
|
||||
0x0000024bu, 0x0000007cu, 0x0000024au, 0x0004003du, 0x00000006u, 0x0000024cu, 0x0000024bu, 0x00050051u,
|
||||
0x00000006u, 0x0000024du, 0x00000249u, 0x00000000u, 0x00050051u, 0x00000006u, 0x0000024eu, 0x00000249u,
|
||||
0x00000001u, 0x00050051u, 0x00000006u, 0x0000024fu, 0x00000249u, 0x00000002u, 0x00070050u, 0x0000002fu,
|
||||
0x00000250u, 0x0000024du, 0x0000024eu, 0x0000024fu, 0x0000024cu, 0x0003003eu, 0x000000f6u, 0x00000250u,
|
||||
0x000100fdu, 0x00010038u, 0x00050036u, 0x00000006u, 0x0000000bu, 0x00000000u, 0x00000009u, 0x00030037u,
|
||||
0x00000008u, 0x0000000au, 0x000200f8u, 0x0000000cu, 0x0004003du, 0x00000007u, 0x00000018u, 0x0000000au,
|
||||
0x00050094u, 0x00000006u, 0x0000001du, 0x00000018u, 0x0000001cu, 0x000200feu, 0x0000001du, 0x00010038u,
|
||||
0x00050036u, 0x00000006u, 0x00000012u, 0x00000000u, 0x0000000fu, 0x00030037u, 0x0000000eu, 0x00000010u,
|
||||
0x00030037u, 0x0000000eu, 0x00000011u, 0x000200f8u, 0x00000013u, 0x0004003bu, 0x00000020u, 0x00000021u,
|
||||
0x00000007u, 0x0004003bu, 0x00000008u, 0x00000031u, 0x00000007u, 0x0004003bu, 0x00000020u, 0x00000034u,
|
||||
0x00000007u, 0x0004003bu, 0x00000008u, 0x0000003cu, 0x00000007u, 0x0004003du, 0x00000023u, 0x00000026u,
|
||||
0x00000025u, 0x0004003du, 0x0000000du, 0x00000027u, 0x00000010u, 0x00050041u, 0x00000020u, 0x0000002au,
|
||||
0x00000011u, 0x00000029u, 0x0004003du, 0x00000006u, 0x0000002bu, 0x0000002au, 0x00050050u, 0x0000000du,
|
||||
0x0000002du, 0x0000002bu, 0x0000002cu, 0x00050083u, 0x0000000du, 0x0000002eu, 0x00000027u, 0x0000002du,
|
||||
0x00050057u, 0x0000002fu, 0x00000030u, 0x00000026u, 0x0000002eu, 0x0008004fu, 0x00000007u, 0x00000032u,
|
||||
0x00000030u, 0x00000030u, 0x00000000u, 0x00000001u, 0x00000002u, 0x0003003eu, 0x00000031u, 0x00000032u,
|
||||
0x00050039u, 0x00000006u, 0x00000033u, 0x0000000bu, 0x00000031u, 0x0003003eu, 0x00000021u, 0x00000033u,
|
||||
0x0004003du, 0x00000023u, 0x00000035u, 0x00000025u, 0x0004003du, 0x0000000du, 0x00000036u, 0x00000010u,
|
||||
0x00050041u, 0x00000020u, 0x00000037u, 0x00000011u, 0x00000029u, 0x0004003du, 0x00000006u, 0x00000038u,
|
||||
0x00000037u, 0x00050050u, 0x0000000du, 0x00000039u, 0x00000038u, 0x0000002cu, 0x00050081u, 0x0000000du,
|
||||
0x0000003au, 0x00000036u, 0x00000039u, 0x00050057u, 0x0000002fu, 0x0000003bu, 0x00000035u, 0x0000003au,
|
||||
0x0008004fu, 0x00000007u, 0x0000003du, 0x0000003bu, 0x0000003bu, 0x00000000u, 0x00000001u, 0x00000002u,
|
||||
0x0003003eu, 0x0000003cu, 0x0000003du, 0x00050039u, 0x00000006u, 0x0000003eu, 0x0000000bu, 0x0000003cu,
|
||||
0x0003003eu, 0x00000034u, 0x0000003eu, 0x0004003du, 0x00000006u, 0x0000003fu, 0x00000021u, 0x0004003du,
|
||||
0x00000006u, 0x00000040u, 0x00000034u, 0x00050083u, 0x00000006u, 0x00000041u, 0x0000003fu, 0x00000040u,
|
||||
0x0006000cu, 0x00000006u, 0x00000042u, 0x00000001u, 0x00000004u, 0x00000041u, 0x000200feu, 0x00000042u,
|
||||
0x00010038u, 0x00050036u, 0x00000006u, 0x00000016u, 0x00000000u, 0x0000000fu, 0x00030037u, 0x0000000eu,
|
||||
0x00000014u, 0x00030037u, 0x0000000eu, 0x00000015u, 0x000200f8u, 0x00000017u, 0x0004003bu, 0x00000020u,
|
||||
0x00000045u, 0x00000007u, 0x0004003bu, 0x00000008u, 0x0000004eu, 0x00000007u, 0x0004003bu, 0x00000020u,
|
||||
0x00000051u, 0x00000007u, 0x0004003bu, 0x00000008u, 0x00000059u, 0x00000007u, 0x0004003du, 0x00000023u,
|
||||
0x00000046u, 0x00000025u, 0x0004003du, 0x0000000du, 0x00000047u, 0x00000014u, 0x00050041u, 0x00000020u,
|
||||
0x00000049u, 0x00000015u, 0x00000048u, 0x0004003du, 0x00000006u, 0x0000004au, 0x00000049u, 0x00050050u,
|
||||
0x0000000du, 0x0000004bu, 0x0000002cu, 0x0000004au, 0x00050083u, 0x0000000du, 0x0000004cu, 0x00000047u,
|
||||
0x0000004bu, 0x00050057u, 0x0000002fu, 0x0000004du, 0x00000046u, 0x0000004cu, 0x0008004fu, 0x00000007u,
|
||||
0x0000004fu, 0x0000004du, 0x0000004du, 0x00000000u, 0x00000001u, 0x00000002u, 0x0003003eu, 0x0000004eu,
|
||||
0x0000004fu, 0x00050039u, 0x00000006u, 0x00000050u, 0x0000000bu, 0x0000004eu, 0x0003003eu, 0x00000045u,
|
||||
0x00000050u, 0x0004003du, 0x00000023u, 0x00000052u, 0x00000025u, 0x0004003du, 0x0000000du, 0x00000053u,
|
||||
0x00000014u, 0x00050041u, 0x00000020u, 0x00000054u, 0x00000015u, 0x00000048u, 0x0004003du, 0x00000006u,
|
||||
0x00000055u, 0x00000054u, 0x00050050u, 0x0000000du, 0x00000056u, 0x0000002cu, 0x00000055u, 0x00050081u,
|
||||
0x0000000du, 0x00000057u, 0x00000053u, 0x00000056u, 0x00050057u, 0x0000002fu, 0x00000058u, 0x00000052u,
|
||||
0x00000057u, 0x0008004fu, 0x00000007u, 0x0000005au, 0x00000058u, 0x00000058u, 0x00000000u, 0x00000001u,
|
||||
0x00000002u, 0x0003003eu, 0x00000059u, 0x0000005au, 0x00050039u, 0x00000006u, 0x0000005bu, 0x0000000bu,
|
||||
0x00000059u, 0x0003003eu, 0x00000051u, 0x0000005bu, 0x0004003du, 0x00000006u, 0x0000005cu, 0x00000045u,
|
||||
0x0004003du, 0x00000006u, 0x0000005du, 0x00000051u, 0x00050083u, 0x00000006u, 0x0000005eu, 0x0000005cu,
|
||||
0x0000005du, 0x0006000cu, 0x00000006u, 0x0000005fu, 0x00000001u, 0x00000004u, 0x0000005eu, 0x000200feu,
|
||||
0x0000005fu, 0x00010038u,
|
||||
};
|
||||
@@ -0,0 +1,153 @@
|
||||
#version 450
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
layout(set = 0, binding = 0) uniform sampler2D EdgeTexture;
|
||||
layout(push_constant) uniform Constants {
|
||||
vec4 ndc;
|
||||
vec2 resolution;
|
||||
float extra;
|
||||
float pad;
|
||||
} pc;
|
||||
|
||||
vec4 edgeAt(vec2 uv, vec2 px) {
|
||||
vec2 edgeUV = clamp(uv, px * 0.5, vec2(1.0) - px * 0.5);
|
||||
vec4 e = textureLod(EdgeTexture, edgeUV, 0.0);
|
||||
e.a = edgeUV.y >= 1.0 - px.y ? 0.0 : e.a;
|
||||
return e;
|
||||
}
|
||||
|
||||
float verticalEdge(vec2 uv, vec2 px) {
|
||||
vec4 e = edgeAt(uv, px);
|
||||
return max(e.r, e.g);
|
||||
}
|
||||
|
||||
float horizontalEdge(vec2 uv, vec2 px) {
|
||||
vec4 e = edgeAt(uv, px);
|
||||
return max(e.b, e.a);
|
||||
}
|
||||
|
||||
float measureRun(vec2 origin, vec2 texel, vec2 tangent,
|
||||
bool verticalLine, float limit, bool positive) {
|
||||
float run = 0.0;
|
||||
for (int i = 1; i <= 6; ++i) {
|
||||
vec2 probe = origin + tangent * float(i) * (positive ? 1.0 : -1.0);
|
||||
ivec2 index = ivec2(floor(probe * pc.resolution));
|
||||
ivec2 size = ivec2(pc.resolution);
|
||||
if (any(lessThan(index, ivec2(0))) ||
|
||||
any(greaterThanEqual(index, size))) {
|
||||
break;
|
||||
}
|
||||
float edge = verticalLine
|
||||
? verticalEdge(probe, texel)
|
||||
: horizontalEdge(probe, texel);
|
||||
if (edge <= limit * 0.65) {
|
||||
break;
|
||||
}
|
||||
run = float(i);
|
||||
}
|
||||
return run;
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec2 px = 1.0 / max(pc.resolution, vec2(1.0));
|
||||
vec2 uv = clamp(fragTexCoord, px * 0.5, vec2(1.0) - px * 0.5);
|
||||
vec4 e = edgeAt(uv, px);
|
||||
|
||||
float dL = e.r;
|
||||
float dR = e.g;
|
||||
float dU = e.b;
|
||||
float dD = e.a;
|
||||
float vertical = max(dL, dR);
|
||||
float horizontal = max(dU, dD);
|
||||
float strongest = max(vertical, horizontal);
|
||||
float threshold = max(0.045, strongest * 0.12);
|
||||
|
||||
if (strongest <= threshold) {
|
||||
outColor = vec4(0.0, 0.5, 0.5, 0.0);
|
||||
return;
|
||||
}
|
||||
|
||||
bool verticalLine;
|
||||
float negativeRun = 0.0;
|
||||
float positiveRun = 0.0;
|
||||
bool runsMeasured = false;
|
||||
|
||||
if (vertical > horizontal) {
|
||||
verticalLine = true;
|
||||
} else if (horizontal > vertical) {
|
||||
verticalLine = false;
|
||||
} else {
|
||||
float vNeg = measureRun(uv, px, vec2(0.0, px.y), true, threshold, false);
|
||||
float vPos = measureRun(uv, px, vec2(0.0, px.y), true, threshold, true);
|
||||
float hNeg = measureRun(uv, px, vec2(px.x, 0.0), false, threshold, false);
|
||||
float hPos = measureRun(uv, px, vec2(px.x, 0.0), false, threshold, true);
|
||||
verticalLine = (vNeg + vPos) >= (hNeg + hPos);
|
||||
negativeRun = verticalLine ? vNeg : hNeg;
|
||||
positiveRun = verticalLine ? vPos : hPos;
|
||||
runsMeasured = true;
|
||||
}
|
||||
|
||||
vec2 tangent = verticalLine ? vec2(0.0, px.y) : vec2(px.x, 0.0);
|
||||
vec2 normal = verticalLine
|
||||
? vec2(dL >= dR ? -1.0 : 1.0, 0.0)
|
||||
: vec2(0.0, dU >= dD ? -1.0 : 1.0);
|
||||
|
||||
if (!runsMeasured) {
|
||||
negativeRun = measureRun(uv, px, tangent, verticalLine, threshold, false);
|
||||
positiveRun = measureRun(uv, px, tangent, verticalLine, threshold, true);
|
||||
}
|
||||
|
||||
float span = negativeRun + positiveRun;
|
||||
float edgeConfidence = smoothstep(threshold, threshold * 2.5, strongest);
|
||||
|
||||
vec4 nw = edgeAt(uv + vec2(-px.x, -px.y), px);
|
||||
vec4 ne = edgeAt(uv + vec2(px.x, -px.y), px);
|
||||
vec4 sw = edgeAt(uv + vec2(-px.x, px.y), px);
|
||||
vec4 se = edgeAt(uv + vec2(px.x, px.y), px);
|
||||
|
||||
float runEndpointPattern = clamp(
|
||||
abs(negativeRun - positiveRun) / max(span, 1.0), 0.0, 1.0);
|
||||
float crossingA = verticalLine
|
||||
? abs(nw.a - ne.a)
|
||||
: abs(nw.g - sw.g);
|
||||
float crossingB = verticalLine
|
||||
? abs(sw.b - se.b)
|
||||
: abs(ne.r - se.r);
|
||||
float crossingContrast = abs(crossingA - crossingB);
|
||||
float crossingPattern = smoothstep(threshold, threshold * 2.5, crossingContrast);
|
||||
vec4 edgeMin = min(min(nw, ne), min(sw, se));
|
||||
vec4 edgeMax = max(max(nw, ne), max(sw, se));
|
||||
float edgeVariation = max(
|
||||
max(edgeMax.r - edgeMin.r, edgeMax.g - edgeMin.g),
|
||||
max(edgeMax.b - edgeMin.b, edgeMax.a - edgeMin.a));
|
||||
float balancedCrossing = edgeVariation > 0.01
|
||||
? smoothstep(threshold, threshold * 2.5, min(crossingA, crossingB))
|
||||
: 0.0;
|
||||
float endpointPattern = runEndpointPattern > 0.01
|
||||
? max(runEndpointPattern, balancedCrossing)
|
||||
: runEndpointPattern;
|
||||
float endpointArea = endpointPattern / (1.0 + span * 0.055);
|
||||
float areaWeight = 0.38 * crossingPattern * clamp(span / 4.0, 0.0, 1.0);
|
||||
float diagonalContrast = max(
|
||||
max(max(abs(nw.r - se.r), abs(nw.g - se.g)),
|
||||
max(abs(nw.b - se.b), abs(nw.a - se.a))),
|
||||
max(max(abs(ne.r - sw.r), abs(ne.g - sw.g)),
|
||||
max(abs(ne.b - sw.b), abs(ne.a - sw.a))));
|
||||
float cornerFactor = 1.0 - 0.35 * smoothstep(threshold, threshold * 3.0, diagonalContrast);
|
||||
float baseWeight = areaWeight * endpointArea * edgeConfidence * cornerFactor;
|
||||
|
||||
float diagonalStrength = min(vertical, horizontal);
|
||||
float diagonalPattern = smoothstep(threshold, threshold * 2.5, diagonalStrength);
|
||||
float diagonalContinuity = smoothstep(1.0, 3.0, span);
|
||||
float shortDiagonalFallback =
|
||||
(span > 0.0 && span <= 1.0 && crossingContrast <= threshold && diagonalStrength > threshold)
|
||||
? 1.0 : 0.0;
|
||||
float diagonalFallback = 0.16 * diagonalPattern * edgeConfidence
|
||||
* cornerFactor * max(
|
||||
diagonalContinuity * max(crossingPattern, balancedCrossing),
|
||||
shortDiagonalFallback);
|
||||
|
||||
float weight = clamp(max(baseWeight, diagonalFallback), 0.0, 0.42);
|
||||
outColor = vec4(weight, normal.x * 0.5 + 0.5, normal.y * 0.5 + 0.5, 1.0);
|
||||
}
|
||||
@@ -0,0 +1,567 @@
|
||||
// SPIR-V gerado
|
||||
#pragma once
|
||||
const uint32_t smaa_weights_code[] = {
|
||||
0x07230203,0x00010000,0x0008000b,0x000002e6,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x000000cb,0x000000fd,0x00030010,
|
||||
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d,
|
||||
0x00000000,0x00060005,0x0000000d,0x65676465,0x76287441,0x763b3266,0x003b3266,0x00030005,
|
||||
0x0000000b,0x00007675,0x00030005,0x0000000c,0x00007870,0x00080005,0x00000012,0x74726576,
|
||||
0x6c616369,0x65676445,0x32667628,0x3266763b,0x0000003b,0x00030005,0x00000010,0x00007675,
|
||||
0x00030005,0x00000011,0x00007870,0x00080005,0x00000016,0x69726f68,0x746e6f7a,0x64456c61,
|
||||
0x76286567,0x763b3266,0x003b3266,0x00030005,0x00000014,0x00007675,0x00030005,0x00000015,
|
||||
0x00007870,0x000b0005,0x00000022,0x7361656d,0x52657275,0x76286e75,0x763b3266,0x763b3266,
|
||||
0x623b3266,0x31663b31,0x3b31623b,0x00000000,0x00040005,0x0000001c,0x6769726f,0x00006e69,
|
||||
0x00040005,0x0000001d,0x65786574,0x0000006c,0x00040005,0x0000001e,0x676e6174,0x00746e65,
|
||||
0x00060005,0x0000001f,0x74726576,0x6c616369,0x656e694c,0x00000000,0x00040005,0x00000020,
|
||||
0x696d696c,0x00000074,0x00050005,0x00000021,0x69736f70,0x65766974,0x00000000,0x00040005,
|
||||
0x00000024,0x65676465,0x00005655,0x00030005,0x00000030,0x00000065,0x00050005,0x00000034,
|
||||
0x65676445,0x74786554,0x00657275,0x00030005,0x0000004d,0x00000065,0x00040005,0x0000004e,
|
||||
0x61726170,0x0000006d,0x00040005,0x00000050,0x61726170,0x0000006d,0x00030005,0x0000005b,
|
||||
0x00000065,0x00040005,0x0000005c,0x61726170,0x0000006d,0x00040005,0x0000005e,0x61726170,
|
||||
0x0000006d,0x00030005,0x00000069,0x006e7572,0x00030005,0x0000006c,0x00000069,0x00040005,
|
||||
0x00000076,0x626f7270,0x00000065,0x00040005,0x00000083,0x65646e69,0x00000078,0x00050005,
|
||||
0x00000085,0x736e6f43,0x746e6174,0x00000073,0x00040006,0x00000085,0x00000000,0x0063646e,
|
||||
0x00060006,0x00000085,0x00000001,0x6f736572,0x6974756c,0x00006e6f,0x00050006,0x00000085,
|
||||
0x00000002,0x72747865,0x00000061,0x00040006,0x00000085,0x00000003,0x00646170,0x00030005,
|
||||
0x00000087,0x00006370,0x00040005,0x0000008e,0x657a6973,0x00000000,0x00040005,0x000000a3,
|
||||
0x65676465,0x00000000,0x00040005,0x000000a8,0x61726170,0x0000006d,0x00040005,0x000000aa,
|
||||
0x61726170,0x0000006d,0x00040005,0x000000ae,0x61726170,0x0000006d,0x00040005,0x000000b0,
|
||||
0x61726170,0x0000006d,0x00030005,0x000000c3,0x00007870,0x00030005,0x000000c9,0x00007675,
|
||||
0x00060005,0x000000cb,0x67617266,0x43786554,0x64726f6f,0x00000000,0x00030005,0x000000d3,
|
||||
0x00000065,0x00040005,0x000000d4,0x61726170,0x0000006d,0x00040005,0x000000d6,0x61726170,
|
||||
0x0000006d,0x00030005,0x000000d9,0x00004c64,0x00030005,0x000000dc,0x00005264,0x00030005,
|
||||
0x000000df,0x00005564,0x00030005,0x000000e2,0x00004464,0x00050005,0x000000e5,0x74726576,
|
||||
0x6c616369,0x00000000,0x00050005,0x000000e9,0x69726f68,0x746e6f7a,0x00006c61,0x00050005,
|
||||
0x000000ed,0x6f727473,0x7365676e,0x00000074,0x00050005,0x000000f1,0x65726874,0x6c6f6873,
|
||||
0x00000064,0x00050005,0x000000fd,0x4374756f,0x726f6c6f,0x00000000,0x00050005,0x00000100,
|
||||
0x6167656e,0x65766974,0x006e7552,0x00050005,0x00000101,0x69736f70,0x65766974,0x006e7552,
|
||||
0x00060005,0x00000102,0x736e7572,0x7361654d,0x64657275,0x00000000,0x00060005,0x00000109,
|
||||
0x74726576,0x6c616369,0x656e694c,0x00000000,0x00040005,0x00000112,0x67654e76,0x00000000,
|
||||
0x00040005,0x00000116,0x61726170,0x0000006d,0x00040005,0x00000118,0x61726170,0x0000006d,
|
||||
0x00040005,0x0000011a,0x61726170,0x0000006d,0x00040005,0x0000011b,0x61726170,0x0000006d,
|
||||
0x00040005,0x0000011c,0x61726170,0x0000006d,0x00040005,0x0000011e,0x61726170,0x0000006d,
|
||||
0x00040005,0x00000120,0x736f5076,0x00000000,0x00040005,0x00000124,0x61726170,0x0000006d,
|
||||
0x00040005,0x00000126,0x61726170,0x0000006d,0x00040005,0x00000128,0x61726170,0x0000006d,
|
||||
0x00040005,0x00000129,0x61726170,0x0000006d,0x00040005,0x0000012a,0x61726170,0x0000006d,
|
||||
0x00040005,0x0000012c,0x61726170,0x0000006d,0x00040005,0x0000012e,0x67654e68,0x00000000,
|
||||
0x00040005,0x00000132,0x61726170,0x0000006d,0x00040005,0x00000134,0x61726170,0x0000006d,
|
||||
0x00040005,0x00000136,0x61726170,0x0000006d,0x00040005,0x00000137,0x61726170,0x0000006d,
|
||||
0x00040005,0x00000138,0x61726170,0x0000006d,0x00040005,0x0000013a,0x61726170,0x0000006d,
|
||||
0x00040005,0x0000013c,0x736f5068,0x00000000,0x00040005,0x00000140,0x61726170,0x0000006d,
|
||||
0x00040005,0x00000142,0x61726170,0x0000006d,0x00040005,0x00000144,0x61726170,0x0000006d,
|
||||
0x00040005,0x00000145,0x61726170,0x0000006d,0x00040005,0x00000146,0x61726170,0x0000006d,
|
||||
0x00040005,0x00000148,0x61726170,0x0000006d,0x00040005,0x00000159,0x676e6174,0x00746e65,
|
||||
0x00040005,0x00000166,0x6d726f6e,0x00006c61,0x00040005,0x0000017b,0x61726170,0x0000006d,
|
||||
0x00040005,0x0000017d,0x61726170,0x0000006d,0x00040005,0x0000017f,0x61726170,0x0000006d,
|
||||
0x00040005,0x00000181,0x61726170,0x0000006d,0x00040005,0x00000183,0x61726170,0x0000006d,
|
||||
0x00040005,0x00000185,0x61726170,0x0000006d,0x00040005,0x00000187,0x61726170,0x0000006d,
|
||||
0x00040005,0x00000189,0x61726170,0x0000006d,0x00040005,0x0000018b,0x61726170,0x0000006d,
|
||||
0x00040005,0x0000018d,0x61726170,0x0000006d,0x00040005,0x0000018f,0x61726170,0x0000006d,
|
||||
0x00040005,0x00000191,0x61726170,0x0000006d,0x00040005,0x00000193,0x6e617073,0x00000000,
|
||||
0x00060005,0x00000197,0x65676465,0x666e6f43,0x6e656469,0x00006563,0x00030005,0x0000019e,
|
||||
0x0000776e,0x00040005,0x000001a8,0x61726170,0x0000006d,0x00040005,0x000001a9,0x61726170,
|
||||
0x0000006d,0x00030005,0x000001ac,0x0000656e,0x00040005,0x000001b5,0x61726170,0x0000006d,
|
||||
0x00040005,0x000001b6,0x61726170,0x0000006d,0x00030005,0x000001b9,0x00007773,0x00040005,
|
||||
0x000001c2,0x61726170,0x0000006d,0x00040005,0x000001c3,0x61726170,0x0000006d,0x00030005,
|
||||
0x000001c6,0x00006573,0x00040005,0x000001ce,0x61726170,0x0000006d,0x00040005,0x000001cf,
|
||||
0x61726170,0x0000006d,0x00070005,0x000001d2,0x456e7572,0x6f70646e,0x50746e69,0x65747461,
|
||||
0x00006e72,0x00050005,0x000001db,0x736f7263,0x676e6973,0x00000041,0x00050005,0x000001ee,
|
||||
0x736f7263,0x676e6973,0x00000042,0x00070005,0x00000201,0x736f7263,0x676e6973,0x746e6f43,
|
||||
0x74736172,0x00000000,0x00060005,0x00000206,0x736f7263,0x676e6973,0x74746150,0x006e7265,
|
||||
0x00040005,0x0000020c,0x65676465,0x006e694d,0x00040005,0x00000214,0x65676465,0x0078614d,
|
||||
0x00060005,0x0000021c,0x65676465,0x69726156,0x6f697461,0x0000006e,0x00070005,0x00000234,
|
||||
0x616c6162,0x6465636e,0x736f7243,0x676e6973,0x00000000,0x00060005,0x00000244,0x70646e65,
|
||||
0x746e696f,0x74746150,0x006e7265,0x00060005,0x00000250,0x70646e65,0x746e696f,0x61657241,
|
||||
0x00000000,0x00050005,0x00000257,0x61657261,0x67696557,0x00007468,0x00070005,0x00000260,
|
||||
0x67616964,0x6c616e6f,0x746e6f43,0x74736172,0x00000000,0x00060005,0x00000298,0x6e726f63,
|
||||
0x61467265,0x726f7463,0x00000000,0x00050005,0x000002a2,0x65736162,0x67696557,0x00007468,
|
||||
0x00070005,0x000002aa,0x67616964,0x6c616e6f,0x65727453,0x6874676e,0x00000000,0x00060005,
|
||||
0x000002ae,0x67616964,0x6c616e6f,0x74746150,0x006e7265,0x00070005,0x000002b4,0x67616964,
|
||||
0x6c616e6f,0x746e6f43,0x69756e69,0x00007974,0x00080005,0x000002b7,0x726f6873,0x61694474,
|
||||
0x616e6f67,0x6c61466c,0x6361626c,0x0000006b,0x00070005,0x000002c6,0x67616964,0x6c616e6f,
|
||||
0x6c6c6146,0x6b636162,0x00000000,0x00040005,0x000002d6,0x67696577,0x00007468,0x00040047,
|
||||
0x00000034,0x00000021,0x00000000,0x00040047,0x00000034,0x00000022,0x00000000,0x00030047,
|
||||
0x00000085,0x00000002,0x00050048,0x00000085,0x00000000,0x00000023,0x00000000,0x00050048,
|
||||
0x00000085,0x00000001,0x00000023,0x00000010,0x00050048,0x00000085,0x00000002,0x00000023,
|
||||
0x00000018,0x00050048,0x00000085,0x00000003,0x00000023,0x0000001c,0x00040047,0x000000cb,
|
||||
0x0000001e,0x00000000,0x00040047,0x000000fd,0x0000001e,0x00000000,0x00020013,0x00000002,
|
||||
0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,
|
||||
0x00000006,0x00000002,0x00040020,0x00000008,0x00000007,0x00000007,0x00040017,0x00000009,
|
||||
0x00000006,0x00000004,0x00050021,0x0000000a,0x00000009,0x00000008,0x00000008,0x00050021,
|
||||
0x0000000f,0x00000006,0x00000008,0x00000008,0x00020014,0x00000018,0x00040020,0x00000019,
|
||||
0x00000007,0x00000018,0x00040020,0x0000001a,0x00000007,0x00000006,0x00090021,0x0000001b,
|
||||
0x00000006,0x00000008,0x00000008,0x00000008,0x00000019,0x0000001a,0x00000019,0x0004002b,
|
||||
0x00000006,0x00000027,0x3f000000,0x0004002b,0x00000006,0x00000029,0x3f800000,0x0005002c,
|
||||
0x00000007,0x0000002a,0x00000029,0x00000029,0x00040020,0x0000002f,0x00000007,0x00000009,
|
||||
0x00090019,0x00000031,0x00000006,0x00000001,0x00000000,0x00000000,0x00000000,0x00000001,
|
||||
0x00000000,0x0003001b,0x00000032,0x00000031,0x00040020,0x00000033,0x00000000,0x00000032,
|
||||
0x0004003b,0x00000033,0x00000034,0x00000000,0x0004002b,0x00000006,0x00000037,0x00000000,
|
||||
0x00040015,0x00000039,0x00000020,0x00000000,0x0004002b,0x00000039,0x0000003a,0x00000001,
|
||||
0x0004002b,0x00000039,0x00000045,0x00000003,0x0004002b,0x00000039,0x00000053,0x00000000,
|
||||
0x0004002b,0x00000039,0x00000061,0x00000002,0x00040015,0x0000006a,0x00000020,0x00000001,
|
||||
0x00040020,0x0000006b,0x00000007,0x0000006a,0x0004002b,0x0000006a,0x0000006d,0x00000001,
|
||||
0x0004002b,0x0000006a,0x00000074,0x00000006,0x0004002b,0x00000006,0x0000007d,0xbf800000,
|
||||
0x00040017,0x00000081,0x0000006a,0x00000002,0x00040020,0x00000082,0x00000007,0x00000081,
|
||||
0x0006001e,0x00000085,0x00000009,0x00000007,0x00000006,0x00000006,0x00040020,0x00000086,
|
||||
0x00000009,0x00000085,0x0004003b,0x00000086,0x00000087,0x00000009,0x00040020,0x00000088,
|
||||
0x00000009,0x00000007,0x0004002b,0x0000006a,0x00000093,0x00000000,0x0005002c,0x00000081,
|
||||
0x00000094,0x00000093,0x00000093,0x00040017,0x00000095,0x00000018,0x00000002,0x0004002b,
|
||||
0x00000006,0x000000b6,0x3f266666,0x00040020,0x000000ca,0x00000001,0x00000007,0x0004003b,
|
||||
0x000000ca,0x000000cb,0x00000001,0x0004002b,0x00000006,0x000000f2,0x3d3851ec,0x0004002b,
|
||||
0x00000006,0x000000f4,0x3df5c28f,0x00040020,0x000000fc,0x00000003,0x00000009,0x0004003b,
|
||||
0x000000fc,0x000000fd,0x00000003,0x0007002c,0x00000009,0x000000fe,0x00000037,0x00000027,
|
||||
0x00000027,0x00000037,0x0003002a,0x00000018,0x00000103,0x00030029,0x00000018,0x0000010a,
|
||||
0x0004002b,0x00000006,0x0000019a,0x40200000,0x0004002b,0x00000006,0x00000236,0x3c23d70a,
|
||||
0x0004002b,0x00000006,0x00000253,0x3d6147ae,0x0004002b,0x00000006,0x00000258,0x3ec28f5c,
|
||||
0x0004002b,0x00000006,0x0000025c,0x40800000,0x0004002b,0x00000006,0x00000299,0x3eb33333,
|
||||
0x0004002b,0x00000006,0x0000029c,0x40400000,0x0004002b,0x00000006,0x000002c7,0x3e23d70a,
|
||||
0x0004002b,0x00000006,0x000002da,0x3ed70a3d,0x00050036,0x00000002,0x00000004,0x00000000,
|
||||
0x00000003,0x000200f8,0x00000005,0x0004003b,0x00000008,0x000000c3,0x00000007,0x0004003b,
|
||||
0x00000008,0x000000c9,0x00000007,0x0004003b,0x0000002f,0x000000d3,0x00000007,0x0004003b,
|
||||
0x00000008,0x000000d4,0x00000007,0x0004003b,0x00000008,0x000000d6,0x00000007,0x0004003b,
|
||||
0x0000001a,0x000000d9,0x00000007,0x0004003b,0x0000001a,0x000000dc,0x00000007,0x0004003b,
|
||||
0x0000001a,0x000000df,0x00000007,0x0004003b,0x0000001a,0x000000e2,0x00000007,0x0004003b,
|
||||
0x0000001a,0x000000e5,0x00000007,0x0004003b,0x0000001a,0x000000e9,0x00000007,0x0004003b,
|
||||
0x0000001a,0x000000ed,0x00000007,0x0004003b,0x0000001a,0x000000f1,0x00000007,0x0004003b,
|
||||
0x0000001a,0x00000100,0x00000007,0x0004003b,0x0000001a,0x00000101,0x00000007,0x0004003b,
|
||||
0x00000019,0x00000102,0x00000007,0x0004003b,0x00000019,0x00000109,0x00000007,0x0004003b,
|
||||
0x0000001a,0x00000112,0x00000007,0x0004003b,0x00000008,0x00000116,0x00000007,0x0004003b,
|
||||
0x00000008,0x00000118,0x00000007,0x0004003b,0x00000008,0x0000011a,0x00000007,0x0004003b,
|
||||
0x00000019,0x0000011b,0x00000007,0x0004003b,0x0000001a,0x0000011c,0x00000007,0x0004003b,
|
||||
0x00000019,0x0000011e,0x00000007,0x0004003b,0x0000001a,0x00000120,0x00000007,0x0004003b,
|
||||
0x00000008,0x00000124,0x00000007,0x0004003b,0x00000008,0x00000126,0x00000007,0x0004003b,
|
||||
0x00000008,0x00000128,0x00000007,0x0004003b,0x00000019,0x00000129,0x00000007,0x0004003b,
|
||||
0x0000001a,0x0000012a,0x00000007,0x0004003b,0x00000019,0x0000012c,0x00000007,0x0004003b,
|
||||
0x0000001a,0x0000012e,0x00000007,0x0004003b,0x00000008,0x00000132,0x00000007,0x0004003b,
|
||||
0x00000008,0x00000134,0x00000007,0x0004003b,0x00000008,0x00000136,0x00000007,0x0004003b,
|
||||
0x00000019,0x00000137,0x00000007,0x0004003b,0x0000001a,0x00000138,0x00000007,0x0004003b,
|
||||
0x00000019,0x0000013a,0x00000007,0x0004003b,0x0000001a,0x0000013c,0x00000007,0x0004003b,
|
||||
0x00000008,0x00000140,0x00000007,0x0004003b,0x00000008,0x00000142,0x00000007,0x0004003b,
|
||||
0x00000008,0x00000144,0x00000007,0x0004003b,0x00000019,0x00000145,0x00000007,0x0004003b,
|
||||
0x0000001a,0x00000146,0x00000007,0x0004003b,0x00000019,0x00000148,0x00000007,0x0004003b,
|
||||
0x00000008,0x00000159,0x00000007,0x0004003b,0x00000008,0x0000015b,0x00000007,0x0004003b,
|
||||
0x00000008,0x00000166,0x00000007,0x0004003b,0x00000008,0x00000168,0x00000007,0x0004003b,
|
||||
0x00000008,0x0000017b,0x00000007,0x0004003b,0x00000008,0x0000017d,0x00000007,0x0004003b,
|
||||
0x00000008,0x0000017f,0x00000007,0x0004003b,0x00000019,0x00000181,0x00000007,0x0004003b,
|
||||
0x0000001a,0x00000183,0x00000007,0x0004003b,0x00000019,0x00000185,0x00000007,0x0004003b,
|
||||
0x00000008,0x00000187,0x00000007,0x0004003b,0x00000008,0x00000189,0x00000007,0x0004003b,
|
||||
0x00000008,0x0000018b,0x00000007,0x0004003b,0x00000019,0x0000018d,0x00000007,0x0004003b,
|
||||
0x0000001a,0x0000018f,0x00000007,0x0004003b,0x00000019,0x00000191,0x00000007,0x0004003b,
|
||||
0x0000001a,0x00000193,0x00000007,0x0004003b,0x0000001a,0x00000197,0x00000007,0x0004003b,
|
||||
0x0000002f,0x0000019e,0x00000007,0x0004003b,0x00000008,0x000001a8,0x00000007,0x0004003b,
|
||||
0x00000008,0x000001a9,0x00000007,0x0004003b,0x0000002f,0x000001ac,0x00000007,0x0004003b,
|
||||
0x00000008,0x000001b5,0x00000007,0x0004003b,0x00000008,0x000001b6,0x00000007,0x0004003b,
|
||||
0x0000002f,0x000001b9,0x00000007,0x0004003b,0x00000008,0x000001c2,0x00000007,0x0004003b,
|
||||
0x00000008,0x000001c3,0x00000007,0x0004003b,0x0000002f,0x000001c6,0x00000007,0x0004003b,
|
||||
0x00000008,0x000001ce,0x00000007,0x0004003b,0x00000008,0x000001cf,0x00000007,0x0004003b,
|
||||
0x0000001a,0x000001d2,0x00000007,0x0004003b,0x0000001a,0x000001db,0x00000007,0x0004003b,
|
||||
0x0000001a,0x000001dd,0x00000007,0x0004003b,0x0000001a,0x000001ee,0x00000007,0x0004003b,
|
||||
0x0000001a,0x000001f0,0x00000007,0x0004003b,0x0000001a,0x00000201,0x00000007,0x0004003b,
|
||||
0x0000001a,0x00000206,0x00000007,0x0004003b,0x0000002f,0x0000020c,0x00000007,0x0004003b,
|
||||
0x0000002f,0x00000214,0x00000007,0x0004003b,0x0000001a,0x0000021c,0x00000007,0x0004003b,
|
||||
0x0000001a,0x00000234,0x00000007,0x0004003b,0x0000001a,0x00000238,0x00000007,0x0004003b,
|
||||
0x0000001a,0x00000244,0x00000007,0x0004003b,0x0000001a,0x00000247,0x00000007,0x0004003b,
|
||||
0x0000001a,0x00000250,0x00000007,0x0004003b,0x0000001a,0x00000257,0x00000007,0x0004003b,
|
||||
0x0000001a,0x00000260,0x00000007,0x0004003b,0x0000001a,0x00000298,0x00000007,0x0004003b,
|
||||
0x0000001a,0x000002a2,0x00000007,0x0004003b,0x0000001a,0x000002aa,0x00000007,0x0004003b,
|
||||
0x0000001a,0x000002ae,0x00000007,0x0004003b,0x0000001a,0x000002b4,0x00000007,0x0004003b,
|
||||
0x0000001a,0x000002b7,0x00000007,0x0004003b,0x0000001a,0x000002c6,0x00000007,0x0004003b,
|
||||
0x0000001a,0x000002d6,0x00000007,0x00050041,0x00000088,0x000000c4,0x00000087,0x0000006d,
|
||||
0x0004003d,0x00000007,0x000000c5,0x000000c4,0x0007000c,0x00000007,0x000000c6,0x00000001,
|
||||
0x00000028,0x000000c5,0x0000002a,0x00050050,0x00000007,0x000000c7,0x00000029,0x00000029,
|
||||
0x00050088,0x00000007,0x000000c8,0x000000c7,0x000000c6,0x0003003e,0x000000c3,0x000000c8,
|
||||
0x0004003d,0x00000007,0x000000cc,0x000000cb,0x0004003d,0x00000007,0x000000cd,0x000000c3,
|
||||
0x0005008e,0x00000007,0x000000ce,0x000000cd,0x00000027,0x0004003d,0x00000007,0x000000cf,
|
||||
0x000000c3,0x0005008e,0x00000007,0x000000d0,0x000000cf,0x00000027,0x00050083,0x00000007,
|
||||
0x000000d1,0x0000002a,0x000000d0,0x0008000c,0x00000007,0x000000d2,0x00000001,0x0000002b,
|
||||
0x000000cc,0x000000ce,0x000000d1,0x0003003e,0x000000c9,0x000000d2,0x0004003d,0x00000007,
|
||||
0x000000d5,0x000000c9,0x0003003e,0x000000d4,0x000000d5,0x0004003d,0x00000007,0x000000d7,
|
||||
0x000000c3,0x0003003e,0x000000d6,0x000000d7,0x00060039,0x00000009,0x000000d8,0x0000000d,
|
||||
0x000000d4,0x000000d6,0x0003003e,0x000000d3,0x000000d8,0x00050041,0x0000001a,0x000000da,
|
||||
0x000000d3,0x00000053,0x0004003d,0x00000006,0x000000db,0x000000da,0x0003003e,0x000000d9,
|
||||
0x000000db,0x00050041,0x0000001a,0x000000dd,0x000000d3,0x0000003a,0x0004003d,0x00000006,
|
||||
0x000000de,0x000000dd,0x0003003e,0x000000dc,0x000000de,0x00050041,0x0000001a,0x000000e0,
|
||||
0x000000d3,0x00000061,0x0004003d,0x00000006,0x000000e1,0x000000e0,0x0003003e,0x000000df,
|
||||
0x000000e1,0x00050041,0x0000001a,0x000000e3,0x000000d3,0x00000045,0x0004003d,0x00000006,
|
||||
0x000000e4,0x000000e3,0x0003003e,0x000000e2,0x000000e4,0x0004003d,0x00000006,0x000000e6,
|
||||
0x000000d9,0x0004003d,0x00000006,0x000000e7,0x000000dc,0x0007000c,0x00000006,0x000000e8,
|
||||
0x00000001,0x00000028,0x000000e6,0x000000e7,0x0003003e,0x000000e5,0x000000e8,0x0004003d,
|
||||
0x00000006,0x000000ea,0x000000df,0x0004003d,0x00000006,0x000000eb,0x000000e2,0x0007000c,
|
||||
0x00000006,0x000000ec,0x00000001,0x00000028,0x000000ea,0x000000eb,0x0003003e,0x000000e9,
|
||||
0x000000ec,0x0004003d,0x00000006,0x000000ee,0x000000e5,0x0004003d,0x00000006,0x000000ef,
|
||||
0x000000e9,0x0007000c,0x00000006,0x000000f0,0x00000001,0x00000028,0x000000ee,0x000000ef,
|
||||
0x0003003e,0x000000ed,0x000000f0,0x0004003d,0x00000006,0x000000f3,0x000000ed,0x00050085,
|
||||
0x00000006,0x000000f5,0x000000f3,0x000000f4,0x0007000c,0x00000006,0x000000f6,0x00000001,
|
||||
0x00000028,0x000000f2,0x000000f5,0x0003003e,0x000000f1,0x000000f6,0x0004003d,0x00000006,
|
||||
0x000000f7,0x000000ed,0x0004003d,0x00000006,0x000000f8,0x000000f1,0x000500bc,0x00000018,
|
||||
0x000000f9,0x000000f7,0x000000f8,0x000300f7,0x000000fb,0x00000000,0x000400fa,0x000000f9,
|
||||
0x000000fa,0x000000fb,0x000200f8,0x000000fa,0x0003003e,0x000000fd,0x000000fe,0x000100fd,
|
||||
0x000200f8,0x000000fb,0x0003003e,0x00000100,0x00000037,0x0003003e,0x00000101,0x00000037,
|
||||
0x0003003e,0x00000102,0x00000103,0x0004003d,0x00000006,0x00000104,0x000000e5,0x0004003d,
|
||||
0x00000006,0x00000105,0x000000e9,0x000500ba,0x00000018,0x00000106,0x00000104,0x00000105,
|
||||
0x000300f7,0x00000108,0x00000000,0x000400fa,0x00000106,0x00000107,0x0000010b,0x000200f8,
|
||||
0x00000107,0x0003003e,0x00000109,0x0000010a,0x000200f9,0x00000108,0x000200f8,0x0000010b,
|
||||
0x0004003d,0x00000006,0x0000010c,0x000000e9,0x0004003d,0x00000006,0x0000010d,0x000000e5,
|
||||
0x000500ba,0x00000018,0x0000010e,0x0000010c,0x0000010d,0x000300f7,0x00000110,0x00000000,
|
||||
0x000400fa,0x0000010e,0x0000010f,0x00000111,0x000200f8,0x0000010f,0x0003003e,0x00000109,
|
||||
0x00000103,0x000200f9,0x00000110,0x000200f8,0x00000111,0x00050041,0x0000001a,0x00000113,
|
||||
0x000000c3,0x0000003a,0x0004003d,0x00000006,0x00000114,0x00000113,0x00050050,0x00000007,
|
||||
0x00000115,0x00000037,0x00000114,0x0004003d,0x00000007,0x00000117,0x000000c9,0x0003003e,
|
||||
0x00000116,0x00000117,0x0004003d,0x00000007,0x00000119,0x000000c3,0x0003003e,0x00000118,
|
||||
0x00000119,0x0003003e,0x0000011a,0x00000115,0x0003003e,0x0000011b,0x0000010a,0x0004003d,
|
||||
0x00000006,0x0000011d,0x000000f1,0x0003003e,0x0000011c,0x0000011d,0x0003003e,0x0000011e,
|
||||
0x00000103,0x000a0039,0x00000006,0x0000011f,0x00000022,0x00000116,0x00000118,0x0000011a,
|
||||
0x0000011b,0x0000011c,0x0000011e,0x0003003e,0x00000112,0x0000011f,0x00050041,0x0000001a,
|
||||
0x00000121,0x000000c3,0x0000003a,0x0004003d,0x00000006,0x00000122,0x00000121,0x00050050,
|
||||
0x00000007,0x00000123,0x00000037,0x00000122,0x0004003d,0x00000007,0x00000125,0x000000c9,
|
||||
0x0003003e,0x00000124,0x00000125,0x0004003d,0x00000007,0x00000127,0x000000c3,0x0003003e,
|
||||
0x00000126,0x00000127,0x0003003e,0x00000128,0x00000123,0x0003003e,0x00000129,0x0000010a,
|
||||
0x0004003d,0x00000006,0x0000012b,0x000000f1,0x0003003e,0x0000012a,0x0000012b,0x0003003e,
|
||||
0x0000012c,0x0000010a,0x000a0039,0x00000006,0x0000012d,0x00000022,0x00000124,0x00000126,
|
||||
0x00000128,0x00000129,0x0000012a,0x0000012c,0x0003003e,0x00000120,0x0000012d,0x00050041,
|
||||
0x0000001a,0x0000012f,0x000000c3,0x00000053,0x0004003d,0x00000006,0x00000130,0x0000012f,
|
||||
0x00050050,0x00000007,0x00000131,0x00000130,0x00000037,0x0004003d,0x00000007,0x00000133,
|
||||
0x000000c9,0x0003003e,0x00000132,0x00000133,0x0004003d,0x00000007,0x00000135,0x000000c3,
|
||||
0x0003003e,0x00000134,0x00000135,0x0003003e,0x00000136,0x00000131,0x0003003e,0x00000137,
|
||||
0x00000103,0x0004003d,0x00000006,0x00000139,0x000000f1,0x0003003e,0x00000138,0x00000139,
|
||||
0x0003003e,0x0000013a,0x00000103,0x000a0039,0x00000006,0x0000013b,0x00000022,0x00000132,
|
||||
0x00000134,0x00000136,0x00000137,0x00000138,0x0000013a,0x0003003e,0x0000012e,0x0000013b,
|
||||
0x00050041,0x0000001a,0x0000013d,0x000000c3,0x00000053,0x0004003d,0x00000006,0x0000013e,
|
||||
0x0000013d,0x00050050,0x00000007,0x0000013f,0x0000013e,0x00000037,0x0004003d,0x00000007,
|
||||
0x00000141,0x000000c9,0x0003003e,0x00000140,0x00000141,0x0004003d,0x00000007,0x00000143,
|
||||
0x000000c3,0x0003003e,0x00000142,0x00000143,0x0003003e,0x00000144,0x0000013f,0x0003003e,
|
||||
0x00000145,0x00000103,0x0004003d,0x00000006,0x00000147,0x000000f1,0x0003003e,0x00000146,
|
||||
0x00000147,0x0003003e,0x00000148,0x0000010a,0x000a0039,0x00000006,0x00000149,0x00000022,
|
||||
0x00000140,0x00000142,0x00000144,0x00000145,0x00000146,0x00000148,0x0003003e,0x0000013c,
|
||||
0x00000149,0x0004003d,0x00000006,0x0000014a,0x00000112,0x0004003d,0x00000006,0x0000014b,
|
||||
0x00000120,0x00050081,0x00000006,0x0000014c,0x0000014a,0x0000014b,0x0004003d,0x00000006,
|
||||
0x0000014d,0x0000012e,0x0004003d,0x00000006,0x0000014e,0x0000013c,0x00050081,0x00000006,
|
||||
0x0000014f,0x0000014d,0x0000014e,0x000500be,0x00000018,0x00000150,0x0000014c,0x0000014f,
|
||||
0x0003003e,0x00000109,0x00000150,0x0004003d,0x00000018,0x00000151,0x00000109,0x0004003d,
|
||||
0x00000006,0x00000152,0x00000112,0x0004003d,0x00000006,0x00000153,0x0000012e,0x000600a9,
|
||||
0x00000006,0x00000154,0x00000151,0x00000152,0x00000153,0x0003003e,0x00000100,0x00000154,
|
||||
0x0004003d,0x00000018,0x00000155,0x00000109,0x0004003d,0x00000006,0x00000156,0x00000120,
|
||||
0x0004003d,0x00000006,0x00000157,0x0000013c,0x000600a9,0x00000006,0x00000158,0x00000155,
|
||||
0x00000156,0x00000157,0x0003003e,0x00000101,0x00000158,0x0003003e,0x00000102,0x0000010a,
|
||||
0x000200f9,0x00000110,0x000200f8,0x00000110,0x000200f9,0x00000108,0x000200f8,0x00000108,
|
||||
0x0004003d,0x00000018,0x0000015a,0x00000109,0x000300f7,0x0000015d,0x00000000,0x000400fa,
|
||||
0x0000015a,0x0000015c,0x00000161,0x000200f8,0x0000015c,0x00050041,0x0000001a,0x0000015e,
|
||||
0x000000c3,0x0000003a,0x0004003d,0x00000006,0x0000015f,0x0000015e,0x00050050,0x00000007,
|
||||
0x00000160,0x00000037,0x0000015f,0x0003003e,0x0000015b,0x00000160,0x000200f9,0x0000015d,
|
||||
0x000200f8,0x00000161,0x00050041,0x0000001a,0x00000162,0x000000c3,0x00000053,0x0004003d,
|
||||
0x00000006,0x00000163,0x00000162,0x00050050,0x00000007,0x00000164,0x00000163,0x00000037,
|
||||
0x0003003e,0x0000015b,0x00000164,0x000200f9,0x0000015d,0x000200f8,0x0000015d,0x0004003d,
|
||||
0x00000007,0x00000165,0x0000015b,0x0003003e,0x00000159,0x00000165,0x0004003d,0x00000018,
|
||||
0x00000167,0x00000109,0x000300f7,0x0000016a,0x00000000,0x000400fa,0x00000167,0x00000169,
|
||||
0x00000170,0x000200f8,0x00000169,0x0004003d,0x00000006,0x0000016b,0x000000d9,0x0004003d,
|
||||
0x00000006,0x0000016c,0x000000dc,0x000500be,0x00000018,0x0000016d,0x0000016b,0x0000016c,
|
||||
0x000600a9,0x00000006,0x0000016e,0x0000016d,0x0000007d,0x00000029,0x00050050,0x00000007,
|
||||
0x0000016f,0x0000016e,0x00000037,0x0003003e,0x00000168,0x0000016f,0x000200f9,0x0000016a,
|
||||
0x000200f8,0x00000170,0x0004003d,0x00000006,0x00000171,0x000000df,0x0004003d,0x00000006,
|
||||
0x00000172,0x000000e2,0x000500be,0x00000018,0x00000173,0x00000171,0x00000172,0x000600a9,
|
||||
0x00000006,0x00000174,0x00000173,0x0000007d,0x00000029,0x00050050,0x00000007,0x00000175,
|
||||
0x00000037,0x00000174,0x0003003e,0x00000168,0x00000175,0x000200f9,0x0000016a,0x000200f8,
|
||||
0x0000016a,0x0004003d,0x00000007,0x00000176,0x00000168,0x0003003e,0x00000166,0x00000176,
|
||||
0x0004003d,0x00000018,0x00000177,0x00000102,0x000400a8,0x00000018,0x00000178,0x00000177,
|
||||
0x000300f7,0x0000017a,0x00000000,0x000400fa,0x00000178,0x00000179,0x0000017a,0x000200f8,
|
||||
0x00000179,0x0004003d,0x00000007,0x0000017c,0x000000c9,0x0003003e,0x0000017b,0x0000017c,
|
||||
0x0004003d,0x00000007,0x0000017e,0x000000c3,0x0003003e,0x0000017d,0x0000017e,0x0004003d,
|
||||
0x00000007,0x00000180,0x00000159,0x0003003e,0x0000017f,0x00000180,0x0004003d,0x00000018,
|
||||
0x00000182,0x00000109,0x0003003e,0x00000181,0x00000182,0x0004003d,0x00000006,0x00000184,
|
||||
0x000000f1,0x0003003e,0x00000183,0x00000184,0x0003003e,0x00000185,0x00000103,0x000a0039,
|
||||
0x00000006,0x00000186,0x00000022,0x0000017b,0x0000017d,0x0000017f,0x00000181,0x00000183,
|
||||
0x00000185,0x0003003e,0x00000100,0x00000186,0x0004003d,0x00000007,0x00000188,0x000000c9,
|
||||
0x0003003e,0x00000187,0x00000188,0x0004003d,0x00000007,0x0000018a,0x000000c3,0x0003003e,
|
||||
0x00000189,0x0000018a,0x0004003d,0x00000007,0x0000018c,0x00000159,0x0003003e,0x0000018b,
|
||||
0x0000018c,0x0004003d,0x00000018,0x0000018e,0x00000109,0x0003003e,0x0000018d,0x0000018e,
|
||||
0x0004003d,0x00000006,0x00000190,0x000000f1,0x0003003e,0x0000018f,0x00000190,0x0003003e,
|
||||
0x00000191,0x0000010a,0x000a0039,0x00000006,0x00000192,0x00000022,0x00000187,0x00000189,
|
||||
0x0000018b,0x0000018d,0x0000018f,0x00000191,0x0003003e,0x00000101,0x00000192,0x000200f9,
|
||||
0x0000017a,0x000200f8,0x0000017a,0x0004003d,0x00000006,0x00000194,0x00000100,0x0004003d,
|
||||
0x00000006,0x00000195,0x00000101,0x00050081,0x00000006,0x00000196,0x00000194,0x00000195,
|
||||
0x0003003e,0x00000193,0x00000196,0x0004003d,0x00000006,0x00000198,0x000000f1,0x0004003d,
|
||||
0x00000006,0x00000199,0x000000f1,0x00050085,0x00000006,0x0000019b,0x00000199,0x0000019a,
|
||||
0x0004003d,0x00000006,0x0000019c,0x000000ed,0x0008000c,0x00000006,0x0000019d,0x00000001,
|
||||
0x00000031,0x00000198,0x0000019b,0x0000019c,0x0003003e,0x00000197,0x0000019d,0x0004003d,
|
||||
0x00000007,0x0000019f,0x000000c9,0x00050041,0x0000001a,0x000001a0,0x000000c3,0x00000053,
|
||||
0x0004003d,0x00000006,0x000001a1,0x000001a0,0x0004007f,0x00000006,0x000001a2,0x000001a1,
|
||||
0x00050041,0x0000001a,0x000001a3,0x000000c3,0x0000003a,0x0004003d,0x00000006,0x000001a4,
|
||||
0x000001a3,0x0004007f,0x00000006,0x000001a5,0x000001a4,0x00050050,0x00000007,0x000001a6,
|
||||
0x000001a2,0x000001a5,0x00050081,0x00000007,0x000001a7,0x0000019f,0x000001a6,0x0003003e,
|
||||
0x000001a8,0x000001a7,0x0004003d,0x00000007,0x000001aa,0x000000c3,0x0003003e,0x000001a9,
|
||||
0x000001aa,0x00060039,0x00000009,0x000001ab,0x0000000d,0x000001a8,0x000001a9,0x0003003e,
|
||||
0x0000019e,0x000001ab,0x0004003d,0x00000007,0x000001ad,0x000000c9,0x00050041,0x0000001a,
|
||||
0x000001ae,0x000000c3,0x00000053,0x0004003d,0x00000006,0x000001af,0x000001ae,0x00050041,
|
||||
0x0000001a,0x000001b0,0x000000c3,0x0000003a,0x0004003d,0x00000006,0x000001b1,0x000001b0,
|
||||
0x0004007f,0x00000006,0x000001b2,0x000001b1,0x00050050,0x00000007,0x000001b3,0x000001af,
|
||||
0x000001b2,0x00050081,0x00000007,0x000001b4,0x000001ad,0x000001b3,0x0003003e,0x000001b5,
|
||||
0x000001b4,0x0004003d,0x00000007,0x000001b7,0x000000c3,0x0003003e,0x000001b6,0x000001b7,
|
||||
0x00060039,0x00000009,0x000001b8,0x0000000d,0x000001b5,0x000001b6,0x0003003e,0x000001ac,
|
||||
0x000001b8,0x0004003d,0x00000007,0x000001ba,0x000000c9,0x00050041,0x0000001a,0x000001bb,
|
||||
0x000000c3,0x00000053,0x0004003d,0x00000006,0x000001bc,0x000001bb,0x0004007f,0x00000006,
|
||||
0x000001bd,0x000001bc,0x00050041,0x0000001a,0x000001be,0x000000c3,0x0000003a,0x0004003d,
|
||||
0x00000006,0x000001bf,0x000001be,0x00050050,0x00000007,0x000001c0,0x000001bd,0x000001bf,
|
||||
0x00050081,0x00000007,0x000001c1,0x000001ba,0x000001c0,0x0003003e,0x000001c2,0x000001c1,
|
||||
0x0004003d,0x00000007,0x000001c4,0x000000c3,0x0003003e,0x000001c3,0x000001c4,0x00060039,
|
||||
0x00000009,0x000001c5,0x0000000d,0x000001c2,0x000001c3,0x0003003e,0x000001b9,0x000001c5,
|
||||
0x0004003d,0x00000007,0x000001c7,0x000000c9,0x00050041,0x0000001a,0x000001c8,0x000000c3,
|
||||
0x00000053,0x0004003d,0x00000006,0x000001c9,0x000001c8,0x00050041,0x0000001a,0x000001ca,
|
||||
0x000000c3,0x0000003a,0x0004003d,0x00000006,0x000001cb,0x000001ca,0x00050050,0x00000007,
|
||||
0x000001cc,0x000001c9,0x000001cb,0x00050081,0x00000007,0x000001cd,0x000001c7,0x000001cc,
|
||||
0x0003003e,0x000001ce,0x000001cd,0x0004003d,0x00000007,0x000001d0,0x000000c3,0x0003003e,
|
||||
0x000001cf,0x000001d0,0x00060039,0x00000009,0x000001d1,0x0000000d,0x000001ce,0x000001cf,
|
||||
0x0003003e,0x000001c6,0x000001d1,0x0004003d,0x00000006,0x000001d3,0x00000100,0x0004003d,
|
||||
0x00000006,0x000001d4,0x00000101,0x00050083,0x00000006,0x000001d5,0x000001d3,0x000001d4,
|
||||
0x0006000c,0x00000006,0x000001d6,0x00000001,0x00000004,0x000001d5,0x0004003d,0x00000006,
|
||||
0x000001d7,0x00000193,0x0007000c,0x00000006,0x000001d8,0x00000001,0x00000028,0x000001d7,
|
||||
0x00000029,0x00050088,0x00000006,0x000001d9,0x000001d6,0x000001d8,0x0008000c,0x00000006,
|
||||
0x000001da,0x00000001,0x0000002b,0x000001d9,0x00000037,0x00000029,0x0003003e,0x000001d2,
|
||||
0x000001da,0x0004003d,0x00000018,0x000001dc,0x00000109,0x000300f7,0x000001df,0x00000000,
|
||||
0x000400fa,0x000001dc,0x000001de,0x000001e6,0x000200f8,0x000001de,0x00050041,0x0000001a,
|
||||
0x000001e0,0x0000019e,0x00000045,0x0004003d,0x00000006,0x000001e1,0x000001e0,0x00050041,
|
||||
0x0000001a,0x000001e2,0x000001ac,0x00000045,0x0004003d,0x00000006,0x000001e3,0x000001e2,
|
||||
0x00050083,0x00000006,0x000001e4,0x000001e1,0x000001e3,0x0006000c,0x00000006,0x000001e5,
|
||||
0x00000001,0x00000004,0x000001e4,0x0003003e,0x000001dd,0x000001e5,0x000200f9,0x000001df,
|
||||
0x000200f8,0x000001e6,0x00050041,0x0000001a,0x000001e7,0x0000019e,0x0000003a,0x0004003d,
|
||||
0x00000006,0x000001e8,0x000001e7,0x00050041,0x0000001a,0x000001e9,0x000001b9,0x0000003a,
|
||||
0x0004003d,0x00000006,0x000001ea,0x000001e9,0x00050083,0x00000006,0x000001eb,0x000001e8,
|
||||
0x000001ea,0x0006000c,0x00000006,0x000001ec,0x00000001,0x00000004,0x000001eb,0x0003003e,
|
||||
0x000001dd,0x000001ec,0x000200f9,0x000001df,0x000200f8,0x000001df,0x0004003d,0x00000006,
|
||||
0x000001ed,0x000001dd,0x0003003e,0x000001db,0x000001ed,0x0004003d,0x00000018,0x000001ef,
|
||||
0x00000109,0x000300f7,0x000001f2,0x00000000,0x000400fa,0x000001ef,0x000001f1,0x000001f9,
|
||||
0x000200f8,0x000001f1,0x00050041,0x0000001a,0x000001f3,0x000001b9,0x00000061,0x0004003d,
|
||||
0x00000006,0x000001f4,0x000001f3,0x00050041,0x0000001a,0x000001f5,0x000001c6,0x00000061,
|
||||
0x0004003d,0x00000006,0x000001f6,0x000001f5,0x00050083,0x00000006,0x000001f7,0x000001f4,
|
||||
0x000001f6,0x0006000c,0x00000006,0x000001f8,0x00000001,0x00000004,0x000001f7,0x0003003e,
|
||||
0x000001f0,0x000001f8,0x000200f9,0x000001f2,0x000200f8,0x000001f9,0x00050041,0x0000001a,
|
||||
0x000001fa,0x000001ac,0x00000053,0x0004003d,0x00000006,0x000001fb,0x000001fa,0x00050041,
|
||||
0x0000001a,0x000001fc,0x000001c6,0x00000053,0x0004003d,0x00000006,0x000001fd,0x000001fc,
|
||||
0x00050083,0x00000006,0x000001fe,0x000001fb,0x000001fd,0x0006000c,0x00000006,0x000001ff,
|
||||
0x00000001,0x00000004,0x000001fe,0x0003003e,0x000001f0,0x000001ff,0x000200f9,0x000001f2,
|
||||
0x000200f8,0x000001f2,0x0004003d,0x00000006,0x00000200,0x000001f0,0x0003003e,0x000001ee,
|
||||
0x00000200,0x0004003d,0x00000006,0x00000202,0x000001db,0x0004003d,0x00000006,0x00000203,
|
||||
0x000001ee,0x00050083,0x00000006,0x00000204,0x00000202,0x00000203,0x0006000c,0x00000006,
|
||||
0x00000205,0x00000001,0x00000004,0x00000204,0x0003003e,0x00000201,0x00000205,0x0004003d,
|
||||
0x00000006,0x00000207,0x000000f1,0x0004003d,0x00000006,0x00000208,0x000000f1,0x00050085,
|
||||
0x00000006,0x00000209,0x00000208,0x0000019a,0x0004003d,0x00000006,0x0000020a,0x00000201,
|
||||
0x0008000c,0x00000006,0x0000020b,0x00000001,0x00000031,0x00000207,0x00000209,0x0000020a,
|
||||
0x0003003e,0x00000206,0x0000020b,0x0004003d,0x00000009,0x0000020d,0x0000019e,0x0004003d,
|
||||
0x00000009,0x0000020e,0x000001ac,0x0007000c,0x00000009,0x0000020f,0x00000001,0x00000025,
|
||||
0x0000020d,0x0000020e,0x0004003d,0x00000009,0x00000210,0x000001b9,0x0004003d,0x00000009,
|
||||
0x00000211,0x000001c6,0x0007000c,0x00000009,0x00000212,0x00000001,0x00000025,0x00000210,
|
||||
0x00000211,0x0007000c,0x00000009,0x00000213,0x00000001,0x00000025,0x0000020f,0x00000212,
|
||||
0x0003003e,0x0000020c,0x00000213,0x0004003d,0x00000009,0x00000215,0x0000019e,0x0004003d,
|
||||
0x00000009,0x00000216,0x000001ac,0x0007000c,0x00000009,0x00000217,0x00000001,0x00000028,
|
||||
0x00000215,0x00000216,0x0004003d,0x00000009,0x00000218,0x000001b9,0x0004003d,0x00000009,
|
||||
0x00000219,0x000001c6,0x0007000c,0x00000009,0x0000021a,0x00000001,0x00000028,0x00000218,
|
||||
0x00000219,0x0007000c,0x00000009,0x0000021b,0x00000001,0x00000028,0x00000217,0x0000021a,
|
||||
0x0003003e,0x00000214,0x0000021b,0x00050041,0x0000001a,0x0000021d,0x00000214,0x00000053,
|
||||
0x0004003d,0x00000006,0x0000021e,0x0000021d,0x00050041,0x0000001a,0x0000021f,0x0000020c,
|
||||
0x00000053,0x0004003d,0x00000006,0x00000220,0x0000021f,0x00050083,0x00000006,0x00000221,
|
||||
0x0000021e,0x00000220,0x00050041,0x0000001a,0x00000222,0x00000214,0x0000003a,0x0004003d,
|
||||
0x00000006,0x00000223,0x00000222,0x00050041,0x0000001a,0x00000224,0x0000020c,0x0000003a,
|
||||
0x0004003d,0x00000006,0x00000225,0x00000224,0x00050083,0x00000006,0x00000226,0x00000223,
|
||||
0x00000225,0x0007000c,0x00000006,0x00000227,0x00000001,0x00000028,0x00000221,0x00000226,
|
||||
0x00050041,0x0000001a,0x00000228,0x00000214,0x00000061,0x0004003d,0x00000006,0x00000229,
|
||||
0x00000228,0x00050041,0x0000001a,0x0000022a,0x0000020c,0x00000061,0x0004003d,0x00000006,
|
||||
0x0000022b,0x0000022a,0x00050083,0x00000006,0x0000022c,0x00000229,0x0000022b,0x00050041,
|
||||
0x0000001a,0x0000022d,0x00000214,0x00000045,0x0004003d,0x00000006,0x0000022e,0x0000022d,
|
||||
0x00050041,0x0000001a,0x0000022f,0x0000020c,0x00000045,0x0004003d,0x00000006,0x00000230,
|
||||
0x0000022f,0x00050083,0x00000006,0x00000231,0x0000022e,0x00000230,0x0007000c,0x00000006,
|
||||
0x00000232,0x00000001,0x00000028,0x0000022c,0x00000231,0x0007000c,0x00000006,0x00000233,
|
||||
0x00000001,0x00000028,0x00000227,0x00000232,0x0003003e,0x0000021c,0x00000233,0x0004003d,
|
||||
0x00000006,0x00000235,0x0000021c,0x000500ba,0x00000018,0x00000237,0x00000235,0x00000236,
|
||||
0x000300f7,0x0000023a,0x00000000,0x000400fa,0x00000237,0x00000239,0x00000242,0x000200f8,
|
||||
0x00000239,0x0004003d,0x00000006,0x0000023b,0x000000f1,0x0004003d,0x00000006,0x0000023c,
|
||||
0x000000f1,0x00050085,0x00000006,0x0000023d,0x0000023c,0x0000019a,0x0004003d,0x00000006,
|
||||
0x0000023e,0x000001db,0x0004003d,0x00000006,0x0000023f,0x000001ee,0x0007000c,0x00000006,
|
||||
0x00000240,0x00000001,0x00000025,0x0000023e,0x0000023f,0x0008000c,0x00000006,0x00000241,
|
||||
0x00000001,0x00000031,0x0000023b,0x0000023d,0x00000240,0x0003003e,0x00000238,0x00000241,
|
||||
0x000200f9,0x0000023a,0x000200f8,0x00000242,0x0003003e,0x00000238,0x00000037,0x000200f9,
|
||||
0x0000023a,0x000200f8,0x0000023a,0x0004003d,0x00000006,0x00000243,0x00000238,0x0003003e,
|
||||
0x00000234,0x00000243,0x0004003d,0x00000006,0x00000245,0x000001d2,0x000500ba,0x00000018,
|
||||
0x00000246,0x00000245,0x00000236,0x000300f7,0x00000249,0x00000000,0x000400fa,0x00000246,
|
||||
0x00000248,0x0000024d,0x000200f8,0x00000248,0x0004003d,0x00000006,0x0000024a,0x000001d2,
|
||||
0x0004003d,0x00000006,0x0000024b,0x00000234,0x0007000c,0x00000006,0x0000024c,0x00000001,
|
||||
0x00000028,0x0000024a,0x0000024b,0x0003003e,0x00000247,0x0000024c,0x000200f9,0x00000249,
|
||||
0x000200f8,0x0000024d,0x0004003d,0x00000006,0x0000024e,0x000001d2,0x0003003e,0x00000247,
|
||||
0x0000024e,0x000200f9,0x00000249,0x000200f8,0x00000249,0x0004003d,0x00000006,0x0000024f,
|
||||
0x00000247,0x0003003e,0x00000244,0x0000024f,0x0004003d,0x00000006,0x00000251,0x00000244,
|
||||
0x0004003d,0x00000006,0x00000252,0x00000193,0x00050085,0x00000006,0x00000254,0x00000252,
|
||||
0x00000253,0x00050081,0x00000006,0x00000255,0x00000029,0x00000254,0x00050088,0x00000006,
|
||||
0x00000256,0x00000251,0x00000255,0x0003003e,0x00000250,0x00000256,0x0004003d,0x00000006,
|
||||
0x00000259,0x00000206,0x00050085,0x00000006,0x0000025a,0x00000258,0x00000259,0x0004003d,
|
||||
0x00000006,0x0000025b,0x00000193,0x00050088,0x00000006,0x0000025d,0x0000025b,0x0000025c,
|
||||
0x0008000c,0x00000006,0x0000025e,0x00000001,0x0000002b,0x0000025d,0x00000037,0x00000029,
|
||||
0x00050085,0x00000006,0x0000025f,0x0000025a,0x0000025e,0x0003003e,0x00000257,0x0000025f,
|
||||
0x00050041,0x0000001a,0x00000261,0x0000019e,0x00000053,0x0004003d,0x00000006,0x00000262,
|
||||
0x00000261,0x00050041,0x0000001a,0x00000263,0x000001c6,0x00000053,0x0004003d,0x00000006,
|
||||
0x00000264,0x00000263,0x00050083,0x00000006,0x00000265,0x00000262,0x00000264,0x0006000c,
|
||||
0x00000006,0x00000266,0x00000001,0x00000004,0x00000265,0x00050041,0x0000001a,0x00000267,
|
||||
0x0000019e,0x0000003a,0x0004003d,0x00000006,0x00000268,0x00000267,0x00050041,0x0000001a,
|
||||
0x00000269,0x000001c6,0x0000003a,0x0004003d,0x00000006,0x0000026a,0x00000269,0x00050083,
|
||||
0x00000006,0x0000026b,0x00000268,0x0000026a,0x0006000c,0x00000006,0x0000026c,0x00000001,
|
||||
0x00000004,0x0000026b,0x0007000c,0x00000006,0x0000026d,0x00000001,0x00000028,0x00000266,
|
||||
0x0000026c,0x00050041,0x0000001a,0x0000026e,0x0000019e,0x00000061,0x0004003d,0x00000006,
|
||||
0x0000026f,0x0000026e,0x00050041,0x0000001a,0x00000270,0x000001c6,0x00000061,0x0004003d,
|
||||
0x00000006,0x00000271,0x00000270,0x00050083,0x00000006,0x00000272,0x0000026f,0x00000271,
|
||||
0x0006000c,0x00000006,0x00000273,0x00000001,0x00000004,0x00000272,0x00050041,0x0000001a,
|
||||
0x00000274,0x0000019e,0x00000045,0x0004003d,0x00000006,0x00000275,0x00000274,0x00050041,
|
||||
0x0000001a,0x00000276,0x000001c6,0x00000045,0x0004003d,0x00000006,0x00000277,0x00000276,
|
||||
0x00050083,0x00000006,0x00000278,0x00000275,0x00000277,0x0006000c,0x00000006,0x00000279,
|
||||
0x00000001,0x00000004,0x00000278,0x0007000c,0x00000006,0x0000027a,0x00000001,0x00000028,
|
||||
0x00000273,0x00000279,0x0007000c,0x00000006,0x0000027b,0x00000001,0x00000028,0x0000026d,
|
||||
0x0000027a,0x00050041,0x0000001a,0x0000027c,0x000001ac,0x00000053,0x0004003d,0x00000006,
|
||||
0x0000027d,0x0000027c,0x00050041,0x0000001a,0x0000027e,0x000001b9,0x00000053,0x0004003d,
|
||||
0x00000006,0x0000027f,0x0000027e,0x00050083,0x00000006,0x00000280,0x0000027d,0x0000027f,
|
||||
0x0006000c,0x00000006,0x00000281,0x00000001,0x00000004,0x00000280,0x00050041,0x0000001a,
|
||||
0x00000282,0x000001ac,0x0000003a,0x0004003d,0x00000006,0x00000283,0x00000282,0x00050041,
|
||||
0x0000001a,0x00000284,0x000001b9,0x0000003a,0x0004003d,0x00000006,0x00000285,0x00000284,
|
||||
0x00050083,0x00000006,0x00000286,0x00000283,0x00000285,0x0006000c,0x00000006,0x00000287,
|
||||
0x00000001,0x00000004,0x00000286,0x0007000c,0x00000006,0x00000288,0x00000001,0x00000028,
|
||||
0x00000281,0x00000287,0x00050041,0x0000001a,0x00000289,0x000001ac,0x00000061,0x0004003d,
|
||||
0x00000006,0x0000028a,0x00000289,0x00050041,0x0000001a,0x0000028b,0x000001b9,0x00000061,
|
||||
0x0004003d,0x00000006,0x0000028c,0x0000028b,0x00050083,0x00000006,0x0000028d,0x0000028a,
|
||||
0x0000028c,0x0006000c,0x00000006,0x0000028e,0x00000001,0x00000004,0x0000028d,0x00050041,
|
||||
0x0000001a,0x0000028f,0x000001ac,0x00000045,0x0004003d,0x00000006,0x00000290,0x0000028f,
|
||||
0x00050041,0x0000001a,0x00000291,0x000001b9,0x00000045,0x0004003d,0x00000006,0x00000292,
|
||||
0x00000291,0x00050083,0x00000006,0x00000293,0x00000290,0x00000292,0x0006000c,0x00000006,
|
||||
0x00000294,0x00000001,0x00000004,0x00000293,0x0007000c,0x00000006,0x00000295,0x00000001,
|
||||
0x00000028,0x0000028e,0x00000294,0x0007000c,0x00000006,0x00000296,0x00000001,0x00000028,
|
||||
0x00000288,0x00000295,0x0007000c,0x00000006,0x00000297,0x00000001,0x00000028,0x0000027b,
|
||||
0x00000296,0x0003003e,0x00000260,0x00000297,0x0004003d,0x00000006,0x0000029a,0x000000f1,
|
||||
0x0004003d,0x00000006,0x0000029b,0x000000f1,0x00050085,0x00000006,0x0000029d,0x0000029b,
|
||||
0x0000029c,0x0004003d,0x00000006,0x0000029e,0x00000260,0x0008000c,0x00000006,0x0000029f,
|
||||
0x00000001,0x00000031,0x0000029a,0x0000029d,0x0000029e,0x00050085,0x00000006,0x000002a0,
|
||||
0x00000299,0x0000029f,0x00050083,0x00000006,0x000002a1,0x00000029,0x000002a0,0x0003003e,
|
||||
0x00000298,0x000002a1,0x0004003d,0x00000006,0x000002a3,0x00000257,0x0004003d,0x00000006,
|
||||
0x000002a4,0x00000250,0x00050085,0x00000006,0x000002a5,0x000002a3,0x000002a4,0x0004003d,
|
||||
0x00000006,0x000002a6,0x00000197,0x00050085,0x00000006,0x000002a7,0x000002a5,0x000002a6,
|
||||
0x0004003d,0x00000006,0x000002a8,0x00000298,0x00050085,0x00000006,0x000002a9,0x000002a7,
|
||||
0x000002a8,0x0003003e,0x000002a2,0x000002a9,0x0004003d,0x00000006,0x000002ab,0x000000e5,
|
||||
0x0004003d,0x00000006,0x000002ac,0x000000e9,0x0007000c,0x00000006,0x000002ad,0x00000001,
|
||||
0x00000025,0x000002ab,0x000002ac,0x0003003e,0x000002aa,0x000002ad,0x0004003d,0x00000006,
|
||||
0x000002af,0x000000f1,0x0004003d,0x00000006,0x000002b0,0x000000f1,0x00050085,0x00000006,
|
||||
0x000002b1,0x000002b0,0x0000019a,0x0004003d,0x00000006,0x000002b2,0x000002aa,0x0008000c,
|
||||
0x00000006,0x000002b3,0x00000001,0x00000031,0x000002af,0x000002b1,0x000002b2,0x0003003e,
|
||||
0x000002ae,0x000002b3,0x0004003d,0x00000006,0x000002b5,0x00000193,0x0008000c,0x00000006,
|
||||
0x000002b6,0x00000001,0x00000031,0x00000029,0x0000029c,0x000002b5,0x0003003e,0x000002b4,
|
||||
0x000002b6,0x0004003d,0x00000006,0x000002b8,0x00000193,0x000500ba,0x00000018,0x000002b9,
|
||||
0x000002b8,0x00000037,0x0004003d,0x00000006,0x000002ba,0x00000193,0x000500bc,0x00000018,
|
||||
0x000002bb,0x000002ba,0x00000029,0x000500a7,0x00000018,0x000002bc,0x000002b9,0x000002bb,
|
||||
0x0004003d,0x00000006,0x000002bd,0x00000201,0x0004003d,0x00000006,0x000002be,0x000000f1,
|
||||
0x000500bc,0x00000018,0x000002bf,0x000002bd,0x000002be,0x000500a7,0x00000018,0x000002c0,
|
||||
0x000002bc,0x000002bf,0x0004003d,0x00000006,0x000002c1,0x000002aa,0x0004003d,0x00000006,
|
||||
0x000002c2,0x000000f1,0x000500ba,0x00000018,0x000002c3,0x000002c1,0x000002c2,0x000500a7,
|
||||
0x00000018,0x000002c4,0x000002c0,0x000002c3,0x000600a9,0x00000006,0x000002c5,0x000002c4,
|
||||
0x00000029,0x00000037,0x0003003e,0x000002b7,0x000002c5,0x0004003d,0x00000006,0x000002c8,
|
||||
0x000002ae,0x00050085,0x00000006,0x000002c9,0x000002c7,0x000002c8,0x0004003d,0x00000006,
|
||||
0x000002ca,0x00000197,0x00050085,0x00000006,0x000002cb,0x000002c9,0x000002ca,0x0004003d,
|
||||
0x00000006,0x000002cc,0x00000298,0x00050085,0x00000006,0x000002cd,0x000002cb,0x000002cc,
|
||||
0x0004003d,0x00000006,0x000002ce,0x000002b4,0x0004003d,0x00000006,0x000002cf,0x00000206,
|
||||
0x0004003d,0x00000006,0x000002d0,0x00000234,0x0007000c,0x00000006,0x000002d1,0x00000001,
|
||||
0x00000028,0x000002cf,0x000002d0,0x00050085,0x00000006,0x000002d2,0x000002ce,0x000002d1,
|
||||
0x0004003d,0x00000006,0x000002d3,0x000002b7,0x0007000c,0x00000006,0x000002d4,0x00000001,
|
||||
0x00000028,0x000002d2,0x000002d3,0x00050085,0x00000006,0x000002d5,0x000002cd,0x000002d4,
|
||||
0x0003003e,0x000002c6,0x000002d5,0x0004003d,0x00000006,0x000002d7,0x000002a2,0x0004003d,
|
||||
0x00000006,0x000002d8,0x000002c6,0x0007000c,0x00000006,0x000002d9,0x00000001,0x00000028,
|
||||
0x000002d7,0x000002d8,0x0008000c,0x00000006,0x000002db,0x00000001,0x0000002b,0x000002d9,
|
||||
0x00000037,0x000002da,0x0003003e,0x000002d6,0x000002db,0x0004003d,0x00000006,0x000002dc,
|
||||
0x000002d6,0x00050041,0x0000001a,0x000002dd,0x00000166,0x00000053,0x0004003d,0x00000006,
|
||||
0x000002de,0x000002dd,0x00050085,0x00000006,0x000002df,0x000002de,0x00000027,0x00050081,
|
||||
0x00000006,0x000002e0,0x000002df,0x00000027,0x00050041,0x0000001a,0x000002e1,0x00000166,
|
||||
0x0000003a,0x0004003d,0x00000006,0x000002e2,0x000002e1,0x00050085,0x00000006,0x000002e3,
|
||||
0x000002e2,0x00000027,0x00050081,0x00000006,0x000002e4,0x000002e3,0x00000027,0x00070050,
|
||||
0x00000009,0x000002e5,0x000002dc,0x000002e0,0x000002e4,0x00000029,0x0003003e,0x000000fd,
|
||||
0x000002e5,0x000100fd,0x00010038,0x00050036,0x00000009,0x0000000d,0x00000000,0x0000000a,
|
||||
0x00030037,0x00000008,0x0000000b,0x00030037,0x00000008,0x0000000c,0x000200f8,0x0000000e,
|
||||
0x0004003b,0x00000008,0x00000024,0x00000007,0x0004003b,0x0000002f,0x00000030,0x00000007,
|
||||
0x0004003b,0x0000001a,0x00000041,0x00000007,0x0004003d,0x00000007,0x00000025,0x0000000b,
|
||||
0x0004003d,0x00000007,0x00000026,0x0000000c,0x0005008e,0x00000007,0x00000028,0x00000026,
|
||||
0x00000027,0x0004003d,0x00000007,0x0000002b,0x0000000c,0x0005008e,0x00000007,0x0000002c,
|
||||
0x0000002b,0x00000027,0x00050083,0x00000007,0x0000002d,0x0000002a,0x0000002c,0x0008000c,
|
||||
0x00000007,0x0000002e,0x00000001,0x0000002b,0x00000025,0x00000028,0x0000002d,0x0003003e,
|
||||
0x00000024,0x0000002e,0x0004003d,0x00000032,0x00000035,0x00000034,0x0004003d,0x00000007,
|
||||
0x00000036,0x00000024,0x00070058,0x00000009,0x00000038,0x00000035,0x00000036,0x00000002,
|
||||
0x00000037,0x0003003e,0x00000030,0x00000038,0x00050041,0x0000001a,0x0000003b,0x00000024,
|
||||
0x0000003a,0x0004003d,0x00000006,0x0000003c,0x0000003b,0x00050041,0x0000001a,0x0000003d,
|
||||
0x0000000c,0x0000003a,0x0004003d,0x00000006,0x0000003e,0x0000003d,0x00050083,0x00000006,
|
||||
0x0000003f,0x00000029,0x0000003e,0x000500be,0x00000018,0x00000040,0x0000003c,0x0000003f,
|
||||
0x000300f7,0x00000043,0x00000000,0x000400fa,0x00000040,0x00000042,0x00000044,0x000200f8,
|
||||
0x00000042,0x0003003e,0x00000041,0x00000037,0x000200f9,0x00000043,0x000200f8,0x00000044,
|
||||
0x00050041,0x0000001a,0x00000046,0x00000030,0x00000045,0x0004003d,0x00000006,0x00000047,
|
||||
0x00000046,0x0003003e,0x00000041,0x00000047,0x000200f9,0x00000043,0x000200f8,0x00000043,
|
||||
0x0004003d,0x00000006,0x00000048,0x00000041,0x00050041,0x0000001a,0x00000049,0x00000030,
|
||||
0x00000045,0x0003003e,0x00000049,0x00000048,0x0004003d,0x00000009,0x0000004a,0x00000030,
|
||||
0x000200fe,0x0000004a,0x00010038,0x00050036,0x00000006,0x00000012,0x00000000,0x0000000f,
|
||||
0x00030037,0x00000008,0x00000010,0x00030037,0x00000008,0x00000011,0x000200f8,0x00000013,
|
||||
0x0004003b,0x0000002f,0x0000004d,0x00000007,0x0004003b,0x00000008,0x0000004e,0x00000007,
|
||||
0x0004003b,0x00000008,0x00000050,0x00000007,0x0004003d,0x00000007,0x0000004f,0x00000010,
|
||||
0x0003003e,0x0000004e,0x0000004f,0x0004003d,0x00000007,0x00000051,0x00000011,0x0003003e,
|
||||
0x00000050,0x00000051,0x00060039,0x00000009,0x00000052,0x0000000d,0x0000004e,0x00000050,
|
||||
0x0003003e,0x0000004d,0x00000052,0x00050041,0x0000001a,0x00000054,0x0000004d,0x00000053,
|
||||
0x0004003d,0x00000006,0x00000055,0x00000054,0x00050041,0x0000001a,0x00000056,0x0000004d,
|
||||
0x0000003a,0x0004003d,0x00000006,0x00000057,0x00000056,0x0007000c,0x00000006,0x00000058,
|
||||
0x00000001,0x00000028,0x00000055,0x00000057,0x000200fe,0x00000058,0x00010038,0x00050036,
|
||||
0x00000006,0x00000016,0x00000000,0x0000000f,0x00030037,0x00000008,0x00000014,0x00030037,
|
||||
0x00000008,0x00000015,0x000200f8,0x00000017,0x0004003b,0x0000002f,0x0000005b,0x00000007,
|
||||
0x0004003b,0x00000008,0x0000005c,0x00000007,0x0004003b,0x00000008,0x0000005e,0x00000007,
|
||||
0x0004003d,0x00000007,0x0000005d,0x00000014,0x0003003e,0x0000005c,0x0000005d,0x0004003d,
|
||||
0x00000007,0x0000005f,0x00000015,0x0003003e,0x0000005e,0x0000005f,0x00060039,0x00000009,
|
||||
0x00000060,0x0000000d,0x0000005c,0x0000005e,0x0003003e,0x0000005b,0x00000060,0x00050041,
|
||||
0x0000001a,0x00000062,0x0000005b,0x00000061,0x0004003d,0x00000006,0x00000063,0x00000062,
|
||||
0x00050041,0x0000001a,0x00000064,0x0000005b,0x00000045,0x0004003d,0x00000006,0x00000065,
|
||||
0x00000064,0x0007000c,0x00000006,0x00000066,0x00000001,0x00000028,0x00000063,0x00000065,
|
||||
0x000200fe,0x00000066,0x00010038,0x00050036,0x00000006,0x00000022,0x00000000,0x0000001b,
|
||||
0x00030037,0x00000008,0x0000001c,0x00030037,0x00000008,0x0000001d,0x00030037,0x00000008,
|
||||
0x0000001e,0x00030037,0x00000019,0x0000001f,0x00030037,0x0000001a,0x00000020,0x00030037,
|
||||
0x00000019,0x00000021,0x000200f8,0x00000023,0x0004003b,0x0000001a,0x00000069,0x00000007,
|
||||
0x0004003b,0x0000006b,0x0000006c,0x00000007,0x0004003b,0x00000008,0x00000076,0x00000007,
|
||||
0x0004003b,0x00000082,0x00000083,0x00000007,0x0004003b,0x00000082,0x0000008e,0x00000007,
|
||||
0x0004003b,0x0000001a,0x000000a3,0x00000007,0x0004003b,0x0000001a,0x000000a5,0x00000007,
|
||||
0x0004003b,0x00000008,0x000000a8,0x00000007,0x0004003b,0x00000008,0x000000aa,0x00000007,
|
||||
0x0004003b,0x00000008,0x000000ae,0x00000007,0x0004003b,0x00000008,0x000000b0,0x00000007,
|
||||
0x0003003e,0x00000069,0x00000037,0x0003003e,0x0000006c,0x0000006d,0x000200f9,0x0000006e,
|
||||
0x000200f8,0x0000006e,0x000400f6,0x00000070,0x00000071,0x00000000,0x000200f9,0x00000072,
|
||||
0x000200f8,0x00000072,0x0004003d,0x0000006a,0x00000073,0x0000006c,0x000500b3,0x00000018,
|
||||
0x00000075,0x00000073,0x00000074,0x000400fa,0x00000075,0x0000006f,0x00000070,0x000200f8,
|
||||
0x0000006f,0x0004003d,0x00000007,0x00000077,0x0000001c,0x0004003d,0x00000007,0x00000078,
|
||||
0x0000001e,0x0004003d,0x0000006a,0x00000079,0x0000006c,0x0004006f,0x00000006,0x0000007a,
|
||||
0x00000079,0x0005008e,0x00000007,0x0000007b,0x00000078,0x0000007a,0x0004003d,0x00000018,
|
||||
0x0000007c,0x00000021,0x000600a9,0x00000006,0x0000007e,0x0000007c,0x00000029,0x0000007d,
|
||||
0x0005008e,0x00000007,0x0000007f,0x0000007b,0x0000007e,0x00050081,0x00000007,0x00000080,
|
||||
0x00000077,0x0000007f,0x0003003e,0x00000076,0x00000080,0x0004003d,0x00000007,0x00000084,
|
||||
0x00000076,0x00050041,0x00000088,0x00000089,0x00000087,0x0000006d,0x0004003d,0x00000007,
|
||||
0x0000008a,0x00000089,0x00050085,0x00000007,0x0000008b,0x00000084,0x0000008a,0x0006000c,
|
||||
0x00000007,0x0000008c,0x00000001,0x00000008,0x0000008b,0x0004006e,0x00000081,0x0000008d,
|
||||
0x0000008c,0x0003003e,0x00000083,0x0000008d,0x00050041,0x00000088,0x0000008f,0x00000087,
|
||||
0x0000006d,0x0004003d,0x00000007,0x00000090,0x0000008f,0x0004006e,0x00000081,0x00000091,
|
||||
0x00000090,0x0003003e,0x0000008e,0x00000091,0x0004003d,0x00000081,0x00000092,0x00000083,
|
||||
0x000500b1,0x00000095,0x00000096,0x00000092,0x00000094,0x0004009a,0x00000018,0x00000097,
|
||||
0x00000096,0x000400a8,0x00000018,0x00000098,0x00000097,0x000300f7,0x0000009a,0x00000000,
|
||||
0x000400fa,0x00000098,0x00000099,0x0000009a,0x000200f8,0x00000099,0x0004003d,0x00000081,
|
||||
0x0000009b,0x00000083,0x0004003d,0x00000081,0x0000009c,0x0000008e,0x000500af,0x00000095,
|
||||
0x0000009d,0x0000009b,0x0000009c,0x0004009a,0x00000018,0x0000009e,0x0000009d,0x000200f9,
|
||||
0x0000009a,0x000200f8,0x0000009a,0x000700f5,0x00000018,0x0000009f,0x00000097,0x0000006f,
|
||||
0x0000009e,0x00000099,0x000300f7,0x000000a1,0x00000000,0x000400fa,0x0000009f,0x000000a0,
|
||||
0x000000a1,0x000200f8,0x000000a0,0x000200f9,0x00000070,0x000200f8,0x000000a1,0x0004003d,
|
||||
0x00000018,0x000000a4,0x0000001f,0x000300f7,0x000000a7,0x00000000,0x000400fa,0x000000a4,
|
||||
0x000000a6,0x000000ad,0x000200f8,0x000000a6,0x0004003d,0x00000007,0x000000a9,0x00000076,
|
||||
0x0003003e,0x000000a8,0x000000a9,0x0004003d,0x00000007,0x000000ab,0x0000001d,0x0003003e,
|
||||
0x000000aa,0x000000ab,0x00060039,0x00000006,0x000000ac,0x00000012,0x000000a8,0x000000aa,
|
||||
0x0003003e,0x000000a5,0x000000ac,0x000200f9,0x000000a7,0x000200f8,0x000000ad,0x0004003d,
|
||||
0x00000007,0x000000af,0x00000076,0x0003003e,0x000000ae,0x000000af,0x0004003d,0x00000007,
|
||||
0x000000b1,0x0000001d,0x0003003e,0x000000b0,0x000000b1,0x00060039,0x00000006,0x000000b2,
|
||||
0x00000016,0x000000ae,0x000000b0,0x0003003e,0x000000a5,0x000000b2,0x000200f9,0x000000a7,
|
||||
0x000200f8,0x000000a7,0x0004003d,0x00000006,0x000000b3,0x000000a5,0x0003003e,0x000000a3,
|
||||
0x000000b3,0x0004003d,0x00000006,0x000000b4,0x000000a3,0x0004003d,0x00000006,0x000000b5,
|
||||
0x00000020,0x00050085,0x00000006,0x000000b7,0x000000b5,0x000000b6,0x000500bc,0x00000018,
|
||||
0x000000b8,0x000000b4,0x000000b7,0x000300f7,0x000000ba,0x00000000,0x000400fa,0x000000b8,
|
||||
0x000000b9,0x000000ba,0x000200f8,0x000000b9,0x000200f9,0x00000070,0x000200f8,0x000000ba,
|
||||
0x0004003d,0x0000006a,0x000000bc,0x0000006c,0x0004006f,0x00000006,0x000000bd,0x000000bc,
|
||||
0x0003003e,0x00000069,0x000000bd,0x000200f9,0x00000071,0x000200f8,0x00000071,0x0004003d,
|
||||
0x0000006a,0x000000be,0x0000006c,0x00050080,0x0000006a,0x000000bf,0x000000be,0x0000006d,
|
||||
0x0003003e,0x0000006c,0x000000bf,0x000200f9,0x0000006e,0x000200f8,0x00000070,0x0004003d,
|
||||
0x00000006,0x000000c0,0x00000069,0x000200fe,0x000000c0,0x00010038,
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
#version 450
|
||||
|
||||
// =============================================================================
|
||||
// Toon / cel edge-outline post effect.
|
||||
//
|
||||
// Ported verbatim from the OpenGL ToonEffect.java shader. GL derived uv from
|
||||
// gl_FragCoord.xy / resolution; here fragTexCoord already spans [0,1] across
|
||||
// the output, so it IS that uv. edgeThreshold/offset constants unchanged.
|
||||
//
|
||||
// Conventions match upscale.vert: combined-image-sampler at binding 0, the
|
||||
// push-constant block leads with vec4 ndc (offset 0), fragTexCoord in [0,1].
|
||||
// Runs after FXAA in the canonical chain (stylize the clean image).
|
||||
// =============================================================================
|
||||
|
||||
layout(binding = 0) uniform sampler2D InputTexture;
|
||||
|
||||
layout(push_constant) uniform PC {
|
||||
vec4 ndc; // quad NDC rect, consumed by upscale.vert (offset 0)
|
||||
vec2 resolution; // input texture size in px
|
||||
} pc;
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
void main() {
|
||||
vec2 uv = fragTexCoord;
|
||||
|
||||
float edgeThreshold = 0.2; // edge-detect threshold
|
||||
vec2 offset = vec2(1.0) / pc.resolution; // 1-texel neighbour offset
|
||||
|
||||
vec3 colorCenter = texture(InputTexture, uv).rgb;
|
||||
vec3 colorLeft = texture(InputTexture, uv - vec2(offset.x, 0.0)).rgb;
|
||||
vec3 colorRight = texture(InputTexture, uv + vec2(offset.x, 0.0)).rgb;
|
||||
vec3 colorUp = texture(InputTexture, uv - vec2(0.0, offset.y)).rgb;
|
||||
vec3 colorDown = texture(InputTexture, uv + vec2(0.0, offset.y)).rgb;
|
||||
|
||||
float diffHorizontal = length(colorRight - colorLeft);
|
||||
float diffVertical = length(colorUp - colorDown);
|
||||
|
||||
float edgeFactor = step(edgeThreshold, diffHorizontal + diffVertical);
|
||||
vec3 outlineColor = mix(colorCenter, vec3(0.0), edgeFactor);
|
||||
|
||||
outColor = vec4(outlineColor, 1.0);
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
#version 450
|
||||
|
||||
layout(binding = 0) uniform sampler2D InputTexture;
|
||||
|
||||
layout(push_constant) uniform PC {
|
||||
vec4 ndc;
|
||||
vec2 resolution;
|
||||
float brightness;
|
||||
float contrast;
|
||||
float gamma;
|
||||
float saturation;
|
||||
} pc;
|
||||
|
||||
layout(location = 0) in vec2 fragTexCoord;
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
void main() {
|
||||
vec2 uv = fragTexCoord;
|
||||
vec2 offset = vec2(1.0) / pc.resolution;
|
||||
|
||||
vec3 center = texture(InputTexture, uv).rgb;
|
||||
vec3 left = texture(
|
||||
InputTexture, uv - vec2(offset.x, 0.0)).rgb;
|
||||
vec3 right = texture(
|
||||
InputTexture, uv + vec2(offset.x, 0.0)).rgb;
|
||||
vec3 up = texture(
|
||||
InputTexture, uv - vec2(0.0, offset.y)).rgb;
|
||||
vec3 down = texture(
|
||||
InputTexture, uv + vec2(0.0, offset.y)).rgb;
|
||||
|
||||
float horizontal = length(right - left);
|
||||
float vertical = length(up - down);
|
||||
float edge = step(0.2, horizontal + vertical);
|
||||
|
||||
vec3 color = mix(center, vec3(0.0), edge);
|
||||
|
||||
color = roundEven(clamp(color, 0.0, 1.0) * 255.0) / 255.0;
|
||||
|
||||
color = clamp(color + pc.brightness, 0.0, 1.0);
|
||||
color = (color - 0.5) *
|
||||
clamp(pc.contrast + 1.0, 0.5, 2.0) + 0.5;
|
||||
|
||||
vec3 grey = vec3(
|
||||
dot(color, vec3(0.2126, 0.7152, 0.0722)));
|
||||
|
||||
color = mix(grey, color, clamp(pc.saturation, 0.0, 2.0));
|
||||
color = max(color, vec3(0.0));
|
||||
color = pow(color, vec3(1.0 / pc.gamma));
|
||||
|
||||
outColor = vec4(color, 1.0);
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
// 1116.3.0
|
||||
#pragma once
|
||||
const uint32_t toon_color_code[] = {
|
||||
0x07230203,0x00010000,0x0008000b,0x000000a4,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000000b,0x0000009e,0x00030010,
|
||||
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d,
|
||||
0x00000000,0x00030005,0x00000009,0x00007675,0x00060005,0x0000000b,0x67617266,0x43786554,
|
||||
0x64726f6f,0x00000000,0x00040005,0x0000000d,0x7366666f,0x00007465,0x00030005,0x00000011,
|
||||
0x00004350,0x00040006,0x00000011,0x00000000,0x0063646e,0x00060006,0x00000011,0x00000001,
|
||||
0x6f736572,0x6974756c,0x00006e6f,0x00060006,0x00000011,0x00000002,0x67697262,0x656e7468,
|
||||
0x00007373,0x00060006,0x00000011,0x00000003,0x746e6f63,0x74736172,0x00000000,0x00050006,
|
||||
0x00000011,0x00000004,0x6d6d6167,0x00000061,0x00060006,0x00000011,0x00000005,0x75746173,
|
||||
0x69746172,0x00006e6f,0x00030005,0x00000013,0x00006370,0x00040005,0x0000001c,0x746e6563,
|
||||
0x00007265,0x00060005,0x00000020,0x75706e49,0x78655474,0x65727574,0x00000000,0x00040005,
|
||||
0x00000025,0x7466656c,0x00000000,0x00040005,0x00000032,0x68676972,0x00000074,0x00030005,
|
||||
0x0000003b,0x00007075,0x00040005,0x00000045,0x6e776f64,0x00000000,0x00050005,0x0000004e,
|
||||
0x69726f68,0x746e6f7a,0x00006c61,0x00050005,0x00000053,0x74726576,0x6c616369,0x00000000,
|
||||
0x00040005,0x00000058,0x65676465,0x00000000,0x00040005,0x0000005e,0x6f6c6f63,0x00000072,
|
||||
0x00040005,0x00000084,0x79657267,0x00000000,0x00050005,0x0000009e,0x4374756f,0x726f6c6f,
|
||||
0x00000000,0x00040047,0x0000000b,0x0000001e,0x00000000,0x00030047,0x00000011,0x00000002,
|
||||
0x00050048,0x00000011,0x00000000,0x00000023,0x00000000,0x00050048,0x00000011,0x00000001,
|
||||
0x00000023,0x00000010,0x00050048,0x00000011,0x00000002,0x00000023,0x00000018,0x00050048,
|
||||
0x00000011,0x00000003,0x00000023,0x0000001c,0x00050048,0x00000011,0x00000004,0x00000023,
|
||||
0x00000020,0x00050048,0x00000011,0x00000005,0x00000023,0x00000024,0x00040047,0x00000020,
|
||||
0x00000021,0x00000000,0x00040047,0x00000020,0x00000022,0x00000000,0x00040047,0x0000009e,
|
||||
0x0000001e,0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,
|
||||
0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,
|
||||
0x00000007,0x00000007,0x00040020,0x0000000a,0x00000001,0x00000007,0x0004003b,0x0000000a,
|
||||
0x0000000b,0x00000001,0x0004002b,0x00000006,0x0000000e,0x3f800000,0x0005002c,0x00000007,
|
||||
0x0000000f,0x0000000e,0x0000000e,0x00040017,0x00000010,0x00000006,0x00000004,0x0008001e,
|
||||
0x00000011,0x00000010,0x00000007,0x00000006,0x00000006,0x00000006,0x00000006,0x00040020,
|
||||
0x00000012,0x00000009,0x00000011,0x0004003b,0x00000012,0x00000013,0x00000009,0x00040015,
|
||||
0x00000014,0x00000020,0x00000001,0x0004002b,0x00000014,0x00000015,0x00000001,0x00040020,
|
||||
0x00000016,0x00000009,0x00000007,0x00040017,0x0000001a,0x00000006,0x00000003,0x00040020,
|
||||
0x0000001b,0x00000007,0x0000001a,0x00090019,0x0000001d,0x00000006,0x00000001,0x00000000,
|
||||
0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x0000001e,0x0000001d,0x00040020,
|
||||
0x0000001f,0x00000000,0x0000001e,0x0004003b,0x0000001f,0x00000020,0x00000000,0x00040015,
|
||||
0x00000028,0x00000020,0x00000000,0x0004002b,0x00000028,0x00000029,0x00000000,0x00040020,
|
||||
0x0000002a,0x00000007,0x00000006,0x0004002b,0x00000006,0x0000002d,0x00000000,0x0004002b,
|
||||
0x00000028,0x0000003e,0x00000001,0x0004002b,0x00000006,0x00000059,0x3e4ccccd,0x0006002c,
|
||||
0x0000001a,0x00000060,0x0000002d,0x0000002d,0x0000002d,0x0004002b,0x00000006,0x00000068,
|
||||
0x437f0000,0x0004002b,0x00000014,0x0000006e,0x00000002,0x00040020,0x0000006f,0x00000009,
|
||||
0x00000006,0x0004002b,0x00000006,0x00000078,0x3f000000,0x0004002b,0x00000014,0x0000007b,
|
||||
0x00000003,0x0004002b,0x00000006,0x0000007f,0x40000000,0x0004002b,0x00000006,0x00000086,
|
||||
0x3e59b3d0,0x0004002b,0x00000006,0x00000087,0x3f371759,0x0004002b,0x00000006,0x00000088,
|
||||
0x3d93dd98,0x0006002c,0x0000001a,0x00000089,0x00000086,0x00000087,0x00000088,0x0004002b,
|
||||
0x00000014,0x0000008e,0x00000005,0x0004002b,0x00000014,0x00000097,0x00000004,0x00040020,
|
||||
0x0000009d,0x00000003,0x00000010,0x0004003b,0x0000009d,0x0000009e,0x00000003,0x00050036,
|
||||
0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,0x00000008,
|
||||
0x00000009,0x00000007,0x0004003b,0x00000008,0x0000000d,0x00000007,0x0004003b,0x0000001b,
|
||||
0x0000001c,0x00000007,0x0004003b,0x0000001b,0x00000025,0x00000007,0x0004003b,0x0000001b,
|
||||
0x00000032,0x00000007,0x0004003b,0x0000001b,0x0000003b,0x00000007,0x0004003b,0x0000001b,
|
||||
0x00000045,0x00000007,0x0004003b,0x0000002a,0x0000004e,0x00000007,0x0004003b,0x0000002a,
|
||||
0x00000053,0x00000007,0x0004003b,0x0000002a,0x00000058,0x00000007,0x0004003b,0x0000001b,
|
||||
0x0000005e,0x00000007,0x0004003b,0x0000001b,0x00000084,0x00000007,0x0004003d,0x00000007,
|
||||
0x0000000c,0x0000000b,0x0003003e,0x00000009,0x0000000c,0x00050041,0x00000016,0x00000017,
|
||||
0x00000013,0x00000015,0x0004003d,0x00000007,0x00000018,0x00000017,0x00050088,0x00000007,
|
||||
0x00000019,0x0000000f,0x00000018,0x0003003e,0x0000000d,0x00000019,0x0004003d,0x0000001e,
|
||||
0x00000021,0x00000020,0x0004003d,0x00000007,0x00000022,0x00000009,0x00050057,0x00000010,
|
||||
0x00000023,0x00000021,0x00000022,0x0008004f,0x0000001a,0x00000024,0x00000023,0x00000023,
|
||||
0x00000000,0x00000001,0x00000002,0x0003003e,0x0000001c,0x00000024,0x0004003d,0x0000001e,
|
||||
0x00000026,0x00000020,0x0004003d,0x00000007,0x00000027,0x00000009,0x00050041,0x0000002a,
|
||||
0x0000002b,0x0000000d,0x00000029,0x0004003d,0x00000006,0x0000002c,0x0000002b,0x00050050,
|
||||
0x00000007,0x0000002e,0x0000002c,0x0000002d,0x00050083,0x00000007,0x0000002f,0x00000027,
|
||||
0x0000002e,0x00050057,0x00000010,0x00000030,0x00000026,0x0000002f,0x0008004f,0x0000001a,
|
||||
0x00000031,0x00000030,0x00000030,0x00000000,0x00000001,0x00000002,0x0003003e,0x00000025,
|
||||
0x00000031,0x0004003d,0x0000001e,0x00000033,0x00000020,0x0004003d,0x00000007,0x00000034,
|
||||
0x00000009,0x00050041,0x0000002a,0x00000035,0x0000000d,0x00000029,0x0004003d,0x00000006,
|
||||
0x00000036,0x00000035,0x00050050,0x00000007,0x00000037,0x00000036,0x0000002d,0x00050081,
|
||||
0x00000007,0x00000038,0x00000034,0x00000037,0x00050057,0x00000010,0x00000039,0x00000033,
|
||||
0x00000038,0x0008004f,0x0000001a,0x0000003a,0x00000039,0x00000039,0x00000000,0x00000001,
|
||||
0x00000002,0x0003003e,0x00000032,0x0000003a,0x0004003d,0x0000001e,0x0000003c,0x00000020,
|
||||
0x0004003d,0x00000007,0x0000003d,0x00000009,0x00050041,0x0000002a,0x0000003f,0x0000000d,
|
||||
0x0000003e,0x0004003d,0x00000006,0x00000040,0x0000003f,0x00050050,0x00000007,0x00000041,
|
||||
0x0000002d,0x00000040,0x00050083,0x00000007,0x00000042,0x0000003d,0x00000041,0x00050057,
|
||||
0x00000010,0x00000043,0x0000003c,0x00000042,0x0008004f,0x0000001a,0x00000044,0x00000043,
|
||||
0x00000043,0x00000000,0x00000001,0x00000002,0x0003003e,0x0000003b,0x00000044,0x0004003d,
|
||||
0x0000001e,0x00000046,0x00000020,0x0004003d,0x00000007,0x00000047,0x00000009,0x00050041,
|
||||
0x0000002a,0x00000048,0x0000000d,0x0000003e,0x0004003d,0x00000006,0x00000049,0x00000048,
|
||||
0x00050050,0x00000007,0x0000004a,0x0000002d,0x00000049,0x00050081,0x00000007,0x0000004b,
|
||||
0x00000047,0x0000004a,0x00050057,0x00000010,0x0000004c,0x00000046,0x0000004b,0x0008004f,
|
||||
0x0000001a,0x0000004d,0x0000004c,0x0000004c,0x00000000,0x00000001,0x00000002,0x0003003e,
|
||||
0x00000045,0x0000004d,0x0004003d,0x0000001a,0x0000004f,0x00000032,0x0004003d,0x0000001a,
|
||||
0x00000050,0x00000025,0x00050083,0x0000001a,0x00000051,0x0000004f,0x00000050,0x0006000c,
|
||||
0x00000006,0x00000052,0x00000001,0x00000042,0x00000051,0x0003003e,0x0000004e,0x00000052,
|
||||
0x0004003d,0x0000001a,0x00000054,0x0000003b,0x0004003d,0x0000001a,0x00000055,0x00000045,
|
||||
0x00050083,0x0000001a,0x00000056,0x00000054,0x00000055,0x0006000c,0x00000006,0x00000057,
|
||||
0x00000001,0x00000042,0x00000056,0x0003003e,0x00000053,0x00000057,0x0004003d,0x00000006,
|
||||
0x0000005a,0x0000004e,0x0004003d,0x00000006,0x0000005b,0x00000053,0x00050081,0x00000006,
|
||||
0x0000005c,0x0000005a,0x0000005b,0x0007000c,0x00000006,0x0000005d,0x00000001,0x00000030,
|
||||
0x00000059,0x0000005c,0x0003003e,0x00000058,0x0000005d,0x0004003d,0x0000001a,0x0000005f,
|
||||
0x0000001c,0x0004003d,0x00000006,0x00000061,0x00000058,0x00060050,0x0000001a,0x00000062,
|
||||
0x00000061,0x00000061,0x00000061,0x0008000c,0x0000001a,0x00000063,0x00000001,0x0000002e,
|
||||
0x0000005f,0x00000060,0x00000062,0x0003003e,0x0000005e,0x00000063,0x0004003d,0x0000001a,
|
||||
0x00000064,0x0000005e,0x00060050,0x0000001a,0x00000065,0x0000002d,0x0000002d,0x0000002d,
|
||||
0x00060050,0x0000001a,0x00000066,0x0000000e,0x0000000e,0x0000000e,0x0008000c,0x0000001a,
|
||||
0x00000067,0x00000001,0x0000002b,0x00000064,0x00000065,0x00000066,0x0005008e,0x0000001a,
|
||||
0x00000069,0x00000067,0x00000068,0x0006000c,0x0000001a,0x0000006a,0x00000001,0x00000002,
|
||||
0x00000069,0x00060050,0x0000001a,0x0000006b,0x00000068,0x00000068,0x00000068,0x00050088,
|
||||
0x0000001a,0x0000006c,0x0000006a,0x0000006b,0x0003003e,0x0000005e,0x0000006c,0x0004003d,
|
||||
0x0000001a,0x0000006d,0x0000005e,0x00050041,0x0000006f,0x00000070,0x00000013,0x0000006e,
|
||||
0x0004003d,0x00000006,0x00000071,0x00000070,0x00060050,0x0000001a,0x00000072,0x00000071,
|
||||
0x00000071,0x00000071,0x00050081,0x0000001a,0x00000073,0x0000006d,0x00000072,0x00060050,
|
||||
0x0000001a,0x00000074,0x0000002d,0x0000002d,0x0000002d,0x00060050,0x0000001a,0x00000075,
|
||||
0x0000000e,0x0000000e,0x0000000e,0x0008000c,0x0000001a,0x00000076,0x00000001,0x0000002b,
|
||||
0x00000073,0x00000074,0x00000075,0x0003003e,0x0000005e,0x00000076,0x0004003d,0x0000001a,
|
||||
0x00000077,0x0000005e,0x00060050,0x0000001a,0x00000079,0x00000078,0x00000078,0x00000078,
|
||||
0x00050083,0x0000001a,0x0000007a,0x00000077,0x00000079,0x00050041,0x0000006f,0x0000007c,
|
||||
0x00000013,0x0000007b,0x0004003d,0x00000006,0x0000007d,0x0000007c,0x00050081,0x00000006,
|
||||
0x0000007e,0x0000007d,0x0000000e,0x0008000c,0x00000006,0x00000080,0x00000001,0x0000002b,
|
||||
0x0000007e,0x00000078,0x0000007f,0x0005008e,0x0000001a,0x00000081,0x0000007a,0x00000080,
|
||||
0x00060050,0x0000001a,0x00000082,0x00000078,0x00000078,0x00000078,0x00050081,0x0000001a,
|
||||
0x00000083,0x00000081,0x00000082,0x0003003e,0x0000005e,0x00000083,0x0004003d,0x0000001a,
|
||||
0x00000085,0x0000005e,0x00050094,0x00000006,0x0000008a,0x00000085,0x00000089,0x00060050,
|
||||
0x0000001a,0x0000008b,0x0000008a,0x0000008a,0x0000008a,0x0003003e,0x00000084,0x0000008b,
|
||||
0x0004003d,0x0000001a,0x0000008c,0x00000084,0x0004003d,0x0000001a,0x0000008d,0x0000005e,
|
||||
0x00050041,0x0000006f,0x0000008f,0x00000013,0x0000008e,0x0004003d,0x00000006,0x00000090,
|
||||
0x0000008f,0x0008000c,0x00000006,0x00000091,0x00000001,0x0000002b,0x00000090,0x0000002d,
|
||||
0x0000007f,0x00060050,0x0000001a,0x00000092,0x00000091,0x00000091,0x00000091,0x0008000c,
|
||||
0x0000001a,0x00000093,0x00000001,0x0000002e,0x0000008c,0x0000008d,0x00000092,0x0003003e,
|
||||
0x0000005e,0x00000093,0x0004003d,0x0000001a,0x00000094,0x0000005e,0x0007000c,0x0000001a,
|
||||
0x00000095,0x00000001,0x00000028,0x00000094,0x00000060,0x0003003e,0x0000005e,0x00000095,
|
||||
0x0004003d,0x0000001a,0x00000096,0x0000005e,0x00050041,0x0000006f,0x00000098,0x00000013,
|
||||
0x00000097,0x0004003d,0x00000006,0x00000099,0x00000098,0x00050088,0x00000006,0x0000009a,
|
||||
0x0000000e,0x00000099,0x00060050,0x0000001a,0x0000009b,0x0000009a,0x0000009a,0x0000009a,
|
||||
0x0007000c,0x0000001a,0x0000009c,0x00000001,0x0000001a,0x00000096,0x0000009b,0x0003003e,
|
||||
0x0000005e,0x0000009c,0x0004003d,0x0000001a,0x0000009f,0x0000005e,0x00050051,0x00000006,
|
||||
0x000000a0,0x0000009f,0x00000000,0x00050051,0x00000006,0x000000a1,0x0000009f,0x00000001,
|
||||
0x00050051,0x00000006,0x000000a2,0x0000009f,0x00000002,0x00070050,0x00000010,0x000000a3,
|
||||
0x000000a0,0x000000a1,0x000000a2,0x0000000e,0x0003003e,0x0000009e,0x000000a3,0x000100fd,
|
||||
0x00010038
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
#version 450
|
||||
|
||||
// Full-screen / sub-rect quad for the spatial-upscaler post passes (SGSR, FSR
|
||||
// EASU/RCAS). Identical quad generation to window.vert, but the push-constant
|
||||
// block is declared as a single vec4 `ndc` so it matches the leading member of
|
||||
// the upscaler fragment shaders' push-constant blocks (cross-stage layout must
|
||||
// agree). gl_VertexIndex 0..3 over a TRIANGLE_STRIP -> the rect; fragTexCoord
|
||||
// spans [0,1] across that rect (= normalised output position).
|
||||
|
||||
layout(push_constant) uniform PC {
|
||||
vec4 ndc; // (x0, y0, x1, y1) destination rect in NDC
|
||||
} pc;
|
||||
|
||||
layout(location = 0) out vec2 fragTexCoord;
|
||||
|
||||
void main() {
|
||||
int xi = (gl_VertexIndex >> 1) & 1;
|
||||
int yi = gl_VertexIndex & 1;
|
||||
float x = xi == 1 ? pc.ndc.z : pc.ndc.x;
|
||||
float y = yi == 1 ? pc.ndc.w : pc.ndc.y;
|
||||
gl_Position = vec4(x, y, 0.0, 1.0);
|
||||
fragTexCoord = vec2(float(xi), float(yi));
|
||||
}
|
||||
@@ -237,6 +237,7 @@ struct surface {
|
||||
int drawn;
|
||||
int64_t next_release_ns;
|
||||
int releases_pending;
|
||||
int release_pace_open;
|
||||
|
||||
enum surface_role role;
|
||||
struct wl_resource *idle_buffer;
|
||||
@@ -288,6 +289,7 @@ static int g_scene_queues;
|
||||
static int g_tick_held;
|
||||
static int64_t g_hold_missed_ns;
|
||||
#define HOLD_RETRY_NS 1000000000LL
|
||||
#define RELEASE_PACE_DEPTH 8
|
||||
#define PACE_BUFFERS 32
|
||||
static struct {
|
||||
unsigned ticks, ticks_late_2ms, renders, commit_renders, null_attaches, reattaches, presented, replaced, undrawn, distinct;
|
||||
@@ -548,13 +550,25 @@ static int on_release_timer(int fd, uint32_t mask, void *data) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void describe(const struct surface *s, char *out, size_t size);
|
||||
|
||||
static void release_buffer(struct surface *s, struct wl_resource *buffer, int64_t since_ns, struct surface *holder) {
|
||||
/* No allocation or immediate-release fallback is allowed for a quarantined
|
||||
* DMA-BUF. Existing queued releases stay held; their timer is disarmed. */
|
||||
if (buffer_release_blocked(buffer)) return;
|
||||
const int limit = g_fps_limit;
|
||||
const int64_t interval = limit > 0 ? 1000000000LL / limit : g_refresh_ns;
|
||||
const int paced = !g_release_unpaced && interval > 0 && g_release_timer_fd >= 0;
|
||||
int paced = !g_release_unpaced && interval > 0 && g_release_timer_fd >= 0;
|
||||
if (paced && s->releases_pending >= RELEASE_PACE_DEPTH) {
|
||||
paced = 0;
|
||||
if (!s->release_pace_open) {
|
||||
char name[160];
|
||||
describe(s, name, sizeof(name));
|
||||
droiddeck_log("pace", "%s keeps drawing into new buffers instead of waiting for releases: "
|
||||
"its releases beyond %d are no longer held for the frame limit", name, RELEASE_PACE_DEPTH);
|
||||
s->release_pace_open = 1;
|
||||
}
|
||||
}
|
||||
if (!paced && !holder) { send_buffer_release(buffer); perf_note_release(since_ns); return; }
|
||||
int64_t now = now_ns();
|
||||
int64_t at = now;
|
||||
@@ -620,7 +634,8 @@ static void cursor_publish_shown(void) {
|
||||
|
||||
static void cursor_publish_hidden(void) {
|
||||
pthread_mutex_lock(&g_cursor_lock);
|
||||
if (!g_cursor_hidden) { g_cursor_hidden = 1; g_cursor_serial++; }
|
||||
// A client that hides the cursor before ever showing one (gamescope drawing its own) must still be reported.
|
||||
if (!g_cursor_hidden || g_cursor_serial == 0) { g_cursor_hidden = 1; g_cursor_serial++; }
|
||||
pthread_mutex_unlock(&g_cursor_lock);
|
||||
}
|
||||
|
||||
@@ -737,6 +752,11 @@ static void describe(const struct surface *s, char *out, size_t size) {
|
||||
else snprintf(out, size, "window %#x (%s)", w->hwnd, prog);
|
||||
}
|
||||
|
||||
static int is_steam_client_surface(const struct surface *s) {
|
||||
const char *name = client_name(wl_resource_get_client(s->resource));
|
||||
return strcmp(name, "steam") == 0 || strstr(name, "steamwebhelper") != NULL;
|
||||
}
|
||||
|
||||
static struct surface *toplevel_by_hwnd(uint32_t hwnd) {
|
||||
struct surface *s;
|
||||
wl_list_for_each(s, &g_toplevels, toplevel_link)
|
||||
@@ -894,6 +914,7 @@ int droiddeck_hud_frame_times(float *out, int len, int64_t *total) {
|
||||
static uint64_t g_game_frames;
|
||||
extern void droiddeck_on_game_surface(const char *window, const char *gpu);
|
||||
extern void droiddeck_on_game_frame(void);
|
||||
extern void droiddeck_on_compositor_frame(void);
|
||||
extern void droiddeck_on_content_rate(int fps);
|
||||
static int64_t g_cadence_ns;
|
||||
static int64_t g_cadence_frames;
|
||||
@@ -949,9 +970,10 @@ static void take_shm(struct surface *s, struct wl_shm_buffer *shm, struct wl_res
|
||||
g_hud_shm = s;
|
||||
g_hud_shm_ns = now;
|
||||
g_hud_new = 1;
|
||||
droiddeck_on_game_frame();
|
||||
}
|
||||
}
|
||||
if (s == g_hud_shm && (!g_hud_surface || now_ns() - g_hud_last_ns > 1000000000LL))
|
||||
droiddeck_on_compositor_frame();
|
||||
}
|
||||
|
||||
static void take_pixel(struct surface *s, const uint8_t bgra[4], struct wl_resource *buffer) {
|
||||
@@ -1025,7 +1047,8 @@ static void take_dmabuf(struct surface *s, struct dmabuf_buffer *b, struct wl_re
|
||||
droiddeck_log("error", "could not import GPU frames from %s (%dx%d, modifier %#llx)",
|
||||
name, b->width, b->height, (unsigned long long)b->modifier);
|
||||
}
|
||||
if (s != g_hud_surface && (b->img || ahb_swapchain_has_ahb(b)) &&
|
||||
if (s != g_hud_surface && !is_steam_client_surface(s) &&
|
||||
(b->img || ahb_swapchain_has_ahb(b)) &&
|
||||
(!g_hud_surface || now_ns() - g_hud_alive_ns > 1000000000LL || (!repeat && below_surface(s, g_hud_surface)) ||
|
||||
(announced_now && !below_surface(g_hud_surface, s) &&
|
||||
(int64_t)b->width * b->height >= (int64_t)g_hud_surface->buf_w * g_hud_surface->buf_h))) {
|
||||
@@ -1050,9 +1073,12 @@ static void take_dmabuf(struct surface *s, struct dmabuf_buffer *b, struct wl_re
|
||||
: "the compositor's driver could NOT import it (nothing can show it)");
|
||||
s->hdr_fmt_logged = b->format;
|
||||
}
|
||||
if (s == g_hud_surface) {
|
||||
if (s == g_hud_surface && !is_steam_client_surface(s)) {
|
||||
g_hud_alive_ns = now_ns();
|
||||
if (!repeat) { g_hud_last_ns = g_hud_alive_ns; g_hud_fresh = 1; g_hud_new = 1; g_game_frames++; note_game_frame_gap(); droiddeck_on_game_frame(); }
|
||||
} else if (is_steam_client_surface(s) && !repeat &&
|
||||
(!g_hud_surface || now_ns() - g_hud_alive_ns > 1000000000LL)) {
|
||||
droiddeck_on_compositor_frame();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1172,6 +1198,14 @@ static uint32_t nominal_refresh_ns(void) {
|
||||
return (uint32_t)(1000000000000LL / (int64_t)mhz);
|
||||
}
|
||||
|
||||
static uint32_t feedback_refresh_ns(void) {
|
||||
const int limit = g_fps_limit;
|
||||
const uint32_t panel = nominal_refresh_ns();
|
||||
if (limit <= 0 || g_release_unpaced) return panel;
|
||||
const uint32_t paced = (uint32_t)(1000000000LL / limit);
|
||||
return paced > panel ? paced : panel;
|
||||
}
|
||||
|
||||
static int64_t presented_ns(int64_t render_ns) {
|
||||
int64_t tick = g_tick_vsync_ns;
|
||||
int64_t refresh = (int64_t)nominal_refresh_ns();
|
||||
@@ -1190,7 +1224,7 @@ static void feedback_present_all(struct wl_list *list, int64_t t) {
|
||||
uint32_t nsec = (uint32_t)(t % 1000000000LL);
|
||||
wl_resource_for_each_safe(fb, tmp, list) {
|
||||
wp_presentation_feedback_send_presented(fb, (uint32_t)(sec >> 32), (uint32_t)sec, nsec,
|
||||
nominal_refresh_ns(), 0, 0,
|
||||
feedback_refresh_ns(), 0, 0,
|
||||
WP_PRESENTATION_FEEDBACK_KIND_VSYNC);
|
||||
wl_resource_destroy(fb);
|
||||
g_pace.presented++;
|
||||
|
||||
@@ -17,8 +17,12 @@
|
||||
#include "cas_frag.h"
|
||||
#include "color_frag.h"
|
||||
#include "fxaa_frag.h"
|
||||
#include "smaa_frag.h"
|
||||
#include "fxaa_toon_frag.h"
|
||||
#include "smaa_edge_frag.h"
|
||||
#include "smaa_weights_frag.h"
|
||||
#include "smaa_blend_frag.h"
|
||||
#include "toon_frag.h"
|
||||
#include "toon_color_frag.h"
|
||||
#include "hdr_frag.h"
|
||||
#include "ntsc_frag.h"
|
||||
#include "crt_frag.h"
|
||||
@@ -30,6 +34,7 @@
|
||||
|
||||
|
||||
static VkFormat g_fx_fmt = FX_FORMAT, g_scene_fmt = FX_FORMAT;
|
||||
static int g_scene_is_pq;
|
||||
#define FX_MAX_DIM 4096
|
||||
|
||||
|
||||
@@ -104,10 +109,12 @@ static const char *scaling_name(int m) {
|
||||
}
|
||||
static int spatial_mode(int m) { return m >= 3 && m <= 8; }
|
||||
static int cas_active(const struct fx_settings *s) { return s->cas_on && s->cas_pct > 0; }
|
||||
static int deband_active(const struct fx_settings *s) { return s->deband_on && s->deband_pct > 0; }
|
||||
static int effect_count(const struct fx_settings *s) {
|
||||
return (s->aa_mode != 0) + s->toon + s->color_on + cas_active(s) + s->hdr_on + s->ntsc + s->crt + s->deband_on;
|
||||
return (s->aa_mode != 0) + s->toon + s->color_on + cas_active(s) + s->hdr_on + s->ntsc + s->crt + deband_active(s);
|
||||
}
|
||||
|
||||
|
||||
static void log_settings(const struct fx_settings *s) {
|
||||
char line[400];
|
||||
int n;
|
||||
@@ -129,7 +136,7 @@ static void log_settings(const struct fx_settings *s) {
|
||||
if (s->hdr_on) n += snprintf(line + n, sizeof(line) - n, ", HDR on");
|
||||
if (s->ntsc) n += snprintf(line + n, sizeof(line) - n, ", NTSC on");
|
||||
if (s->crt) n += snprintf(line + n, sizeof(line) - n, ", CRT on");
|
||||
if (s->deband_on) n += snprintf(line + n, sizeof(line) - n, ", Deband on %d%%", s->deband_pct);
|
||||
if (deband_active(s)) n += snprintf(line + n, sizeof(line) - n, ", Deband on %d%%", s->deband_pct);
|
||||
(void)n;
|
||||
droiddeck_log("effects", "%s", line);
|
||||
}
|
||||
@@ -176,6 +183,11 @@ struct pc_easu { float ndc[4]; uint32_t con0[4], con1[4], con2[4], con3[4]; flo
|
||||
struct pc_rcas { float ndc[4]; uint32_t con[4]; float outW, outH; };
|
||||
struct pc_res { float ndc[4]; float res[2]; float extra; float pad; };
|
||||
struct pc_color { float ndc[4]; float b, c, g, s; };
|
||||
struct pc_toon_color {
|
||||
float ndc[4]; float res[2]; float b, c, g, s;
|
||||
};
|
||||
_Static_assert(sizeof(struct pc_toon_color) == 40,
|
||||
"toon_color push constants layout mismatch");
|
||||
#define PC_MAX_SIZE sizeof(struct pc_easu)
|
||||
|
||||
static uint32_t packf(float f) { uint32_t u; memcpy(&u, &f, 4); return u; }
|
||||
@@ -204,17 +216,16 @@ static VkDevice g_dev;
|
||||
static VkPhysicalDevice g_pd;
|
||||
static VkPhysicalDeviceMemoryProperties g_mp;
|
||||
static int g_ready;
|
||||
static VkRenderPass g_rp;
|
||||
static VkRenderPass g_rp, g_smaa_rp;
|
||||
static VkDescriptorSetLayout g_dsl;
|
||||
static VkPipelineLayout g_pl;
|
||||
static VkDescriptorPool g_dpool;
|
||||
static VkSampler g_sampler;
|
||||
enum { P_SGSR, P_SGSR_HQ, P_NIS, P_EASU, P_RCAS, P_CAS, P_COLOR, P_FXAA, P_SMAA, P_TOON, P_HDR, P_NTSC, P_CRT, P_DEBAND, P_COUNT };
|
||||
enum { P_SGSR, P_SGSR_HQ, P_NIS, P_EASU, P_RCAS, P_CAS, P_COLOR, P_FXAA, P_FXAA_TOON, P_SMAA_EDGE, P_SMAA_WEIGHTS, P_SMAA_BLEND, P_TOON, P_TOON_COLOR, P_HDR, P_NTSC, P_CRT, P_DEBAND, P_COUNT };
|
||||
static VkPipeline g_pipe[P_COUNT];
|
||||
static struct fx_target g_t[2], g_mid;
|
||||
static struct fx_target g_t[2], g_mid, g_smaa_edges, g_smaa_weights;
|
||||
|
||||
static struct { VkImage img; VkImageView view; VkDescriptorSet ds; int w, h; } g_scene;
|
||||
static uint32_t g_ntsc_frame;
|
||||
|
||||
void vkp_effects_bind_device(VkDevice dev, VkPhysicalDevice pd,
|
||||
const VkPhysicalDeviceMemoryProperties *memprops) {
|
||||
@@ -260,15 +271,20 @@ static void target_destroy(struct fx_target *t) {
|
||||
memset(t, 0, sizeof(*t));
|
||||
}
|
||||
|
||||
static int target_ensure(struct fx_target *t, int w, int h, const char *what) {
|
||||
#define FX_TARGET_USAGE (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT | \
|
||||
VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT)
|
||||
#define FX_SCRATCH_USAGE (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT)
|
||||
|
||||
static int target_ensure_format(struct fx_target *t, int w, int h,
|
||||
VkImageUsageFlags usage, const char *what,
|
||||
VkFormat format, VkRenderPass render_pass) {
|
||||
if (t->img && t->w == w && t->h == h) return 0;
|
||||
target_destroy(t);
|
||||
VkImageCreateInfo ii = {.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
|
||||
.flags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, .imageType = VK_IMAGE_TYPE_2D,
|
||||
.format = g_fx_fmt, .extent = {(uint32_t)w, (uint32_t)h, 1}, .mipLevels = 1,
|
||||
.format = format, .extent = {(uint32_t)w, (uint32_t)h, 1}, .mipLevels = 1,
|
||||
.arrayLayers = 1, .samples = VK_SAMPLE_COUNT_1_BIT, .tiling = VK_IMAGE_TILING_OPTIMAL,
|
||||
.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT |
|
||||
VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT,
|
||||
.usage = usage,
|
||||
.sharingMode = VK_SHARING_MODE_EXCLUSIVE, .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED};
|
||||
VkResult r = g_vk.CreateImage(g_dev, &ii, NULL, &t->img);
|
||||
if (r != VK_SUCCESS) { droiddeck_log("error", "effects: %s image %dx%d: vkCreateImage %d", what, w, h, (int)r); return -1; }
|
||||
@@ -285,8 +301,8 @@ static int target_ensure(struct fx_target *t, int w, int h, const char *what) {
|
||||
target_destroy(t); return -1;
|
||||
}
|
||||
g_vk.BindImageMemory(g_dev, t->img, t->mem, 0);
|
||||
if (!(t->view = make_view(t->img, g_fx_fmt))) { target_destroy(t); return -1; }
|
||||
VkFramebufferCreateInfo fi = {.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, .renderPass = g_rp,
|
||||
if (!(t->view = make_view(t->img, format))) { target_destroy(t); return -1; }
|
||||
VkFramebufferCreateInfo fi = {.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, .renderPass = render_pass,
|
||||
.attachmentCount = 1, .pAttachments = &t->view, .width = (uint32_t)w,
|
||||
.height = (uint32_t)h, .layers = 1};
|
||||
if (g_vk.CreateFramebuffer(g_dev, &fi, NULL, &t->fb) != VK_SUCCESS) { target_destroy(t); return -1; }
|
||||
@@ -295,6 +311,11 @@ static int target_ensure(struct fx_target *t, int w, int h, const char *what) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int target_ensure(struct fx_target *t, int w, int h,
|
||||
VkImageUsageFlags usage, const char *what) {
|
||||
return target_ensure_format(t, w, h, usage, what, g_fx_fmt, g_rp);
|
||||
}
|
||||
|
||||
static void scene_release(void) {
|
||||
if (g_scene.ds) g_vk.FreeDescriptorSets(g_dev, g_dpool, 1, &g_scene.ds);
|
||||
if (g_scene.view) g_vk.DestroyImageView(g_dev, g_scene.view, NULL);
|
||||
@@ -321,7 +342,9 @@ static VkShaderModule shader(const uint32_t *code, size_t size) {
|
||||
return m;
|
||||
}
|
||||
|
||||
static VkPipeline post_pipeline(VkShaderModule vert, const uint32_t *frag_code, size_t frag_size, const char *name) {
|
||||
static VkPipeline post_pipeline_for_renderpass(VkShaderModule vert,
|
||||
const uint32_t *frag_code, size_t frag_size, VkRenderPass render_pass,
|
||||
const char *name) {
|
||||
VkShaderModule frag = shader(frag_code, frag_size);
|
||||
if (!frag) { droiddeck_log("error", "effects: %s: vkCreateShaderModule failed", name); return VK_NULL_HANDLE; }
|
||||
VkPipelineShaderStageCreateInfo st[2] = {
|
||||
@@ -347,7 +370,7 @@ static VkPipeline post_pipeline(VkShaderModule vert, const uint32_t *frag_code,
|
||||
.pStages = st, .pVertexInputState = &vi, .pInputAssemblyState = &ia,
|
||||
.pViewportState = &vp, .pRasterizationState = &rs, .pMultisampleState = &ms,
|
||||
.pColorBlendState = &cb, .pDynamicState = &ds, .layout = g_pl,
|
||||
.renderPass = g_rp, .subpass = 0};
|
||||
.renderPass = render_pass, .subpass = 0};
|
||||
VkPipeline p = VK_NULL_HANDLE;
|
||||
VkResult r = g_vk.CreateGraphicsPipelines(g_dev, VK_NULL_HANDLE, 1, &pi, NULL, &p);
|
||||
g_vk.DestroyShaderModule(g_dev, frag, NULL);
|
||||
@@ -355,23 +378,32 @@ static VkPipeline post_pipeline(VkShaderModule vert, const uint32_t *frag_code,
|
||||
return p;
|
||||
}
|
||||
|
||||
static VkPipeline post_pipeline(VkShaderModule vert, const uint32_t *frag_code,
|
||||
size_t frag_size, const char *name) {
|
||||
return post_pipeline_for_renderpass(vert, frag_code, frag_size, g_rp, name);
|
||||
}
|
||||
|
||||
static void objects_destroy(void) {
|
||||
if (!g_dev) return;
|
||||
scene_release();
|
||||
target_destroy(&g_t[0]); target_destroy(&g_t[1]); target_destroy(&g_mid);
|
||||
target_destroy(&g_smaa_edges); target_destroy(&g_smaa_weights);
|
||||
for (int i = 0; i < P_COUNT; i++) { if (g_pipe[i]) g_vk.DestroyPipeline(g_dev, g_pipe[i], NULL); g_pipe[i] = VK_NULL_HANDLE; }
|
||||
if (g_dpool) g_vk.DestroyDescriptorPool(g_dev, g_dpool, NULL);
|
||||
if (g_pl) g_vk.DestroyPipelineLayout(g_dev, g_pl, NULL);
|
||||
if (g_dsl) g_vk.DestroyDescriptorSetLayout(g_dev, g_dsl, NULL);
|
||||
if (g_sampler) g_vk.DestroySampler(g_dev, g_sampler, NULL);
|
||||
if (g_smaa_rp) g_vk.DestroyRenderPass(g_dev, g_smaa_rp, NULL);
|
||||
if (g_rp) g_vk.DestroyRenderPass(g_dev, g_rp, NULL);
|
||||
g_dpool = VK_NULL_HANDLE; g_pl = VK_NULL_HANDLE; g_dsl = VK_NULL_HANDLE; g_sampler = VK_NULL_HANDLE; g_rp = VK_NULL_HANDLE;
|
||||
g_dpool = VK_NULL_HANDLE; g_pl = VK_NULL_HANDLE; g_dsl = VK_NULL_HANDLE;
|
||||
g_sampler = VK_NULL_HANDLE; g_rp = VK_NULL_HANDLE; g_smaa_rp = VK_NULL_HANDLE;
|
||||
g_ready = 0;
|
||||
}
|
||||
|
||||
void vkp_effects_destroy(void) { objects_destroy(); g_dev = VK_NULL_HANDLE; }
|
||||
|
||||
void vkp_effects_set_formats(VkFormat scene_fmt, VkFormat target_fmt) {
|
||||
void vkp_effects_set_formats(VkFormat scene_fmt, VkFormat target_fmt, int scene_is_pq) {
|
||||
g_scene_is_pq = scene_is_pq != 0;
|
||||
if (target_fmt != g_fx_fmt) {
|
||||
if (g_ready) objects_destroy();
|
||||
g_fx_fmt = target_fmt;
|
||||
@@ -413,6 +445,12 @@ static int objects_ensure(void) {
|
||||
.subpassCount = 1, .pSubpasses = &sub, .dependencyCount = 2, .pDependencies = deps};
|
||||
if (g_vk.CreateRenderPass(g_dev, &rci, NULL, &g_rp) != VK_SUCCESS) goto fail;
|
||||
|
||||
VkAttachmentDescription smaa_att = att;
|
||||
smaa_att.format = FX_FORMAT;
|
||||
VkRenderPassCreateInfo smaa_rci = rci;
|
||||
smaa_rci.pAttachments = &smaa_att;
|
||||
if (g_vk.CreateRenderPass(g_dev, &smaa_rci, NULL, &g_smaa_rp) != VK_SUCCESS) goto fail;
|
||||
|
||||
VkSamplerCreateInfo sci = {.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO, .magFilter = VK_FILTER_LINEAR,
|
||||
.minFilter = VK_FILTER_LINEAR, .mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST,
|
||||
.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
|
||||
@@ -425,7 +463,8 @@ static int objects_ensure(void) {
|
||||
VkDescriptorSetLayoutCreateInfo dli = {.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, .bindingCount = 1, .pBindings = &b};
|
||||
if (g_vk.CreateDescriptorSetLayout(g_dev, &dli, NULL, &g_dsl) != VK_SUCCESS) goto fail;
|
||||
VkPushConstantRange pcr = {.stageFlags = VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, .offset = 0, .size = PC_MAX_SIZE};
|
||||
VkPipelineLayoutCreateInfo pli = {.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, .setLayoutCount = 1, .pSetLayouts = &g_dsl,
|
||||
VkDescriptorSetLayout set_layouts[2] = {g_dsl, g_dsl};
|
||||
VkPipelineLayoutCreateInfo pli = {.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, .setLayoutCount = 2, .pSetLayouts = set_layouts,
|
||||
.pushConstantRangeCount = 1, .pPushConstantRanges = &pcr};
|
||||
if (g_vk.CreatePipelineLayout(g_dev, &pli, NULL, &g_pl) != VK_SUCCESS) goto fail;
|
||||
VkDescriptorPoolSize ps = {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 8};
|
||||
@@ -445,8 +484,16 @@ static int objects_ensure(void) {
|
||||
MK(P_CAS, cas_code, "cas");
|
||||
MK(P_COLOR, color_code, "color");
|
||||
MK(P_FXAA, fxaa_code, "fxaa");
|
||||
MK(P_SMAA, smaa_code, "smaa");
|
||||
MK(P_FXAA_TOON, fxaa_toon_code, "fxaa_toon");
|
||||
g_pipe[P_SMAA_EDGE] = post_pipeline_for_renderpass(
|
||||
vert, smaa_edge_code, sizeof(smaa_edge_code), g_smaa_rp, "smaa_edge");
|
||||
if (!g_pipe[P_SMAA_EDGE]) { g_vk.DestroyShaderModule(g_dev, vert, NULL); goto fail; }
|
||||
g_pipe[P_SMAA_WEIGHTS] = post_pipeline_for_renderpass(
|
||||
vert, smaa_weights_code, sizeof(smaa_weights_code), g_smaa_rp, "smaa_weights");
|
||||
if (!g_pipe[P_SMAA_WEIGHTS]) { g_vk.DestroyShaderModule(g_dev, vert, NULL); goto fail; }
|
||||
MK(P_SMAA_BLEND, smaa_blend_code, "smaa_blend");
|
||||
MK(P_TOON, toon_code, "toon");
|
||||
MK(P_TOON_COLOR, toon_color_code, "toon_color");
|
||||
MK(P_HDR, hdr_code, "hdr");
|
||||
MK(P_NTSC, ntsc_code, "ntsc");
|
||||
MK(P_CRT, crt_code, "crt");
|
||||
@@ -454,7 +501,7 @@ static int objects_ensure(void) {
|
||||
#undef MK
|
||||
g_vk.DestroyShaderModule(g_dev, vert, NULL);
|
||||
g_ready = 1;
|
||||
droiddeck_log("effects", "chain ready: 14 pipelines (SGSR, SGSR HQ, NIS, FSR EASU+RCAS, CAS, colour, FXAA, SMAA, Toon, HDR, NTSC, CRT, deband) on %s", vkp_gpu_name());
|
||||
droiddeck_log("effects", "chain ready: 16 pipelines (SGSR, SGSR HQ, NIS, FSR EASU+RCAS, CAS, colour, FXAA, SMAA edge/weights/blend, Toon, HDR, NTSC, CRT, deband) on %s", vkp_gpu_name());
|
||||
return 0;
|
||||
fail:
|
||||
objects_destroy();
|
||||
@@ -474,15 +521,12 @@ static void barrier(VkCommandBuffer cmd, VkImage img, VkImageLayout from, VkImag
|
||||
g_vk.CmdPipelineBarrier(cmd, src_stage, dst_stage, 0, 0, NULL, 0, NULL, 1, &b);
|
||||
}
|
||||
|
||||
static void pass(VkCommandBuffer cmd, VkPipeline p, struct fx_target *dst, VkDescriptorSet src,
|
||||
static void pass_renderpass(VkCommandBuffer cmd, VkRenderPass render_pass,
|
||||
VkPipeline p, struct fx_target *dst, VkDescriptorSet src,
|
||||
const void *pc, uint32_t pcsz) {
|
||||
VkRenderPassBeginInfo rpi = {.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, .renderPass = g_rp, .framebuffer = dst->fb,
|
||||
VkRenderPassBeginInfo rpi = {.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, .renderPass = render_pass, .framebuffer = dst->fb,
|
||||
.renderArea = {{0, 0}, {(uint32_t)dst->w, (uint32_t)dst->h}}};
|
||||
VkViewport vp = {0, 0, (float)dst->w, (float)dst->h, 0, 1};
|
||||
VkRect2D sc = {{0, 0}, {(uint32_t)dst->w, (uint32_t)dst->h}};
|
||||
g_vk.CmdBeginRenderPass(cmd, &rpi, VK_SUBPASS_CONTENTS_INLINE);
|
||||
g_vk.CmdSetViewport(cmd, 0, 1, &vp);
|
||||
g_vk.CmdSetScissor(cmd, 0, 1, &sc);
|
||||
g_vk.CmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, p);
|
||||
g_vk.CmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, g_pl, 0, 1, &src, 0, NULL);
|
||||
g_vk.CmdPushConstants(cmd, g_pl, VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, 0, pcsz, pc);
|
||||
@@ -490,14 +534,37 @@ static void pass(VkCommandBuffer cmd, VkPipeline p, struct fx_target *dst, VkDes
|
||||
g_vk.CmdEndRenderPass(cmd);
|
||||
}
|
||||
|
||||
static void pass(VkCommandBuffer cmd, VkPipeline p, struct fx_target *dst,
|
||||
VkDescriptorSet src, const void *pc, uint32_t pcsz) {
|
||||
pass_renderpass(cmd, g_rp, p, dst, src, pc, pcsz);
|
||||
}
|
||||
|
||||
static void pass_dual(VkCommandBuffer cmd, VkPipeline p, struct fx_target *dst,
|
||||
VkDescriptorSet src, VkDescriptorSet second,
|
||||
const void *pc, uint32_t pcsz) {
|
||||
VkRenderPassBeginInfo rpi = {.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, .renderPass = g_rp, .framebuffer = dst->fb,
|
||||
.renderArea = {{0, 0}, {(uint32_t)dst->w, (uint32_t)dst->h}}};
|
||||
VkDescriptorSet sets[2] = {src, second};
|
||||
g_vk.CmdBeginRenderPass(cmd, &rpi, VK_SUBPASS_CONTENTS_INLINE);
|
||||
g_vk.CmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, p);
|
||||
g_vk.CmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, g_pl, 0, 2, sets, 0, NULL);
|
||||
g_vk.CmdPushConstants(cmd, g_pl, VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, 0, pcsz, pc);
|
||||
g_vk.CmdDraw(cmd, 4, 1, 0, 0);
|
||||
g_vk.CmdEndRenderPass(cmd);
|
||||
}
|
||||
|
||||
static const float FULL_NDC[4] = {-1.0f, -1.0f, 1.0f, 1.0f};
|
||||
#define SET_NDC(pc) memcpy((pc).ndc, FULL_NDC, sizeof(FULL_NDC))
|
||||
|
||||
VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int scene_h,
|
||||
int out_w, int out_h, int *res_w, int *res_h) {
|
||||
struct fx_settings snapshot;
|
||||
const struct fx_settings *s;
|
||||
vkp_effects_sync();
|
||||
s = &g_cur;
|
||||
pthread_mutex_lock(&g_lock);
|
||||
snapshot = g_cur;
|
||||
pthread_mutex_unlock(&g_lock);
|
||||
s = &snapshot;
|
||||
*res_w = scene_w; *res_h = scene_h;
|
||||
|
||||
int cw = out_w > 0 ? out_w : scene_w, ch = out_h > 0 ? out_h : scene_h;
|
||||
@@ -508,18 +575,53 @@ VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int sce
|
||||
const int upscaling = cw > scene_w || ch > scene_h;
|
||||
int spatial = 0;
|
||||
if (spatial_mode(s->scaling) && (s->scaling == 6 || upscaling)) spatial = s->scaling;
|
||||
/* NIS here is the SDR implementation and is documented for <=2x upscales. */
|
||||
const int nis_fallback = spatial == 7 &&
|
||||
(g_scene_is_pq || cw < scene_w || ch < scene_h ||
|
||||
(double)cw > (double)scene_w * 2.0 ||
|
||||
(double)ch > (double)scene_h * 2.0);
|
||||
static int last_nis_fallback = 0;
|
||||
const int was_nis_fallback =
|
||||
__atomic_exchange_n(&last_nis_fallback, nis_fallback, __ATOMIC_RELAXED);
|
||||
if (nis_fallback) {
|
||||
spatial = 4; /* FSR fallback; keep the saved NIS selection unchanged. */
|
||||
if (!was_nis_fallback)
|
||||
droiddeck_log("effects", "NIS unsupported for this output; FSR fallback active");
|
||||
} else if (was_nis_fallback && s->scaling == 7) {
|
||||
droiddeck_log("effects", "NIS supported again; NIS active");
|
||||
}
|
||||
const int nfx = effect_count(s);
|
||||
const int resize = cw != scene_w || ch != scene_h;
|
||||
const int npasses = ((spatial || resize) ? 1 : 0) + nfx;
|
||||
const int fuse_toon_color = s->toon && s->color_on && g_fx_fmt == FX_FORMAT;
|
||||
const int fuse_fxaa_toon = 0;
|
||||
const int chain_passes = ((spatial || resize) ? 1 : 0) +
|
||||
effect_count(s) - (fuse_toon_color ? 1 : 0) -
|
||||
(fuse_fxaa_toon ? 1 : 0);
|
||||
|
||||
if ((spatial || nfx) && objects_ensure() == 0 && scene_ensure(scene, scene_w, scene_h) == 0 &&
|
||||
target_ensure(&g_t[0], cw, ch, "chain") == 0 && (npasses < 2 || target_ensure(&g_t[1], cw, ch, "chain") == 0) &&
|
||||
(!(spatial == 4 || spatial == 5) || target_ensure(&g_mid, cw, ch, "EASU") == 0)) {
|
||||
target_ensure(&g_t[0], cw, ch, FX_TARGET_USAGE, "chain") == 0 && (chain_passes < 2 || target_ensure(&g_t[1], cw, ch, FX_TARGET_USAGE, "chain") == 0) &&
|
||||
(!(spatial == 4 || spatial == 5) || s->sharp_pct == 0 ||
|
||||
target_ensure(&g_mid, cw, ch, FX_SCRATCH_USAGE, "EASU") == 0)) {
|
||||
if (s->aa_mode == 2 &&
|
||||
(target_ensure_format(&g_smaa_edges, cw, ch, FX_SCRATCH_USAGE,
|
||||
"SMAA edges", FX_FORMAT, g_smaa_rp) != 0 ||
|
||||
target_ensure_format(&g_smaa_weights, cw, ch, FX_SCRATCH_USAGE,
|
||||
"SMAA weights", FX_FORMAT, g_smaa_rp) != 0)) {
|
||||
droiddeck_log("error", "effects: SMAA scratch allocation failed; falling back to FXAA");
|
||||
snapshot.aa_mode = 1;
|
||||
s = &snapshot;
|
||||
}
|
||||
|
||||
VkDescriptorSet cur_ds;
|
||||
struct fx_target *cur = NULL;
|
||||
#define FREE_TARGET() ((cur == &g_t[0]) ? &g_t[1] : &g_t[0])
|
||||
const float sharp01 = (float)s->sharp_pct / 100.0f;
|
||||
|
||||
VkViewport chain_vp = {0, 0, (float)cw, (float)ch, 0, 1};
|
||||
VkRect2D chain_sc = {{0, 0}, {(uint32_t)cw, (uint32_t)ch}};
|
||||
g_vk.CmdSetViewport(cmd, 0, 1, &chain_vp);
|
||||
g_vk.CmdSetScissor(cmd, 0, 1, &chain_sc);
|
||||
|
||||
if (spatial) {
|
||||
barrier(cmd, scene, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
|
||||
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_WRITE_BIT,
|
||||
@@ -546,11 +648,14 @@ VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int sce
|
||||
SET_NDC(e);
|
||||
easu_con(&e, (float)scene_w, (float)scene_h, (float)cw, (float)ch);
|
||||
e.outW = (float)cw; e.outH = (float)ch;
|
||||
pass(cmd, g_pipe[P_EASU], &g_mid, g_scene.ds, &e, sizeof(e));
|
||||
SET_NDC(r);
|
||||
rcas_con(&r, sharp01);
|
||||
r.outW = (float)cw; r.outH = (float)ch;
|
||||
pass(cmd, g_pipe[P_RCAS], dst, g_mid.ds, &r, sizeof(r));
|
||||
struct fx_target *easu_dst = sharp01 == 0.0f ? dst : &g_mid;
|
||||
pass(cmd, g_pipe[P_EASU], easu_dst, g_scene.ds, &e, sizeof(e));
|
||||
if (sharp01 != 0.0f) {
|
||||
SET_NDC(r);
|
||||
rcas_con(&r, sharp01);
|
||||
r.outW = (float)cw; r.outH = (float)ch;
|
||||
pass(cmd, g_pipe[P_RCAS], dst, g_mid.ds, &r, sizeof(r));
|
||||
}
|
||||
}
|
||||
cur = dst; cur_ds = dst->ds;
|
||||
} else if (resize) {
|
||||
@@ -563,7 +668,7 @@ VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int sce
|
||||
VkImageBlit bl = {.srcSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1}, .srcOffsets = {{0, 0, 0}, {scene_w, scene_h, 1}},
|
||||
.dstSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1}, .dstOffsets = {{0, 0, 0}, {cw, ch, 1}}};
|
||||
g_vk.CmdBlitImage(cmd, scene, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, dst->img, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
||||
1, &bl, vkp_effects_blit_filter());
|
||||
1, &bl, s->scaling == 2 ? VK_FILTER_NEAREST : VK_FILTER_LINEAR);
|
||||
barrier(cmd, dst->img, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
|
||||
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_WRITE_BIT,
|
||||
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_SHADER_READ_BIT);
|
||||
@@ -575,17 +680,22 @@ VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int sce
|
||||
cur = NULL; cur_ds = g_scene.ds;
|
||||
}
|
||||
|
||||
enum { FX_FXAA, FX_SMAA, FX_TOON, FX_COLOR, FX_CAS, FX_HDR, FX_NTSC, FX_CRT, FX_DEBAND };
|
||||
enum { FX_FXAA, FX_FXAA_TOON, FX_SMAA, FX_TOON, FX_COLOR, FX_TOON_COLOR, FX_CAS, FX_HDR, FX_NTSC, FX_CRT, FX_DEBAND };
|
||||
int order[8], n = 0;
|
||||
if (s->aa_mode == 1) order[n++] = FX_FXAA;
|
||||
if (s->aa_mode == 1)
|
||||
order[n++] = fuse_fxaa_toon ? FX_FXAA_TOON : FX_FXAA;
|
||||
else if (s->aa_mode == 2) order[n++] = FX_SMAA;
|
||||
if (s->toon) order[n++] = FX_TOON;
|
||||
if (s->color_on) order[n++] = FX_COLOR;
|
||||
if (s->toon && s->color_on && g_fx_fmt == FX_FORMAT) {
|
||||
order[n++] = FX_TOON_COLOR;
|
||||
} else {
|
||||
if (s->toon && !fuse_fxaa_toon) order[n++] = FX_TOON;
|
||||
if (s->color_on) order[n++] = FX_COLOR;
|
||||
}
|
||||
if (cas_active(s)) order[n++] = FX_CAS;
|
||||
if (s->hdr_on) order[n++] = FX_HDR;
|
||||
if (s->ntsc) order[n++] = FX_NTSC;
|
||||
if (s->crt) order[n++] = FX_CRT;
|
||||
if (s->deband_on) order[n++] = FX_DEBAND;
|
||||
if (deband_active(s)) order[n++] = FX_DEBAND;
|
||||
for (int i = 0; i < n; i++) {
|
||||
struct fx_target *dst = FREE_TARGET();
|
||||
struct pc_res pr = {0};
|
||||
@@ -593,8 +703,29 @@ VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int sce
|
||||
pr.res[0] = (float)cw; pr.res[1] = (float)ch;
|
||||
switch (order[i]) {
|
||||
case FX_FXAA: pass(cmd, g_pipe[P_FXAA], dst, cur_ds, &pr, sizeof(pr)); break;
|
||||
case FX_SMAA: pass(cmd, g_pipe[P_SMAA], dst, cur_ds, &pr, sizeof(pr)); break;
|
||||
case FX_FXAA_TOON: pass(cmd, g_pipe[P_FXAA_TOON], dst, cur_ds, &pr, sizeof(pr)); break;
|
||||
case FX_SMAA:
|
||||
pass_renderpass(cmd, g_smaa_rp, g_pipe[P_SMAA_EDGE],
|
||||
&g_smaa_edges, cur_ds, &pr, sizeof(pr));
|
||||
pass_renderpass(cmd, g_smaa_rp, g_pipe[P_SMAA_WEIGHTS],
|
||||
&g_smaa_weights, g_smaa_edges.ds, &pr, sizeof(pr));
|
||||
pass_dual(cmd, g_pipe[P_SMAA_BLEND], dst, cur_ds,
|
||||
g_smaa_weights.ds, &pr, sizeof(pr));
|
||||
break;
|
||||
case FX_TOON: pass(cmd, g_pipe[P_TOON], dst, cur_ds, &pr, sizeof(pr)); break;
|
||||
case FX_TOON_COLOR: {
|
||||
struct pc_toon_color pc = {0};
|
||||
SET_NDC(pc);
|
||||
pc.res[0] = (float)cw;
|
||||
pc.res[1] = (float)ch;
|
||||
pc.b = s->brightness;
|
||||
pc.c = s->contrast;
|
||||
pc.g = s->gamma;
|
||||
pc.s = s->saturation;
|
||||
pass(cmd, g_pipe[P_TOON_COLOR], dst, cur_ds,
|
||||
&pc, sizeof(pc));
|
||||
break;
|
||||
}
|
||||
case FX_COLOR: {
|
||||
struct pc_color pc = {0};
|
||||
SET_NDC(pc);
|
||||
@@ -605,7 +736,6 @@ VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int sce
|
||||
case FX_CAS: pr.extra = (float)s->cas_pct / 100.0f; pass(cmd, g_pipe[P_CAS], dst, cur_ds, &pr, sizeof(pr)); break;
|
||||
case FX_HDR: pass(cmd, g_pipe[P_HDR], dst, cur_ds, &pr, sizeof(pr)); break;
|
||||
case FX_NTSC:
|
||||
pr.extra = (float)(g_ntsc_frame++ & 3u);
|
||||
pass(cmd, g_pipe[P_NTSC], dst, cur_ds, &pr, sizeof(pr));
|
||||
break;
|
||||
case FX_CRT: pass(cmd, g_pipe[P_CRT], dst, cur_ds, &pr, sizeof(pr)); break;
|
||||
|
||||
@@ -23,7 +23,7 @@ void vkp_effects_destroy(void);
|
||||
|
||||
void vkp_effects_forget_image(VkImage img);
|
||||
|
||||
void vkp_effects_set_formats(VkFormat scene_fmt, VkFormat target_fmt);
|
||||
void vkp_effects_set_formats(VkFormat scene_fmt, VkFormat target_fmt, int scene_is_pq);
|
||||
|
||||
void vkp_effects_set_scaling(int mode);
|
||||
void vkp_effects_set_upscale_sharpness(int pct);
|
||||
|
||||
@@ -163,6 +163,7 @@ struct layer {
|
||||
ARect geo_src, geo_dst;
|
||||
int geo_valid;
|
||||
int alloc_tier;
|
||||
unsigned import_failed_fmts;
|
||||
uint64_t pool_modifier;
|
||||
int first_logged;
|
||||
int64_t drop_logged_ns;
|
||||
@@ -487,7 +488,8 @@ static const char *tier_name(int tier) {
|
||||
|
||||
static int alloc_slot(struct layer *l, struct slot *s, int w, int h, uint32_t fmt) {
|
||||
g_alloc_failed = 0;
|
||||
while (l->alloc_tier <= TIER_LINEAR) {
|
||||
const unsigned fmt_bit = fmt == AHB_RGB10A2 ? 2u : 1u;
|
||||
while (l->alloc_tier <= TIER_LINEAR && !(l->import_failed_fmts & fmt_bit)) {
|
||||
const int tier = l->alloc_tier;
|
||||
AHardwareBuffer_Desc d = {
|
||||
.width = (uint32_t)w, .height = (uint32_t)h, .layers = 1,
|
||||
@@ -560,6 +562,7 @@ static int alloc_slot(struct layer *l, struct slot *s, int w, int h, uint32_t fm
|
||||
nh ? nh->numFds : -1, nh ? nh->numInts : -1, hd);
|
||||
AHardwareBuffer_release(ahb);
|
||||
if (tier < TIER_LINEAR) { l->alloc_tier = tier + 1; continue; }
|
||||
l->import_failed_fmts |= fmt_bit;
|
||||
g_alloc_failed = 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1494,7 +1494,7 @@ struct vkp_image *vkp_image_from_ahb(AHardwareBuffer *ahb) {
|
||||
}
|
||||
|
||||
int vkp_can_import_ahb(void) {
|
||||
return dev_init() == 0 && g_vendor_id != VKP_VENDOR_QUALCOMM && g_ahb_import &&
|
||||
return dev_init() == 0 && g_vendor_id != VKP_VENDOR_QUALCOMM && !g_library_name && g_ahb_import &&
|
||||
g_vk.GetAndroidHardwareBufferPropertiesANDROID;
|
||||
}
|
||||
|
||||
@@ -2309,11 +2309,15 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
|
||||
|
||||
int drawn = 0;
|
||||
int hdr_how = 0;
|
||||
if (hf && pass && n > 0 &&
|
||||
const int hdr_compose_requested = hf && pass && n > 0;
|
||||
int hdr_unconverted = 0;
|
||||
if (hdr_compose_requested &&
|
||||
compose_hdr(cmd, draws, n, hf, scene_w, scene_h, scene_img, scene_fmt,
|
||||
g_swap_is_hdr ? HDRC_OUT_PQ : HDRC_OUT_SDR) == 0) {
|
||||
hdr_how = g_swap_is_hdr ? 1 : 2;
|
||||
drawn = n;
|
||||
} else if (hdr_compose_requested) {
|
||||
hdr_unconverted = 1;
|
||||
}
|
||||
for (int i = 0; i < draw_n && !hdr_how; i++) {
|
||||
VkImageBlit blit;
|
||||
@@ -2344,7 +2348,7 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
|
||||
if (fx) {
|
||||
int mapped_w = (int)(scene_w * g_map.kx + 0.5f), mapped_h = (int)(scene_h * g_map.ky + 0.5f);
|
||||
if (fg && !vkp_effects_sharpening()) { mapped_w = scene_w; mapped_h = scene_h; }
|
||||
vkp_effects_set_formats(scene_fmt, scene_fmt);
|
||||
vkp_effects_set_formats(scene_fmt, scene_fmt, hdr_how == 1 || hdr_unconverted);
|
||||
result = vkp_effects_run(cmd, scene_img, input_w, input_h, mapped_w, mapped_h, &rw, &rh);
|
||||
effects_overlay_draws(cmd, result, rw, rh, scene_w, scene_h,
|
||||
draws ? draws + overlay_start : NULL, n - overlay_start);
|
||||
@@ -2869,7 +2873,7 @@ static int pass_begin_impl(int scene_w, int scene_h, const struct vkp_draw *draw
|
||||
g_vk.EndCommandBuffer(cmd);
|
||||
return -1;
|
||||
}
|
||||
if (vkp_effects_active()) vkp_effects_set_formats(scene_fmt, scene_fmt);
|
||||
if (vkp_effects_active()) vkp_effects_set_formats(scene_fmt, scene_fmt, !hf->tonemap);
|
||||
} else {
|
||||
VkClearColorValue black = {.float32 = {0.0f, 0.0f, 0.0f, 1.0f}};
|
||||
g_vk.CmdClearColorImage(cmd, g_scene.img, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &black, 1, &range);
|
||||
@@ -2884,7 +2888,7 @@ static int pass_begin_impl(int scene_w, int scene_h, const struct vkp_draw *draw
|
||||
record_draw(cmd, &pass_draws[i], &blit, g_scene.img, SCENE_FMT, input_w, input_h,
|
||||
VK_FILTER_LINEAR);
|
||||
}
|
||||
if (vkp_effects_active()) vkp_effects_set_formats(VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM);
|
||||
if (vkp_effects_active()) vkp_effects_set_formats(VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM, 0);
|
||||
}
|
||||
|
||||
int mapped_w = (int)(scene_w * g_map.kx + 0.5f), mapped_h = (int)(scene_h * g_map.ky + 0.5f);
|
||||
|
||||
@@ -63,6 +63,7 @@ static jclass g_compositor_cls;
|
||||
static jmethodID g_on_first_frame;
|
||||
static jmethodID g_on_game_surface;
|
||||
static jmethodID g_on_game_frame;
|
||||
static jmethodID g_on_compositor_frame;
|
||||
static jmethodID g_on_game_program;
|
||||
static jmethodID g_on_pointer_lock;
|
||||
static jmethodID g_on_clipboard;
|
||||
@@ -84,6 +85,7 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
g_on_game_surface = (*env)->GetStaticMethodID(env, g_compositor_cls, "onGameSurface",
|
||||
"(Ljava/lang/String;Ljava/lang/String;)V");
|
||||
g_on_game_frame = (*env)->GetStaticMethodID(env, g_compositor_cls, "onGameFrame", "()V");
|
||||
g_on_compositor_frame = (*env)->GetStaticMethodID(env, g_compositor_cls, "onCompositorFrame", "()V");
|
||||
g_on_game_program = (*env)->GetStaticMethodID(env, g_compositor_cls, "onGameProgram",
|
||||
"(ILjava/lang/String;)V");
|
||||
if ((*env)->ExceptionCheck(env)) { (*env)->ExceptionClear(env); g_on_game_program = NULL; }
|
||||
@@ -154,6 +156,13 @@ void droiddeck_on_game_frame(void) {
|
||||
if ((*env)->ExceptionCheck(env)) (*env)->ExceptionClear(env);
|
||||
}
|
||||
|
||||
void droiddeck_on_compositor_frame(void) {
|
||||
JNIEnv *env;
|
||||
if (!g_compositor_cls || !g_on_compositor_frame || !(env = thread_env())) return;
|
||||
(*env)->CallStaticVoidMethod(env, g_compositor_cls, g_on_compositor_frame);
|
||||
if ((*env)->ExceptionCheck(env)) (*env)->ExceptionClear(env);
|
||||
}
|
||||
|
||||
void droiddeck_on_refresh_target(int refresh, int frame_rate) {
|
||||
JNIEnv *env;
|
||||
if (!g_compositor_cls || !g_on_refresh_target || !(env = thread_env())) return;
|
||||
|
||||
@@ -55,7 +55,7 @@ class App : Application() {
|
||||
com.droiddeck.launcher.session.QuestExperimental.initialize(this)
|
||||
com.droiddeck.launcher.session.SessionPrefs.applyNtsyncDefault(this)
|
||||
com.droiddeck.launcher.session.SessionPrefs.settleGpuDriverMode(this)
|
||||
com.droiddeck.launcher.session.SessionPrefs.settleStoresTabOrder(this, com.droiddeck.launcher.stores.Store.entries.map { it.id })
|
||||
com.droiddeck.launcher.session.SessionPrefs.settleStoresTabOrder(this, com.droiddeck.launcher.stores.Store.tabbed.map { it.id })
|
||||
com.droiddeck.launcher.update.AppUpdates.init(this)
|
||||
com.droiddeck.launcher.update.UpdateWatch.sync(this, com.droiddeck.launcher.update.AppUpdates.follow(this, null))
|
||||
com.droiddeck.launcher.core.DownloadSource.init(this)
|
||||
@@ -80,6 +80,7 @@ class App : Application() {
|
||||
com.droiddeck.launcher.stores.ea.EaBackend.app = this
|
||||
com.droiddeck.launcher.stores.StoresState.register(com.droiddeck.launcher.stores.ea.EaBackend)
|
||||
com.droiddeck.launcher.stores.StoresState.register(com.droiddeck.launcher.stores.rockstar.RockstarBackend)
|
||||
com.droiddeck.launcher.stores.StoresState.register(com.droiddeck.launcher.stores.steam.SteamBackend)
|
||||
}
|
||||
|
||||
private fun prefetchAddonPacks() {
|
||||
|
||||
@@ -1,589 +0,0 @@
|
||||
package com.droiddeck.launcher
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.view.InputDevice
|
||||
import android.view.KeyEvent
|
||||
import android.view.MotionEvent
|
||||
import android.view.WindowManager
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.gestures.awaitEachGesture
|
||||
import androidx.compose.foundation.gestures.awaitFirstDown
|
||||
import androidx.compose.foundation.gestures.waitForUpOrCancellation
|
||||
import androidx.compose.foundation.horizontalScroll
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.BoxWithConstraints
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.offset
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.geometry.Offset
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.input.pointer.pointerInput
|
||||
import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.IntOffset
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.droiddeck.launcher.core.AppLanguage
|
||||
import com.droiddeck.launcher.input.bt.BtGamepad
|
||||
import com.droiddeck.launcher.input.bt.BtPadProfile
|
||||
import com.droiddeck.launcher.input.bt.BtPadState
|
||||
import com.droiddeck.launcher.ui.DroidDeckTheme
|
||||
import com.droiddeck.launcher.ui.LocalPalette
|
||||
import com.droiddeck.launcher.ui.PrimaryButton
|
||||
import com.droiddeck.launcher.ui.SecondaryButton
|
||||
import kotlin.math.hypot
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
class BtControllerActivity : ComponentActivity() {
|
||||
private val physical = BtPadState()
|
||||
private val touch = BtPadState()
|
||||
private val merged = BtPadState()
|
||||
private var keyButtons = 0
|
||||
private var hatButtons = 0
|
||||
private var touchEpoch by mutableStateOf(0)
|
||||
private val main = Handler(Looper.getMainLooper())
|
||||
private val exitHold = Runnable { finish() }
|
||||
private var exitArmed = false
|
||||
private var profile by mutableStateOf(BtPadProfile.GENERIC)
|
||||
private var showTouch by mutableStateOf(true)
|
||||
private var permissionDenied by mutableStateOf(false)
|
||||
private var locationDenied by mutableStateOf(false)
|
||||
|
||||
override fun attachBaseContext(newBase: Context) = super.attachBaseContext(AppLanguage.wrap(newBase))
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||
val prefs = prefs(this)
|
||||
profile = BtPadProfile.byId(prefs.getString(KEY_PROFILE, null))
|
||||
showTouch = prefs.getBoolean(KEY_TOUCH, true)
|
||||
val wanted = if (Build.VERSION.SDK_INT >= 31) NEARBY + LOCATION else LOCATION
|
||||
val missing = wanted.filter { checkSelfPermission(it) != PackageManager.PERMISSION_GRANTED }
|
||||
if (missing.isEmpty()) startPad() else requestPermissions(missing.toTypedArray(), REQUEST_NEARBY)
|
||||
setContent { DroidDeckTheme { Screen() } }
|
||||
}
|
||||
|
||||
private fun openAppInfo() {
|
||||
runCatching {
|
||||
startActivity(Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS, android.net.Uri.fromParts("package", packageName, null)))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
locationDenied = LOCATION.any { checkSelfPermission(it) != PackageManager.PERMISSION_GRANTED }
|
||||
if (permissionDenied && Build.VERSION.SDK_INT >= 31 && NEARBY.all { checkSelfPermission(it) == PackageManager.PERMISSION_GRANTED }) {
|
||||
permissionDenied = false
|
||||
startPad()
|
||||
}
|
||||
}
|
||||
|
||||
private fun startPad() {
|
||||
BtGamepad.start(this, profile)
|
||||
BtGamepad.openPairingWindow()
|
||||
}
|
||||
|
||||
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
||||
if (requestCode != REQUEST_NEARBY) return
|
||||
val nearbyDenied = Build.VERSION.SDK_INT >= 31 && NEARBY.any { checkSelfPermission(it) != PackageManager.PERMISSION_GRANTED }
|
||||
permissionDenied = nearbyDenied
|
||||
locationDenied = LOCATION.any { checkSelfPermission(it) != PackageManager.PERMISSION_GRANTED }
|
||||
if (!nearbyDenied) startPad()
|
||||
}
|
||||
|
||||
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
||||
super.onWindowFocusChanged(hasFocus)
|
||||
if (hasFocus) return
|
||||
physical.set(BtPadState())
|
||||
touch.set(BtPadState())
|
||||
touchEpoch++
|
||||
keyButtons = 0
|
||||
hatButtons = 0
|
||||
push()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
main.removeCallbacks(exitHold)
|
||||
if (isFinishing) BtGamepad.stop()
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
private fun pickProfile(p: BtPadProfile) {
|
||||
if (p == profile) return
|
||||
profile = p
|
||||
prefs(this).edit().putString(KEY_PROFILE, p.id).apply()
|
||||
BtGamepad.switchProfile(p)
|
||||
}
|
||||
|
||||
private fun push() {
|
||||
physical.buttons = keyButtons or hatButtons
|
||||
merged.merge(physical, touch)
|
||||
BtGamepad.update(merged)
|
||||
val combo = BtPadState.SELECT or BtPadState.START
|
||||
val held = physical.buttons and combo == combo
|
||||
if (held && !exitArmed) main.postDelayed(exitHold, EXIT_HOLD_MS)
|
||||
else if (!held && exitArmed) main.removeCallbacks(exitHold)
|
||||
exitArmed = held
|
||||
}
|
||||
|
||||
private fun isPad(event: KeyEvent): Boolean {
|
||||
val s = event.source
|
||||
return s and InputDevice.SOURCE_GAMEPAD == InputDevice.SOURCE_GAMEPAD ||
|
||||
s and InputDevice.SOURCE_JOYSTICK == InputDevice.SOURCE_JOYSTICK ||
|
||||
KeyEvent.isGamepadButton(event.keyCode)
|
||||
}
|
||||
|
||||
override fun dispatchKeyEvent(event: KeyEvent): Boolean {
|
||||
val bit = KEYS[event.keyCode]
|
||||
if (bit == null || event.keyCode in DPAD_KEYS && !isPad(event) && event.source and InputDevice.SOURCE_DPAD != InputDevice.SOURCE_DPAD) {
|
||||
return super.dispatchKeyEvent(event)
|
||||
}
|
||||
when (event.action) {
|
||||
KeyEvent.ACTION_DOWN -> keyButtons = keyButtons or bit
|
||||
KeyEvent.ACTION_UP -> keyButtons = keyButtons and bit.inv()
|
||||
}
|
||||
push()
|
||||
return true
|
||||
}
|
||||
|
||||
override fun dispatchGenericMotionEvent(event: MotionEvent): Boolean {
|
||||
if (event.source and InputDevice.SOURCE_JOYSTICK != InputDevice.SOURCE_JOYSTICK || event.action != MotionEvent.ACTION_MOVE) {
|
||||
return super.dispatchGenericMotionEvent(event)
|
||||
}
|
||||
val device = event.device
|
||||
fun axis(code: Int): Float {
|
||||
val range = device?.getMotionRange(code, event.source) ?: return 0f
|
||||
val v = event.getAxisValue(code)
|
||||
return if (Math.abs(v) > maxOf(range.flat, 0.04f)) v else 0f
|
||||
}
|
||||
val hasZ = device?.getMotionRange(MotionEvent.AXIS_Z, event.source) != null
|
||||
physical.lx = axis(MotionEvent.AXIS_X); physical.ly = axis(MotionEvent.AXIS_Y)
|
||||
physical.rx = axis(if (hasZ) MotionEvent.AXIS_Z else MotionEvent.AXIS_RX)
|
||||
physical.ry = axis(if (hasZ) MotionEvent.AXIS_RZ else MotionEvent.AXIS_RY)
|
||||
physical.lt = maxOf(axis(MotionEvent.AXIS_LTRIGGER), axis(MotionEvent.AXIS_BRAKE))
|
||||
physical.rt = maxOf(axis(MotionEvent.AXIS_RTRIGGER), axis(MotionEvent.AXIS_GAS))
|
||||
val hx = event.getAxisValue(MotionEvent.AXIS_HAT_X)
|
||||
val hy = event.getAxisValue(MotionEvent.AXIS_HAT_Y)
|
||||
hatButtons = (if (hy < -0.5f) BtPadState.UP else 0) or (if (hy > 0.5f) BtPadState.DOWN else 0) or
|
||||
(if (hx < -0.5f) BtPadState.LEFT else 0) or (if (hx > 0.5f) BtPadState.RIGHT else 0)
|
||||
push()
|
||||
return true
|
||||
}
|
||||
|
||||
private fun touchButton(bit: Int, down: Boolean) {
|
||||
touch.buttons = if (down) touch.buttons or bit else touch.buttons and bit.inv()
|
||||
if (bit == BtPadState.LT) touch.lt = if (down) 1f else 0f
|
||||
if (bit == BtPadState.RT) touch.rt = if (down) 1f else 0f
|
||||
push()
|
||||
}
|
||||
|
||||
private fun touchStick(left: Boolean, x: Float, y: Float) {
|
||||
if (left) { touch.lx = x; touch.ly = y } else { touch.rx = x; touch.ry = y }
|
||||
push()
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Screen() {
|
||||
val status by BtGamepad.status.collectAsState()
|
||||
val colors = MaterialTheme.colorScheme
|
||||
Column(Modifier.fillMaxSize().background(colors.background).padding(horizontal = 12.dp, vertical = 8.dp)) {
|
||||
Panel(status)
|
||||
if (showTouch) {
|
||||
TouchPad(Modifier.weight(1f).fillMaxWidth().padding(top = 6.dp), status)
|
||||
} else {
|
||||
Column(Modifier.weight(1f).fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(12.dp, Alignment.CenterVertically),
|
||||
horizontalAlignment = Alignment.CenterHorizontally) {
|
||||
Instructions(status, Modifier.widthIn(max = 480.dp))
|
||||
Text(stringResource(R.string.btpad_physical_hint), fontSize = 15.sp, color = colors.onSurfaceVariant)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Panel(status: BtGamepad.Status) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val connected = status.phase == BtGamepad.Phase.CONNECTED
|
||||
BoxWithConstraints(Modifier.fillMaxWidth()) {
|
||||
val narrow = maxWidth < 600.dp
|
||||
val types: @Composable (Modifier) -> Unit = { m ->
|
||||
Row(m.horizontalScroll(rememberScrollState()), horizontalArrangement = Arrangement.spacedBy(6.dp), verticalAlignment = Alignment.CenterVertically) {
|
||||
BtPadProfile.entries.forEach { p -> Chip(profileLabel(p), p == profile) { pickProfile(p) } }
|
||||
Chip(stringResource(R.string.btpad_touch), showTouch) {
|
||||
showTouch = !showTouch
|
||||
prefs(this@BtControllerActivity).edit().putBoolean(KEY_TOUCH, showTouch).apply()
|
||||
}
|
||||
}
|
||||
}
|
||||
Column {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
Box(Modifier.size(10.dp).clip(CircleShape).background(status.lightbar?.let { Color(it) } ?: if (connected) pal.signal else colors.onSurfaceVariant.copy(alpha = 0.4f)))
|
||||
Column(if (narrow) Modifier.weight(1f) else Modifier.widthIn(max = 220.dp)) {
|
||||
Text(shortStatus(status), fontSize = 13.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||
Text(stringResource(if (connected) R.string.btpad_exit_hint else R.string.btpad_switch_hint), fontSize = 11.sp,
|
||||
color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||
}
|
||||
if (!narrow) types(Modifier.weight(1f))
|
||||
if (locationDenied && !permissionDenied && !connected) SecondaryButton(stringResource(R.string.btpad_permission_open), compact = true) { openAppInfo() }
|
||||
if (permissionDenied) PrimaryButton(stringResource(R.string.btpad_permission_open), compact = true) { openAppInfo() }
|
||||
else if (connected) SecondaryButton(stringResource(R.string.btpad_disconnect), compact = true) { BtGamepad.disconnect() }
|
||||
else PrimaryButton(stringResource(R.string.btpad_pair), compact = true, enabled = status.phase == BtGamepad.Phase.READY) { BtGamepad.openPairingWindow() }
|
||||
SecondaryButton(stringResource(R.string.btpad_close), compact = true) { finish() }
|
||||
}
|
||||
if (narrow) types(Modifier.padding(top = 6.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun shortStatus(status: BtGamepad.Status): String =
|
||||
if (status.phase == BtGamepad.Phase.READY && !permissionDenied) stringResource(R.string.btpad_status_waiting) else statusText(status)
|
||||
|
||||
@Composable
|
||||
private fun Instructions(status: BtGamepad.Status, modifier: Modifier, size: androidx.compose.ui.unit.TextUnit = 14.sp) {
|
||||
if (status.phase == BtGamepad.Phase.CONNECTED) return
|
||||
val text = statusText(status) + if (locationDenied && !permissionDenied) "\n\n" + stringResource(R.string.btpad_location_hint) else ""
|
||||
Text(text, fontSize = size, color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
textAlign = androidx.compose.ui.text.style.TextAlign.Center, modifier = modifier)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun statusText(status: BtGamepad.Status): String = if (permissionDenied) stringResource(R.string.btpad_status_permission) else when (status.phase) {
|
||||
BtGamepad.Phase.OFF, BtGamepad.Phase.STARTING -> stringResource(R.string.btpad_status_starting)
|
||||
BtGamepad.Phase.BLUETOOTH_OFF -> stringResource(R.string.btpad_status_bt_off)
|
||||
BtGamepad.Phase.UNSUPPORTED -> stringResource(R.string.btpad_status_unsupported)
|
||||
BtGamepad.Phase.READY -> stringResource(R.string.btpad_status_ready, status.name ?: "")
|
||||
BtGamepad.Phase.CONNECTING -> stringResource(R.string.btpad_status_connecting, status.host ?: "")
|
||||
BtGamepad.Phase.CONNECTED -> stringResource(R.string.btpad_status_connected, status.host ?: "")
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun profileLabel(p: BtPadProfile) = stringResource(when (p) {
|
||||
BtPadProfile.GENERIC -> R.string.btpad_profile_generic
|
||||
BtPadProfile.XBOX -> R.string.btpad_profile_xbox
|
||||
BtPadProfile.DUALSHOCK4 -> R.string.btpad_profile_ds4
|
||||
BtPadProfile.DUALSENSE -> R.string.btpad_profile_dualsense
|
||||
BtPadProfile.STEAM -> R.string.btpad_profile_steam
|
||||
})
|
||||
|
||||
@Composable
|
||||
private fun Chip(label: String, on: Boolean, enabled: Boolean = true, onClick: () -> Unit) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
Text(label, fontSize = 13.sp, fontWeight = FontWeight.SemiBold,
|
||||
color = if (on) colors.background else if (enabled) colors.onBackground else colors.onSurfaceVariant,
|
||||
modifier = Modifier.clip(CircleShape).background(if (on) pal.signal else colors.surface)
|
||||
.border(1.dp, if (on) pal.signal else pal.line2, CircleShape)
|
||||
.clickable(enabled = enabled, onClick = onClick).padding(horizontal = 12.dp, vertical = 6.dp))
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun TouchPad(modifier: Modifier, status: BtGamepad.Status) {
|
||||
val lightbar = status.lightbar
|
||||
val sony = profile == BtPadProfile.DUALSHOCK4 || profile == BtPadProfile.DUALSENSE
|
||||
val steam = profile == BtPadProfile.STEAM
|
||||
BoxWithConstraints(modifier) {
|
||||
val w = maxWidth
|
||||
val h = maxHeight
|
||||
val stick = minOf(h * (if (steam) 0.38f else 0.46f), w * 0.2f)
|
||||
val face = stick * 0.4f
|
||||
val cluster = face * 3f
|
||||
val shoulderW = minOf(w * 0.09f, stick * 0.75f)
|
||||
val shoulderH = minOf(h * 0.13f, 44.dp)
|
||||
val small = shoulderH * 0.85f
|
||||
@Composable
|
||||
fun at(fx: Float, fy: Float, bw: Dp, bh: Dp, content: @Composable () -> Unit) {
|
||||
val x = (w * fx - bw / 2).coerceIn(0.dp, w - bw)
|
||||
val y = (h * fy - bh / 2).coerceIn(0.dp, h - bh)
|
||||
Box(Modifier.offset(x, y).size(bw, bh), contentAlignment = Alignment.Center) { content() }
|
||||
}
|
||||
val shoulderY = shoulderH / h / 2f
|
||||
at(0.0f, shoulderY, shoulderW, shoulderH) { PadButton(if (sony) "L2" else "LT", BtPadState.LT, shoulderW, shoulderH) }
|
||||
val second = (shoulderW * 1.5f + 8.dp) / w
|
||||
at(second, shoulderY, shoulderW, shoulderH) { PadButton(if (sony) "L1" else "LB", BtPadState.LB, shoulderW, shoulderH) }
|
||||
at(1f - second, shoulderY, shoulderW, shoulderH) { PadButton(if (sony) "R1" else "RB", BtPadState.RB, shoulderW, shoulderH) }
|
||||
at(1.0f, shoulderY, shoulderW, shoulderH) { PadButton(if (sony) "R2" else "RT", BtPadState.RT, shoulderW, shoulderH) }
|
||||
val menuW = shoulderW * 0.95f
|
||||
val menu = listOfNotNull(
|
||||
Triple(if (sony) "Share" else "View", BtPadState.SELECT, null),
|
||||
Triple(if (sony) "PS" else if (steam) "Steam" else "Home", BtPadState.GUIDE, lightbar),
|
||||
if (steam) Triple("···", BtPadState.SHARE, null) else null,
|
||||
Triple(if (sony) "Options" else "Menu", BtPadState.START, null),
|
||||
)
|
||||
menu.forEachIndexed { i, (label, bit, tint) ->
|
||||
val fx = 0.5f + (i - (menu.size - 1) / 2f) * ((menuW + 8.dp) / w)
|
||||
at(fx, shoulderY, menuW, small) { PadButton(label, bit, menuW, small, tint = tint?.let { Color(it) }) }
|
||||
}
|
||||
val steamPad = minOf(h * 0.4f, w * 0.2f)
|
||||
val infoW = if (steam) w * 0.4f - steamPad - 12.dp else w * 0.3f
|
||||
val infoH = if (steam) h * 0.3f else h * 0.22f
|
||||
at(0.5f, if (steam) 0.72f else 0.3f, infoW, infoH) { Instructions(status, Modifier.fillMaxWidth(), if (steam) 12.sp else 14.sp) }
|
||||
if (steam) {
|
||||
val rearY = (shoulderH * 1.6f) / h
|
||||
at(0.0f, rearY, shoulderW, small) { PadButton("L5", BtPadState.L5, shoulderW, small) }
|
||||
at(second, rearY, shoulderW, small) { PadButton("L4", BtPadState.L4, shoulderW, small) }
|
||||
at(1f - second, rearY, shoulderW, small) { PadButton("R4", BtPadState.R4, shoulderW, small) }
|
||||
at(1.0f, rearY, shoulderW, small) { PadButton("R5", BtPadState.R5, shoulderW, small) }
|
||||
val pad = steamPad
|
||||
at(0.11f, 0.5f, stick, stick) { Stick(stick, left = true) }
|
||||
at(0.89f, 0.5f, stick, stick) { Stick(stick, left = false) }
|
||||
at(0.3f, 0.34f, cluster, cluster) { Cross(face) }
|
||||
at(0.7f, 0.34f, cluster, cluster) { Diamond(face, false) }
|
||||
at(0.3f, 1f, pad, pad) { Trackpad(pad, left = true) }
|
||||
at(0.7f, 1f, pad, pad) { Trackpad(pad, left = false) }
|
||||
at(0.44f, 0.94f, menuW, small) { PadButton("L3", BtPadState.L3, menuW, small) }
|
||||
at(0.56f, 0.94f, menuW, small) { PadButton("R3", BtPadState.R3, menuW, small) }
|
||||
} else {
|
||||
at(0.12f, 0.45f, stick, stick) { Stick(stick, left = true) }
|
||||
at(0.88f, 0.45f, cluster, cluster) { Diamond(face, sony) }
|
||||
at(0.32f, 0.78f, cluster, cluster) { Cross(face) }
|
||||
at(0.68f, 0.78f, stick, stick) { Stick(stick, left = false) }
|
||||
at(0.42f, 0.5f, menuW, small) { PadButton("L3", BtPadState.L3, menuW, small) }
|
||||
at(0.58f, 0.5f, menuW, small) { PadButton("R3", BtPadState.R3, menuW, small) }
|
||||
if (sony) at(0.5f, 0.68f, menuW * 1.6f, small * 1.4f) { PadButton("Touchpad", BtPadState.TOUCHPAD, menuW * 1.6f, small * 1.4f) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Trackpad(size: Dp, left: Boolean) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
var dot by remember { mutableStateOf<Offset?>(null) }
|
||||
val px = with(LocalDensity.current) { size.toPx() }
|
||||
Box(
|
||||
Modifier.size(size).clip(RoundedCornerShape(18.dp)).background(colors.surface).border(1.dp, pal.line2, RoundedCornerShape(18.dp))
|
||||
.pointerInput(left, touchEpoch) {
|
||||
awaitEachGesture {
|
||||
val first = awaitFirstDown(requireUnconsumed = false)
|
||||
val started = first.uptimeMillis
|
||||
fun norm(p: Offset) = Offset((p.x / this.size.width * 2f - 1f).coerceIn(-1f, 1f), (p.y / this.size.height * 2f - 1f).coerceIn(-1f, 1f))
|
||||
var moved = 0f
|
||||
var last = norm(first.position)
|
||||
dot = last
|
||||
touchPad(left, last, true)
|
||||
var upTime = started
|
||||
try {
|
||||
while (true) {
|
||||
val change = awaitPointerEvent().changes.firstOrNull { it.id == first.id } ?: break
|
||||
if (!change.pressed) { upTime = change.uptimeMillis; break }
|
||||
change.consume()
|
||||
val p = norm(change.position)
|
||||
moved += (p - last).getDistance()
|
||||
last = p
|
||||
dot = p
|
||||
touchPad(left, p, true)
|
||||
}
|
||||
} catch (e: kotlinx.coroutines.CancellationException) {
|
||||
dot = null
|
||||
touchPad(left, last, false)
|
||||
throw e
|
||||
}
|
||||
dot = null
|
||||
if (upTime - started < TAP_MS && moved < 0.15f) clickPad(left, last)
|
||||
else touchPad(left, last, false)
|
||||
}
|
||||
},
|
||||
) {
|
||||
dot?.let { d ->
|
||||
val r = px * 0.08f
|
||||
Box(Modifier.offset { IntOffset(((d.x + 1f) / 2f * px - r).roundToInt(), ((d.y + 1f) / 2f * px - r).roundToInt()) }
|
||||
.size(size * 0.16f).clip(CircleShape).background(pal.signal))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun touchPad(left: Boolean, p: Offset, down: Boolean) {
|
||||
val bit = if (left) BtPadState.LPAD_TOUCH else BtPadState.RPAD_TOUCH
|
||||
touch.buttons = if (down) touch.buttons or bit else touch.buttons and bit.inv()
|
||||
if (left) { touch.lpx = p.x; touch.lpy = p.y } else { touch.rpx = p.x; touch.rpy = p.y }
|
||||
push()
|
||||
}
|
||||
|
||||
private fun clickPad(left: Boolean, p: Offset) {
|
||||
val click = if (left) BtPadState.LPAD_CLICK else BtPadState.RPAD_CLICK
|
||||
touch.buttons = touch.buttons or click
|
||||
touchPad(left, p, true)
|
||||
main.postDelayed({
|
||||
touch.buttons = touch.buttons and click.inv()
|
||||
touchPad(left, p, false)
|
||||
}, CLICK_MS)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Cross(size: Dp) {
|
||||
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
||||
PadButton("▲", BtPadState.UP, size, size)
|
||||
Row {
|
||||
PadButton("◀", BtPadState.LEFT, size, size)
|
||||
Spacer(Modifier.size(size))
|
||||
PadButton("▶", BtPadState.RIGHT, size, size)
|
||||
}
|
||||
PadButton("▼", BtPadState.DOWN, size, size)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Diamond(size: Dp, sony: Boolean) {
|
||||
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
||||
PadButton(if (sony) "△" else "Y", BtPadState.Y, size, size, round = true)
|
||||
Row {
|
||||
PadButton(if (sony) "□" else "X", BtPadState.X, size, size, round = true)
|
||||
Spacer(Modifier.size(size))
|
||||
PadButton(if (sony) "○" else "B", BtPadState.B, size, size, round = true)
|
||||
}
|
||||
PadButton(if (sony) "✕" else "A", BtPadState.A, size, size, round = true)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun PadButton(label: String, bit: Int, width: Dp, height: Dp, round: Boolean = false, tint: Color? = null) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
var down by remember { mutableStateOf(false) }
|
||||
val shape = if (round) CircleShape else RoundedCornerShape(10.dp)
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = Modifier.size(width, height).clip(shape)
|
||||
.background(if (down) pal.signal else tint?.copy(alpha = 0.35f) ?: colors.surface)
|
||||
.border(1.dp, pal.line2, shape)
|
||||
.pointerInput(bit, touchEpoch) {
|
||||
awaitEachGesture {
|
||||
awaitFirstDown(requireUnconsumed = false)
|
||||
down = true; touchButton(bit, true)
|
||||
try {
|
||||
waitForUpOrCancellation()
|
||||
} finally {
|
||||
down = false; touchButton(bit, false)
|
||||
}
|
||||
}
|
||||
},
|
||||
) {
|
||||
Text(label, fontSize = 14.sp, fontWeight = FontWeight.Bold, color = if (down) colors.background else colors.onBackground)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Stick(size: Dp, left: Boolean) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
var knob by remember { mutableStateOf(Offset.Zero) }
|
||||
val px = with(LocalDensity.current) { size.toPx() }
|
||||
val knobSize = size * 0.42f
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = Modifier.size(size).clip(CircleShape).background(colors.surface).border(1.dp, pal.line2, CircleShape)
|
||||
.pointerInput(left, touchEpoch) {
|
||||
awaitEachGesture {
|
||||
val first = awaitFirstDown(requireUnconsumed = false)
|
||||
val radius = this.size.width / 2f
|
||||
val center = Offset(radius, this.size.height / 2f)
|
||||
fun move(p: Offset) {
|
||||
var d = (p - center) / (radius * 0.8f)
|
||||
val len = hypot(d.x, d.y)
|
||||
if (len > 1f) d /= len
|
||||
knob = d
|
||||
touchStick(left, d.x, d.y)
|
||||
}
|
||||
move(first.position)
|
||||
try {
|
||||
while (true) {
|
||||
val change = awaitPointerEvent().changes.firstOrNull { it.id == first.id } ?: break
|
||||
if (!change.pressed) break
|
||||
change.consume()
|
||||
move(change.position)
|
||||
}
|
||||
} finally {
|
||||
knob = Offset.Zero
|
||||
touchStick(left, 0f, 0f)
|
||||
}
|
||||
}
|
||||
},
|
||||
) {
|
||||
val travel = px * 0.29f
|
||||
Box(Modifier.offset { IntOffset((knob.x * travel).roundToInt(), (knob.y * travel).roundToInt()) }
|
||||
.size(knobSize).clip(CircleShape).background(if (knob != Offset.Zero) pal.signal else colors.onSurfaceVariant.copy(alpha = 0.5f)))
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val EXIT_HOLD_MS = 1_500L
|
||||
private const val TAP_MS = 200L
|
||||
private const val CLICK_MS = 90L
|
||||
private const val REQUEST_NEARBY = 41
|
||||
private val NEARBY = listOf("android.permission.BLUETOOTH_ADVERTISE", "android.permission.BLUETOOTH_CONNECT", "android.permission.BLUETOOTH_SCAN")
|
||||
private val LOCATION = listOf("android.permission.ACCESS_FINE_LOCATION")
|
||||
private const val KEY_PROFILE = "btpad_profile"
|
||||
private const val KEY_TOUCH = "btpad_touch"
|
||||
|
||||
private fun prefs(c: Context) = c.getSharedPreferences("trinkets", Context.MODE_PRIVATE)
|
||||
|
||||
private val DPAD_KEYS = setOf(KeyEvent.KEYCODE_DPAD_UP, KeyEvent.KEYCODE_DPAD_DOWN, KeyEvent.KEYCODE_DPAD_LEFT, KeyEvent.KEYCODE_DPAD_RIGHT)
|
||||
|
||||
private val KEYS = mapOf(
|
||||
KeyEvent.KEYCODE_BUTTON_A to BtPadState.A,
|
||||
KeyEvent.KEYCODE_BUTTON_B to BtPadState.B,
|
||||
KeyEvent.KEYCODE_BUTTON_X to BtPadState.X,
|
||||
KeyEvent.KEYCODE_BUTTON_Y to BtPadState.Y,
|
||||
KeyEvent.KEYCODE_BUTTON_L1 to BtPadState.LB,
|
||||
KeyEvent.KEYCODE_BUTTON_R1 to BtPadState.RB,
|
||||
KeyEvent.KEYCODE_BUTTON_L2 to BtPadState.LT,
|
||||
KeyEvent.KEYCODE_BUTTON_R2 to BtPadState.RT,
|
||||
KeyEvent.KEYCODE_BUTTON_SELECT to BtPadState.SELECT,
|
||||
KeyEvent.KEYCODE_BUTTON_START to BtPadState.START,
|
||||
KeyEvent.KEYCODE_BUTTON_MODE to BtPadState.GUIDE,
|
||||
KeyEvent.KEYCODE_BUTTON_THUMBL to BtPadState.L3,
|
||||
KeyEvent.KEYCODE_BUTTON_THUMBR to BtPadState.R3,
|
||||
KeyEvent.KEYCODE_BUTTON_C to BtPadState.L4,
|
||||
KeyEvent.KEYCODE_BUTTON_Z to BtPadState.R4,
|
||||
KeyEvent.KEYCODE_BUTTON_1 to BtPadState.L4,
|
||||
KeyEvent.KEYCODE_BUTTON_2 to BtPadState.R4,
|
||||
KeyEvent.KEYCODE_BUTTON_3 to BtPadState.L5,
|
||||
KeyEvent.KEYCODE_BUTTON_4 to BtPadState.R5,
|
||||
KeyEvent.KEYCODE_DPAD_UP to BtPadState.UP,
|
||||
KeyEvent.KEYCODE_DPAD_DOWN to BtPadState.DOWN,
|
||||
KeyEvent.KEYCODE_DPAD_LEFT to BtPadState.LEFT,
|
||||
KeyEvent.KEYCODE_DPAD_RIGHT to BtPadState.RIGHT,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -53,6 +53,8 @@ import com.droiddeck.launcher.session.SessionLogShare
|
||||
import com.droiddeck.launcher.session.SessionPaths
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import com.droiddeck.launcher.session.SteamRepair
|
||||
import com.droiddeck.launcher.session.LaunchCoordinator
|
||||
import com.droiddeck.launcher.session.LaunchTicket
|
||||
import com.droiddeck.launcher.core.CpuCores
|
||||
import com.droiddeck.launcher.core.DownloadSource
|
||||
import com.droiddeck.launcher.core.PhantomProcessLimit
|
||||
@@ -139,6 +141,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
private var glThread by mutableStateOf(true)
|
||||
private var noGlError by mutableStateOf(true)
|
||||
private var returnAfterGame by mutableStateOf(true)
|
||||
private var valveProtonOnDemand by mutableStateOf(true)
|
||||
private var shaderPrecache by mutableStateOf<Boolean?>(null)
|
||||
private var steamRepairQueued by mutableStateOf(false)
|
||||
private var mangoapp by mutableStateOf(true)
|
||||
@@ -166,6 +169,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
private var battleNetInstalled by mutableStateOf(false)
|
||||
private var offlineAccount by mutableStateOf<String?>(null)
|
||||
private var offline by mutableStateOf(false)
|
||||
private var offlineAuto by mutableStateOf(true)
|
||||
private var showPerformance by mutableStateOf(false)
|
||||
private var clientOverride by mutableStateOf(false)
|
||||
private var clientCores by mutableStateOf<Set<Int>>(emptySet())
|
||||
@@ -188,7 +192,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
private var prootNoSeccomp by mutableStateOf(false)
|
||||
private var prootFastPath by mutableStateOf(true)
|
||||
private var nativeUserland by mutableStateOf(true)
|
||||
private var cursorComposite by mutableStateOf(false)
|
||||
private var cursorComposite by mutableStateOf(true)
|
||||
private var guestHostname by mutableStateOf(SessionPrefs.DEFAULT_GUEST_HOSTNAME)
|
||||
private var phantomWarning by mutableStateOf<String?>(null)
|
||||
private var phantomProcessStatus by mutableStateOf(PhantomProcessStatus.NOT_APPLICABLE)
|
||||
@@ -215,7 +219,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
private var soundtracksLoaded by mutableStateOf(false)
|
||||
private var gameStoresSpeedTier by mutableStateOf("fast")
|
||||
private var navRequest by mutableStateOf<String?>(null)
|
||||
private val gameLaunchRequest = java.util.concurrent.atomic.AtomicLong()
|
||||
private val launchCoordinator = LaunchCoordinator<Intent, com.droiddeck.launcher.frontend.GameRequest>()
|
||||
private var preparingGames by mutableStateOf(emptySet<String>())
|
||||
private var storesShowMature by mutableStateOf(false)
|
||||
private var storesSort by mutableStateOf(SessionPrefs.STORES_SORTS.first())
|
||||
@@ -637,6 +641,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
}
|
||||
private var storageDiagnostics by mutableStateOf(false)
|
||||
private var storageOptions by mutableStateOf<List<GameStorage.Option>>(emptyList())
|
||||
private var storageFat32 by mutableStateOf(false)
|
||||
private val pickGameStorage = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { r ->
|
||||
if (r.resultCode == RESULT_OK) InAppFilePicker.pickedPath(r.data)?.let { path -> setGameStorage(path, GameStorage.labelFor(this, path)) }
|
||||
}
|
||||
@@ -652,6 +657,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
private fun addSteamLibrary(path: String) {
|
||||
Thread({
|
||||
val result = SteamLibraries.add(this, path)
|
||||
val fat32 = result is SteamLibraries.AddResult.Added && GameStorage.isFat32(result.entry.path)
|
||||
ui.post {
|
||||
steamLibraries = SteamLibraries.list(this)
|
||||
refreshFoundSteamLibraries()
|
||||
@@ -662,6 +668,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
result is SteamLibraries.AddResult.Added && result.entry.path != path ->
|
||||
android.widget.Toast.makeText(this, getString(R.string.libraries_used_inner, result.entry.label), android.widget.Toast.LENGTH_LONG).show()
|
||||
}
|
||||
if (fat32) android.widget.Toast.makeText(this, R.string.main_storage_fat32, android.widget.Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}, "steam-library-add").start()
|
||||
}
|
||||
@@ -717,6 +724,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
}
|
||||
}
|
||||
private var secondScreenDisplays by mutableStateOf<List<SecondScreenDisplay>>(emptyList())
|
||||
private var ownScreen by mutableStateOf<SecondScreenDisplay?>(null)
|
||||
private var dualDisplayId by mutableStateOf(-1)
|
||||
private var dualScreenDevice by mutableStateOf(false)
|
||||
private var dualScreenMode by mutableStateOf(com.droiddeck.launcher.input.DualScreen.MODE_AUTO)
|
||||
@@ -893,7 +901,6 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
runCatching { com.droiddeck.launcher.frontend.AutoComponents.restoreMissing(this) }.onFailure { Log.w(TAG, "components: restore failed", it) }
|
||||
}, "components-restore").start()
|
||||
}
|
||||
private var pendingGameLink: com.droiddeck.launcher.frontend.GameRequest? = null
|
||||
private var gameLinkReading = false
|
||||
private var gameLinkTried = false
|
||||
private var gameSyncFolder by mutableStateOf<String?>(null)
|
||||
@@ -919,12 +926,24 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
LauncherIcon.set(this, style)
|
||||
launcherIcon = LauncherIcon.current(this)
|
||||
if (launcherIcon == before) return false
|
||||
restartLauncher()
|
||||
return true
|
||||
}
|
||||
|
||||
// recreate() leaves this activity's window drawing nothing and ignoring input on some devices (#2668).
|
||||
private fun restartLauncher() {
|
||||
LauncherHandoff.put(Bundle().also(::saveLauncherState))
|
||||
switchPoll?.let { ui.removeCallbacks(it) }
|
||||
switchPoll = null
|
||||
switchingTo = null
|
||||
queuedLaunch.clear()
|
||||
cancelCompatLaunch()
|
||||
startActivity(Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER)
|
||||
.setComponent(LauncherIcon.activity(this))
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
|
||||
.putExtra(com.droiddeck.launcher.stores.download.StoreDownloadService.EXTRA_NAV, "setup:launcher"))
|
||||
.putExtra(com.droiddeck.launcher.stores.download.StoreDownloadService.EXTRA_NAV, "setup:launcher")
|
||||
.putExtra(EXTRA_RESTARTED, true))
|
||||
finishAndRemoveTask()
|
||||
return true
|
||||
}
|
||||
|
||||
private fun readGameIntent(request: Intent) {
|
||||
@@ -935,7 +954,6 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
else "settings:" + (com.droiddeck.launcher.ui.SettingsSection.of(section) ?: com.droiddeck.launcher.ui.SettingsSection.OVERVIEW).key
|
||||
request.data = null
|
||||
gameLinkReading = false
|
||||
pendingGameLink = null
|
||||
syncDualPanel()
|
||||
return
|
||||
}
|
||||
@@ -948,7 +966,6 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
steamGames = emptyList()
|
||||
shortcutLibraryScanning = true
|
||||
} else shortcutLibraryScanning = false
|
||||
pendingGameLink = null
|
||||
gameLinkReading = false
|
||||
gameLinkTried = false
|
||||
soundtrackLaunch = false
|
||||
@@ -961,6 +978,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
return
|
||||
}
|
||||
if (GameLaunchIntent.accepts(request.action)) {
|
||||
val ticket = launchCoordinator.beginLink(request)
|
||||
gameLinkReading = true
|
||||
com.droiddeck.launcher.ui.DualScreenPanel.hide(taskId)
|
||||
val copy = Intent(request)
|
||||
@@ -969,12 +987,17 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
ui.post {
|
||||
if (intent === request && !isDestroyed) {
|
||||
gameLinkReading = false
|
||||
pendingGameLink = game
|
||||
if (!launchCoordinator.resolve(ticket, game)) {
|
||||
clearGameLinkIntent(request)
|
||||
syncDualPanel()
|
||||
return@post
|
||||
}
|
||||
if (game == null) {
|
||||
launchCoordinator.consume(ticket)
|
||||
syncDualPanel()
|
||||
android.widget.Toast.makeText(this, R.string.game_link_invalid, android.widget.Toast.LENGTH_LONG).show()
|
||||
} else {
|
||||
handleGameLink(steamGames, scanned = false)
|
||||
handleGameLink(steamGames, scanned = false, ticket = ticket)
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
@@ -983,37 +1006,66 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
}
|
||||
}
|
||||
|
||||
private fun launchGame(game: Library.SteamGame, returnHome: Boolean = false, onHandled: () -> Unit = {}, onSettled: () -> Unit = {}) {
|
||||
val request = gameLaunchRequest.incrementAndGet()
|
||||
private fun beginUiLaunch(): LaunchTicket {
|
||||
val dropped = launchCoordinator.pendingLink()
|
||||
val ticket = launchCoordinator.beginLaunch()
|
||||
dropped?.let { if (intent === it.owner) clearGameLinkIntent(it.owner) }
|
||||
return ticket
|
||||
}
|
||||
|
||||
private fun clearGameLinkIntent(link: Intent) {
|
||||
link.data = null
|
||||
link.action = Intent.ACTION_MAIN
|
||||
link.removeExtra(GameLaunchIntent.EXTRA_APP_ID)
|
||||
}
|
||||
|
||||
private fun launchGame(
|
||||
game: Library.SteamGame,
|
||||
returnHome: Boolean = false,
|
||||
onHandled: () -> Unit = {},
|
||||
onSettled: () -> Unit = {},
|
||||
ticket: LaunchTicket? = null,
|
||||
) {
|
||||
if (!SessionPrefs.soundtracksIngame(this)) com.droiddeck.launcher.playback.SoundtrackController.pause(this)
|
||||
if (pkgStage != null) {
|
||||
ticket?.let(launchCoordinator::releaseHandling)
|
||||
onHandled()
|
||||
android.widget.Toast.makeText(this, R.string.main_wait_install_game, android.widget.Toast.LENGTH_SHORT).show()
|
||||
return
|
||||
}
|
||||
val request = ticket ?: beginUiLaunch()
|
||||
if (!launchCoordinator.isCurrent(request)) {
|
||||
onHandled()
|
||||
return
|
||||
}
|
||||
val files = game.gameFiles
|
||||
if (game.source != com.droiddeck.launcher.stores.Store.XBOX.id || files == null) {
|
||||
if (startGame(game, returnHome, onHandled)) onSettled()
|
||||
if (startGame(game, returnHome, onHandled, request)) onSettled()
|
||||
else launchCoordinator.releaseHandling(request)
|
||||
return
|
||||
}
|
||||
Thread({
|
||||
val refused = com.droiddeck.launcher.stores.xbox.XboxManifest.needsAppModel(files)
|
||||
ui.post {
|
||||
when {
|
||||
request != gameLaunchRequest.get() || isFinishing || isDestroyed -> onHandled()
|
||||
!launchCoordinator.isCurrent(request) || isFinishing || isDestroyed -> {
|
||||
launchCoordinator.releaseHandling(request)
|
||||
onHandled()
|
||||
}
|
||||
refused -> {
|
||||
onHandled()
|
||||
android.widget.Toast.makeText(this, getString(R.string.game_needs_app_model, game.name), android.widget.Toast.LENGTH_LONG).show()
|
||||
onSettled()
|
||||
}
|
||||
startGame(game, returnHome, onHandled) -> onSettled()
|
||||
startGame(game, returnHome, onHandled, request) -> onSettled()
|
||||
else -> launchCoordinator.releaseHandling(request)
|
||||
}
|
||||
}
|
||||
}, "xbox-app-model").start()
|
||||
}
|
||||
|
||||
private fun startGame(game: Library.SteamGame, returnHome: Boolean, onHandled: () -> Unit): Boolean {
|
||||
if (com.droiddeck.launcher.session.NoSteamLaunch.enabled(this, game)) return launchWithoutSteam(game, returnHome, onHandled)
|
||||
private fun startGame(game: Library.SteamGame, returnHome: Boolean, onHandled: () -> Unit, ticket: LaunchTicket): Boolean {
|
||||
if (com.droiddeck.launcher.session.NoSteamLaunch.enabled(this, game)) return launchWithoutSteam(game, returnHome, onHandled, ticket)
|
||||
onHandled()
|
||||
if (SessionState.running) {
|
||||
if (SessionState.mode != SessionService.MODE_STEAM || SessionState.stopRequested) {
|
||||
@@ -1058,15 +1110,34 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
.apply { if (returnHome) putExtra(SessionActivity.EXTRA_LINK_TASK, task) }
|
||||
}
|
||||
|
||||
private fun launchWithoutSteam(game: Library.SteamGame, returnHome: Boolean, onHandled: () -> Unit = {}): Boolean {
|
||||
private fun launchWithoutSteam(
|
||||
game: Library.SteamGame,
|
||||
returnHome: Boolean,
|
||||
onHandled: () -> Unit = {},
|
||||
ticket: LaunchTicket? = null,
|
||||
): Boolean {
|
||||
if (pkgStage != null) {
|
||||
onHandled()
|
||||
android.widget.Toast.makeText(this, R.string.main_wait_install_game, android.widget.Toast.LENGTH_SHORT).show()
|
||||
return false
|
||||
}
|
||||
val app = applicationContext
|
||||
val request = ticket ?: beginUiLaunch()
|
||||
if (!launchCoordinator.isCurrent(request)) {
|
||||
onHandled()
|
||||
return false
|
||||
}
|
||||
Thread({
|
||||
val added = if (com.droiddeck.launcher.session.NoSteamLaunch.needsAddedGame(game)) runCatching { com.droiddeck.launcher.session.NoSteamLaunch.addedGame(app, game) }.getOrNull() else null
|
||||
val command = com.droiddeck.launcher.session.NoSteamLaunch.command(game, added)
|
||||
ui.post {
|
||||
onHandled()
|
||||
if (isDestroyed) return@post
|
||||
if (!launchCoordinator.isCurrent(request) || isFinishing || isDestroyed) {
|
||||
launchCoordinator.releaseHandling(request)
|
||||
return@post
|
||||
}
|
||||
if (command == null) {
|
||||
launchCoordinator.releaseHandling(request)
|
||||
android.widget.Toast.makeText(this, R.string.game_link_failed, android.widget.Toast.LENGTH_LONG).show()
|
||||
return@post
|
||||
}
|
||||
@@ -1188,6 +1259,10 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
}
|
||||
|
||||
private fun startAfterSession(next: Intent) {
|
||||
if (com.droiddeck.launcher.stores.steam.SteamStore.blocksSession(next)) {
|
||||
android.widget.Toast.makeText(this, R.string.steam_store_session_wait, android.widget.Toast.LENGTH_SHORT).show()
|
||||
return
|
||||
}
|
||||
SessionService.stop(this)
|
||||
awaitSessionEnd(next, android.os.SystemClock.uptimeMillis() + SESSION_SWITCH_WAIT_MS)
|
||||
}
|
||||
@@ -1218,22 +1293,27 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
ui.postDelayed(poll, SESSION_SWITCH_POLL_MS)
|
||||
}
|
||||
|
||||
private fun handleGameLink(games: List<Library.SteamGame>, scanned: Boolean = true) {
|
||||
private fun handleGameLink(games: List<Library.SteamGame>, scanned: Boolean = true, ticket: LaunchTicket? = null) {
|
||||
if (!lifecycle.currentState.isAtLeast(androidx.lifecycle.Lifecycle.State.RESUMED)) return
|
||||
val request = pendingGameLink ?: return
|
||||
val link = launchCoordinator.pendingLink() ?: return
|
||||
if (ticket != null && link.ticket !== ticket) return
|
||||
val request = link.request ?: return
|
||||
if (launchCoordinator.isHandling(link.ticket)) return
|
||||
if (ticket == null && !link.ownedBy(intent)) {
|
||||
// A refresh may only finish the link that belongs to the intent this activity shows.
|
||||
launchCoordinator.consume(link.ticket)
|
||||
return
|
||||
}
|
||||
val game = request.find(games, byTitle = scanned)
|
||||
if (!scanned && game == null) return
|
||||
gameLinkTried = true
|
||||
ui.postDelayed({
|
||||
if (!isDestroyed && lifecycle.currentState.isAtLeast(androidx.lifecycle.Lifecycle.State.RESUMED)) syncDualPanel()
|
||||
}, LINK_PANEL_MS)
|
||||
val link = intent
|
||||
val linkIntent = link.owner
|
||||
fun consume() {
|
||||
if (intent !== link || pendingGameLink !== request) return
|
||||
pendingGameLink = null
|
||||
link.data = null
|
||||
link.action = Intent.ACTION_MAIN
|
||||
link.removeExtra(GameLaunchIntent.EXTRA_APP_ID)
|
||||
if (!launchCoordinator.consume(link.ticket)) return
|
||||
if (intent === linkIntent) clearGameLinkIntent(linkIntent)
|
||||
}
|
||||
if (game == null) {
|
||||
consume()
|
||||
@@ -1241,7 +1321,10 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
android.widget.Toast.makeText(this,
|
||||
if (request.program != null) R.string.game_link_program_unknown else R.string.game_link_missing,
|
||||
android.widget.Toast.LENGTH_LONG).show()
|
||||
} else launchGame(game, returnHome = true, onSettled = ::consume)
|
||||
} else {
|
||||
if (!launchCoordinator.beginHandling(link.ticket)) return
|
||||
launchGame(game, returnHome = true, onSettled = ::consume, ticket = link.ticket)
|
||||
}
|
||||
}
|
||||
|
||||
private fun chooseGameShortcut(game: Library.SteamGame) {
|
||||
@@ -1253,13 +1336,22 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
super.onCreate(savedInstanceState)
|
||||
drivers.restartBlocked = ::runtimeChangesBlocked
|
||||
drivers.loadTpUbwcMode()
|
||||
pendingSessionLogExport = savedInstanceState?.getString(KEY_PENDING_SESSION_LOG_EXPORT)?.let(::File)
|
||||
homeChoiceOpen = savedInstanceState?.getBoolean(STATE_HOME_CHOICE_OPEN) == true
|
||||
gameSpaceOffered = savedInstanceState?.getBoolean(STATE_GAME_SPACE_OFFERED) == true
|
||||
val handoff = if (savedInstanceState == null && intent.getBooleanExtra(EXTRA_RESTARTED, false)) LauncherHandoff.take() else null
|
||||
val saved = savedInstanceState ?: handoff
|
||||
pendingSessionLogExport = saved?.getString(KEY_PENDING_SESSION_LOG_EXPORT)?.let(::File)
|
||||
queuedLaunch.restore(
|
||||
saved?.let { androidx.core.os.BundleCompat.getParcelable(it, STATE_PENDING_GATE_LAUNCH, Intent::class.java) },
|
||||
saved?.getLong(STATE_PENDING_GATE_LAUNCH_AT, 0L) ?: 0L, System.currentTimeMillis(),
|
||||
)
|
||||
homeChoiceOpen = saved?.getBoolean(STATE_HOME_CHOICE_OPEN) == true
|
||||
gameSpaceOffered = saved?.getBoolean(STATE_GAME_SPACE_OFFERED) == true
|
||||
if (savedInstanceState == null) readIntegrationIntent(intent)
|
||||
val shortcutsFilter = android.content.IntentFilter(SteamIntegration.SHORTCUTS_STATUS)
|
||||
if (android.os.Build.VERSION.SDK_INT >= 33) registerReceiver(shortcutsInstallStatus, shortcutsFilter, RECEIVER_NOT_EXPORTED)
|
||||
else registerReceiver(shortcutsInstallStatus, shortcutsFilter)
|
||||
if (GameLaunchIntent.accepts(intent.action) &&
|
||||
GameLaunchIntent.replayed(intent, savedInstanceState != null, savedInstanceState?.getString(STATE_PROCESS), PROCESS))
|
||||
clearGameLinkIntent(intent)
|
||||
readGameIntent(intent)
|
||||
// A Lab build is usually the agent's work, so the app comes back where the agent is.
|
||||
if (savedInstanceState == null && navRequest == null && com.droiddeck.launcher.lab.LabOverlay.promoted && com.droiddeck.launcher.agent.AgentTab.visible) navRequest = "agent"
|
||||
@@ -1332,7 +1424,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
gameSyncFolder = gameSyncFolder,
|
||||
busy = busy, stage = stage, percent = percent,
|
||||
desktopInstalled = desktopInstalled, desktopPresent = desktopPresent,
|
||||
offlineAccount = offlineAccount, offline = offline,
|
||||
offlineAccount = offlineAccount, offline = offline, offlineAuto = offlineAuto,
|
||||
frameGenLabel = frameGenLabel, romsDir = romsDir, logsEnabled = logsEnabled,
|
||||
enhancedDiagnosticsArmed = enhancedDiagnosticsArmed,
|
||||
gameDebugLogsEnabled = gameDebugLogsEnabled, gameDebugLogsNeedsRestart = gameDebugLogsNeedsRestart,
|
||||
@@ -1355,6 +1447,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
integrationFocus = integrationFocus,
|
||||
androidApps = androidApps,
|
||||
secondScreenDisplays = secondScreenDisplays,
|
||||
ownScreen = ownScreen,
|
||||
dualScreen = dualDisplayId >= 0 && com.droiddeck.launcher.ui.DualScreenPanel.available,
|
||||
dualScreenDevice = dualScreenDevice,
|
||||
dualScreenMode = dualScreenMode,
|
||||
@@ -1402,6 +1495,9 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
),
|
||||
FrontEndActions(
|
||||
onPlay = { playSteam() },
|
||||
onQueuePlaySteam = {
|
||||
queuedLaunch.queue(Intent(this, SessionActivity::class.java).putExtra(SessionActivity.EXTRA_STEAMVR, false), System.currentTimeMillis())
|
||||
},
|
||||
onPlaySteamVr = { playSteamVr() },
|
||||
onSteamUrl = { url ->
|
||||
if (!SessionState.running) startSession(
|
||||
@@ -1422,16 +1518,20 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
},
|
||||
onStoreGame = { store, id ->
|
||||
val key = "${store.id}:$id"
|
||||
if (key !in preparingGames) {
|
||||
if (pkgStage != null) {
|
||||
android.widget.Toast.makeText(this, R.string.main_wait_install_game, android.widget.Toast.LENGTH_SHORT).show()
|
||||
} else if (key !in preparingGames) {
|
||||
preparingGames = preparingGames + key
|
||||
val ticket = beginUiLaunch()
|
||||
val app = applicationContext
|
||||
Thread({
|
||||
val g = runCatching { com.droiddeck.launcher.stores.StoreLaunch.installedGame(app, store, id) }.getOrNull()
|
||||
runOnUiThread {
|
||||
if (g != null && !isFinishing && !isDestroyed) prepareAndLaunch(g, key)
|
||||
else {
|
||||
if (g != null && launchCoordinator.isCurrent(ticket) && !isFinishing && !isDestroyed) {
|
||||
prepareAndLaunch(g, key, ticket)
|
||||
} else {
|
||||
preparingGames = preparingGames - key
|
||||
if (g == null && !isFinishing && !isDestroyed) android.widget.Toast.makeText(this, R.string.stores_launch_not_registered, android.widget.Toast.LENGTH_LONG).show()
|
||||
if (g == null && launchCoordinator.isCurrent(ticket) && !isFinishing && !isDestroyed) android.widget.Toast.makeText(this, R.string.stores_launch_not_registered, android.widget.Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
}, "store-play").start()
|
||||
@@ -1662,6 +1762,11 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
OfflineMode.setEnabled(this, !OfflineMode.enabled(this))
|
||||
offline = OfflineMode.enabled(this)
|
||||
},
|
||||
onOfflineAuto = {
|
||||
OfflineMode.setAuto(this, !OfflineMode.auto(this))
|
||||
offlineAuto = OfflineMode.auto(this)
|
||||
offline = OfflineMode.enabled(this)
|
||||
},
|
||||
onPageBack = { showPerformance = false; showComponents = false; showMapping = false },
|
||||
onSoundtracksIngame = { on ->
|
||||
SessionPrefs.setSoundtracksIngame(this, on)
|
||||
@@ -1676,7 +1781,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
onLanguage = { tag ->
|
||||
if (tag != com.droiddeck.launcher.core.AppLanguage.chosen(this)) {
|
||||
com.droiddeck.launcher.core.AppLanguage.setChosen(this, tag)
|
||||
recreate()
|
||||
restartLauncher()
|
||||
}
|
||||
},
|
||||
onAppScale = { percent ->
|
||||
@@ -1773,31 +1878,6 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
},
|
||||
onRefreshPhantomStatus = { refreshPhantomStatus() },
|
||||
onOpenDeveloperOptions = { displayId -> openDeveloperOptions(displayId) },
|
||||
onWirelessAdbPair = { host, port, code, complete ->
|
||||
Thread({
|
||||
val result = runCatching {
|
||||
kotlinx.coroutines.runBlocking { WirelessAdbFix.pair(this@FrontEndActivity, host, port, code) }
|
||||
}
|
||||
val error = result.exceptionOrNull()?.let { it.localizedMessage ?: getString(R.string.main_wadb_pair_failed) }
|
||||
ui.post { complete(error) }
|
||||
}, "wireless-adb-pair").start()
|
||||
},
|
||||
onFindWirelessAdbPort = { host, complete ->
|
||||
Thread({
|
||||
val port = WirelessAdbFix.findConnectPort(this@FrontEndActivity, host)
|
||||
ui.post { complete(port) }
|
||||
}, "wireless-adb-discovery").start()
|
||||
},
|
||||
onWirelessAdbApply = { host, port, enabled, complete ->
|
||||
Thread({
|
||||
val result = runCatching { WirelessAdbFix.setChildProcessLimit(this@FrontEndActivity, host, port, enabled) }
|
||||
val error = result.exceptionOrNull()?.let { it.localizedMessage ?: getString(R.string.main_wadb_command_failed) }
|
||||
ui.post {
|
||||
if (error == null) refreshPhantomStatus()
|
||||
complete(error)
|
||||
}
|
||||
}, "wireless-adb-fix").start()
|
||||
},
|
||||
onSetPhantomProcessLimit = { enabled, complete ->
|
||||
Thread({
|
||||
val result = runCatching { WirelessAdbFix.setUsingSavedPairing(this@FrontEndActivity, enabled) }
|
||||
@@ -1814,18 +1894,14 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
)
|
||||
android.widget.Toast.makeText(this, R.string.main_adb_copied, android.widget.Toast.LENGTH_SHORT).show()
|
||||
},
|
||||
onDismissPhantomGate = { showPhantomGate = false },
|
||||
onDismissPhantomGate = { queuedLaunch.clear(); showPhantomGate = false },
|
||||
onShowPhantomGate = {
|
||||
refreshPhantomStatus()
|
||||
showPhantomGate = true
|
||||
},
|
||||
onStartWirelessAdbPairing = { WirelessAdbPairingService.start(this) },
|
||||
onStartWirelessAdbPairing = { enabled -> WirelessAdbPairingService.start(this, enabled) },
|
||||
onStartPairingGuide = { displayId, toggleOnly -> PairingGuideActivity.start(this, displayId, toggleOnly) },
|
||||
onOpenNotificationSettings = {
|
||||
startActivity(Intent(android.provider.Settings.ACTION_APP_NOTIFICATION_SETTINGS)
|
||||
.putExtra(android.provider.Settings.EXTRA_APP_PACKAGE, packageName)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
|
||||
},
|
||||
onEnsureNotifications = { done -> ensureNotifications(done) },
|
||||
updates = updates.actions(),
|
||||
controller = ControllerActions(
|
||||
onMapping = { showPerformance = false; showComponents = false; showMapping = true },
|
||||
@@ -1921,10 +1997,11 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
!SessionPrefs.allFilesAsked(this)
|
||||
if (savedInstanceState == null) {
|
||||
if (!askAllFiles) ui.post { startSteamAtStartupIfEnabled(cold = true) }
|
||||
} else {
|
||||
restoreCompatLaunch(savedInstanceState)
|
||||
pendingSwitch = savedIntent(savedInstanceState, KEY_PENDING_SWITCH)
|
||||
savedIntent(savedInstanceState, KEY_SWITCHING_TO)?.let { awaitSessionEnd(it, savedInstanceState.getLong(KEY_SWITCH_DEADLINE)) }
|
||||
}
|
||||
saved?.let { state ->
|
||||
restoreCompatLaunch(state)
|
||||
pendingSwitch = savedIntent(state, KEY_PENDING_SWITCH)
|
||||
savedIntent(state, KEY_SWITCHING_TO)?.let { awaitSessionEnd(it, state.getLong(KEY_SWITCH_DEADLINE)) }
|
||||
}
|
||||
|
||||
val wanted = ArrayList<String>()
|
||||
@@ -1962,10 +2039,9 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
setIntent(intent)
|
||||
gameLaunchRequest.incrementAndGet()
|
||||
supersedeUncommittedLaunch()
|
||||
if (intent.action == SteamIntegration.ACTION_SETUP) {
|
||||
gameLinkReading = false
|
||||
pendingGameLink = null
|
||||
syncDualPanel()
|
||||
readIntegrationIntent(intent)
|
||||
return
|
||||
@@ -1975,10 +2051,19 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
startSteamAtStartupIfEnabled()
|
||||
}
|
||||
|
||||
/** A replacement activity intent supersedes anything this activity has not dispatched yet. */
|
||||
private fun supersedeUncommittedLaunch() {
|
||||
launchCoordinator.cancelAll()
|
||||
}
|
||||
|
||||
private var soundtrackLaunch = false
|
||||
|
||||
// A restarted launcher starts before the old one stops, so each clears the hooks only if they are still its own.
|
||||
private val libraryHook: () -> Unit = { refreshAddedGames(); refresh() }
|
||||
private val battleNetHook: (List<String>) -> Unit = { args -> openBattleNet(args) }
|
||||
|
||||
private fun startSteamAtStartupIfEnabled(cold: Boolean = false) {
|
||||
if (soundtrackLaunch) return
|
||||
if (soundtrackLaunch || intent.getBooleanExtra(EXTRA_RESTARTED, false)) return
|
||||
if (intent.action != Intent.ACTION_MAIN && !(cold && intent.action == null)) return
|
||||
if (isFinishing || isDestroyed) return
|
||||
when (SessionPrefs.startupSession(this)) {
|
||||
@@ -2005,7 +2090,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
}
|
||||
|
||||
private fun startSteamSession(steamVr: Boolean = false) {
|
||||
startSession(Intent(this, SessionActivity::class.java).putExtra(SessionActivity.EXTRA_STEAMVR, steamVr), steamSession = true)
|
||||
startSession(Intent(this, SessionActivity::class.java).putExtra(SessionActivity.EXTRA_STEAMVR, steamVr), steamSession = true, queueIfBlocked = !steamVr)
|
||||
}
|
||||
|
||||
@Suppress("OVERRIDE_DEPRECATION")
|
||||
@@ -2099,6 +2184,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
if (!triggerKeys.synthesizing && triggerKeys.nativeKey(event)) return true
|
||||
val tabStep = com.droiddeck.launcher.ui.dualPageStep(event)
|
||||
val tabs = com.droiddeck.launcher.ui.MainTabSteps.handler
|
||||
if (tabStep == null && event.action == KeyEvent.ACTION_DOWN) com.droiddeck.launcher.ui.MainTabSteps.otherKeys++
|
||||
if (tabStep != null && tabs != null) {
|
||||
if (controllerHaptics) com.droiddeck.launcher.ui.ControllerHaptics.onKey(this, event)
|
||||
if (event.action == KeyEvent.ACTION_DOWN && event.repeatCount == 0) tabs(tabStep)
|
||||
@@ -2153,8 +2239,8 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
homePage = com.droiddeck.launcher.core.AppUiPrefs.homePage(this)
|
||||
refreshWifiDiscovery()
|
||||
com.droiddeck.launcher.stores.StoresState.refresh(this)
|
||||
com.droiddeck.launcher.stores.StoresState.libraryListener = { refreshAddedGames(); refresh() }
|
||||
com.droiddeck.launcher.stores.battlenet.BattleNetClient.opener = { args -> openBattleNet(args) }
|
||||
com.droiddeck.launcher.stores.StoresState.libraryListener = libraryHook
|
||||
com.droiddeck.launcher.stores.battlenet.BattleNetClient.opener = battleNetHook
|
||||
com.droiddeck.launcher.ui.Motion.refresh(this)
|
||||
com.droiddeck.launcher.ui.QuitFlood.take()?.let { c ->
|
||||
returning = ReturningFlood(c, com.droiddeck.launcher.ui.LaunchOrigin.takeReturn())
|
||||
@@ -2225,9 +2311,18 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
super.onSaveInstanceState(outState)
|
||||
saveLauncherState(outState)
|
||||
}
|
||||
|
||||
private fun saveLauncherState(outState: Bundle) {
|
||||
outState.putString(STATE_PROCESS, PROCESS)
|
||||
outState.putBoolean(STATE_HOME_CHOICE_OPEN, homeChoiceOpen)
|
||||
outState.putBoolean(STATE_GAME_SPACE_OFFERED, gameSpaceOffered)
|
||||
pendingSessionLogExport?.let { outState.putString(KEY_PENDING_SESSION_LOG_EXPORT, it.absolutePath) }
|
||||
queuedLaunch.launch?.let {
|
||||
outState.putParcelable(STATE_PENDING_GATE_LAUNCH, it)
|
||||
outState.putLong(STATE_PENDING_GATE_LAUNCH_AT, queuedLaunch.queuedAt)
|
||||
}
|
||||
if (slowUsbNever) SessionPrefs.setSlowUsbWarningOff(this)
|
||||
saveCompatLaunch(outState)
|
||||
pendingSwitch?.let { outState.putParcelable(KEY_PENDING_SWITCH, it) }
|
||||
@@ -2241,21 +2336,32 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
if (Build.VERSION.SDK_INT >= 33) state.getParcelable(key, Intent::class.java)
|
||||
else @Suppress("DEPRECATION") state.getParcelable(key)
|
||||
|
||||
private fun prepareAndLaunch(g: Library.SteamGame, key: String) {
|
||||
val request = gameLaunchRequest.incrementAndGet()
|
||||
private fun prepareAndLaunch(g: Library.SteamGame, key: String, ticket: LaunchTicket? = null) {
|
||||
if (pkgStage != null) {
|
||||
preparingGames = preparingGames - key
|
||||
android.widget.Toast.makeText(this, R.string.main_wait_install_game, android.widget.Toast.LENGTH_SHORT).show()
|
||||
return
|
||||
}
|
||||
val request = ticket ?: beginUiLaunch()
|
||||
if (!launchCoordinator.isCurrent(request)) {
|
||||
preparingGames = preparingGames - key
|
||||
return
|
||||
}
|
||||
val done = { preparingGames = preparingGames - key }
|
||||
com.droiddeck.launcher.frontend.AutoComponents.beforeLaunch(this, g, onBlocked = done) {
|
||||
if (request != gameLaunchRequest.get() || isFinishing || isDestroyed) { done(); return@beforeLaunch }
|
||||
if (!launchCoordinator.isCurrent(request) || isFinishing || isDestroyed) { done(); return@beforeLaunch }
|
||||
com.droiddeck.launcher.stores.StoreLaunch.prepare(this, g) {
|
||||
if (request == gameLaunchRequest.get() && !isFinishing && !isDestroyed) launchGame(g, onHandled = done)
|
||||
if (launchCoordinator.isCurrent(request) && !isFinishing && !isDestroyed) launchGame(g, onHandled = done, ticket = request)
|
||||
else done()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
// The queued launch was saved before this; a restored activity keeps its copy, and this one must not start it too.
|
||||
queuedLaunchRunner.destroy()
|
||||
triggerKeys.cancel()
|
||||
gameLaunchRequest.incrementAndGet()
|
||||
launchCoordinator.cancelAll()
|
||||
cancelCompatLaunch()
|
||||
updates.unregister()
|
||||
runCatching { unregisterReceiver(shortcutsInstallStatus) }
|
||||
@@ -2275,8 +2381,8 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
getSystemService(android.content.pm.LauncherApps::class.java).unregisterCallback(packageCallback)
|
||||
HomeWidgets.stopListening(this)
|
||||
ui.removeCallbacks(mediaRefresh)
|
||||
com.droiddeck.launcher.stores.StoresState.libraryListener = null
|
||||
com.droiddeck.launcher.stores.battlenet.BattleNetClient.opener = null
|
||||
if (com.droiddeck.launcher.stores.StoresState.libraryListener === libraryHook) com.droiddeck.launcher.stores.StoresState.libraryListener = null
|
||||
if (com.droiddeck.launcher.stores.battlenet.BattleNetClient.opener === battleNetHook) com.droiddeck.launcher.stores.battlenet.BattleNetClient.opener = null
|
||||
displayManager.unregisterDisplayListener(secondScreenDisplayListener)
|
||||
com.droiddeck.launcher.input.DualScreen.unwatchTaken(bottomScreenListener)
|
||||
getSystemService(android.hardware.input.InputManager::class.java)?.unregisterInputDeviceListener(secondScreenTouchListener)
|
||||
@@ -2293,6 +2399,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
homeScreenEnabled = HomeApp.isHomeScreenEnabled(this)
|
||||
homeAppSelected = homeScreenEnabled && HomeApp.isDefault(this)
|
||||
defaultHomeLabel = HomeApp.defaultLabel(this)
|
||||
com.droiddeck.launcher.ui.NavTabs.syncHomeApps(this, homeAppSelected)
|
||||
refreshAndroidApps()
|
||||
integrationState = readIntegration()
|
||||
}
|
||||
@@ -2316,6 +2423,9 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
val ownDisplayId = if (android.os.Build.VERSION.SDK_INT >= 30) display?.displayId ?: android.view.Display.DEFAULT_DISPLAY else @Suppress("DEPRECATION") windowManager.defaultDisplay.displayId
|
||||
dualScreenMode = SessionPrefs.dualScreenMode(this)
|
||||
secondScreenDisplays = SecondScreenDisplays.available(displayManager, ownDisplayId)
|
||||
ownScreen = ownDisplayId.takeIf { it != Display.DEFAULT_DISPLAY }?.let { id ->
|
||||
displayManager.getDisplay(id)?.takeIf { it.isValid }?.let { SecondScreenDisplay(id, "${it.name} · ${it.mode.physicalWidth}×${it.mode.physicalHeight}") }
|
||||
}
|
||||
dualScreenDevice = com.droiddeck.launcher.input.DualScreen.anyDisplay(displayManager, ownDisplayId) != null
|
||||
dualScreenSessions = SessionPrefs.dualScreenSessionMode(this)
|
||||
dualScreenControls = SessionPrefs.dualScreenSessionControls(this)
|
||||
@@ -2331,22 +2441,29 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
else com.droiddeck.launcher.ui.DualScreenPanel.hide(taskId)
|
||||
}
|
||||
|
||||
private fun launchPending(): Boolean = gameLinkReading || (pendingGameLink != null && !gameLinkTried)
|
||||
private fun launchPending(): Boolean = gameLinkReading || (launchCoordinator.hasPending() && !gameLinkTried)
|
||||
|
||||
private fun launchAndroidApp(app: HomeApp.LaunchableApp, displayId: Int?) {
|
||||
val onOwnScreen = displayId == null || displayId == (display?.displayId ?: Display.DEFAULT_DISPLAY)
|
||||
if (onOwnScreen) com.droiddeck.launcher.ui.DualScreenPanel.yieldTo(taskId, true)
|
||||
try {
|
||||
HomeApp.launch(this, app, displayId)
|
||||
} catch (_: Exception) {
|
||||
com.droiddeck.launcher.ui.DualScreenPanel.yieldTo(taskId, false)
|
||||
val label = secondScreenDisplays.firstOrNull { it.id == displayId }?.label
|
||||
val message = when {
|
||||
displayId == null || displayId == Display.DEFAULT_DISPLAY -> getString(R.string.android_app_open_failed_primary, app.label)
|
||||
label != null -> getString(R.string.android_app_open_failed_on, app.label, label)
|
||||
else -> getString(R.string.android_app_open_failed_display, app.label, displayId)
|
||||
val open = {
|
||||
try {
|
||||
HomeApp.launch(this, app, displayId)
|
||||
} catch (_: Exception) {
|
||||
com.droiddeck.launcher.ui.DualScreenPanel.yieldTo(taskId, false)
|
||||
val label = secondScreenDisplays.firstOrNull { it.id == displayId }?.label
|
||||
val message = when {
|
||||
displayId == null || displayId == Display.DEFAULT_DISPLAY -> getString(R.string.android_app_open_failed_primary, app.label)
|
||||
label != null -> getString(R.string.android_app_open_failed_on, app.label, label)
|
||||
else -> getString(R.string.android_app_open_failed_display, app.label, displayId)
|
||||
}
|
||||
android.widget.Toast.makeText(this, message, android.widget.Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
android.widget.Toast.makeText(this, message, android.widget.Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
if (displayId != null && displayId == com.droiddeck.launcher.ui.DualScreenPanel.shownOn) {
|
||||
com.droiddeck.launcher.ui.DualScreenPanel.makeRoomForApp(this, displayId, open)
|
||||
} else {
|
||||
open()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2672,6 +2789,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
mic = if (mode == SessionService.MODE_STEAM) mic else null,
|
||||
gameStorage = if (mode == SessionService.MODE_STEAM) gameStorage else null,
|
||||
storageOptions = storageOptions,
|
||||
storageFat32 = storageFat32,
|
||||
steamLibraries = steamLibraries,
|
||||
foundSteamLibraries = foundSteamLibraries,
|
||||
allFilesAccessMissing = allFilesAccessMissing,
|
||||
@@ -2682,6 +2800,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
steamClientArch = if (mode == SessionService.MODE_STEAM) steamClientArch else null,
|
||||
returnAfterGame = if (mode == SessionService.MODE_STEAM) returnAfterGame else null,
|
||||
shaderPrecache = if (mode == SessionService.MODE_STEAM) shaderPrecache else null,
|
||||
valveProtonOnDemand = if (mode == SessionService.MODE_STEAM) valveProtonOnDemand else null,
|
||||
steamRepairQueued = steamRepairQueued,
|
||||
mangoapp = mangoapp,
|
||||
steamController = if (mode == SessionService.MODE_STEAM) steamController else null,
|
||||
@@ -2789,6 +2908,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
onMangoapp = { on -> SessionPrefs.setMangoapp(this, on); mangoapp = on },
|
||||
onReturnAfterGame = { on -> SessionPrefs.setReturnAfterGame(this, on); returnAfterGame = on },
|
||||
onShaderPrecache = { on -> SessionPrefs.setShaderPrecache(this, on); shaderPrecache = on },
|
||||
onValveProtonOnDemand = { on -> SessionPrefs.setValveProtonOnDemand(this, on); valveProtonOnDemand = on },
|
||||
onSteamController = { id -> SessionPrefs.setSteamController(this, id); steamController = id },
|
||||
onStartupSession = { id ->
|
||||
SessionPrefs.setStartupSession(this, id)
|
||||
@@ -2984,6 +3104,10 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
return
|
||||
}
|
||||
val target = com.droiddeck.launcher.frontend.GameRemoval.steamFiles(g) ?: return
|
||||
if (Library.fromSteamClient(g)) {
|
||||
com.droiddeck.launcher.stores.steam.SteamStore.uninstall(this, g.appId, target.manifest, fallback = { com.droiddeck.launcher.frontend.GameRemoval.delete(target) }) { refreshAddedGames(); refresh() }
|
||||
return
|
||||
}
|
||||
Thread({
|
||||
com.droiddeck.launcher.frontend.GameRemoval.delete(target)
|
||||
ui.post { refreshAddedGames(); refresh() }
|
||||
@@ -3061,6 +3185,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
steamRepairQueued = SteamRepair.queued(this)
|
||||
mangoapp = SessionPrefs.mangoapp(this)
|
||||
returnAfterGame = SessionPrefs.returnAfterGame(this)
|
||||
valveProtonOnDemand = SessionPrefs.valveProtonOnDemand(this)
|
||||
loadShaderPrecache(mode)
|
||||
steamController = SessionPrefs.steamController(this)
|
||||
startupSession = SessionPrefs.startupSession(this)
|
||||
@@ -3094,10 +3219,12 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
Thread({
|
||||
drivers.refreshDrivers()
|
||||
val storage = GameStorage.options(this)
|
||||
val fat32 = GameStorage.effective(this)?.path?.let(GameStorage::isFat32) == true
|
||||
val deckyInstalled = if (mode == SessionService.MODE_STEAM) DeckyManager.installed(this) else null
|
||||
val deckySupervisor = mode == SessionService.MODE_STEAM && DeckyManager.supervisorEnabled(this)
|
||||
ui.post {
|
||||
storageOptions = storage
|
||||
storageFat32 = fat32
|
||||
if (mode == SessionService.MODE_STEAM) {
|
||||
decky.deckyInstalled = deckyInstalled
|
||||
decky.deckySupervisor = deckySupervisor
|
||||
@@ -3119,6 +3246,8 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
}
|
||||
SessionPrefs.setGameStorage(this, path, label)
|
||||
gameStorage = path
|
||||
storageFat32 = GameStorage.effective(this)?.path?.let(GameStorage::isFat32) == true
|
||||
if (storageFat32) android.widget.Toast.makeText(this, R.string.main_storage_fat32, android.widget.Toast.LENGTH_LONG).show()
|
||||
checkUsbLink()
|
||||
if (settingsMode == SessionService.MODE_STEAM) refreshFoundSteamLibraries()
|
||||
}
|
||||
@@ -3208,6 +3337,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
battleNetInstalled = com.droiddeck.launcher.runtime.BattleNet.installed(this)
|
||||
offlineAccount = OfflineMode.account(this)
|
||||
offline = OfflineMode.enabled(this)
|
||||
offlineAuto = OfflineMode.auto(this)
|
||||
installed = LinuxRuntimeInstaller.installedVersion(this)
|
||||
ready = LinuxRuntime.isInstalled(this)
|
||||
vkBridge = SessionPrefs.vkBridge(this)
|
||||
@@ -3343,7 +3473,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
install(release)
|
||||
}
|
||||
|
||||
private fun startSession(intent: Intent, steamSession: Boolean = false): Boolean {
|
||||
private fun startSession(intent: Intent, steamSession: Boolean = false, queueIfBlocked: Boolean = false): Boolean {
|
||||
if (busy || LinuxRuntimeInstaller.isBusy()) return false
|
||||
if (SessionState.installing != null && !SessionState.running) {
|
||||
android.widget.Toast.makeText(this, R.string.main_wait_desktop_install, android.widget.Toast.LENGTH_SHORT).show()
|
||||
@@ -3353,8 +3483,13 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
android.widget.Toast.makeText(this, R.string.storage_cleanup_busy, android.widget.Toast.LENGTH_SHORT).show()
|
||||
return false
|
||||
}
|
||||
if (!SessionState.running && com.droiddeck.launcher.stores.steam.SteamStore.blocksSession(intent)) {
|
||||
android.widget.Toast.makeText(this, R.string.steam_store_session_wait, android.widget.Toast.LENGTH_SHORT).show()
|
||||
return false
|
||||
}
|
||||
refreshPhantomStatus()
|
||||
if (steamSession && PhantomProcessLimit.blocksSteam(phantomProcessStatus)) {
|
||||
if (queueIfBlocked) queuedLaunch.queue(intent, System.currentTimeMillis())
|
||||
showPhantomGate = true
|
||||
return false
|
||||
}
|
||||
@@ -3364,8 +3499,65 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
return true
|
||||
}
|
||||
|
||||
private var notificationsDone: ((Boolean) -> Unit)? = null
|
||||
|
||||
private fun ensureNotifications(done: (Boolean) -> Unit) {
|
||||
if (WirelessAdbPairingService.notificationsEnabled(this)) {
|
||||
done(true)
|
||||
return
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 33 && checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
|
||||
notificationsDone = done
|
||||
requestPermissions(arrayOf(Manifest.permission.POST_NOTIFICATIONS), REQUEST_NOTIFICATIONS)
|
||||
return
|
||||
}
|
||||
openNotificationSettings()
|
||||
done(false)
|
||||
}
|
||||
|
||||
private fun openNotificationSettings() {
|
||||
android.widget.Toast.makeText(this, R.string.gate_notifications_toast, android.widget.Toast.LENGTH_LONG).show()
|
||||
val appAllowed = getSystemService(android.app.NotificationManager::class.java)?.areNotificationsEnabled() != false
|
||||
val intent = if (appAllowed && WirelessAdbPairingService.channelBlocked(this)) {
|
||||
Intent(android.provider.Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS)
|
||||
.putExtra(android.provider.Settings.EXTRA_CHANNEL_ID, WirelessAdbPairingService.channelId())
|
||||
} else {
|
||||
Intent(android.provider.Settings.ACTION_APP_NOTIFICATION_SETTINGS)
|
||||
}
|
||||
startActivity(intent.putExtra(android.provider.Settings.EXTRA_APP_PACKAGE, packageName).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
|
||||
}
|
||||
|
||||
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
||||
if (requestCode != REQUEST_NOTIFICATIONS) return
|
||||
val done = notificationsDone ?: return
|
||||
notificationsDone = null
|
||||
val granted = WirelessAdbPairingService.notificationsEnabled(this)
|
||||
if (!granted) openNotificationSettings()
|
||||
done(granted)
|
||||
}
|
||||
|
||||
private val queuedLaunch = com.droiddeck.launcher.session.QueuedLaunch<Intent>(GATE_LAUNCH_MS)
|
||||
private val queuedLaunchRunner = com.droiddeck.launcher.session.QueuedLaunchRunner(
|
||||
queue = queuedLaunch,
|
||||
now = System::currentTimeMillis,
|
||||
blocked = { PhantomProcessLimit.blocksSteam(phantomProcessStatus) },
|
||||
busy = ::steamStartBusy,
|
||||
schedule = { delay, task -> if (delay <= 0L) ui.post(task) else ui.postDelayed(task, delay) },
|
||||
unschedule = ui::removeCallbacks,
|
||||
start = { launch -> startSession(launch, steamSession = true, queueIfBlocked = true) },
|
||||
retryMs = GATE_LAUNCH_RETRY_MS,
|
||||
)
|
||||
|
||||
/** The conditions under which a Steam start waits instead of being refused: setup, a runtime or desktop install, a storage cleanup, or a Steam store download. */
|
||||
private fun steamStartBusy(): Boolean = busy || LinuxRuntimeInstaller.isBusy() || com.droiddeck.launcher.session.Onboarding.settling() ||
|
||||
(SessionState.installing != null && !SessionState.running) || com.droiddeck.launcher.storage.StorageState.cleaning ||
|
||||
(!SessionState.running && com.droiddeck.launcher.stores.steam.SteamStore.downloading())
|
||||
|
||||
private fun refreshPhantomStatus() {
|
||||
phantomProcessStatus = PhantomProcessLimit.read(this)
|
||||
if (queuedLaunch.launch != null && !PhantomProcessLimit.blocksSteam(phantomProcessStatus)) showPhantomGate = false
|
||||
queuedLaunchRunner.poke()
|
||||
adbPaired = WirelessAdbFix.hasSavedPairing(this)
|
||||
phantomWarning = if (PhantomProcessLimit.blocksSteam(phantomProcessStatus)) {
|
||||
getString(
|
||||
@@ -3377,7 +3569,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
|
||||
private fun openDeveloperOptions(displayId: Int?) {
|
||||
val highlight = if (PhantomProcessLimit.hasDeveloperToggle() &&
|
||||
WirelessAdbPairingService.stage.value == WirelessAdbPairingService.Stage.Idle) null else "toggle_adb_wireless"
|
||||
WirelessAdbPairingService.stage.value == WirelessAdbPairingService.Stage.Idle) "disable_phantom_process_monitor" else "toggle_adb_wireless"
|
||||
val intent = Intent(android.provider.Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.apply { if (highlight != null) putExtra(":settings:fragment_args_key", highlight) }
|
||||
@@ -3423,7 +3615,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
com.droiddeck.launcher.ui.Motion.refresh(this)
|
||||
com.droiddeck.launcher.ui.DeveloperTools.load(this)
|
||||
com.droiddeck.launcher.ui.NavTabs.load(this)
|
||||
if (!switchLauncherIcon(LauncherIcon.DARK)) recreate()
|
||||
if (!switchLauncherIcon(LauncherIcon.DARK)) restartLauncher()
|
||||
}
|
||||
}, "reset-settings").start()
|
||||
}
|
||||
@@ -3496,7 +3688,15 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val PROCESS = java.util.UUID.randomUUID().toString()
|
||||
private const val STATE_PROCESS = "process"
|
||||
private const val REQUEST_NOTIFICATIONS = 7103
|
||||
private const val EXTRA_RESTARTED = "com.droiddeck.launcher.extra.RESTARTED"
|
||||
private const val STATE_HOME_CHOICE_OPEN = "home_choice_open"
|
||||
private const val STATE_PENDING_GATE_LAUNCH = "pending_gate_launch"
|
||||
private const val STATE_PENDING_GATE_LAUNCH_AT = "pending_gate_launch_at"
|
||||
private const val GATE_LAUNCH_MS = 15 * 60_000L
|
||||
private const val GATE_LAUNCH_RETRY_MS = 2_000L
|
||||
private const val KEY_PENDING_SESSION_LOG_EXPORT = "pending_session_log_export"
|
||||
private const val STATE_GAME_SPACE_OFFERED = "game_space_offered"
|
||||
private const val TAG = "MainActivity"
|
||||
|
||||
@@ -118,12 +118,18 @@ object HomeWidgets {
|
||||
if (live.size != parsed.size) save(context)
|
||||
}
|
||||
|
||||
private val listeners: MutableSet<Any> = java.util.Collections.newSetFromMap(java.util.IdentityHashMap())
|
||||
|
||||
fun startListening(context: Context) {
|
||||
listeners.add(context)
|
||||
load(context)
|
||||
runCatching { host(context).startListening() }
|
||||
}
|
||||
|
||||
// A restarted launcher starts before the old one stops; the host keeps listening until the last owner stops.
|
||||
fun stopListening(context: Context) {
|
||||
listeners.remove(context)
|
||||
if (listeners.isNotEmpty()) return
|
||||
runCatching { host(context).stopListening() }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.droiddeck.launcher
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.SystemClock
|
||||
|
||||
/**
|
||||
* State a restarting launcher passes to its replacement inside this process. Intent extras are not used
|
||||
* because FrontEndActivity is exported and any app could fill them.
|
||||
*/
|
||||
internal object LauncherHandoff {
|
||||
private const val LIFETIME_MS = 10_000L
|
||||
private var state: Bundle? = null
|
||||
private var at = 0L
|
||||
|
||||
@Synchronized
|
||||
fun put(carried: Bundle) {
|
||||
state = carried
|
||||
at = SystemClock.elapsedRealtime()
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun take(): Bundle? {
|
||||
val carried = state
|
||||
state = null
|
||||
return carried?.takeIf { SystemClock.elapsedRealtime() - at <= LIFETIME_MS }
|
||||
}
|
||||
}
|
||||
@@ -93,6 +93,14 @@ class PairingGuideActivity : ComponentActivity() {
|
||||
launchPending = true
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
val stage = WirelessAdbPairingService.stage.value
|
||||
if (isFinishing && (stage is WirelessAdbPairingService.Stage.Waiting || stage is WirelessAdbPairingService.Stage.CodeNeeded)) {
|
||||
WirelessAdbPairingService.cancel(this)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (!launchPending) return
|
||||
|
||||
@@ -49,7 +49,7 @@ internal class ProtonMenu(
|
||||
@VisibleForTesting internal var latestCheck: (Boolean) -> Boolean = { force -> ProtonExtras.checkLatest(activity, force) }
|
||||
@VisibleForTesting internal var experimentalRefresh: () -> List<ExperimentalProtons.Release>? = { ExperimentalProtons.refresh(activity) }
|
||||
@VisibleForTesting internal var installer: (ProtonExtras.Tool, (String, Int) -> Unit) -> String? =
|
||||
{ tool, progress -> ProtonExtras.install(activity, tool, progress) }
|
||||
{ tool, progress -> ProtonExtras.install(activity, tool, onProgress = progress) }
|
||||
|
||||
fun installProton(id: String, automatic: Boolean = false) {
|
||||
val tool = ProtonExtras.tools.firstOrNull { it.id == id } ?: return
|
||||
@@ -156,7 +156,7 @@ internal class ProtonMenu(
|
||||
|
||||
fun refreshProtons() {
|
||||
refreshExperimental()
|
||||
protonRows = ProtonExtras.tools.map {
|
||||
protonRows = ProtonExtras.offered(activity).map {
|
||||
val all = ProtonExtras.installedAll(activity, it)
|
||||
ProtonRow(it.id, it.name, all.lastOrNull(), ProtonExtras.queued(activity, it), all, ProtonExtras.update(activity, it))
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
private lateinit var threeFingerTap: com.droiddeck.launcher.input.ThreeFingerTap
|
||||
private lateinit var touchscreenGestures: TouchscreenGestures
|
||||
private var gestureConfig = com.droiddeck.launcher.input.TouchGestureConfig()
|
||||
private var gestureGame: String? = null
|
||||
private var gestureGame by mutableStateOf<String?>(null)
|
||||
private var gameStarts by mutableIntStateOf(0)
|
||||
private var gestureSettingsOpen by mutableStateOf(false)
|
||||
private var steamImportAsk by mutableStateOf<com.droiddeck.launcher.session.SteamImportPrompt.Ask?>(null)
|
||||
@@ -703,6 +703,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
@Volatile private var frameGenInventoryLastAttemptAt = 0L
|
||||
private val frameGenInventoryRetryScheduled = java.util.concurrent.atomic.AtomicBoolean()
|
||||
private val frameGenInventoryRefreshScheduled = java.util.concurrent.atomic.AtomicBoolean()
|
||||
@Volatile private var frameGenInventoryRefreshDue = false
|
||||
@Volatile private var frameGenInventoryMissedAppId = 0L
|
||||
|
||||
@Volatile private var appliedFrameGenMode: FrameGen.Mode? = null
|
||||
@Volatile private var appliedFrameGenHz: Float? = null
|
||||
@@ -842,6 +844,16 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
finish()
|
||||
return
|
||||
}
|
||||
if (!SessionState.running && com.droiddeck.launcher.stores.steam.SteamStore.blocksSession(intent)) {
|
||||
runtimeRemovalBlocked = true
|
||||
android.widget.Toast.makeText(this, R.string.steam_store_session_wait, android.widget.Toast.LENGTH_SHORT).show()
|
||||
finish()
|
||||
return
|
||||
}
|
||||
if (savedInstanceState == null && !SessionState.running && !com.droiddeck.launcher.stores.steam.SteamStore.downloading()) {
|
||||
// The Steam client signs in itself; the store's own sign-in must not overlap it.
|
||||
Thread({ com.droiddeck.launcher.stores.steam.SteamEngine.forget() }, "steam-store-signout").start()
|
||||
}
|
||||
if (!SessionState.running && SessionState.phase in setOf(SessionPhase.IDLE, SessionPhase.FAILED)) {
|
||||
val mode = intent.getStringExtra(SessionService.EXTRA_MODE) ?: SessionService.MODE_STEAM
|
||||
SessionState.programArgs = intent.getStringArrayExtra(SessionService.EXTRA_PROGRAM_ARGS)?.toList().orEmpty()
|
||||
@@ -850,8 +862,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
SessionState.bottomMenu = false
|
||||
SessionState.secondScreenProvisional = false
|
||||
SessionState.secondScreenAutomatic = false
|
||||
SessionState.gameOnBottom = false
|
||||
gameOnBottom = false
|
||||
SessionState.gameOnBottom = SessionPrefs.dualScreenSessionMode(this) == com.droiddeck.launcher.input.DualScreen.MODE_SWAPPED
|
||||
gameOnBottom = SessionState.gameOnBottom
|
||||
}
|
||||
if (!SessionState.running && SessionState.phase in setOf(SessionPhase.IDLE, SessionPhase.FAILED)) {
|
||||
SessionState.program = intent.getStringExtra(SessionService.EXTRA_PROGRAM)
|
||||
@@ -875,9 +887,10 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
cornerTap = SessionPrefs.drawerCornerTap(this)
|
||||
applyOutputPacing()
|
||||
if (!SessionState.running) {
|
||||
SessionState.followScreen = followChoice()
|
||||
SessionState.followScale = followScale()
|
||||
SessionState.followScales = SessionPrefs.followScales(this, displayMode(),
|
||||
com.droiddeck.launcher.session.SessionDisplay.panelSize(this))
|
||||
}
|
||||
applyFollowChoice()
|
||||
applyFollowOrientation(resources.configuration)
|
||||
goFullscreen()
|
||||
volumeControlStream = android.media.AudioManager.STREAM_MUSIC
|
||||
@@ -1300,6 +1313,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
if (nextGame != null) gameStarts++
|
||||
gestureGame = nextGame
|
||||
refreshGestureConfig()
|
||||
restoreGamePanel(nextGame)
|
||||
}
|
||||
if (
|
||||
SessionState.mode == SessionService.MODE_STEAM &&
|
||||
@@ -1545,6 +1559,10 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
secondScreenDisplays = secondScreenDisplays,
|
||||
selectedSecondScreenDisplay = selectedSecondScreenDisplay,
|
||||
onHud = { on -> SessionPrefs.setHudEnabled(this@SessionActivity, on); hudOn = on; hud.refresh() },
|
||||
onHudOnlyDuringGame = { on ->
|
||||
SessionPrefs.setHudOnlyDuringGame(this@SessionActivity, on)
|
||||
hud.refresh()
|
||||
},
|
||||
onGpuClockPin = { on ->
|
||||
SessionPrefs.setGpuClockPin(this@SessionActivity, on)
|
||||
gpuClockPin = on
|
||||
@@ -1752,6 +1770,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
wowChat = wowChat.remembered,
|
||||
onWowChat = wowChat::choose,
|
||||
controller = controllerSettings,
|
||||
onControllerSize = { percent -> updateControllerPrefs { ControllerPrefs.setSize(this@SessionActivity, percent) } },
|
||||
onRumble = { on -> updateControllerPrefs { ControllerPrefs.setRumble(this@SessionActivity, on) } },
|
||||
onSteamMenu = if (SessionState.mode == SessionService.MODE_STEAM) ({ sendSteamGuide() }) else null,
|
||||
onQam = if (SessionState.mode == SessionService.MODE_STEAM) ({ triggerSteamQam() }) else null,
|
||||
@@ -2093,6 +2112,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
change()
|
||||
controllerSettings = ControllerPrefs.read(this)
|
||||
onScreenControls?.reload()
|
||||
bottomInputControls?.reload()
|
||||
unfoldedPanel?.reload()
|
||||
}
|
||||
|
||||
private fun routeBackAction() {
|
||||
@@ -2916,7 +2937,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
val on = SessionState.hdrCapable && SessionPrefs.hdr(this, mode)
|
||||
SessionState.hdr = on
|
||||
WaylandCompositor.nativeSetHdrOutput(on)
|
||||
WaylandCompositor.nativeSetZeroCopy(on || SessionPrefs.zeroCopy(this, mode))
|
||||
WaylandCompositor.nativeSetZeroCopy(on || SessionPrefs.zeroCopy(this, mode) && composedOutputFree())
|
||||
Log.i(TAG, "hdr: " + (if (on) "on" else "off") + " for this $mode session")
|
||||
}
|
||||
com.droiddeck.launcher.gpu.DriverSetupLog.write(this, "compositor.start driver=$driverId")
|
||||
@@ -2991,16 +3012,10 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
|
||||
private fun followPortrait(): Boolean = glassesScreen == null && SessionPrefs.portrait(this)
|
||||
|
||||
private fun followScale(): Float {
|
||||
val mode = displayMode()
|
||||
val choice = SessionPrefs.resolutionChoice(this, mode, com.droiddeck.launcher.session.SessionDisplay.panelSize(this), followPortrait())
|
||||
return com.droiddeck.launcher.session.SessionDisplay.followScale(choice) ?: 1f
|
||||
}
|
||||
|
||||
private fun followChoice(): Boolean {
|
||||
val mode = displayMode()
|
||||
return com.droiddeck.launcher.session.SessionDisplay.isFollow(
|
||||
SessionPrefs.resolutionChoice(this, mode, com.droiddeck.launcher.session.SessionDisplay.panelSize(this), followPortrait()))
|
||||
private fun applyFollowChoice() {
|
||||
val scale = SessionState.followScales.let { if (followPortrait()) it.second else it.first }
|
||||
SessionState.followScreen = scale != null
|
||||
SessionState.followScale = scale ?: 1f
|
||||
}
|
||||
|
||||
private fun applyFollowOrientation(config: android.content.res.Configuration) {
|
||||
@@ -3014,6 +3029,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
SessionService.setActivityDisplay(this, sessionActivityDisplayId)
|
||||
}
|
||||
cancelTouchGestures()
|
||||
applyFollowChoice()
|
||||
applyFollowOrientation(newConfig)
|
||||
applyNotchInset()
|
||||
applyUnfoldedControls()
|
||||
@@ -3162,6 +3178,17 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}
|
||||
}
|
||||
|
||||
private fun scheduleFrameGenInventoryRefresh() {
|
||||
if (!frameGenInventoryRefreshScheduled.compareAndSet(false, true)) return
|
||||
uiHandler.postDelayed({
|
||||
frameGenInventoryRefreshScheduled.set(false)
|
||||
if (frameGenActivityActive && !isFinishing && !isDestroyed) {
|
||||
frameGenInventoryRefreshDue = true
|
||||
applyFrameGen()
|
||||
}
|
||||
}, 15_000L)
|
||||
}
|
||||
|
||||
private fun frameGenModeForActiveGame(request: Int): FrameGen.Mode {
|
||||
if (SessionState.mode == SessionService.MODE_RUN) {
|
||||
val activeAppId = (
|
||||
@@ -3175,7 +3202,26 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
.mapNotNull { it.profileKey.toLongOrNull() }
|
||||
.toSet()
|
||||
|
||||
if (frameGenInventoryRefreshDue) {
|
||||
val focusedAppId = AgentGuest.focus(this)?.let { snapshot ->
|
||||
snapshot.optLong("focusedApp").takeIf { snapshot.has("focusedApp") }
|
||||
}
|
||||
val stillKnown = synchronized(frameGenInventoryLock) {
|
||||
frameGenInventoryRefreshDue = false
|
||||
val known = frameGenInventoryIds
|
||||
val keep = known != null && focusedAppId != null &&
|
||||
AgentGuest.focusedInstalledSteamAppId(focusedAppId, cachedIds + known) != null
|
||||
if (!keep) {
|
||||
frameGenInventoryIds = null
|
||||
frameGenInventoryLastAttemptAt = 0L
|
||||
}
|
||||
keep
|
||||
}
|
||||
if (stillKnown) scheduleFrameGenInventoryRefresh()
|
||||
}
|
||||
|
||||
var inventoryRevision = drawerGameInventoryRevision
|
||||
var scannedNow = false
|
||||
var ids = synchronized(frameGenInventoryLock) {
|
||||
if (frameGenInventoryRevision != inventoryRevision) {
|
||||
frameGenInventoryIds = null
|
||||
@@ -3235,21 +3281,11 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
ids = cachedIds + currentIds
|
||||
frameGenInventoryIds = ids
|
||||
published = true
|
||||
scannedNow = true
|
||||
}
|
||||
}
|
||||
if (published) {
|
||||
if (frameGenInventoryRefreshScheduled.compareAndSet(false, true)) {
|
||||
uiHandler.postDelayed({
|
||||
frameGenInventoryRefreshScheduled.set(false)
|
||||
if (frameGenActivityActive && !isFinishing && !isDestroyed) {
|
||||
synchronized(frameGenInventoryLock) {
|
||||
frameGenInventoryIds = null
|
||||
frameGenInventoryLastAttemptAt = 0L
|
||||
}
|
||||
applyFrameGen()
|
||||
}
|
||||
}, 15_000L)
|
||||
}
|
||||
scheduleFrameGenInventoryRefresh()
|
||||
if (frameGenRequests.get() != request) {
|
||||
applyFrameGen()
|
||||
}
|
||||
@@ -3267,7 +3303,24 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
val activeAppId = AgentGuest.activeSteamAppId(
|
||||
this, cachedIds + (ids ?: emptySet())
|
||||
)
|
||||
if (activeAppId == null) return FrameGen.Mode.OFF
|
||||
if (activeAppId == null) {
|
||||
val focusedAppId = AgentGuest.focus(this)?.optLong("focusedApp", 0L) ?: 0L
|
||||
val rescan = !scannedNow && focusedAppId > 0 && synchronized(frameGenInventoryLock) {
|
||||
val retained = frameGenInventoryIds
|
||||
if (retained != null && focusedAppId !in retained &&
|
||||
focusedAppId != frameGenInventoryMissedAppId
|
||||
) {
|
||||
frameGenInventoryMissedAppId = focusedAppId
|
||||
frameGenInventoryIds = null
|
||||
frameGenInventoryLastAttemptAt = 0L
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
if (rescan) uiHandler.post { if (!isFinishing && !isDestroyed) applyFrameGen() }
|
||||
return FrameGen.Mode.OFF
|
||||
}
|
||||
return FrameGen.mode(this, activeAppId.toString())
|
||||
}
|
||||
|
||||
@@ -3395,8 +3448,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
if (status == 0) SessionState.takeRelaunch()?.let { next ->
|
||||
next.putExtra(EXTRA_RETURN_HOME, intent.getBooleanExtra(EXTRA_RETURN_HOME, false))
|
||||
next.putExtra(EXTRA_LINK_TASK, intent.getIntExtra(EXTRA_LINK_TASK, -1))
|
||||
setIntent(next)
|
||||
recreate()
|
||||
relaunch(next)
|
||||
return@runOnUiThread
|
||||
}
|
||||
showEnded(status, hint)
|
||||
@@ -3404,6 +3456,16 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}, "session-end-hint").start()
|
||||
}
|
||||
|
||||
// recreate() keeps this window, and Compose content added to it afterwards never recomposes, so the
|
||||
// loading screen of the next session stays up over a running session. A new instance gets its own window.
|
||||
// This instance finishes first because the activity is singleTask and would otherwise take the intent itself.
|
||||
private fun relaunch(next: Intent) {
|
||||
closeAtOnce = true
|
||||
super.finish()
|
||||
startActivity(next)
|
||||
overridePendingTransition(0, 0)
|
||||
}
|
||||
|
||||
private fun showEnded(status: Int, hint: EndHint?) {
|
||||
if (status == 0 && hint?.evenOnSuccess != true) {
|
||||
finish()
|
||||
@@ -3548,6 +3610,15 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
|
||||
|
||||
override fun dispatchKeyEvent(event: KeyEvent): Boolean {
|
||||
val normalized = com.droiddeck.launcher.input.GuestKeys.normalizeKeyboardEscape(event)
|
||||
if (normalized === event) return dispatchSessionKeyEvent(event)
|
||||
if (event.action == KeyEvent.ACTION_DOWN && event.repeatCount == 0) {
|
||||
Log.i(TAG, "hardware Esc normalized from Back device=${event.deviceId} scan=${event.scanCode}")
|
||||
}
|
||||
return dispatchSessionKeyEvent(normalized)
|
||||
}
|
||||
|
||||
private fun dispatchSessionKeyEvent(event: KeyEvent): Boolean {
|
||||
if (com.droiddeck.launcher.ui.AgentPet.handleBack(this, event)) return true
|
||||
when (event.keyCode) {
|
||||
KeyEvent.KEYCODE_VOLUME_UP, KeyEvent.KEYCODE_VOLUME_DOWN, KeyEvent.KEYCODE_VOLUME_MUTE -> {
|
||||
@@ -3919,6 +3990,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
val presentation = secondScreenPresentation ?: return
|
||||
presentation.showMenu(false)
|
||||
if (secondScreenMode == SecondScreenMode.NONE) closeSecondScreen(reset = false) else updateKeyboardRoute()
|
||||
if (gamePanelPending) uiHandler.post { restoreGamePanel(gestureGame) }
|
||||
}
|
||||
|
||||
|
||||
@@ -4358,8 +4430,13 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
if (secondScreenMode == SecondScreenMode.DECK_CONTROLS && !SessionState.deckPad) selectSecondScreenMode(secondScreenMode)
|
||||
}
|
||||
|
||||
private fun openingPanel() = SecondScreenMode.opening(SessionPrefs.secondScreenPanel(this, desktopSession), SessionState.deckPad,
|
||||
bottomPages().isNotEmpty(), com.droiddeck.launcher.session.BottomDesktop.available())
|
||||
private fun openingPanel(): SecondScreenMode {
|
||||
val saved = bottomGameKey()?.let { SessionPrefs.gameSecondScreenPanel(this, it) }
|
||||
// A game's own panel counts as applied, so the next game without one returns to the global choice.
|
||||
if (saved != null) gamePanelApplied = true
|
||||
return SecondScreenMode.opening(saved ?: SessionPrefs.secondScreenPanel(this, desktopSession), SessionState.deckPad,
|
||||
bottomPages().isNotEmpty(), com.droiddeck.launcher.session.BottomDesktop.available(), SessionState.mode == SessionService.MODE_STEAM)
|
||||
}
|
||||
|
||||
private fun openingSurface() = openingPanel().takeIf { it != SecondScreenMode.MENU } ?: SecondScreenMode.KEYBOARD_TRACKPAD
|
||||
|
||||
@@ -4385,9 +4462,16 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
typingReturnMode = null
|
||||
automaticPanel = false
|
||||
SessionPrefs.setSecondScreenPanel(this, desktopSession, SecondScreenMode.MENU.id)
|
||||
bottomGameKey()?.let { SessionPrefs.setGameSecondScreenPanel(this, it, SecondScreenMode.MENU.id) }
|
||||
gamePanelApplied = bottomGameKey() != null
|
||||
drawerOpen = true
|
||||
}
|
||||
|
||||
/** What bottom-screen memory is kept under: the game id in direct-run mode when there is one, else the focused game. */
|
||||
private fun bottomGameKey(): String? =
|
||||
if (SessionState.mode == SessionService.MODE_RUN) SessionState.gameId?.takeIf { it.isNotBlank() }?.let { "game:$it" } ?: gestureGame
|
||||
else gestureGame
|
||||
|
||||
private fun settleDualScreenControls() {
|
||||
if (!dualControlsProvisional || pipUi || !started || (::loading.isInitialized && loading.visible)) return
|
||||
dualControlsProvisional = false
|
||||
@@ -4405,6 +4489,11 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
SessionState.secondScreenAutoOpened = false
|
||||
val menuOnBottom = drawerDocked
|
||||
val menuOnTop = drawerOpenState && !drawerDocked
|
||||
if (mode == com.droiddeck.launcher.input.DualScreen.MODE_SWAPPED) {
|
||||
putGameOnBottom(true)
|
||||
} else if (gameOnBottom && mode != com.droiddeck.launcher.input.DualScreen.MODE_OFF) {
|
||||
putGameOnBottom(false)
|
||||
}
|
||||
if (mode == com.droiddeck.launcher.input.DualScreen.MODE_OFF) {
|
||||
if (gameOnBottom) putGameOnBottom(false)
|
||||
if (secondScreenMode != SecondScreenMode.NONE || menuOnBottom) closeSecondScreen(reset = true)
|
||||
@@ -4500,10 +4589,36 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
typingReturnMode = null
|
||||
automaticPanel = false
|
||||
SessionState.bottomMenu = false
|
||||
if (mode != SecondScreenMode.NONE) SessionPrefs.setSecondScreenPanel(this, desktopSession, mode.id)
|
||||
if (mode != SecondScreenMode.NONE) {
|
||||
SessionPrefs.setSecondScreenPanel(this, desktopSession, mode.id)
|
||||
bottomGameKey()?.let { SessionPrefs.setGameSecondScreenPanel(this, it, mode.id) }
|
||||
gamePanelApplied = bottomGameKey() != null
|
||||
}
|
||||
selectSecondScreenMode(mode)
|
||||
}
|
||||
|
||||
private var gamePanelApplied = false
|
||||
private var gamePanelPending = false
|
||||
|
||||
private fun restoreGamePanel(game: String?) {
|
||||
if (secondScreenMode == SecondScreenMode.NONE || pipUi) return
|
||||
// The bottom menu or field keyboard is in the way; the panel is restored once it closes.
|
||||
if (typingReturnMode != null || menuShownOnBottom()) {
|
||||
gamePanelPending = true
|
||||
return
|
||||
}
|
||||
gamePanelPending = false
|
||||
val remembered = game?.let { bottomGameKey() }?.let { SessionPrefs.gameSecondScreenPanel(this, it) }
|
||||
val wanted = when {
|
||||
remembered != null -> SecondScreenMode.opening(remembered, SessionState.deckPad, bottomPages().isNotEmpty(),
|
||||
com.droiddeck.launcher.session.BottomDesktop.available(), SessionState.mode == SessionService.MODE_STEAM)
|
||||
gamePanelApplied -> openingPanel()
|
||||
else -> return
|
||||
}
|
||||
gamePanelApplied = remembered != null
|
||||
if (wanted != SecondScreenMode.MENU && wanted != secondScreenMode) selectSecondScreenMode(wanted)
|
||||
}
|
||||
|
||||
private fun bottomScreenPicker(mode: SecondScreenMode) = com.droiddeck.launcher.ui.ScreenPicker(
|
||||
com.droiddeck.launcher.ui.secondScreenModes(false, SessionState.deckPad, bottomPages().isNotEmpty(),
|
||||
com.droiddeck.launcher.session.BottomDesktop.available()),
|
||||
@@ -4519,6 +4634,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
onKeyboardClosed = ::bottomKeyboardClosed,
|
||||
onMenu = { drawerOpen = true },
|
||||
picker = ::bottomScreenPicker,
|
||||
panel = ::bottomPanel,
|
||||
onMenuTouched = {
|
||||
if (drawerPinned) {
|
||||
drawerPinned = false
|
||||
@@ -4555,7 +4671,11 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
BottomDashboard(
|
||||
bottomPages(), com.droiddeck.launcher.ui.SessionBottomTab.picked(SessionState.sessionId),
|
||||
gameStarts = gameStarts,
|
||||
onPage = { com.droiddeck.launcher.ui.SessionBottomTab.pick(SessionState.sessionId, it) },
|
||||
gamePage = { bottomGameKey()?.let { SessionPrefs.gameBottomPage(this@SessionActivity, it) } },
|
||||
onPage = {
|
||||
com.droiddeck.launcher.ui.SessionBottomTab.pick(SessionState.sessionId, it)
|
||||
bottomGameKey()?.let { game -> SessionPrefs.setGameBottomPage(this@SessionActivity, game, it) }
|
||||
},
|
||||
strip = { pageId ->
|
||||
com.droiddeck.launcher.ui.SessionBottomStrip(pageId) { if (::hud.isInitialized) hud.liveFps else null }
|
||||
},
|
||||
@@ -4564,11 +4684,21 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}),
|
||||
)
|
||||
|
||||
private fun bottomPages(): List<BottomPage> = sessionBottomPages(BottomPageActions(
|
||||
private fun bottomPages(): List<BottomPage> = sessionBottomPages(bottomActions())
|
||||
|
||||
private fun bottomPanel(mode: SecondScreenMode): (@androidx.compose.runtime.Composable () -> Unit)? =
|
||||
if (!mode.sessionPanel) null else ({ DroidDeckTheme { com.droiddeck.launcher.ui.BottomSessionPanel(mode, bottomActions()) } })
|
||||
|
||||
private fun bottomActions() = BottomPageActions(
|
||||
takeScreenshot = ::captureScreenshot,
|
||||
fps = { if (::hud.isInitialized) hud.liveFps else null },
|
||||
runningGame = { gestureGame },
|
||||
))
|
||||
gameKey = ::bottomGameKey,
|
||||
copyRegion = ::copyGameRegion,
|
||||
sourceAspect = { gameSource()?.takeIf { it.width > 0 && it.height > 0 }?.let { it.width.toFloat() / it.height } ?: (16f / 9f) },
|
||||
holdComposed = ::holdComposedOutput,
|
||||
maskRegion = ::maskGameRegion,
|
||||
)
|
||||
|
||||
private fun captureScreenshot(onDone: (Boolean) -> Unit) = copyGameFrame { bitmap ->
|
||||
if (bitmap == null) {
|
||||
@@ -4617,6 +4747,46 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}
|
||||
}
|
||||
|
||||
private fun gameSource(): android.view.SurfaceView? = if (glassesOutputActive) glassesScreen?.surfaceView
|
||||
else if (bottomOutputActive) bottomGame?.surfaceView else if (::surfaceView.isInitialized) surfaceView else null
|
||||
|
||||
private fun copyGameRegion(region: android.graphics.RectF?, outWidth: Int, outHeight: Int, onFrame: (android.graphics.Bitmap?) -> Unit) {
|
||||
val source = gameSource()
|
||||
val width = source?.width ?: 0
|
||||
val height = source?.height ?: 0
|
||||
if (source == null || width <= 0 || height <= 0 || outWidth <= 0 || outHeight <= 0 || source.holder.surface?.isValid != true) {
|
||||
onFrame(null)
|
||||
return
|
||||
}
|
||||
val r = region ?: android.graphics.RectF(0f, 0f, 1f, 1f)
|
||||
val src = android.graphics.Rect((r.left * width).toInt(), (r.top * height).toInt(), (r.right * width).toInt(), (r.bottom * height).toInt())
|
||||
if (src.width() <= 0 || src.height() <= 0) {
|
||||
onFrame(null)
|
||||
return
|
||||
}
|
||||
val bitmap = try {
|
||||
android.graphics.Bitmap.createBitmap(outWidth, outHeight, android.graphics.Bitmap.Config.ARGB_8888)
|
||||
} catch (_: OutOfMemoryError) {
|
||||
onFrame(null)
|
||||
return
|
||||
}
|
||||
withPictureFrame { done ->
|
||||
try {
|
||||
android.view.PixelCopy.request(source, src, bitmap, { result ->
|
||||
done()
|
||||
if (result == android.view.PixelCopy.SUCCESS) onFrame(bitmap) else {
|
||||
bitmap.recycle()
|
||||
onFrame(null)
|
||||
}
|
||||
}, uiHandler)
|
||||
} catch (_: IllegalArgumentException) {
|
||||
done()
|
||||
bitmap.recycle()
|
||||
onFrame(null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** PixelCopy reads the last queued buffer, which black frame insertion makes black every other refresh. */
|
||||
private fun withPictureFrame(copy: (done: () -> Unit) -> Unit) {
|
||||
if (!CompositorHost.holdPicture()) return copy {}
|
||||
@@ -4919,7 +5089,10 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
com.droiddeck.launcher.ui.SessionTyping.returnFocus(this, taskId)
|
||||
val mode = typingReturnMode ?: return
|
||||
typingReturnMode = null
|
||||
uiHandler.post { if (secondScreenMode == SecondScreenMode.KEYBOARD_TRACKPAD) selectSecondScreenMode(mode) }
|
||||
uiHandler.post {
|
||||
if (secondScreenMode == SecondScreenMode.KEYBOARD_TRACKPAD) selectSecondScreenMode(mode)
|
||||
if (gamePanelPending) restoreGamePanel(gestureGame)
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateKeyboardRoute() {
|
||||
@@ -5144,10 +5317,10 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
private var sessionTouchDown = false
|
||||
private var screenTapsClick = true
|
||||
|
||||
private fun onScreenMouseButtonShown(): Boolean = listOfNotNull(
|
||||
private fun onScreenLeftMouseButtonShown(): Boolean = listOfNotNull(
|
||||
onScreenControls?.inputSurface, bottomInputControls?.inputSurface, unfoldedPanel?.inputSurface, unfoldedDeckSurface,
|
||||
secondScreenPresentation?.controlsView, swappedInputSurface,
|
||||
).any { it.isShown && inputProfile.showsMouseButton(it.inputRole, it.shownElements, stockInputProfile) }
|
||||
).any { it.isShown && inputProfile.showsLeftMouseButton(it.inputRole, it.shownElements, stockInputProfile) }
|
||||
|
||||
override fun onTouchEvent(event: MotionEvent): Boolean = inSurfaceSpace(event) { handleTouch(event) }
|
||||
|
||||
@@ -5183,7 +5356,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
val snapshot = fingerTouchSnapshot(uiBlocking)
|
||||
val route = com.droiddeck.launcher.input.TouchRouter.decide(snapshot)
|
||||
if (event.actionMasked == MotionEvent.ACTION_DOWN) {
|
||||
screenTapsClick = !onScreenMouseButtonShown()
|
||||
screenTapsClick = !onScreenLeftMouseButtonShown()
|
||||
if (::touchpad.isInitialized) touchpad.clicks = screenTapsClick
|
||||
if (::scrollTouch.isInitialized) scrollTouch.clicks = screenTapsClick
|
||||
}
|
||||
@@ -5850,7 +6023,13 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
if (zeroCopyActive()) {
|
||||
WaylandCompositor.nativeSetZeroCopy(false)
|
||||
val restore = java.util.concurrent.atomic.AtomicBoolean(false)
|
||||
val back = { if (restore.compareAndSet(false, true)) WaylandCompositor.nativeSetZeroCopy(true) }
|
||||
pauseCaptures++
|
||||
val back = {
|
||||
if (restore.compareAndSet(false, true)) {
|
||||
pauseCaptures--
|
||||
if (!isDestroyed) WaylandCompositor.nativeSetZeroCopy(composedOutputFree())
|
||||
}
|
||||
}
|
||||
uiHandler.postDelayed({ capturePausedFrame(manual = true, onDone = back) }, ZERO_COPY_SETTLE_MS)
|
||||
uiHandler.postDelayed({ back() }, ZERO_COPY_RESTORE_MS)
|
||||
} else {
|
||||
@@ -5859,6 +6038,53 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
SessionService.pause(this)
|
||||
}
|
||||
|
||||
private var composedHolds = 0
|
||||
private var pauseCaptures = 0
|
||||
|
||||
private fun composedOutputFree() = composedHolds == 0 && pauseCaptures == 0
|
||||
private var mirrorMask: android.view.View? = null
|
||||
private var maskedRegion: android.graphics.RectF? = null
|
||||
private var maskDim = false
|
||||
private val maskLayout = android.view.View.OnLayoutChangeListener { _, _, _, _, _, _, _, _, _ -> placeMirrorMask() }
|
||||
|
||||
private fun maskGameRegion(region: android.graphics.RectF?, dim: Boolean) {
|
||||
maskedRegion = region
|
||||
maskDim = dim
|
||||
if (region != null && mirrorMask == null && ::sessionRoot.isInitialized && ::surfaceView.isInitialized) {
|
||||
val mask = android.view.View(this).apply {
|
||||
isClickable = false
|
||||
isFocusable = false
|
||||
importantForAccessibility = android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO
|
||||
}
|
||||
sessionRoot.addView(mask, sessionRoot.indexOfChild(surfaceView) + 1, FrameLayout.LayoutParams(0, 0))
|
||||
surfaceView.addOnLayoutChangeListener(maskLayout)
|
||||
mirrorMask = mask
|
||||
}
|
||||
placeMirrorMask()
|
||||
}
|
||||
|
||||
private fun placeMirrorMask() {
|
||||
val mask = mirrorMask ?: return
|
||||
val r = maskedRegion
|
||||
if (r == null || glassesOutputActive || bottomOutputActive || surfaceView.width <= 0) {
|
||||
mask.visibility = android.view.View.GONE
|
||||
return
|
||||
}
|
||||
mask.setBackgroundColor(if (maskDim) 0xB3000000.toInt() else android.graphics.Color.BLACK)
|
||||
val w = surfaceView.width
|
||||
val h = surfaceView.height
|
||||
mask.layoutParams = FrameLayout.LayoutParams(((r.right - r.left) * w).toInt(), ((r.bottom - r.top) * h).toInt(), Gravity.TOP or Gravity.START).apply {
|
||||
leftMargin = surfaceView.left - sessionRoot.paddingLeft + (r.left * w).toInt()
|
||||
topMargin = surfaceView.top - sessionRoot.paddingTop + (r.top * h).toInt()
|
||||
}
|
||||
mask.visibility = android.view.View.VISIBLE
|
||||
}
|
||||
|
||||
private fun holdComposedOutput(hold: Boolean) {
|
||||
composedHolds = (composedHolds + if (hold) 1 else -1).coerceAtLeast(0)
|
||||
if (zeroCopyActive()) WaylandCompositor.nativeSetZeroCopy(composedOutputFree())
|
||||
}
|
||||
|
||||
private fun zeroCopyActive(): Boolean =
|
||||
CompositorHost.isStarted && !SessionState.hdr && SessionPrefs.zeroCopy(this, SessionState.mode)
|
||||
|
||||
@@ -6017,8 +6243,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
Log.w(TAG, "ignoring agent start while session phase is ${SessionState.phase}")
|
||||
return
|
||||
}
|
||||
setIntent(intent)
|
||||
recreate()
|
||||
relaunch(android.content.Intent(intent).setClass(this, SessionActivity::class.java))
|
||||
return
|
||||
}
|
||||
if (this.intent.getBooleanExtra(EXTRA_RETURN_HOME, false)) intent.putExtra(EXTRA_RETURN_HOME, true)
|
||||
@@ -6577,11 +6802,21 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
modifier = Modifier.fillMaxWidth().weight(1f),
|
||||
)
|
||||
}
|
||||
secondScreenMode.sessionPanel -> androidx.compose.foundation.layout.Column(Modifier.fillMaxSize()) {
|
||||
com.droiddeck.launcher.ui.BottomScreenBar(bar(getString(secondScreenMode.label)))
|
||||
androidx.compose.foundation.layout.Box(Modifier.fillMaxWidth().weight(1f)) {
|
||||
com.droiddeck.launcher.ui.BottomSessionPanel(secondScreenMode, bottomActions())
|
||||
}
|
||||
}
|
||||
pages.isEmpty() -> com.droiddeck.launcher.ui.BottomScreenBar(bar(null))
|
||||
else -> BottomDashboard(
|
||||
pages, com.droiddeck.launcher.ui.SessionBottomTab.picked(SessionState.sessionId),
|
||||
gameStarts = gameStarts,
|
||||
onPage = { com.droiddeck.launcher.ui.SessionBottomTab.pick(SessionState.sessionId, it) },
|
||||
gamePage = { bottomGameKey()?.let { SessionPrefs.gameBottomPage(this@SessionActivity, it) } },
|
||||
onPage = {
|
||||
com.droiddeck.launcher.ui.SessionBottomTab.pick(SessionState.sessionId, it)
|
||||
bottomGameKey()?.let { game -> SessionPrefs.setGameBottomPage(this@SessionActivity, game, it) }
|
||||
},
|
||||
bar = bar(getString(R.string.second_mode_dashboard)),
|
||||
strip = { pageId ->
|
||||
com.droiddeck.launcher.ui.SessionBottomStrip(pageId) { if (::hud.isInitialized) hud.liveFps else null }
|
||||
@@ -6725,9 +6960,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
if (!hasFocus && ::padMouse.isInitialized) padMouse.reset()
|
||||
if (runtimeRemovalBlocked) return
|
||||
if (!hasFocus) {
|
||||
if (::touchscreenGestures.isInitialized) touchscreenGestures.cancel()
|
||||
if (::touchpad.isInitialized) touchpad.cancel()
|
||||
if (::scrollTouch.isInitialized) scrollTouch.cancel()
|
||||
cancelTouchGestures()
|
||||
releaseHeldGuestInput()
|
||||
}
|
||||
if (hasFocus && !pipUi) {
|
||||
|
||||
@@ -126,6 +126,16 @@ object AgentSetup {
|
||||
Thread({ for ((step, command) in probes) probe(app, harness, step, command) }, "agent-checks").start()
|
||||
}
|
||||
|
||||
/** The last failed refresh ends the script: the installs after it would run from stale indexes and could report success. */
|
||||
internal fun installScript(harnessInstall: String) = "set -e; export DEBIAN_FRONTEND=noninteractive; " +
|
||||
"apt() { apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=30 \"\$@\"; }; " +
|
||||
"dpkg --configure -a || echo 'Some packages are not configured yet; repairing dependencies'; " +
|
||||
"for i in 1 2 3; do apt -o APT::Update::Error-Mode=any update -q && break; " +
|
||||
"[ \$i = 3 ] && { echo 'Some package sources could not be refreshed'; exit 1; }; " +
|
||||
"echo 'Some package sources could not be refreshed; retrying'; sleep 3; done; " +
|
||||
"apt -f install -y --fix-missing; " +
|
||||
"apt install -y --no-install-recommends git gh adb curl ca-certificates python3; $harnessInstall"
|
||||
|
||||
fun runsAsRoot(step: Step) = step == Step.INSTALL
|
||||
|
||||
/** Runs [step]'s action. [CONNECTION] is the app's own pairing flow, so the caller opens it. */
|
||||
@@ -140,12 +150,7 @@ object AgentSetup {
|
||||
val command = override ?: when (step) {
|
||||
Step.CONNECTION -> return
|
||||
Step.INSTALL -> {
|
||||
listOf("sh", "-c", "set -e; export DEBIAN_FRONTEND=noninteractive; " +
|
||||
"apt() { apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=30 \"\$@\"; }; " +
|
||||
"dpkg --configure -a || echo 'Some packages are not configured yet; repairing dependencies'; " +
|
||||
"for i in 1 2 3; do apt update -q && break; echo 'Some package sources could not be refreshed; retrying'; sleep 3; done; " +
|
||||
"apt -f install -y --fix-missing; " +
|
||||
"apt install -y --fix-missing --no-install-recommends git gh adb curl ca-certificates python3; ${harness.install}")
|
||||
listOf("sh", "-c", installScript(harness.install))
|
||||
}
|
||||
Step.SIGN_IN -> harness.signIn
|
||||
Step.GITHUB -> listOf("dd-gh-login")
|
||||
|
||||
@@ -293,6 +293,7 @@ object DeviceReport {
|
||||
k("Stretch 16:9 to panel", SessionPrefs.stretch16x9(context))
|
||||
k("Avoid notch", SessionPrefs.avoidNotch(context))
|
||||
k("Return to launcher after a game", SessionPrefs.returnAfterGame(context))
|
||||
k("Valve Proton only when needed", SessionPrefs.valveProtonOnDemand(context))
|
||||
k("Microphone", SessionPrefs.micEnabled(context))
|
||||
k("On-screen controls", SessionPrefs.oscMode(context))
|
||||
k("Touch mode", SessionPrefs.touchMode(context))
|
||||
|
||||
@@ -28,7 +28,9 @@ object DeviceSupport {
|
||||
com.droiddeck.launcher.gpu.GpuInfo.detect().family.name.startsWith("MALI"))
|
||||
}
|
||||
|
||||
fun bridgeUsable(): Boolean = !adreno() && !SystemVulkanDriver.isAvailable() && File("/dev/mali0").exists()
|
||||
fun bridgeUsable(): Boolean = bridgeUsable(adreno(), SystemVulkanDriver.isAvailable())
|
||||
|
||||
internal fun bridgeUsable(adreno: Boolean, systemDriverReady: Boolean): Boolean = !adreno && !systemDriverReady
|
||||
|
||||
fun openDriverActive(context: Context): Boolean {
|
||||
if (adreno()) return false
|
||||
|
||||
@@ -38,6 +38,8 @@ class WirelessAdbPairingService : Service() {
|
||||
private var pairingHost: String? = null
|
||||
private var pairingPort: Int? = null
|
||||
@Volatile private var working = false
|
||||
@Volatile private var limitEnabled = false
|
||||
@Volatile private var session = 0
|
||||
private val timeout = Runnable { finish(Stage.Failed(getString(R.string.adbpair_timed_out))) }
|
||||
|
||||
override fun onBind(intent: Intent?): IBinder? = null
|
||||
@@ -50,12 +52,15 @@ class WirelessAdbPairingService : Service() {
|
||||
onCode(code)
|
||||
}
|
||||
ACTION_CANCEL -> finish(Stage.Idle)
|
||||
else -> begin()
|
||||
else -> begin(intent?.getBooleanExtra(EXTRA_ENABLE_LIMIT, false) == true)
|
||||
}
|
||||
return START_NOT_STICKY
|
||||
}
|
||||
|
||||
private fun begin() {
|
||||
private fun begin(enableLimit: Boolean) {
|
||||
if (working) return
|
||||
session++
|
||||
limitEnabled = enableLimit
|
||||
pairingHost = null
|
||||
pairingPort = null
|
||||
working = false
|
||||
@@ -68,12 +73,13 @@ class WirelessAdbPairingService : Service() {
|
||||
|
||||
private fun startDiscovery() {
|
||||
stopDiscovery()
|
||||
val owner = session
|
||||
val manager = getSystemService(Context.NSD_SERVICE) as NsdManager
|
||||
val listener = object : NsdManager.DiscoveryListener {
|
||||
override fun onDiscoveryStarted(serviceType: String) = Unit
|
||||
override fun onServiceFound(serviceInfo: NsdServiceInfo) {
|
||||
if (serviceInfo.serviceType?.contains(PAIRING_TYPE) != true) return
|
||||
runCatching { manager.resolveService(serviceInfo, resolveListener()) }
|
||||
runCatching { manager.resolveService(serviceInfo, resolveListener(owner)) }
|
||||
}
|
||||
override fun onServiceLost(serviceInfo: NsdServiceInfo) = Unit
|
||||
override fun onDiscoveryStopped(serviceType: String) = Unit
|
||||
@@ -87,18 +93,20 @@ class WirelessAdbPairingService : Service() {
|
||||
.onFailure { finish(Stage.Failed(getString(R.string.adbpair_discovery_failed, it.localizedMessage.toString()))) }
|
||||
}
|
||||
|
||||
private fun resolveListener() = object : NsdManager.ResolveListener {
|
||||
private fun resolveListener(owner: Int): NsdManager.ResolveListener {
|
||||
return object : NsdManager.ResolveListener {
|
||||
override fun onResolveFailed(serviceInfo: NsdServiceInfo, errorCode: Int) = Unit
|
||||
override fun onServiceResolved(serviceInfo: NsdServiceInfo) {
|
||||
val address = serviceInfo.host ?: return
|
||||
if (!WirelessAdbFix.isLocalAddress(address)) return
|
||||
main.post {
|
||||
if (working || current.value == Stage.Done) return@post
|
||||
if (owner != session || working || current.value == Stage.Done) return@post
|
||||
pairingHost = address.hostAddress
|
||||
pairingPort = serviceInfo.port
|
||||
if (current.value !is Stage.CodeNeeded) show(Stage.CodeNeeded())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun onCode(code: String) {
|
||||
@@ -114,29 +122,34 @@ class WirelessAdbPairingService : Service() {
|
||||
return
|
||||
}
|
||||
working = true
|
||||
val owner = session
|
||||
val enable = limitEnabled
|
||||
show(Stage.Working(getString(R.string.adbpair_pairing)))
|
||||
Thread({
|
||||
val paired = runCatching { kotlinx.coroutines.runBlocking { WirelessAdbFix.pair(this@WirelessAdbPairingService, WirelessAdbFix.LOOPBACK, port, code) } }
|
||||
if (paired.isFailure) {
|
||||
main.post {
|
||||
working = false
|
||||
if (owner != session) return@post
|
||||
pairingPort = null
|
||||
show(Stage.CodeNeeded(getString(R.string.adbpair_code_rejected)))
|
||||
}
|
||||
return@Thread
|
||||
}
|
||||
main.post {
|
||||
if (owner != session) return@post
|
||||
stopDiscovery()
|
||||
show(Stage.Working(getString(R.string.adbpair_connecting)))
|
||||
}
|
||||
val result = runCatching {
|
||||
val connectPort = WirelessAdbFix.localConnectPort(this)
|
||||
?: error(getString(R.string.adbpair_port_not_found))
|
||||
main.post { show(Stage.Working(getString(R.string.adbpair_applying))) }
|
||||
WirelessAdbFix.setChildProcessLimit(this, WirelessAdbFix.LOOPBACK, connectPort, false)
|
||||
main.post { if (owner == session) show(Stage.Working(getString(R.string.adbpair_applying))) }
|
||||
WirelessAdbFix.setChildProcessLimit(this, WirelessAdbFix.LOOPBACK, connectPort, enable)
|
||||
}
|
||||
main.post {
|
||||
working = false
|
||||
if (owner != session) return@post
|
||||
finish(result.exceptionOrNull()?.let { Stage.Failed(it.localizedMessage ?: getString(R.string.adbpair_command_failed)) } ?: Stage.Done)
|
||||
}
|
||||
}, "wireless-adb-pairing").start()
|
||||
@@ -148,6 +161,7 @@ class WirelessAdbPairingService : Service() {
|
||||
}
|
||||
|
||||
private fun finish(stage: Stage) {
|
||||
session++
|
||||
main.removeCallbacks(timeout)
|
||||
stopDiscovery()
|
||||
publish(stage)
|
||||
@@ -248,6 +262,7 @@ class WirelessAdbPairingService : Service() {
|
||||
private const val ACTION_CODE = "com.droiddeck.launcher.action.WIRELESS_ADB_CODE"
|
||||
private const val ACTION_CANCEL = "com.droiddeck.launcher.action.WIRELESS_ADB_CANCEL"
|
||||
private const val KEY_CODE = "code"
|
||||
private const val EXTRA_ENABLE_LIMIT = "enable_limit"
|
||||
private const val TIMEOUT_MS = 5 * 60_000L
|
||||
|
||||
private val current = MutableStateFlow<Stage>(Stage.Idle)
|
||||
@@ -255,10 +270,10 @@ class WirelessAdbPairingService : Service() {
|
||||
|
||||
private fun publish(stage: Stage) { current.value = stage }
|
||||
|
||||
fun start(context: Context) {
|
||||
fun start(context: Context, enableLimit: Boolean = false) {
|
||||
context.getSystemService(NotificationManager::class.java)?.cancel(NOTIFICATION_ID)
|
||||
publish(Stage.Waiting)
|
||||
val intent = Intent(context, WirelessAdbPairingService::class.java)
|
||||
val intent = Intent(context, WirelessAdbPairingService::class.java).putExtra(EXTRA_ENABLE_LIMIT, enableLimit)
|
||||
if (Build.VERSION.SDK_INT >= 26) context.startForegroundService(intent) else context.startService(intent)
|
||||
}
|
||||
|
||||
@@ -271,6 +286,12 @@ class WirelessAdbPairingService : Service() {
|
||||
}
|
||||
|
||||
fun notificationsEnabled(context: Context): Boolean =
|
||||
context.getSystemService(NotificationManager::class.java)?.areNotificationsEnabled() != false
|
||||
context.getSystemService(NotificationManager::class.java)?.areNotificationsEnabled() != false && !channelBlocked(context)
|
||||
|
||||
/** The code is typed into a notification on this channel; a channel the user switched off leaves pairing with nothing to type into. */
|
||||
fun channelBlocked(context: Context): Boolean =
|
||||
context.getSystemService(NotificationManager::class.java)?.getNotificationChannel(CHANNEL_ID)?.importance == NotificationManager.IMPORTANCE_NONE
|
||||
|
||||
fun channelId(): String = CHANNEL_ID
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@ object AddedGames {
|
||||
val exeUncertain: Boolean = false,
|
||||
val launchOptions: String = "",
|
||||
val single: Boolean = false,
|
||||
val steamProgram: Boolean = true,
|
||||
) {
|
||||
fun folderName(): String = folder.name
|
||||
}
|
||||
@@ -232,13 +233,14 @@ object AddedGames {
|
||||
if (folder.name.lowercase() in steamInstalls || isSteamLibraryFolder(folder.name)) continue
|
||||
if (folder.path in removed) continue
|
||||
if (folder.name == "Games" && StoreInstallRoot.roots(context).any { it.absolutePath == folder.absolutePath }) continue
|
||||
for (game in expand(folder, entries, reuse = true)) if (game.path !in removed) scanGame(context, game, out, reuse = true)
|
||||
timed(folder) { for (game in expand(folder, entries, reuse = true)) if (game.path !in removed) scanGame(context, game, out, reuse = true) }
|
||||
}
|
||||
}
|
||||
for (entry in AddedExes.list(context)) {
|
||||
val folder = File(entry.folder)
|
||||
if (folder.path in removed || !folder.isDirectory) continue
|
||||
scanGame(context, folder, out, single = entry, reuse = true)
|
||||
if (StoreGameSidecar.read(folder)?.isInstalled == false) continue
|
||||
timed(folder) { scanGame(context, folder, out, single = entry, reuse = true) }
|
||||
}
|
||||
for (folder in libraryDepotInstalls(context)) if (folder.path !in removed) scanGame(context, folder, out, reuse = true)
|
||||
for (folder in StoreInstallRoot.gameFolders(context)) if (StoreInstallRoot.isFinished(folder)) scanGame(context, folder, out, reuse = true)
|
||||
@@ -248,6 +250,15 @@ object AddedGames {
|
||||
return out.distinctBy { it.folder.canonicalPath }
|
||||
}
|
||||
|
||||
private const val SLOW_FOLDER_MS = 1_000L
|
||||
|
||||
private inline fun timed(folder: File, block: () -> Unit) {
|
||||
val began = android.os.SystemClock.elapsedRealtime()
|
||||
block()
|
||||
val took = android.os.SystemClock.elapsedRealtime() - began
|
||||
if (took >= SLOW_FOLDER_MS) Log.i(TAG, "games: scanning ${folder.path} took ${took}ms")
|
||||
}
|
||||
|
||||
fun single(context: Context, folderPath: String, reuse: Boolean = false): Game? {
|
||||
val folder = File(folderPath)
|
||||
if (!folder.isDirectory || folderPath in SessionPrefs.removedAddedGames(context)) return null
|
||||
@@ -336,7 +347,11 @@ object AddedGames {
|
||||
val owner = ownerFolder(app, exe)
|
||||
if (owner != null && owner.path !in SessionPrefs.removedAddedGames(app)) {
|
||||
single(app, owner.path)?.takeIf { canonical(it.exe) == path }?.let {
|
||||
if (guestPath(app, exe) != null) AddedExes.put(app, AddedExes.Entry(owner.path, exe.path))
|
||||
val keep = listOf(it.exe, exe).firstOrNull { f -> guestPath(app, f) != null }
|
||||
if (keep != null) {
|
||||
SessionPrefs.setAddedGameExe(app, owner.path, keep.path)
|
||||
AddedExes.put(app, AddedExes.Entry(owner.path, keep.path))
|
||||
}
|
||||
return AddResult.Existing(it)
|
||||
}
|
||||
}
|
||||
@@ -442,9 +457,9 @@ object AddedGames {
|
||||
val chosen = picked.takeIf { it.isNotEmpty() }?.let { File(it) }?.takeIf { it.isFile }
|
||||
?: single?.takeIf { it.picked }?.let { File(it.exe) }?.takeIf { it.isFile }
|
||||
val found = chosen ?: sidecar?.exeFile(folder)?.takeIf { it.isFile } ?: candidates.firstOrNull() ?: return
|
||||
val epicLauncher = sidecar?.takeIf { it.store == Store.EPIC && (chosen == null || canonical(chosen) == canonical(it.exeFile(folder))) }
|
||||
val storeLauncher = sidecar?.takeIf { chosen == null || canonical(chosen) == canonical(it.exeFile(folder)) }
|
||||
?.launcherFile(folder)?.takeIf { it.isFile }
|
||||
val launch = epicLauncher ?: if (chosen == null) sidecar?.launcherFile(folder)?.takeIf { it.isFile } ?: found else found
|
||||
val launch = storeLauncher ?: found
|
||||
val foundGuest = guestPath(context, launch)
|
||||
if (foundGuest == null) { Log.w(TAG, "${folder.name}: the session cannot see ${launch.path}"); return }
|
||||
val autoName = sidecar?.title ?: identifiedName(folder, found) ?: folder.name
|
||||
@@ -470,7 +485,13 @@ object AddedGames {
|
||||
val guestDir = SessionPrefs.addedGameStartIn(context, folder.path).takeIf { sidecar == null && it.isNotEmpty() }
|
||||
?: sidecarDir
|
||||
?: guestPath(context, (if (adopted != null) adopted else launch).parentFile ?: folder) ?: return
|
||||
val steamId = config?.let { steamRoute(it, appId) }
|
||||
if (adopted == null && SessionPrefs.addedGameAdopted(context, folder.path, "Exe") == null &&
|
||||
guestPath(context, folder)?.let { steamEditedTo(it, record, guestExe) } == true) {
|
||||
SessionPrefs.setAddedGameAdopted(context, folder.path, "Exe", exe.path)
|
||||
}
|
||||
val steamProgram = candidates.firstOrNull()?.let { canonical(it) == canonical(exe) } ?: true ||
|
||||
SessionPrefs.addedGameAdopted(context, folder.path, "Exe")?.let { canonical(File(it)) == canonical(exe) } == true
|
||||
val steamId = config?.takeIf { steamProgram }?.let { steamRoute(it, appId) }
|
||||
out.add(Game(folder, name, exe, guestExe, guestDir, appId,
|
||||
steamId?.toLong() ?: ((appId shl 32) or 0x02000000L), candidates, steamId,
|
||||
source = sidecar?.store?.id ?: Library.ADDED, storeId = sidecar?.id,
|
||||
@@ -480,7 +501,7 @@ object AddedGames {
|
||||
sidecar.store == Store.UBISOFT -> com.droiddeck.launcher.stores.ubisoft.UbisoftConnect.launchOptions(context)
|
||||
else -> ""
|
||||
},
|
||||
single = single != null))
|
||||
single = single != null, steamProgram = steamProgram))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -520,6 +541,11 @@ object AddedGames {
|
||||
return file.takeIf { inside && it.isFile }
|
||||
}
|
||||
|
||||
internal fun steamEditedTo(folderGuest: String, record: JSONObject?, guestExe: String): Boolean {
|
||||
val steam = unquote(record?.optJSONObject("steam")?.optString("Exe"))
|
||||
return steam == guestExe && steam != unquote(record?.optJSONObject("app")?.optString("Exe")) && steam.startsWith("$folderGuest/")
|
||||
}
|
||||
|
||||
private fun unquote(value: String?): String = value.orEmpty().trim().trim('"')
|
||||
|
||||
internal fun adoptSteamEdits(context: Context, folder: File, record: JSONObject) {
|
||||
@@ -547,8 +573,10 @@ object AddedGames {
|
||||
|
||||
class Listed(val appId: Long, val name: String, val launchOptions: String)
|
||||
|
||||
fun listingFile(context: Context): File = File(context.filesDir, "session/added-games.json")
|
||||
|
||||
fun listed(context: Context): List<Listed>? = runCatching {
|
||||
val file = File(context.filesDir, "session/added-games.json")
|
||||
val file = listingFile(context)
|
||||
if (!file.isFile) return null
|
||||
val entries = org.json.JSONArray(file.readText())
|
||||
(0 until entries.length()).mapNotNull { i ->
|
||||
@@ -558,7 +586,7 @@ object AddedGames {
|
||||
|
||||
fun writeListing(context: Context, games: List<Game>,
|
||||
extra: List<JSONObject> = listOfNotNull(com.droiddeck.launcher.stores.epic.EpicClient.steamListing(context))): File {
|
||||
val file = File(context.filesDir, "session/added-games.json").apply { parentFile?.mkdirs() }
|
||||
val file = listingFile(context).apply { parentFile?.mkdirs() }
|
||||
val json = StringBuilder("[")
|
||||
games.forEachIndexed { i, g ->
|
||||
if (i > 0) json.append(',')
|
||||
@@ -568,6 +596,7 @@ object AddedGames {
|
||||
.append(",\"seen\":").append(SessionPrefs.addedGameExeSeen(context, g.folder.path))
|
||||
if (g.launchOptions.isNotEmpty()) json.append(",\"launch\":").append(quote(g.launchOptions))
|
||||
if (g.source != Library.ADDED) json.append(",\"store\":").append(quote(g.source))
|
||||
if (!g.steamProgram) json.append(",\"route\":false")
|
||||
val art = AddedGameArt.resolve(context, g)
|
||||
val pieces = listOf("p" to art.portrait, "header" to art.header, "hero" to art.hero, "logo" to art.logo, "icon" to art.icon)
|
||||
.mapNotNull { (k, f) -> f?.let { file -> artGuestPath(context, file)?.let { k to it } } }
|
||||
@@ -578,10 +607,24 @@ object AddedGames {
|
||||
if (games.isNotEmpty() || i > 0) json.append(',')
|
||||
json.append(entry.toString())
|
||||
}
|
||||
file.writeText(json.append(']').toString())
|
||||
val text = json.append(']').toString()
|
||||
synchronized(listing) {
|
||||
val partial = File(file.parentFile, file.name + ".part")
|
||||
try {
|
||||
partial.writeText(text)
|
||||
java.nio.file.Files.move(partial.toPath(), file.toPath(),
|
||||
java.nio.file.StandardCopyOption.ATOMIC_MOVE, java.nio.file.StandardCopyOption.REPLACE_EXISTING)
|
||||
} catch (e: java.io.IOException) {
|
||||
Log.w(TAG, "games: listing not replaced: ${e.message}")
|
||||
partial.delete()
|
||||
if (!file.isFile) file.writeText(text)
|
||||
}
|
||||
}
|
||||
return file
|
||||
}
|
||||
|
||||
private val listing = Any()
|
||||
|
||||
private fun artGuestPath(context: Context, file: File): String? {
|
||||
val files = context.filesDir.absolutePath
|
||||
if (file.absolutePath.startsWith("$files/")) return file.absolutePath
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package com.droiddeck.launcher.frontend
|
||||
|
||||
import android.content.Context
|
||||
import android.os.SystemClock
|
||||
import android.util.Log
|
||||
import androidx.annotation.VisibleForTesting
|
||||
import com.droiddeck.launcher.session.SessionPhase
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import com.droiddeck.launcher.session.SessionState
|
||||
import com.droiddeck.launcher.stores.SteamLiveShortcuts
|
||||
import java.io.File
|
||||
import java.util.concurrent.Callable
|
||||
import java.util.concurrent.Executors
|
||||
|
||||
object AddedGamesPublisher {
|
||||
private const val TAG = "AddedGamesPublisher"
|
||||
private const val CLIENT_WAIT_MS = 600_000L
|
||||
private const val POLL_MS = 1_000L
|
||||
private const val RETRY_MS = 5_000L
|
||||
|
||||
@VisibleForTesting
|
||||
@Volatile
|
||||
internal var now = false
|
||||
|
||||
@VisibleForTesting
|
||||
@Volatile
|
||||
internal var live: (Context, List<AddedGames.Game>, (AddedGames.Game) -> Boolean) -> Boolean = SteamLiveShortcuts::sync
|
||||
|
||||
private val worker = Executors.newSingleThreadExecutor { r -> Thread(r, "added-games-publish") }
|
||||
|
||||
fun later(context: Context, live: () -> Unit = {}) {
|
||||
@@ -23,10 +37,56 @@ object AddedGamesPublisher {
|
||||
if (now) work.run() else worker.execute(work)
|
||||
}
|
||||
|
||||
fun republish(context: Context) {
|
||||
fun republish(context: Context): List<AddedGames.Game> {
|
||||
val games = AddedGames.scan(context)
|
||||
AddedGames.writeListing(context, games)
|
||||
val arch = com.droiddeck.launcher.session.SessionPrefs.activeSteamClientArch(context)
|
||||
val arch = SessionPrefs.activeSteamClientArch(context)
|
||||
LibraryCache.save(context, Library.launchableGames(context, added = games, arch = arch), arch == "x86_64")
|
||||
return games
|
||||
}
|
||||
|
||||
fun sessionListing(context: Context): File {
|
||||
val app = context.applicationContext
|
||||
val started = AddedGames.listed(app)?.map { it.appId }?.toSet()
|
||||
?: return AddedGames.writeListing(app, AddedGames.scan(app).also { log(it) })
|
||||
val session = SessionState.sessionId
|
||||
val work = Runnable {
|
||||
try {
|
||||
val began = SystemClock.elapsedRealtime()
|
||||
val games = serial { republish(app) }
|
||||
Log.i(TAG, "session refresh: ${games.size} game(s) in ${SystemClock.elapsedRealtime() - began} ms")
|
||||
log(games)
|
||||
val fresh = games.filter { (it.appId and 0xFFFFFFFFL) !in started }
|
||||
if (fresh.isNotEmpty()) deliver(app, session, fresh)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "session refresh: ${e.message}")
|
||||
}
|
||||
}
|
||||
if (now) work.run() else Thread(work, "added-games-refresh").apply { priority = Thread.MIN_PRIORITY }.start()
|
||||
return AddedGames.listingFile(app)
|
||||
}
|
||||
|
||||
internal fun log(games: List<AddedGames.Game>) {
|
||||
if (games.isNotEmpty()) Log.i(TAG, "added games: " + games.joinToString { "${it.name} (${it.exe.name})" })
|
||||
}
|
||||
|
||||
private fun deliver(app: Context, session: String?, games: List<AddedGames.Game>) {
|
||||
val until = SystemClock.uptimeMillis() + CLIENT_WAIT_MS
|
||||
while (current(session)) {
|
||||
val ready = SessionState.phase == SessionPhase.READY
|
||||
if (ready && serial { !current(session) || (SessionState.phase == SessionPhase.READY && syncUnremoved(app, games)) }) return
|
||||
if (now || SystemClock.uptimeMillis() >= until) return
|
||||
Thread.sleep(if (ready) RETRY_MS else POLL_MS)
|
||||
}
|
||||
}
|
||||
|
||||
private fun current(session: String?): Boolean =
|
||||
SessionState.running && !SessionState.stopRequested && SessionState.sessionId == session
|
||||
|
||||
private fun syncUnremoved(app: Context, games: List<AddedGames.Game>): Boolean {
|
||||
val removed = SessionPrefs.removedAddedGames(app).toSet()
|
||||
return live(app, games) { it.folder.path !in removed }
|
||||
}
|
||||
|
||||
private fun <T> serial(block: () -> T): T = if (now) block() else worker.submit(Callable { block() }).get()
|
||||
}
|
||||
@@ -51,11 +51,12 @@ object GameExePicker {
|
||||
val entries = dir.listFiles()?.sortedBy { it.name.lowercase() } ?: continue
|
||||
for (f in entries) {
|
||||
if (visited >= WALK_BUDGET) break@walk
|
||||
if (isLink(f)) continue
|
||||
if (f.isDirectory) {
|
||||
val attrs = attributes(f) ?: continue
|
||||
if (attrs.isSymbolicLink) continue
|
||||
if (attrs.isDirectory) {
|
||||
visited++
|
||||
if (depth < MAX_DEPTH && !skipDir(f, f.relativeTo(folder).invariantSeparatorsPath)) next.add(f)
|
||||
} else if (f.isFile && f.name.endsWith(".exe", ignoreCase = true)) {
|
||||
} else if (attrs.isRegularFile && f.name.endsWith(".exe", ignoreCase = true)) {
|
||||
visited++
|
||||
if (!JUNK_EXE_RE.matches(f.nameWithoutExtension)) found.add(f to depth)
|
||||
}
|
||||
@@ -98,7 +99,9 @@ object GameExePicker {
|
||||
return SKIP_PATHS.any { rel == it || rel.endsWith("/$it") }
|
||||
}
|
||||
|
||||
private fun isLink(f: File): Boolean = runCatching { java.nio.file.Files.isSymbolicLink(f.toPath()) }.getOrDefault(false)
|
||||
private fun attributes(f: File): java.nio.file.attribute.BasicFileAttributes? = runCatching {
|
||||
java.nio.file.Files.readAttributes(f.toPath(), java.nio.file.attribute.BasicFileAttributes::class.java, java.nio.file.LinkOption.NOFOLLOW_LINKS)
|
||||
}.getOrNull()
|
||||
|
||||
private fun key(s: String) = s.lowercase().filter { it.isLetterOrDigit() }
|
||||
}
|
||||
@@ -11,6 +11,10 @@ object GameLaunchIntent {
|
||||
|
||||
fun accepts(action: String?): Boolean = action == Intent.ACTION_VIEW || action == ACTION || action == GAMENATIVE_ACTION
|
||||
|
||||
fun replayed(intent: Intent, restored: Boolean, savedProcess: String?, process: String): Boolean =
|
||||
!(intent.data?.scheme == "droiddeck" && intent.data?.host == "settings") &&
|
||||
(intent.flags and Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY != 0 || restored && savedProcess != process)
|
||||
|
||||
fun read(context: Context, intent: Intent): GameRequest? = when (intent.action) {
|
||||
Intent.ACTION_VIEW -> GameFiles.readIntent(context, intent)
|
||||
ACTION, GAMENATIVE_ACTION -> readExtras(intent)
|
||||
|
||||
@@ -13,6 +13,7 @@ object GamesFolderMigration {
|
||||
|
||||
@Synchronized
|
||||
fun run(context: Context) {
|
||||
repathInternalGuest(context)
|
||||
val dirs = SessionPrefs.addedGamesDirs(context)
|
||||
if (dirs.isEmpty()) return
|
||||
val roots = legacyRoots(SessionPrefs.gameFolderBinds(context).map { it.first } + dirs)
|
||||
@@ -58,12 +59,30 @@ object GamesFolderMigration {
|
||||
SessionPrefs.setGamesFoldersMigrated(context)
|
||||
}
|
||||
|
||||
private fun repathInternalGuest(context: Context) {
|
||||
val binds = SessionPrefs.gameFolderBinds(context)
|
||||
if (binds.none { it.second == StoreInstallRoot.INTERNAL_GUEST }) return
|
||||
val hosts = binds.map { it.first }
|
||||
val roots = legacyRoots(hosts).associateBy { it.host.path }
|
||||
val taken = binds.map { it.second }.filter { it != StoreInstallRoot.INTERNAL_GUEST }.toMutableSet()
|
||||
SessionPrefs.setGameFolderBinds(context, binds.map { (host, guest) ->
|
||||
if (guest != StoreInstallRoot.INTERNAL_GUEST) return@map host to guest
|
||||
val base = roots.getValue(host).guest
|
||||
var next = base
|
||||
var n = 2
|
||||
while (next in taken) next = "$base-${n++}"
|
||||
taken.add(next)
|
||||
host to next
|
||||
})
|
||||
}
|
||||
|
||||
internal fun legacyRoots(paths: List<String>): List<AddedGames.Root> {
|
||||
val hosts = paths.distinct().map { File(it) }
|
||||
val names = hosts.groupingBy { it.name.lowercase() }.eachCount()
|
||||
return hosts.map { host ->
|
||||
val name = host.name.ifEmpty { "games" }
|
||||
val guestName = if ((names[name.lowercase()] ?: 0) > 1) name + "-" + "%08x".format(CRC32().apply { update(host.path.toByteArray()) }.value).take(4) else name
|
||||
val clash = (names[name.lowercase()] ?: 0) > 1 || "${AddedGames.GUEST_DIR}/$name" == StoreInstallRoot.INTERNAL_GUEST
|
||||
val guestName = if (clash) name + "-" + "%08x".format(CRC32().apply { update(host.path.toByteArray()) }.value).take(4) else name
|
||||
AddedGames.Root(host, "${AddedGames.GUEST_DIR}/$guestName")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,12 @@ object SteamRedists {
|
||||
val SCRIPTED = mapOf(
|
||||
72850 to listOf("xact" to "DirectX XACT audio"),
|
||||
489830 to listOf("xact_x64" to "DirectX XACT audio (64-bit)"),
|
||||
// Warband compiles its postFX .fx effects at launch through d3dx9_42; Wine's own d3dcompiler_42 stops with E5017/E5033 on fx_2_0.
|
||||
48700 to listOf("d3dx9" to "DirectX 9 (d3dx9)", "d3dcompiler_42" to "D3DCompiler 42"),
|
||||
// DST's bundled ANGLE compiles SM3 shaders through d3dcompiler_43; DXVK's SM3 parser asserts on what Wine's own one emits.
|
||||
322330 to listOf("d3dcompiler_43" to "D3DCompiler 43"),
|
||||
// EU4 builds its map effects through native d3dx9_43, which calls d3dcompiler_43; Wine's own one fails them with E5005, so the map draws black.
|
||||
236850 to listOf("d3dx9" to "DirectX 9 (d3dx9)", "d3dcompiler_43" to "D3DCompiler 43"),
|
||||
)
|
||||
private val BLOCK = Regex("\"SharedDepots\"\\s*\\{([^}]*)\\}", RegexOption.IGNORE_CASE)
|
||||
private val ENTRY = Regex("\"(\\d+)\"\\s+\"\\d+\"")
|
||||
|
||||
@@ -45,9 +45,8 @@ internal class XrealLink internal constructor(
|
||||
if (msgId == VitureProtocol.MSG_GET_IMU) return true
|
||||
val valid = when (msgId) {
|
||||
VitureProtocol.MSG_GET_DISPLAY -> true
|
||||
VitureProtocol.MSG_DISPLAY -> if (model.stereoOnlyControl) value == 5 || value == XrealModel.NATIVE_60HZ
|
||||
else value in 2..5 || value == XrealModel.NATIVE_60HZ
|
||||
VitureProtocol.MSG_BRIGHTNESS -> !model.stereoOnlyControl && value in 0..9
|
||||
VitureProtocol.MSG_DISPLAY -> model.supportsDisplayMode(value)
|
||||
VitureProtocol.MSG_BRIGHTNESS -> model.hardwareControls && value in 0..model.brightnessMax
|
||||
VitureProtocol.MSG_FILM -> !model.stereoOnlyControl && value in 0..1
|
||||
else -> false
|
||||
}
|
||||
@@ -64,12 +63,12 @@ internal class XrealLink internal constructor(
|
||||
channels = connector.connect()
|
||||
connection.set(channels)
|
||||
if (!running) break
|
||||
val control = XrealControl(channels, stereoOnly = model.stereoOnlyControl)
|
||||
val control = XrealControl(channels, model = model)
|
||||
listener.onValue(VitureProtocol.MSG_GET_DISPLAY, control.display())
|
||||
val current = channels
|
||||
reports = Thread({
|
||||
try {
|
||||
var filter = XrealOrientationFilter(model.flipsYz)
|
||||
var filter = XrealOrientationFilter(model)
|
||||
var wasTracking = false
|
||||
var lastSensor = System.nanoTime()
|
||||
while (running && connection.get() === current) {
|
||||
@@ -78,7 +77,7 @@ internal class XrealLink internal constructor(
|
||||
if (sample != null) {
|
||||
lastSensor = System.nanoTime()
|
||||
val enabled = tracking
|
||||
if (enabled && !wasTracking) filter = XrealOrientationFilter(model.flipsYz)
|
||||
if (enabled && !wasTracking) filter = XrealOrientationFilter(model)
|
||||
wasTracking = enabled
|
||||
if (enabled) filter.update(sample)?.let {
|
||||
if (running && ready && tracking && connection.get() === current)
|
||||
@@ -155,8 +154,9 @@ internal class XrealLink internal constructor(
|
||||
internal class XrealControl(
|
||||
private val channels: XrealChannels,
|
||||
private val settleDelayMs: Long = 150,
|
||||
private val stereoOnly: Boolean = false,
|
||||
private val model: XrealModel = XrealModel.ONE_S,
|
||||
) {
|
||||
private val stereoOnly get() = model.stereoOnlyControl
|
||||
private var transaction = 0
|
||||
private fun exchange(command: Int, value: Int? = null): ByteArray {
|
||||
transaction = if (transaction == Int.MAX_VALUE) 1 else transaction + 1
|
||||
@@ -172,7 +172,7 @@ internal class XrealControl(
|
||||
fun display(): Int {
|
||||
if (stereoOnly) return stereoDisplay()
|
||||
val reply = exchange(XrealProtocol.GET_DISPLAY)
|
||||
return XrealProtocol.numeric(reply)?.takeIf { it in 2..5 || it == XrealModel.NATIVE_60HZ }
|
||||
return XrealProtocol.numeric(reply)?.takeIf(model::supportsDisplayMode)
|
||||
?: throw IOException("Unsupported XREAL display response: ${reply.take(32).joinToString("") { "%02x".format(it) }}")
|
||||
}
|
||||
private fun stereoDisplay(): Int {
|
||||
@@ -187,6 +187,7 @@ internal class XrealControl(
|
||||
}
|
||||
}
|
||||
fun changeDisplay(mode: Int): Int {
|
||||
require(model.supportsDisplayMode(mode))
|
||||
val stereo = mode == 5
|
||||
set(XrealProtocol.SET_INPUT, if (stereo) 1 else 0)
|
||||
val current = awaitDisplay { (it == 5) == stereo }
|
||||
|
||||
@@ -4,6 +4,7 @@ internal class XrealModel private constructor(
|
||||
override val name: String,
|
||||
val family: Family,
|
||||
override val diagonalFovDeg: Float,
|
||||
private val native60Hz: Int = NATIVE_60HZ,
|
||||
) : GlassesModel {
|
||||
enum class Family {
|
||||
ONE_S,
|
||||
@@ -14,23 +15,25 @@ internal class XrealModel private constructor(
|
||||
override val controllable = true
|
||||
override val brightnessMax = 9
|
||||
override val volumeMax = 0
|
||||
override val hasSunblock get() = family == Family.ONE_S
|
||||
override val hardwareControls get() = family == Family.ONE_S
|
||||
override val hasSunblock get() = !stereoOnlyControl
|
||||
override val hardwareControls get() = !stereoOnlyControl
|
||||
override val sbs90 = false
|
||||
override val rates2d get() = if (family == Family.ONE_S) super.rates2d else listOf(60)
|
||||
override val rates2d get() = if (stereoOnlyControl) listOf(60) else super.rates2d
|
||||
|
||||
// Only the 1S has been exercised with SET_DISPLAY; the Aura is known to reboot on an unexpected index.
|
||||
val stereoOnlyControl get() = family != Family.ONE_S
|
||||
val stereoOnlyControl get() = family != Family.ONE_S && this !== ONE_PRO_PLUS
|
||||
|
||||
internal fun supportsDisplayMode(mode: Int) = if (stereoOnlyControl) mode == 5 || mode == native60Hz
|
||||
else mode in 3..5 || mode == native60Hz || (this === ONE_S && mode == 2)
|
||||
|
||||
// The Aura reports x right, y up, z back; the rest of the One family is a half turn about x from it.
|
||||
val flipsYz get() = family != Family.AURA
|
||||
|
||||
override fun mode(hz: Int, sbs: Boolean) = when {
|
||||
sbs -> 5
|
||||
stereoOnlyControl -> NATIVE_60HZ
|
||||
stereoOnlyControl -> native60Hz
|
||||
hz >= 120 -> 4
|
||||
hz >= 90 -> 3
|
||||
else -> NATIVE_60HZ
|
||||
else -> native60Hz
|
||||
}
|
||||
override fun modeForStep(step: Int): Int? = null
|
||||
|
||||
@@ -44,7 +47,7 @@ internal class XrealModel private constructor(
|
||||
val ONE_S = XrealModel("XREAL 1S", Family.ONE_S, 52f)
|
||||
val ONE = XrealModel("XREAL One", Family.ONE, 50f)
|
||||
val ONE_PRO = XrealModel("XREAL One Pro", Family.ONE, 57f)
|
||||
val ONE_PRO_PLUS = XrealModel("XREAL One Pro+", Family.ONE, 57f)
|
||||
val ONE_PRO_PLUS = XrealModel("XREAL One Pro+", Family.ONE, 57f, 9)
|
||||
val AURA = XrealModel("XREAL Aura", Family.AURA, 70f)
|
||||
|
||||
// The odd product ids one below these are the glasses' recovery mode.
|
||||
|
||||
@@ -2,13 +2,18 @@ package com.droiddeck.launcher.glasses
|
||||
|
||||
import kotlin.math.abs
|
||||
|
||||
internal class XrealOrientationFilter(private val flipYz: Boolean = true) {
|
||||
internal class XrealOrientationFilter(private val model: XrealModel = XrealModel.ONE_S) {
|
||||
private val fusion = ImuFusion()
|
||||
private val sensorToDisplay = if (model === XrealModel.ONE_PRO_PLUS)
|
||||
Quaternion.fromAxisAngle(Vec3(1f, 0f, 0f), Math.toRadians(35.0).toFloat()) else null
|
||||
|
||||
fun update(sample: XrealProtocol.Sample): FloatArray? = fusion.update(sample.timeNs,
|
||||
sample.accel.headAxes(), sample.gyro.headAxes())
|
||||
|
||||
private fun Vec3.headAxes() = if (flipYz) Vec3(x, -y, -z) else this
|
||||
private fun Vec3.headAxes(): Vec3 {
|
||||
val display = sensorToDisplay?.rotate(this) ?: this
|
||||
return if (model.flipsYz) Vec3(display.x, -display.y, -display.z) else display
|
||||
}
|
||||
}
|
||||
|
||||
internal class ImuFusion {
|
||||
|
||||
@@ -7,29 +7,50 @@ object SocNames {
|
||||
"SM8150" to "Snapdragon 855", "SM8250" to "Snapdragon 865", "SM8250-AC" to "Snapdragon 870",
|
||||
"SM8350" to "Snapdragon 888", "SM8450" to "Snapdragon 8 Gen 1", "SM8475" to "Snapdragon 8+ Gen 1",
|
||||
"SM8550" to "Snapdragon 8 Gen 2", "QCS8550" to "Snapdragon 8 Gen 2", "SM8650" to "Snapdragon 8 Gen 3",
|
||||
"SM8750" to "Snapdragon 8 Elite", "SM8850" to "Snapdragon 8 Elite Gen 5",
|
||||
"SM8635" to "Snapdragon 8s Gen 3", "SM8735" to "Snapdragon 8s Gen 4",
|
||||
"SM8750" to "Snapdragon 8 Elite", "SM8750P" to "Snapdragon 8 Elite",
|
||||
"SM8850" to "Snapdragon 8 Elite Gen 5",
|
||||
"SM8975" to "Snapdragon 8 Elite Extreme Gen 6",
|
||||
"SM7325" to "Snapdragon 778G", "SM7450" to "Snapdragon 7 Gen 1", "SM7550" to "Snapdragon 7 Gen 3",
|
||||
"SM7675" to "Snapdragon 7+ Gen 3",
|
||||
"SM6375" to "Snapdragon 695",
|
||||
// Handheld parts: AYANEO Pocket FIT (SG8350P), Retroid Pocket Duo (CQ7790S).
|
||||
"SG8350P" to "Snapdragon G3 Gen 3", "CQ7790S" to "Dragonwing Q-7790",
|
||||
)
|
||||
|
||||
private val PLATFORMS = mapOf(
|
||||
"msmnile" to "Snapdragon 855/860", "kona" to "Snapdragon 865/870", "lahaina" to "Snapdragon 888",
|
||||
"taro" to "Snapdragon 8 Gen 1", "cape" to "Snapdragon 8+ Gen 1", "kalama" to "Snapdragon 8 Gen 2",
|
||||
"pineapple" to "Snapdragon 8 Gen 3", "sun" to "Snapdragon 8 Elite",
|
||||
"pineapple" to "Snapdragon 8 Gen 3", "sun" to "Snapdragon 8 Elite", "canoe" to "Snapdragon 8 Elite Gen 5",
|
||||
)
|
||||
|
||||
fun model(prop: (String) -> String = GpuInfo::systemProperty): String {
|
||||
val sdk = if (Build.VERSION.SDK_INT >= 31) Build.SOC_MODEL.takeIf { it != Build.UNKNOWN }.orEmpty() else ""
|
||||
return listOf(prop("ro.soc.model"), prop("ro.vendor.qti.soc_model"), sdk, prop("ro.fota.platform"))
|
||||
.map { it.trim() }
|
||||
.firstOrNull { it.isNotEmpty() && !Regex("(?i)^msm_\\d").containsMatchIn(it) }.orEmpty()
|
||||
.firstOrNull { it.isNotEmpty() && !it.equals(Build.UNKNOWN, ignoreCase = true) && !Regex("(?i)^msm_\\d").containsMatchIn(it) }
|
||||
.orEmpty()
|
||||
}
|
||||
|
||||
internal fun normalizedModel(model: String): String = model.trim().uppercase().removePrefix("QTI ").trim()
|
||||
|
||||
fun name(model: String, platform: String = GpuInfo.systemProperty("ro.board.platform")): String? =
|
||||
MODELS[normalizedModel(model)] ?: PLATFORMS[platform.lowercase()]?.let { "$it family" }
|
||||
/**
|
||||
* The exact model's name; the board platform's family only for an empty model or a phone "SM" part, since
|
||||
* different chips share a platform (the Retroid Pocket Duo's CQ7790S and the Snapdragon 8 Elite are both "sun").
|
||||
*/
|
||||
fun name(model: String, platform: String = GpuInfo.systemProperty("ro.board.platform")): String? {
|
||||
val m = normalizedModel(model)
|
||||
MODELS[m]?.let { return it }
|
||||
if (m.isNotEmpty() && !m.startsWith("SM")) return null
|
||||
return PLATFORMS[platform.lowercase()]?.let { "$it family" }
|
||||
}
|
||||
|
||||
// Without label's platform-family guess: a rebadged chip such as the Duo's CQ7790S reports a platform it is not.
|
||||
fun plainName(model: String = model(), maker: String = manufacturer()): String =
|
||||
MODELS[normalizedModel(model)]?.let { "$it ($model)" } ?: "$maker $model".trim()
|
||||
|
||||
private fun manufacturer(): String =
|
||||
if (Build.VERSION.SDK_INT >= 31) Build.SOC_MANUFACTURER.takeIf { it != Build.UNKNOWN }.orEmpty() else ""
|
||||
|
||||
fun label(model: String = model(), platform: String = GpuInfo.systemProperty("ro.board.platform")): String {
|
||||
val name = name(model, platform)
|
||||
|
||||
@@ -308,8 +308,7 @@ public final class TurnipDriver {
|
||||
}
|
||||
}
|
||||
if (chosen != null && !chosen.isEmpty()) {
|
||||
if (SessionPrefs.GPU_DRIVERS_AUTO.equals(SessionPrefs.INSTANCE.gpuDriverMode(context))
|
||||
&& SessionPrefs.INSTANCE.gpuAutoInstalled(context).contains(chosen)
|
||||
if (SessionPrefs.INSTANCE.displayDriverFromAuto(context)
|
||||
&& gpuDetector.get().getFamily() == GpuInfo.Family.A7XX_LOW) {
|
||||
Log.i(TAG, "Auto-selected display driver does not cover Adreno 710/720/722; leaving the display driver to the system");
|
||||
return null;
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.droiddeck.launcher.session.SessionPrefs
|
||||
|
||||
internal object DroidDeckHudConfig {
|
||||
val DEFAULTS: Map<String, String> = linkedMapOf(
|
||||
"hudSize" to "minimal", "hudLocked" to "1", "hudHold" to "collapse", "hudSnap" to "1", "hudScale" to "100", "hudDock" to "none", "hudOpacity" to "80", "hudColor" to "mid",
|
||||
"hudSize" to "minimal", "hudLocked" to "0", "hudHold" to "collapse", "hudSnap" to "1", "hudScale" to "100", "hudDock" to "none", "hudOpacity" to "80", "hudColor" to "mid",
|
||||
"hudOutline" to "40", "hudOutlineAccent" to "1",
|
||||
"showGpuModel" to "1", "showGPULoad" to "1", "showCPUUsage" to "1", "showCPULoad" to "1",
|
||||
"showPerCore" to "1", "showTemp" to "1", "showBatteryTemp" to "1", "showGpuTemp" to "0",
|
||||
|
||||
@@ -44,6 +44,35 @@ class DroidDeckHudHost(context: Context) {
|
||||
private var protonPid = 0
|
||||
private var proton = ""
|
||||
@Volatile private var lastWindow: String? = null
|
||||
@Volatile private var lastCompositorFrameNanos = 0L
|
||||
@Volatile private var lastVisibilityGameActive = false
|
||||
private var candidateGameActive = false
|
||||
private var candidateGameActiveSinceNs = 0L
|
||||
private var stableGameActive = false
|
||||
|
||||
private fun isGameActive(): Boolean {
|
||||
val now = System.nanoTime()
|
||||
val compositorLive = lastCompositorFrameNanos > 0L &&
|
||||
now - lastCompositorFrameNanos <= 1_000_000_000L
|
||||
val detected = if (feed.live) {
|
||||
feed.steamFocusKnown && !feed.steamFocused
|
||||
} else {
|
||||
compositorLive
|
||||
}
|
||||
|
||||
if (detected != candidateGameActive) {
|
||||
candidateGameActive = detected
|
||||
candidateGameActiveSinceNs = now
|
||||
}
|
||||
|
||||
if (detected != stableGameActive &&
|
||||
now - candidateGameActiveSinceNs >= GAME_ACTIVITY_STABLE_NS
|
||||
) {
|
||||
stableGameActive = detected
|
||||
}
|
||||
|
||||
return stableGameActive
|
||||
}
|
||||
|
||||
var onPresentingWindowChanged: (() -> Unit)? = null
|
||||
|
||||
@@ -66,6 +95,12 @@ class DroidDeckHudHost(context: Context) {
|
||||
}
|
||||
|
||||
override fun onGameFrame() {
|
||||
if (feed.live && (!feed.steamFocusKnown || feed.steamFocused)) return
|
||||
lastCompositorFrameNanos = System.nanoTime()
|
||||
feed.onCompositorFrame(lastCompositorFrameNanos)
|
||||
}
|
||||
|
||||
override fun onCompositorFrame() {
|
||||
feed.onCompositorFrame(System.nanoTime())
|
||||
}
|
||||
}
|
||||
@@ -73,7 +108,9 @@ class DroidDeckHudHost(context: Context) {
|
||||
private val frameCallback = object : Choreographer.FrameCallback {
|
||||
override fun doFrame(frameTimeNanos: Long) {
|
||||
if (!running || !polling) return
|
||||
reconcileGameActivity()
|
||||
if (feed.poll(System.nanoTime())) view?.onFrames()
|
||||
reconcileGameActivity()
|
||||
Choreographer.getInstance().postFrameCallback(this)
|
||||
}
|
||||
}
|
||||
@@ -151,7 +188,7 @@ class DroidDeckHudHost(context: Context) {
|
||||
|
||||
fun refresh() {
|
||||
applyConfig()
|
||||
if (!enabled) stop() else if (!running) start()
|
||||
if (!enabled) stop() else if (!running) start() else applyShown()
|
||||
}
|
||||
|
||||
fun start() {
|
||||
@@ -181,14 +218,26 @@ class DroidDeckHudHost(context: Context) {
|
||||
applyShown()
|
||||
}
|
||||
|
||||
private fun reconcileGameActivity() {
|
||||
if (!SessionPrefs.hudOnlyDuringGame(context)) {
|
||||
lastVisibilityGameActive = isGameActive()
|
||||
return
|
||||
}
|
||||
if (isGameActive() != lastVisibilityGameActive) applyShown()
|
||||
}
|
||||
|
||||
private fun applyShown() {
|
||||
if (!running) return
|
||||
val show = !hidden && !backgrounded
|
||||
val onlyDuringGame = SessionPrefs.hudOnlyDuringGame(context)
|
||||
val gameActive = isGameActive()
|
||||
val show = !hidden && !backgrounded && (!onlyDuringGame || gameActive)
|
||||
view?.visibility = if (show) View.VISIBLE else View.GONE
|
||||
showing = show
|
||||
if (show != polling) {
|
||||
polling = show
|
||||
if (show) Choreographer.getInstance().postFrameCallback(frameCallback)
|
||||
lastVisibilityGameActive = gameActive
|
||||
val shouldPoll = !hidden && !backgrounded && (show || onlyDuringGame)
|
||||
if (shouldPoll != polling) {
|
||||
polling = shouldPoll
|
||||
if (shouldPoll) Choreographer.getInstance().postFrameCallback(frameCallback)
|
||||
else Choreographer.getInstance().removeFrameCallback(frameCallback)
|
||||
}
|
||||
}
|
||||
@@ -532,6 +581,7 @@ class DroidDeckHudHost(context: Context) {
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val GAME_ACTIVITY_STABLE_NS = 350_000_000L
|
||||
private const val DOCK_OVERHANG = 0.4f
|
||||
private const val PREVIEW_FROM = 0.55f
|
||||
private const val STRIP_PULL_ACROSS_DP = 360f
|
||||
|
||||
@@ -349,7 +349,7 @@ class DroidDeckHudView(context: Context) : View(context) {
|
||||
showProton = switchOn("showProton")
|
||||
showSession = switchOn("showSession")
|
||||
tempDisplay = HudMetrics.TempDisplay.from(cfg)
|
||||
lockController.setLocked(cfg.get("hudLocked", "1") == "1")
|
||||
lockController.setLocked(cfg.get("hudLocked", "0") == "1")
|
||||
lockController.setHoldLocks(cfg.get("hudHold", "collapse") == DroidDeckHudConfig.HOLD_LOCKS)
|
||||
dock = DroidDeckHudDock.from(cfg.get("hudDock", "none"))
|
||||
|
||||
|
||||
@@ -183,6 +183,8 @@ internal class GameFrameFeed(
|
||||
private set
|
||||
@Volatile var steamFocused = false
|
||||
private set
|
||||
@Volatile var steamFocusKnown = false
|
||||
private set
|
||||
@Volatile var pid = 0
|
||||
private set
|
||||
@Volatile var outputWidth = 0
|
||||
@@ -198,10 +200,16 @@ internal class GameFrameFeed(
|
||||
val compositorAdded = compositorFrames != seenCompositorFrames
|
||||
seenCompositorFrames = compositorFrames
|
||||
if (handle == 0L) {
|
||||
if (nowNs < nextOpenNs) return compositorAdded
|
||||
if (nowNs < nextOpenNs) {
|
||||
|
||||
return compositorAdded
|
||||
}
|
||||
nextOpenNs = nowNs + REOPEN_NS
|
||||
handle = runCatching { HudFrames.nativeOpen(file.path) }.getOrDefault(0L)
|
||||
if (handle == 0L) return compositorAdded
|
||||
if (handle == 0L) {
|
||||
|
||||
return compositorAdded
|
||||
}
|
||||
HudFrames.nativePoll(handle, frametimes, times)
|
||||
}
|
||||
val n = HudFrames.nativePoll(handle, frametimes, times)
|
||||
@@ -219,6 +227,7 @@ internal class GameFrameFeed(
|
||||
fromGamescope = false
|
||||
}
|
||||
if (n <= 0 && nowNs - maxOf(lastRingFrameNs, nextOpenNs - REOPEN_NS) > STALE_NS) close()
|
||||
|
||||
if (nowNs - lastInfoNs >= INFO_NS) {
|
||||
lastInfoNs = nowNs
|
||||
readInfo()
|
||||
@@ -250,6 +259,7 @@ internal class GameFrameFeed(
|
||||
}
|
||||
|
||||
fun close() {
|
||||
fromGamescope = false
|
||||
if (handle != 0L) HudFrames.nativeClose(handle)
|
||||
handle = 0L
|
||||
}
|
||||
@@ -265,6 +275,7 @@ internal class GameFrameFeed(
|
||||
outputHeight = info[2]
|
||||
refreshMilliHz = info[3]
|
||||
steamFocused = info[4] != 0
|
||||
steamFocusKnown = true
|
||||
engine = engineLabel(name)
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.droiddeck.launcher.input
|
||||
|
||||
internal class AxisPacing(private val intervalMs: Long) {
|
||||
private var lastWriteAt = 0L
|
||||
private var written = false
|
||||
private var heldUntil = NOT_HELD
|
||||
|
||||
fun dueAt(now: Long, axesOnly: Boolean): Long =
|
||||
if (axesOnly && written && now - lastWriteAt < intervalMs) lastWriteAt + intervalMs else now
|
||||
|
||||
fun wrote(at: Long) {
|
||||
lastWriteAt = at
|
||||
written = true
|
||||
}
|
||||
|
||||
fun hold(due: Long): Boolean {
|
||||
if (heldUntil != NOT_HELD) return false
|
||||
heldUntil = due
|
||||
return true
|
||||
}
|
||||
|
||||
fun release(now: Long): Boolean {
|
||||
if (heldUntil == NOT_HELD || now < heldUntil) return false
|
||||
heldUntil = NOT_HELD
|
||||
return true
|
||||
}
|
||||
|
||||
fun cancel(): Boolean {
|
||||
if (heldUntil == NOT_HELD) return false
|
||||
heldUntil = NOT_HELD
|
||||
return true
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val NOT_HELD = Long.MIN_VALUE
|
||||
|
||||
@JvmStatic fun keepsMoving(before: Int, after: Int): Boolean = before == after || (before != 0 && after != 0)
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ object ControllerPrefs {
|
||||
|
||||
val opacities = listOf(40, 60, 80, 100)
|
||||
|
||||
val sizes = listOf(80, 90, 100, 110, 125)
|
||||
val sizes = listOf(80, 85, 90, 95, 100, 105, 110, 115, 120, 125)
|
||||
|
||||
val deadZones = listOf(0, 5, 8, 12, 15, 20, 25)
|
||||
const val DEFAULT_DEAD_ZONE_PERCENT = 12
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.droiddeck.launcher.input
|
||||
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.SystemClock
|
||||
import android.view.MotionEvent
|
||||
import kotlin.math.abs
|
||||
|
||||
@@ -24,6 +25,7 @@ class DirectTouchHold(
|
||||
private var delayMs = 0L
|
||||
private var holdBehavior = TouchGestureConfig.MOUSE_BEHAVIOR_CLICK
|
||||
private var forwarded = false
|
||||
private var forwardedAt = 0L
|
||||
private var held = false
|
||||
private var pressing = false
|
||||
private var upX = 0f
|
||||
@@ -125,8 +127,11 @@ class DirectTouchHold(
|
||||
upX = event.x
|
||||
upY = event.y
|
||||
liftId = event.getPointerId(event.actionIndex)
|
||||
liftPending = true
|
||||
handler.postDelayed(lift, LIFT_MS)
|
||||
val wait = MIN_PRESS_MS - (SystemClock.uptimeMillis() - forwardedAt)
|
||||
if (wait > 0L) {
|
||||
liftPending = true
|
||||
handler.postDelayed(lift, wait)
|
||||
} else lift.run()
|
||||
}
|
||||
MotionEvent.ACTION_CANCEL -> cancel()
|
||||
}
|
||||
@@ -136,9 +141,10 @@ class DirectTouchHold(
|
||||
private fun forwardDown() {
|
||||
touch.down(downId, downX, downY)
|
||||
forwarded = true
|
||||
forwardedAt = SystemClock.uptimeMillis()
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val LIFT_MS = 50L
|
||||
const val MIN_PRESS_MS = 50L
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,8 @@ object DualScreen {
|
||||
const val MODE_AUTO = "auto"
|
||||
const val MODE_ON = "on"
|
||||
const val MODE_OFF = "off"
|
||||
val modes = listOf(MODE_AUTO, MODE_ON, MODE_OFF)
|
||||
const val MODE_SWAPPED = "swapped"
|
||||
val modes = listOf(MODE_AUTO, MODE_ON, MODE_SWAPPED, MODE_OFF)
|
||||
private const val TYPE_INTERNAL = 1
|
||||
private const val TYPE_EXTERNAL = 2
|
||||
private val knownModels = setOf("retroid pocket duo", "ayn thor")
|
||||
@@ -99,7 +100,7 @@ object DualScreen {
|
||||
fun display(context: Context, displayManager: DisplayManager, primaryDisplayId: Int, mode: String = SessionPrefs.dualScreenMode(context)): Display? =
|
||||
when (mode) {
|
||||
MODE_OFF -> null
|
||||
MODE_ON -> internalDisplay(displayManager, primaryDisplayId) ?: anyDisplay(displayManager, primaryDisplayId)
|
||||
MODE_ON, MODE_SWAPPED -> internalDisplay(displayManager, primaryDisplayId) ?: anyDisplay(displayManager, primaryDisplayId)
|
||||
else -> if (dockedToDisplay(displayManager, primaryDisplayId)) null else builtInDisplay(displayManager, primaryDisplayId)
|
||||
}?.takeUnless { taken(it.displayId) }
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.droiddeck.launcher.input;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.os.Process;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.File;
|
||||
@@ -128,6 +132,16 @@ public class FakeInputWriter {
|
||||
|
||||
private static final Object RING_LOCK = new Object();
|
||||
private static final RingSlot[] RING_SLOTS = new RingSlot[MAX_FAKE_INPUT_SLOTS];
|
||||
private static final long AXIS_REPORT_INTERVAL_MS = 4;
|
||||
|
||||
private static final class Pacing {
|
||||
static final Handler HANDLER;
|
||||
static {
|
||||
HandlerThread thread = new HandlerThread("pad-pacing", Process.THREAD_PRIORITY_DISPLAY);
|
||||
thread.start();
|
||||
HANDLER = new Handler(thread.getLooper());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
System.loadLibrary("sdnative");
|
||||
@@ -135,6 +149,8 @@ public class FakeInputWriter {
|
||||
|
||||
private static native void nativeStoreFence();
|
||||
|
||||
private static native void nativeWake(ByteBuffer ring, int offset);
|
||||
|
||||
public static void storeFence() {
|
||||
nativeStoreFence();
|
||||
}
|
||||
@@ -156,6 +172,9 @@ public class FakeInputWriter {
|
||||
private boolean hasChanges = false;
|
||||
private boolean pendingFullResend = false;
|
||||
private boolean forceResend = false;
|
||||
private final AxisPacing axisPacing = new AxisPacing(AXIS_REPORT_INTERVAL_MS);
|
||||
private final PadState pacedPad = new PadState();
|
||||
private final Runnable pacedWrite = this::writePacedPad;
|
||||
|
||||
public FakeInputWriter(String fakeInputPath, int slot) {
|
||||
this.slot = slot;
|
||||
@@ -438,6 +457,7 @@ public class FakeInputWriter {
|
||||
writeSnapshotLocked(ring);
|
||||
nativeStoreFence();
|
||||
ring.putLong(RING_WRITE_SEQ_OFFSET, writeSeq);
|
||||
nativeWake(ring, RING_WRITE_SEQ_OFFSET);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -711,10 +731,12 @@ public class FakeInputWriter {
|
||||
}
|
||||
|
||||
public synchronized void close() {
|
||||
cancelPacedWrite();
|
||||
isOpen = false;
|
||||
}
|
||||
|
||||
public synchronized void reset() {
|
||||
cancelPacedWrite();
|
||||
if (!isOpen && !open())
|
||||
return;
|
||||
|
||||
@@ -822,6 +844,53 @@ public class FakeInputWriter {
|
||||
}
|
||||
|
||||
public synchronized void writePad(PadState state) {
|
||||
long now = SystemClock.uptimeMillis();
|
||||
long due = axisPacing.dueAt(now, !pendingFullResend && onlyAxesMove(state));
|
||||
if (due > now) {
|
||||
pacedPad.copyFrom(state);
|
||||
if (axisPacing.hold(due))
|
||||
Pacing.HANDLER.postAtTime(pacedWrite, due);
|
||||
return;
|
||||
}
|
||||
cancelPacedWrite();
|
||||
writePadNow(state);
|
||||
}
|
||||
|
||||
private synchronized void writePacedPad() {
|
||||
if (axisPacing.release(SystemClock.uptimeMillis()))
|
||||
writePadNow(pacedPad);
|
||||
}
|
||||
|
||||
private void cancelPacedWrite() {
|
||||
if (axisPacing.cancel())
|
||||
Pacing.HANDLER.removeCallbacks(pacedWrite);
|
||||
}
|
||||
|
||||
private boolean onlyAxesMove(PadState state) {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
if (prevButtonStates[i] != state.isDown(i))
|
||||
return false;
|
||||
}
|
||||
return prevButtonStates[SNAPSHOT_IDX_MODE] == state.isDown(PadState.GUIDE)
|
||||
&& prevQam == state.isDown(PadState.QAM)
|
||||
&& prevHatX == state.hatX() && prevHatY == state.hatY()
|
||||
&& AxisPacing.keepsMoving(prevThumbLX, stickValue(state.leftX))
|
||||
&& AxisPacing.keepsMoving(prevThumbLY, stickValue(state.leftY))
|
||||
&& AxisPacing.keepsMoving(prevThumbRX, stickValue(state.rightX))
|
||||
&& AxisPacing.keepsMoving(prevThumbRY, stickValue(state.rightY))
|
||||
&& AxisPacing.keepsMoving(prevTriggerL, triggerValue(state.leftTrigger))
|
||||
&& AxisPacing.keepsMoving(prevTriggerR, triggerValue(state.rightTrigger));
|
||||
}
|
||||
|
||||
private static int stickValue(float value) {
|
||||
return (int) (value * 32767);
|
||||
}
|
||||
|
||||
private static int triggerValue(float value) {
|
||||
return (int) (value * 255);
|
||||
}
|
||||
|
||||
private void writePadNow(PadState state) {
|
||||
if (!isOpen && !open())
|
||||
return;
|
||||
|
||||
@@ -845,10 +914,10 @@ public class FakeInputWriter {
|
||||
hasChanges = true;
|
||||
}
|
||||
|
||||
int lx = (int) (state.leftX * 32767);
|
||||
int ly = (int) (state.leftY * 32767);
|
||||
int rx = (int) (state.rightX * 32767);
|
||||
int ry = (int) (state.rightY * 32767);
|
||||
int lx = stickValue(state.leftX);
|
||||
int ly = stickValue(state.leftY);
|
||||
int rx = stickValue(state.rightX);
|
||||
int ry = stickValue(state.rightY);
|
||||
|
||||
if (forceResend || lx != prevThumbLX) {
|
||||
prevThumbLX = lx;
|
||||
@@ -867,8 +936,8 @@ public class FakeInputWriter {
|
||||
writeEvent(EV_ABS, ABS_RY, ry);
|
||||
}
|
||||
|
||||
int tl = (int) (state.leftTrigger * 255);
|
||||
int tr = (int) (state.rightTrigger * 255);
|
||||
int tl = triggerValue(state.leftTrigger);
|
||||
int tr = triggerValue(state.rightTrigger);
|
||||
if (forceResend || tl != prevTriggerL) {
|
||||
prevTriggerL = tl;
|
||||
writeEvent(EV_ABS, ABS_BRAKE, tl);
|
||||
@@ -895,6 +964,8 @@ public class FakeInputWriter {
|
||||
if (!flushBuffer()) {
|
||||
Log.e(TAG, "Gamepad write error: fake input mmap ring unavailable");
|
||||
pendingFullResend = true;
|
||||
} else {
|
||||
axisPacing.wrote(SystemClock.uptimeMillis());
|
||||
}
|
||||
}
|
||||
forceResend = false;
|
||||
|
||||
@@ -3,6 +3,12 @@ package com.droiddeck.launcher.input
|
||||
import android.view.KeyEvent
|
||||
|
||||
object GuestKeys {
|
||||
fun normalizeKeyboardEscape(event: KeyEvent): KeyEvent {
|
||||
if (!isKeyboardEscape(event.keyCode, event.scanCode)) return event
|
||||
return KeyEvent(event.downTime, event.eventTime, event.action, KeyEvent.KEYCODE_ESCAPE,
|
||||
event.repeatCount, event.metaState, event.deviceId, event.scanCode, event.flags, event.source)
|
||||
}
|
||||
|
||||
/** Sends [event] as evdev presses, with Shift around characters typed by a keyboard that has no Shift key; false when it has no evdev code. */
|
||||
fun send(event: KeyEvent, sendKey: (code: Int, down: Boolean) -> Unit): Boolean {
|
||||
val down = event.action == KeyEvent.ACTION_DOWN
|
||||
|
||||
@@ -53,14 +53,14 @@ data class InputProfile(
|
||||
fun elementClickAction(role: InputRole, element: InputSurfaceElement): InputAction = clicks[role]?.get(element.id)
|
||||
?: defaultElementClick(element, elementAction(role, element.id, element.control)) { action(role, it) }
|
||||
|
||||
fun showsMouseButton(role: InputRole, shown: List<InputSurfaceElement>, stock: InputProfile): Boolean = shown.any { element ->
|
||||
fun showsLeftMouseButton(role: InputRole, shown: List<InputSurfaceElement>, stock: InputProfile): Boolean = shown.any { element ->
|
||||
val action = elementAction(role, element.id, element.control).takeIf {
|
||||
elements[role]?.get(element.id) != stock.elements[role]?.get(element.id) || it != stock.elementAction(role, element.id, element.control)
|
||||
}
|
||||
val click = elementClickAction(role, element).takeIf {
|
||||
clicks[role]?.get(element.id) != stock.clicks[role]?.get(element.id) || it != stock.elementClickAction(role, element)
|
||||
}
|
||||
listOfNotNull(action, click).any { it is InputAction.MouseButton && it.validFor(element.control) }
|
||||
listOfNotNull(action, click).any { it is InputAction.MouseButton && it.code == PointerGestures.BTN_LEFT }
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -5,7 +5,7 @@ import android.graphics.Rect
|
||||
import kotlin.math.*
|
||||
|
||||
internal class LegacyGamepadLayout(private val context: Context, private val width: Int, private val height: Int, private val safe: Rect = Rect(),
|
||||
private val scale: Float = 1f) {
|
||||
private val scale: Float = 1f, private val sizeOverride: Int? = null) {
|
||||
private val resources get() = context.resources
|
||||
private val settings = ControllerPrefs.read(context)
|
||||
private var fit = 1f
|
||||
@@ -41,7 +41,7 @@ internal class LegacyGamepadLayout(private val context: Context, private val wid
|
||||
|
||||
private fun dp(value: Float) = value * resources.displayMetrics.density
|
||||
|
||||
private fun scaled(value: Float) = dp(value) * settings.size / 100f * scale * fit
|
||||
private fun scaled(value: Float) = dp(value) * (sizeOverride ?: settings.size) / 100f * scale * fit
|
||||
|
||||
private fun fitScale(): Float {
|
||||
val metrics = resources.displayMetrics
|
||||
|
||||
@@ -44,7 +44,7 @@ object OnScreenLayout {
|
||||
val (reference, matched) = reference(context, layout, width, height)
|
||||
if (buttonsOnly && dock == null) return generator.buttonsOnly(stored) + fit(stored.filter { it.alwaysShown }, reference.first, reference.second, width, height, safe)
|
||||
if (dock?.portrait == true && !dock.grips && !matched && layout.aspect > 0f && layout.aspect < 1f && stored.any(::isGamepad))
|
||||
return cluster(stored.filterNot { it.alwaysShown || isGamepad(it) && (it.id == KEYBOARD_ID || it.control in BAR) }, layout.aspect, width, height, safe)
|
||||
return scaleDocked(context, cluster(stored.filterNot { it.alwaysShown || isGamepad(it) && (it.id == KEYBOARD_ID || it.control in BAR) }, layout.aspect, width, height, safe), ControllerPrefs.read(context).size / 100f, width, height, safe)
|
||||
val generated = matched || PadKit.forOverlay(context, layout) != null && stored.any(::isGamepad) &&
|
||||
(dock != null || height > width && layout.aspect >= 1f || height <= width && layout.aspect > 0f && layout.aspect < 1f)
|
||||
val gamepad = if (generated) stored.filter(::isGamepad) else emptyList()
|
||||
@@ -57,22 +57,144 @@ object OnScreenLayout {
|
||||
val placed = regenerated + gamepad.filter { g -> dock == null && optional(g) && regenerated.none { it.id == g.id } }
|
||||
val byId = (placed + others).associateBy { it.id }
|
||||
val ordered = stored.mapNotNull { byId[it.id] } + placed.filter { p -> stored.none { it.id == p.id } }
|
||||
val kit = PadKit.forOverlay(context, layout) ?: return ordered
|
||||
val kit = PadKit.forOverlay(context, layout) ?: return if (dock == null) ordered else scaleDocked(context, ordered, ControllerPrefs.read(context).size / 100f, width, height, safe)
|
||||
val controllerScale = layout.scale * ControllerPrefs.read(context).size / 100f
|
||||
if (generated &&
|
||||
ControllerPrefs.layout(context, reference.first.toInt(), reference.second.toInt()).isEmpty() &&
|
||||
ControllerPrefs.layout(context, width, height).isEmpty()) {
|
||||
if (dock != null || height > width) {
|
||||
return ControllerPortraitGeometry(width.toFloat(), height.toFloat(), safe, context.resources.displayMetrics.density)
|
||||
.place(ordered, kit, dock != null, layout.scale, rearButtons == true, trackpads == true)
|
||||
val placed = ControllerPortraitGeometry(width.toFloat(), height.toFloat(), safe, context.resources.displayMetrics.density)
|
||||
.place(ordered, kit, dock != null, controllerScale, rearButtons == true, trackpads == true)
|
||||
return if (dock != null) {
|
||||
scaleDocked(context, placed, ControllerPrefs.read(context).size / 100f, width, height, safe)
|
||||
} else placed
|
||||
}
|
||||
return ControllerOverlayGeometry(width, height, safe, context.resources.displayMetrics, layout.scale)
|
||||
return ControllerOverlayGeometry(width, height, safe, context.resources.displayMetrics, controllerScale)
|
||||
.place(ordered, kit, rearButtons == true, trackpads == true)
|
||||
}
|
||||
if (dock != null || !kit.steam) return ordered
|
||||
if (dock != null || !kit.steam) {
|
||||
if (dock == null) return ordered
|
||||
return scaleDocked(context, ordered, ControllerPrefs.read(context).size / 100f, width, height, safe)
|
||||
}
|
||||
return FloatingSteamOverlay(width, height, safe, context.resources.displayMetrics.density)
|
||||
.place(ordered, lowerShortcuts = generated, rearButtons = rearButtons, trackpads = trackpads)
|
||||
}
|
||||
|
||||
private fun scaleDocked(context: Context, elements: List<InputSurfaceElement>, scale: Float, width: Int, height: Int, safe: Rect): List<InputSurfaceElement> {
|
||||
val usableWidth = (width - safe.left - safe.right).coerceAtLeast(1).toFloat() / width
|
||||
val usableHeight = (height - safe.top - safe.bottom).coerceAtLeast(1).toFloat() / height
|
||||
val leftBound = safe.left.toFloat() / width
|
||||
val rightBound = (width - safe.right).toFloat() / width
|
||||
val topBound = safe.top.toFloat() / height
|
||||
val bottomBound = (height - safe.bottom).toFloat() / height
|
||||
val scaled = elements.map { element ->
|
||||
if (!isGamepad(element)) return@map element
|
||||
val w = (element.width * scale).coerceIn(min(.001f, usableWidth), usableWidth)
|
||||
val h = (element.height * scale).coerceIn(min(.001f, usableHeight), usableHeight)
|
||||
val x = (element.x + element.width / 2f - w / 2f)
|
||||
.coerceIn(leftBound, (rightBound - w).coerceAtLeast(leftBound))
|
||||
val y = (element.y + element.height / 2f - h / 2f)
|
||||
.coerceIn(topBound, (bottomBound - h).coerceAtLeast(topBound))
|
||||
element.copy(x = x, y = y, width = w, height = h)
|
||||
}.toMutableList()
|
||||
if (scale > 1f) {
|
||||
val gap = 4f / width
|
||||
fun spacePair(leftControl: InputControl, rightControl: InputControl) {
|
||||
val li = scaled.indexOfFirst { isGamepad(it) && it.control == leftControl }
|
||||
val ri = scaled.indexOfFirst { isGamepad(it) && it.control == rightControl }
|
||||
if (li < 0 || ri < 0) return
|
||||
var left = scaled[li]
|
||||
var right = scaled[ri]
|
||||
val available = (rightBound - leftBound).coerceAtLeast(.001f)
|
||||
var gapSize = gap.coerceAtMost(available / 4f)
|
||||
if (left.width + right.width + gapSize > available) {
|
||||
val factor = ((available - gapSize).coerceAtLeast(0f) / (left.width + right.width)).coerceAtMost(1f)
|
||||
left = left.copy(width = left.width * factor)
|
||||
right = right.copy(width = right.width * factor)
|
||||
}
|
||||
val total = left.width + gapSize + right.width
|
||||
val center = ((left.x + left.width / 2f) + (right.x + right.width / 2f)) / 2f
|
||||
val start = (center - total / 2f).coerceIn(leftBound, (rightBound - total).coerceAtLeast(leftBound))
|
||||
scaled[li] = left.copy(x = start)
|
||||
scaled[ri] = right.copy(x = start + left.width + gapSize)
|
||||
}
|
||||
spacePair(InputControl.LT, InputControl.LB)
|
||||
spacePair(InputControl.RB, InputControl.RT)
|
||||
}
|
||||
if (scale > 1f && ControllerPrefs.layout(context, width, height).isEmpty()) {
|
||||
repeat(scaled.size) {
|
||||
for (i in scaled.indices) {
|
||||
if (!isGamepad(scaled[i])) continue
|
||||
for (j in i + 1 until scaled.size) {
|
||||
if (!isGamepad(scaled[j])) continue
|
||||
val a = scaled[i]
|
||||
val b = scaled[j]
|
||||
val overlapX = min(a.x + a.width, b.x + b.width) - max(a.x, b.x)
|
||||
val overlapY = min(a.y + a.height, b.y + b.height) - max(a.y, b.y)
|
||||
if (overlapX <= 0f || overlapY <= 0f) continue
|
||||
|
||||
val centerAX = a.x + a.width / 2f
|
||||
val centerBX = b.x + b.width / 2f
|
||||
val centerAY = a.y + a.height / 2f
|
||||
val centerBY = b.y + b.height / 2f
|
||||
if (overlapX / min(a.width, b.width) <= overlapY / min(a.height, b.height)) {
|
||||
val gapX = 2f / width
|
||||
val available = (rightBound - leftBound).coerceAtLeast(.001f)
|
||||
val leftFirst = centerAX <= centerBX
|
||||
val factor = ((available - gapX).coerceAtLeast(0f) / (a.width + b.width)).coerceIn(0f, 1f)
|
||||
val aw = a.width * factor
|
||||
val ah = a.height * factor
|
||||
val bw = b.width * factor
|
||||
val bh = b.height * factor
|
||||
val total = aw + gapX + bw
|
||||
val center = ((centerAX + centerBX) / 2f).coerceIn(
|
||||
leftBound + total / 2f,
|
||||
(rightBound - total / 2f).coerceAtLeast(leftBound + total / 2f))
|
||||
val firstX = center - total / 2f
|
||||
val secondX = firstX + (if (leftFirst) aw else bw) + gapX
|
||||
scaled[i] = if (leftFirst) {
|
||||
a.copy(x = firstX, y = centerAY - ah / 2f, width = aw, height = ah)
|
||||
} else {
|
||||
a.copy(x = secondX, y = centerAY - ah / 2f, width = aw, height = ah)
|
||||
}
|
||||
scaled[j] = if (leftFirst) {
|
||||
b.copy(x = secondX, y = centerBY - bh / 2f, width = bw, height = bh)
|
||||
} else {
|
||||
b.copy(x = firstX, y = centerBY - bh / 2f, width = bw, height = bh)
|
||||
}
|
||||
} else {
|
||||
val gapY = 2f / height
|
||||
val available = (bottomBound - topBound).coerceAtLeast(.001f)
|
||||
val topFirst = centerAY <= centerBY
|
||||
val factor = ((available - gapY).coerceAtLeast(0f) / (a.height + b.height)).coerceIn(0f, 1f)
|
||||
val aw = a.width * factor
|
||||
val ah = a.height * factor
|
||||
val bw = b.width * factor
|
||||
val bh = b.height * factor
|
||||
val total = ah + gapY + bh
|
||||
val center = ((centerAY + centerBY) / 2f).coerceIn(
|
||||
topBound + total / 2f,
|
||||
(bottomBound - total / 2f).coerceAtLeast(topBound + total / 2f))
|
||||
val firstY = center - total / 2f
|
||||
val secondY = firstY + (if (topFirst) ah else bh) + gapY
|
||||
scaled[i] = if (topFirst) {
|
||||
a.copy(x = centerAX - aw / 2f, y = firstY, width = aw, height = ah)
|
||||
} else {
|
||||
a.copy(x = centerAX - aw / 2f, y = secondY, width = aw, height = ah)
|
||||
}
|
||||
scaled[j] = if (topFirst) {
|
||||
b.copy(x = centerBX - bw / 2f, y = secondY, width = bw, height = bh)
|
||||
} else {
|
||||
b.copy(x = centerBX - bw / 2f, y = firstY, width = bw, height = bh)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return scaled
|
||||
}
|
||||
|
||||
fun oriented(layout: SavedInputLayout, width: Int, height: Int): SavedInputLayout = oriented(layout, height > width)
|
||||
|
||||
private fun oriented(layout: SavedInputLayout, portrait: Boolean): SavedInputLayout {
|
||||
@@ -181,7 +303,14 @@ object OnScreenLayout {
|
||||
?.let { (it * height).roundToInt().coerceAtLeast(1) to height }
|
||||
for ((w, h) in listOfNotNull(named, width to height, aspectSize, long to short, short to long).distinct()) {
|
||||
val generator = LegacyGamepadLayout(display, w, h, scale = layout.scale)
|
||||
if (matches(gamepad, generator.elements()) || matches(gamepad, generator.elements(previousStickGeometry = true))) return (w.toFloat() to h.toFloat()) to true
|
||||
val sizedGenerator = LegacyGamepadLayout(
|
||||
display, w, h, scale = layout.scale,
|
||||
sizeOverride = ControllerPrefs.read(context).size
|
||||
)
|
||||
if (matches(gamepad, generator.elements()) || matches(gamepad, generator.elements(previousStickGeometry = true)) ||
|
||||
matches(gamepad, sizedGenerator.elements()) || matches(gamepad, sizedGenerator.elements(previousStickGeometry = true))) {
|
||||
return (w.toFloat() to h.toFloat()) to true
|
||||
}
|
||||
}
|
||||
}
|
||||
val aspect = layout.aspect.takeIf { it > 0f } ?: (long.toFloat() / short)
|
||||
|
||||
@@ -273,7 +273,8 @@ public final class PadBridge {
|
||||
static boolean isSystemVirtualInputName(String name) {
|
||||
if (name == null) return false;
|
||||
String lower = name.trim().toLowerCase(java.util.Locale.ROOT);
|
||||
return lower.startsWith("uinput-") || lower.startsWith("uinput_");
|
||||
// Xiaomi's "ui-input-xiaomi" is a system uinput device that also reports gamepad sources.
|
||||
return lower.startsWith("uinput-") || lower.startsWith("uinput_") || lower.equals("ui-input-xiaomi");
|
||||
}
|
||||
|
||||
public static boolean isFromController(InputDevice device) {
|
||||
|
||||
@@ -15,17 +15,24 @@ enum class SecondScreenMode(val id: String, @StringRes val label: Int, val bindi
|
||||
DECK_CONTROLS("deck-controls", R.string.second_mode_deck_controls, InputStockLayouts.DECK),
|
||||
CUSTOM_CONTROLS("custom-controls", R.string.input_profile_controls_mode),
|
||||
DASHBOARD("dashboard", R.string.second_mode_dashboard),
|
||||
GUIDES("guides", R.string.bottom_page_guides),
|
||||
MIRROR("mirror", R.string.bottom_page_mirror),
|
||||
STEAM_QAM("steam-qam", R.string.bottom_qam_title),
|
||||
ART("art", R.string.bottom_art_title),
|
||||
DESKTOP("desktop", R.string.second_mode_desktop);
|
||||
|
||||
val sessionPanel: Boolean get() = this == GUIDES || this == MIRROR || this == STEAM_QAM || this == ART
|
||||
|
||||
val controls: Boolean get() = this == CUSTOM_CONTROLS || bindings != null
|
||||
|
||||
fun panel(context: Context): String? = if (this == DECK_CONTROLS) SessionPrefs.deckPanel(context).bindings else bindings
|
||||
|
||||
companion object {
|
||||
/** The mode the bottom screen opens in: the one picked last if it is still available, else the DroidDeck menu. */
|
||||
fun opening(remembered: String?, deckPad: Boolean, dashboard: Boolean = false, bottomDesktop: Boolean = false): SecondScreenMode =
|
||||
fun opening(remembered: String?, deckPad: Boolean, dashboard: Boolean = false, bottomDesktop: Boolean = false,
|
||||
steam: Boolean = false): SecondScreenMode =
|
||||
entries.firstOrNull {
|
||||
it != NONE && it.id == remembered && (it != DECK_CONTROLS || deckPad) && (it != DASHBOARD || dashboard) &&
|
||||
it != NONE && it.id == remembered && (it != DECK_CONTROLS || deckPad) && (it != DASHBOARD && !it.sessionPanel || dashboard) && (it != STEAM_QAM && it != ART || steam) &&
|
||||
(it != DESKTOP || bottomDesktop)
|
||||
} ?: MENU
|
||||
}
|
||||
|
||||
@@ -1,609 +0,0 @@
|
||||
package com.droiddeck.launcher.input.bt
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.bluetooth.BluetoothAdapter
|
||||
import android.bluetooth.BluetoothDevice
|
||||
import android.bluetooth.BluetoothGatt
|
||||
import android.bluetooth.BluetoothGattCallback
|
||||
import android.bluetooth.BluetoothGattCharacteristic
|
||||
import android.bluetooth.BluetoothGattDescriptor
|
||||
import android.bluetooth.BluetoothGattServer
|
||||
import android.bluetooth.BluetoothGattServerCallback
|
||||
import android.bluetooth.BluetoothGattService
|
||||
import android.bluetooth.BluetoothManager
|
||||
import android.bluetooth.BluetoothProfile
|
||||
import android.bluetooth.le.AdvertiseData
|
||||
import android.bluetooth.le.AdvertisingSet
|
||||
import android.bluetooth.le.AdvertisingSetCallback
|
||||
import android.bluetooth.le.AdvertisingSetParameters
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.os.Build
|
||||
import android.os.Handler
|
||||
import android.os.HandlerThread
|
||||
import android.os.ParcelUuid
|
||||
import android.os.SystemClock
|
||||
import android.os.VibrationEffect
|
||||
import android.os.Vibrator
|
||||
import android.util.Log
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import java.util.ArrayDeque
|
||||
import java.util.UUID
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
object BtGamepad {
|
||||
enum class Phase { OFF, STARTING, BLUETOOTH_OFF, UNSUPPORTED, READY, CONNECTING, CONNECTED }
|
||||
|
||||
data class Status(val phase: Phase, val host: String? = null, val lightbar: Int? = null, val name: String? = null)
|
||||
|
||||
private const val TAG = "BtGamepad"
|
||||
|
||||
private val _status = MutableStateFlow(Status(Phase.OFF))
|
||||
val status: StateFlow<Status> = _status
|
||||
|
||||
private var handler: Handler? = null
|
||||
private var app: Context? = null
|
||||
private var server: BluetoothGattServer? = null
|
||||
private var advertising = false
|
||||
private var profile = BtPadProfile.GENERIC
|
||||
private var encoder: BtPadEncoder = profile.encoder()
|
||||
private val pendingServices = ArrayDeque<BluetoothGattService>()
|
||||
private val reportRefs = HashMap<BluetoothGattCharacteristic, Pair<Int, Int>>()
|
||||
private val inputChars = HashMap<Int, BluetoothGattCharacteristic>()
|
||||
private val longReads = HashMap<Pair<String, BluetoothGattCharacteristic>, ByteArray>()
|
||||
private val preparedWrites = HashMap<BluetoothGattCharacteristic, ByteArray>()
|
||||
private var host: BluetoothDevice? = null
|
||||
private var priorityLink: BluetoothGatt? = null
|
||||
private var notifyPending = false
|
||||
private var dirty = false
|
||||
private var mtu = 23
|
||||
private val latest = BtPadState()
|
||||
private val sent = BtPadState()
|
||||
private var sentOnce = false
|
||||
private var vibrator: Vibrator? = null
|
||||
@Volatile private var running = false
|
||||
private var pairingUntil = 0L
|
||||
private var pendingHost: BluetoothDevice? = null
|
||||
private var fastLinkPending = false
|
||||
private var notifiedAt = 0L
|
||||
private const val NOTIFY_TIMEOUT_MS = 100L
|
||||
private const val PAIRING_WINDOW_MS = 120_000L
|
||||
private const val MAX_MTU = 517
|
||||
private const val FAST_LINK_DELAY_MS = 1_500L
|
||||
|
||||
fun start(context: Context, p: BtPadProfile) {
|
||||
val h = handler ?: init(context)
|
||||
h.post {
|
||||
running = true
|
||||
if (server != null && p == profile) {
|
||||
val attached = host
|
||||
if (attached != null) publish(Phase.CONNECTED, attached) else publish(Phase.READY)
|
||||
startAdvertising()
|
||||
} else {
|
||||
close()
|
||||
profile = p
|
||||
publish(Phase.STARTING)
|
||||
open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun init(context: Context): Handler {
|
||||
val ctx = context.applicationContext
|
||||
app = ctx
|
||||
vibrator = ctx.getSystemService(Vibrator::class.java)
|
||||
val t = HandlerThread("bt-gamepad").apply { start() }
|
||||
val h = Handler(t.looper)
|
||||
handler = h
|
||||
val receiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(c: Context, intent: Intent) {
|
||||
when (intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, -1)) {
|
||||
BluetoothAdapter.STATE_ON -> h.post { if (running) open() }
|
||||
BluetoothAdapter.STATE_TURNING_OFF, BluetoothAdapter.STATE_OFF -> h.post {
|
||||
close()
|
||||
publish(Phase.BLUETOOTH_OFF)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ctx.registerReceiver(receiver, IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED), null, h)
|
||||
val bonds = object : BroadcastReceiver() {
|
||||
override fun onReceive(c: Context, intent: Intent) {
|
||||
if (intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, -1) != BluetoothDevice.BOND_BONDED) return
|
||||
h.post {
|
||||
val waiting = pendingHost ?: return@post
|
||||
if (waiting.bondState == BluetoothDevice.BOND_BONDED) attach(waiting)
|
||||
}
|
||||
}
|
||||
}
|
||||
ctx.registerReceiver(bonds, IntentFilter(BluetoothDevice.ACTION_BOND_STATE_CHANGED), null, h)
|
||||
return h
|
||||
}
|
||||
|
||||
fun stop() {
|
||||
val h = handler ?: return
|
||||
h.post {
|
||||
running = false
|
||||
rumble(0, 0)
|
||||
pairingUntil = 0
|
||||
keepScanning()
|
||||
stopAdvertising()
|
||||
h.removeCallbacks(periodic)
|
||||
dropFastLink()
|
||||
pendingHost?.let { d -> runCatching { server?.cancelConnection(d) } }
|
||||
pendingHost = null
|
||||
host?.let { d -> runCatching { server?.cancelConnection(d) } }
|
||||
host = null
|
||||
longReads.clear()
|
||||
_status.value = Status(Phase.OFF)
|
||||
}
|
||||
}
|
||||
|
||||
fun switchProfile(p: BtPadProfile) {
|
||||
val h = handler ?: return
|
||||
h.post {
|
||||
if (p == profile && server != null) return@post
|
||||
profile = p
|
||||
close()
|
||||
publish(Phase.STARTING)
|
||||
h.postDelayed(::open, 300)
|
||||
}
|
||||
}
|
||||
|
||||
fun update(s: BtPadState) {
|
||||
val h = handler ?: return
|
||||
synchronized(latest) { latest.set(s) }
|
||||
h.post(::sendIfChanged)
|
||||
}
|
||||
|
||||
fun openPairingWindow() {
|
||||
val h = handler ?: return
|
||||
h.post {
|
||||
pairingUntil = System.currentTimeMillis() + PAIRING_WINDOW_MS
|
||||
keepScanning()
|
||||
if (host == null) {
|
||||
stopAdvertising()
|
||||
startAdvertising()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun keepScanning() {
|
||||
val adapter = adapter() ?: return
|
||||
val h = handler ?: return
|
||||
h.removeCallbacks(scanTick)
|
||||
if (host != null || System.currentTimeMillis() > pairingUntil) {
|
||||
runCatching { if (adapter.isDiscovering) adapter.cancelDiscovery() }
|
||||
return
|
||||
}
|
||||
runCatching { if (!adapter.isDiscovering) adapter.startDiscovery() }
|
||||
h.postDelayed(scanTick, 2_000)
|
||||
}
|
||||
|
||||
private val scanTick = Runnable { keepScanning() }
|
||||
|
||||
fun disconnect() {
|
||||
handler?.post { host?.let { d -> server?.cancelConnection(d) } }
|
||||
}
|
||||
|
||||
private fun manager() = app?.getSystemService(Context.BLUETOOTH_SERVICE) as? BluetoothManager
|
||||
|
||||
private fun adapter(): BluetoothAdapter? = manager()?.adapter
|
||||
|
||||
private fun open() {
|
||||
val ctx = app ?: return
|
||||
if (server != null || !running) return
|
||||
val manager = manager()
|
||||
val adapter = manager?.adapter
|
||||
if (adapter == null || !ctx.packageManager.hasSystemFeature("android.hardware.bluetooth_le")) {
|
||||
publish(Phase.UNSUPPORTED)
|
||||
return
|
||||
}
|
||||
if (!adapter.isEnabled) {
|
||||
publish(Phase.BLUETOOTH_OFF)
|
||||
return
|
||||
}
|
||||
if (adapter.bluetoothLeAdvertiser == null) {
|
||||
publish(Phase.UNSUPPORTED)
|
||||
return
|
||||
}
|
||||
encoder = profile.encoder()
|
||||
sentOnce = false
|
||||
val s = runCatching { manager.openGattServer(ctx, serverCallback) }
|
||||
.onFailure { Log.w(TAG, "no GATT server", it) }.getOrNull()
|
||||
if (s == null) {
|
||||
publish(Phase.UNSUPPORTED)
|
||||
return
|
||||
}
|
||||
server = s
|
||||
pendingServices.clear()
|
||||
pendingServices.add(deviceInfoService())
|
||||
pendingServices.add(hidService())
|
||||
addNextService()
|
||||
}
|
||||
|
||||
private fun close() {
|
||||
stopAdvertising()
|
||||
pairingUntil = 0
|
||||
keepScanning()
|
||||
dropFastLink()
|
||||
server?.let { s ->
|
||||
runCatching { manager()?.getConnectedDevices(BluetoothProfile.GATT_SERVER)?.forEach { s.cancelConnection(it) } }
|
||||
runCatching { s.clearServices(); s.close() }
|
||||
}
|
||||
server = null
|
||||
host = null
|
||||
pendingHost = null
|
||||
notifyPending = false
|
||||
dirty = false
|
||||
reportRefs.clear()
|
||||
inputChars.clear()
|
||||
longReads.clear()
|
||||
preparedWrites.clear()
|
||||
}
|
||||
|
||||
private fun addNextService() {
|
||||
val s = server ?: return
|
||||
val next = pendingServices.pollFirst()
|
||||
if (next == null) {
|
||||
Log.i(TAG, "${profile.id}: services ready")
|
||||
startAdvertising()
|
||||
return
|
||||
}
|
||||
if (!s.addService(next)) {
|
||||
Log.w(TAG, "addService ${next.uuid} refused")
|
||||
publish(Phase.UNSUPPORTED)
|
||||
}
|
||||
}
|
||||
|
||||
private fun deviceInfoService(): BluetoothGattService {
|
||||
val service = BluetoothGattService(uuid16(0x180A), BluetoothGattService.SERVICE_TYPE_PRIMARY)
|
||||
val pnp = BtPadEncoder.bytes(0x02, profile.vendorId and 0xFF, profile.vendorId shr 8,
|
||||
profile.productId and 0xFF, profile.productId shr 8, profile.version and 0xFF, profile.version shr 8)
|
||||
service.addCharacteristic(readOnly(0x2A50, pnp))
|
||||
service.addCharacteristic(readOnly(0x2A29, "DroidDeck".toByteArray()))
|
||||
return service
|
||||
}
|
||||
|
||||
private fun hidService(): BluetoothGattService {
|
||||
val service = BluetoothGattService(uuid16(0x1812), BluetoothGattService.SERVICE_TYPE_PRIMARY)
|
||||
service.addCharacteristic(readOnly(0x2A4A, BtPadEncoder.bytes(0x11, 0x01, 0x00, 0x02)))
|
||||
service.addCharacteristic(readOnly(0x2A4B, encoder.descriptor))
|
||||
service.addCharacteristic(BluetoothGattCharacteristic(uuid16(0x2A4C),
|
||||
BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE, BluetoothGattCharacteristic.PERMISSION_WRITE))
|
||||
for ((id, type) in encoder.reports) {
|
||||
val props = when (type) {
|
||||
BtPadEncoder.INPUT -> BluetoothGattCharacteristic.PROPERTY_READ or BluetoothGattCharacteristic.PROPERTY_NOTIFY
|
||||
BtPadEncoder.OUTPUT -> BluetoothGattCharacteristic.PROPERTY_READ or BluetoothGattCharacteristic.PROPERTY_WRITE or
|
||||
BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE
|
||||
else -> BluetoothGattCharacteristic.PROPERTY_READ or BluetoothGattCharacteristic.PROPERTY_WRITE
|
||||
}
|
||||
val chr = BluetoothGattCharacteristic(uuid16(0x2A4D), props,
|
||||
BluetoothGattCharacteristic.PERMISSION_READ or BluetoothGattCharacteristic.PERMISSION_WRITE)
|
||||
if (type == BtPadEncoder.INPUT) {
|
||||
chr.addDescriptor(cccd())
|
||||
inputChars[id] = chr
|
||||
}
|
||||
val ref = BluetoothGattDescriptor(uuid16(0x2908), BluetoothGattDescriptor.PERMISSION_READ)
|
||||
@Suppress("DEPRECATION")
|
||||
ref.value = BtPadEncoder.bytes(id, type)
|
||||
chr.addDescriptor(ref)
|
||||
reportRefs[chr] = id to type
|
||||
service.addCharacteristic(chr)
|
||||
}
|
||||
return service
|
||||
}
|
||||
|
||||
private fun readOnly(uuid: Int, value: ByteArray): BluetoothGattCharacteristic {
|
||||
val chr = BluetoothGattCharacteristic(uuid16(uuid), BluetoothGattCharacteristic.PROPERTY_READ, BluetoothGattCharacteristic.PERMISSION_READ)
|
||||
@Suppress("DEPRECATION")
|
||||
chr.value = value
|
||||
return chr
|
||||
}
|
||||
|
||||
private fun cccd() = BluetoothGattDescriptor(uuid16(0x2902),
|
||||
BluetoothGattDescriptor.PERMISSION_READ or BluetoothGattDescriptor.PERMISSION_WRITE)
|
||||
|
||||
private fun uuid16(v: Int): UUID = UUID.fromString("%08x-0000-1000-8000-00805f9b34fb".format(v))
|
||||
|
||||
private fun startAdvertising() {
|
||||
val advertiser = adapter()?.bluetoothLeAdvertiser ?: return
|
||||
if (advertising || server == null || host != null || !running) return
|
||||
val params = AdvertisingSetParameters.Builder()
|
||||
.setLegacyMode(true)
|
||||
.setConnectable(true)
|
||||
.setScannable(true)
|
||||
.setInterval(AdvertisingSetParameters.INTERVAL_LOW)
|
||||
.setTxPowerLevel(AdvertisingSetParameters.TX_POWER_HIGH)
|
||||
.build()
|
||||
val data = AdvertiseData.Builder()
|
||||
.addServiceUuid(ParcelUuid(uuid16(0x1812)))
|
||||
.setIncludeDeviceName(true)
|
||||
.build()
|
||||
advertising = runCatching { advertiser.startAdvertisingSet(params, data, null, null, null, advertiseCallback); true }
|
||||
.onFailure { Log.w(TAG, "advertising refused", it) }.getOrDefault(false)
|
||||
if (!advertising) publish(Phase.UNSUPPORTED)
|
||||
}
|
||||
|
||||
private fun stopAdvertising() {
|
||||
if (!advertising) return
|
||||
advertising = false
|
||||
runCatching { adapter()?.bluetoothLeAdvertiser?.stopAdvertisingSet(advertiseCallback) }
|
||||
}
|
||||
|
||||
private val advertiseCallback = object : AdvertisingSetCallback() {
|
||||
override fun onAdvertisingSetStarted(set: AdvertisingSet?, txPower: Int, status: Int) {
|
||||
Log.i(TAG, "advertising status $status")
|
||||
handler?.post {
|
||||
if (status == ADVERTISE_SUCCESS) {
|
||||
if (host == null) publish(Phase.READY)
|
||||
} else {
|
||||
advertising = false
|
||||
publish(Phase.UNSUPPORTED)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val serverCallback = object : BluetoothGattServerCallback() {
|
||||
override fun onServiceAdded(status: Int, service: BluetoothGattService) {
|
||||
handler?.post {
|
||||
if (status != BluetoothGatt.GATT_SUCCESS) {
|
||||
Log.w(TAG, "service ${service.uuid} failed: $status")
|
||||
publish(Phase.UNSUPPORTED)
|
||||
} else addNextService()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onConnectionStateChange(device: BluetoothDevice, status: Int, newState: Int) {
|
||||
handler?.post {
|
||||
Log.i(TAG, "${device.address}: state $newState status $status bond ${device.bondState}")
|
||||
if (newState == BluetoothProfile.STATE_CONNECTED) {
|
||||
stopAdvertising()
|
||||
if (!running) {
|
||||
server?.cancelConnection(device)
|
||||
return@post
|
||||
}
|
||||
mtu = 23
|
||||
if (device.bondState == BluetoothDevice.BOND_BONDED) attach(device)
|
||||
else if (host == null) publish(Phase.CONNECTING, device)
|
||||
} else if (newState == BluetoothProfile.STATE_DISCONNECTED && pendingHost == device && host == null) {
|
||||
pendingHost = null
|
||||
publish(Phase.READY)
|
||||
startAdvertising()
|
||||
} else if (newState == BluetoothProfile.STATE_DISCONNECTED && host == device) {
|
||||
host = null
|
||||
rumble(0, 0)
|
||||
dropFastLink()
|
||||
publish(Phase.READY)
|
||||
startAdvertising()
|
||||
} else if (newState == BluetoothProfile.STATE_DISCONNECTED && host == null) {
|
||||
publish(Phase.READY)
|
||||
startAdvertising()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMtuChanged(device: BluetoothDevice, newMtu: Int) {
|
||||
handler?.post {
|
||||
mtu = newMtu
|
||||
Log.i(TAG, "mtu $newMtu")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCharacteristicReadRequest(device: BluetoothDevice, requestId: Int, offset: Int, chr: BluetoothGattCharacteristic) {
|
||||
handler?.post {
|
||||
val key = device.address to chr
|
||||
val value = if (offset > 0) longReads[key] ?: valueOf(chr, device) else valueOf(chr, device).also { longReads[key] = it }
|
||||
val reply = if (offset >= value.size) ByteArray(0) else value.copyOfRange(offset, value.size)
|
||||
server?.sendResponse(device, requestId, BluetoothGatt.GATT_SUCCESS, offset, reply)
|
||||
if (chr.uuid == uuid16(0x2A4B)) attach(device)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDescriptorReadRequest(device: BluetoothDevice, requestId: Int, offset: Int, descriptor: BluetoothGattDescriptor) {
|
||||
handler?.post {
|
||||
@Suppress("DEPRECATION")
|
||||
val value = descriptor.value ?: if (descriptor.uuid == uuid16(0x2902)) BtPadEncoder.bytes(1, 0) else ByteArray(0)
|
||||
val reply = if (offset >= value.size) ByteArray(0) else value.copyOfRange(offset, value.size)
|
||||
server?.sendResponse(device, requestId, BluetoothGatt.GATT_SUCCESS, offset, reply)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDescriptorWriteRequest(device: BluetoothDevice, requestId: Int, descriptor: BluetoothGattDescriptor,
|
||||
preparedWrite: Boolean, responseNeeded: Boolean, offset: Int, value: ByteArray) {
|
||||
handler?.post {
|
||||
if (responseNeeded) server?.sendResponse(device, requestId, BluetoothGatt.GATT_SUCCESS, offset, value)
|
||||
if (descriptor.uuid == uuid16(0x2902) && descriptor.characteristic in reportRefs && value.isNotEmpty() &&
|
||||
value[0].toInt() and 1 != 0) {
|
||||
attach(device)
|
||||
handler?.postDelayed({ startFastLink(device) }, FAST_LINK_DELAY_MS)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCharacteristicWriteRequest(device: BluetoothDevice, requestId: Int, chr: BluetoothGattCharacteristic,
|
||||
preparedWrite: Boolean, responseNeeded: Boolean, offset: Int, value: ByteArray) {
|
||||
handler?.post {
|
||||
if (device == host && preparedWrite) {
|
||||
val old = preparedWrites[chr] ?: ByteArray(0)
|
||||
val merged = old.copyOf(maxOf(old.size, offset + value.size))
|
||||
value.copyInto(merged, offset)
|
||||
preparedWrites[chr] = merged
|
||||
} else if (device == host) written(chr, value)
|
||||
if (responseNeeded) server?.sendResponse(device, requestId, BluetoothGatt.GATT_SUCCESS, offset, value)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onExecuteWrite(device: BluetoothDevice, requestId: Int, execute: Boolean) {
|
||||
handler?.post {
|
||||
if (execute && device == host) preparedWrites.forEach { (chr, v) -> written(chr, v) }
|
||||
preparedWrites.clear()
|
||||
server?.sendResponse(device, requestId, BluetoothGatt.GATT_SUCCESS, 0, null)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onNotificationSent(device: BluetoothDevice, status: Int) {
|
||||
handler?.post {
|
||||
notifyPending = false
|
||||
if (dirty) sendNow()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun valueOf(chr: BluetoothGattCharacteristic, device: BluetoothDevice): ByteArray {
|
||||
val ref = reportRefs[chr]
|
||||
if (ref == null) {
|
||||
@Suppress("DEPRECATION")
|
||||
return chr.value ?: ByteArray(0)
|
||||
}
|
||||
val (id, type) = ref
|
||||
return when (type) {
|
||||
BtPadEncoder.INPUT -> if (id == encoder.inputId() && device == host) encoder.input(current()) else ByteArray(0)
|
||||
BtPadEncoder.FEATURE -> {
|
||||
host?.let { d -> handler?.postDelayed({ startFastLink(d) }, FAST_LINK_DELAY_MS) }
|
||||
encoder.feature(id).also { Log.i(TAG, "feature 0x%02x read -> %d".format(id, it?.size ?: -1)) } ?: ByteArray(0)
|
||||
}
|
||||
else -> ByteArray(0)
|
||||
}
|
||||
}
|
||||
|
||||
private fun written(chr: BluetoothGattCharacteristic, value: ByteArray) {
|
||||
val (id, type) = reportRefs[chr] ?: return
|
||||
when (type) {
|
||||
BtPadEncoder.FEATURE -> {
|
||||
Log.i(TAG, "feature 0x%02x write %d bytes".format(id, value.size))
|
||||
encoder.setFeature(id, value)
|
||||
}
|
||||
BtPadEncoder.OUTPUT -> feedback(encoder.output(id, value))
|
||||
}
|
||||
}
|
||||
|
||||
private fun attach(device: BluetoothDevice) {
|
||||
if (host != null || !running) return
|
||||
if (device.bondState != BluetoothDevice.BOND_BONDED) {
|
||||
pendingHost = device
|
||||
publish(Phase.CONNECTING, device)
|
||||
return
|
||||
}
|
||||
pendingHost = null
|
||||
host = device
|
||||
stopAdvertising()
|
||||
pairingUntil = 0
|
||||
keepScanning()
|
||||
sentOnce = false
|
||||
notifyPending = false
|
||||
Log.i(TAG, "host ${device.address} attached")
|
||||
publish(Phase.CONNECTED, device)
|
||||
fastLinkPending = true
|
||||
handler?.removeCallbacks(periodic)
|
||||
handler?.post(periodic)
|
||||
}
|
||||
|
||||
private fun startFastLink(device: BluetoothDevice) {
|
||||
if (host != device || !fastLinkPending) return
|
||||
fastLinkPending = false
|
||||
requestFastLink(device)
|
||||
}
|
||||
|
||||
private fun requestFastLink(device: BluetoothDevice) {
|
||||
val ctx = app ?: return
|
||||
dropFastLink()
|
||||
priorityLink = runCatching {
|
||||
device.connectGatt(ctx, false, object : BluetoothGattCallback() {
|
||||
override fun onConnectionStateChange(gatt: BluetoothGatt, status: Int, newState: Int) {
|
||||
if (newState == BluetoothProfile.STATE_CONNECTED && !gatt.requestMtu(MAX_MTU)) {
|
||||
gatt.requestConnectionPriority(BluetoothGatt.CONNECTION_PRIORITY_HIGH)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMtuChanged(gatt: BluetoothGatt, newMtu: Int, status: Int) {
|
||||
handler?.post {
|
||||
if (newMtu > mtu) mtu = newMtu
|
||||
Log.i(TAG, "link mtu $newMtu")
|
||||
}
|
||||
gatt.requestConnectionPriority(BluetoothGatt.CONNECTION_PRIORITY_HIGH)
|
||||
}
|
||||
}, BluetoothDevice.TRANSPORT_LE)
|
||||
}.getOrNull()
|
||||
}
|
||||
|
||||
private fun dropFastLink() {
|
||||
priorityLink?.let { runCatching { it.disconnect(); it.close() } }
|
||||
priorityLink = null
|
||||
}
|
||||
|
||||
private fun current(): BtPadState = BtPadState().also { s -> synchronized(latest) { s.set(latest) } }
|
||||
|
||||
private fun sendIfChanged() {
|
||||
if (encoder.periodMs > 0) return
|
||||
if (sentOnce && current().sameAs(sent)) return
|
||||
sendNow()
|
||||
}
|
||||
|
||||
private fun sendNow() {
|
||||
val s = server ?: return
|
||||
val device = host ?: return
|
||||
if (notifyPending && SystemClock.elapsedRealtime() - notifiedAt < NOTIFY_TIMEOUT_MS) {
|
||||
dirty = true
|
||||
return
|
||||
}
|
||||
val state = current()
|
||||
val (id, value) = encoder.report(state, mtu - 3)
|
||||
val chr = inputChars[id] ?: return
|
||||
val ok = runCatching {
|
||||
if (Build.VERSION.SDK_INT >= 33) {
|
||||
s.notifyCharacteristicChanged(device, chr, false, value) == BluetoothGatt.GATT_SUCCESS
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
chr.value = value
|
||||
@Suppress("DEPRECATION")
|
||||
s.notifyCharacteristicChanged(device, chr, false)
|
||||
}
|
||||
}.getOrDefault(false)
|
||||
dirty = !ok
|
||||
notifyPending = ok
|
||||
notifiedAt = SystemClock.elapsedRealtime()
|
||||
if (ok) {
|
||||
sent.set(state)
|
||||
sentOnce = true
|
||||
}
|
||||
}
|
||||
|
||||
private val periodic: Runnable = object : Runnable {
|
||||
override fun run() {
|
||||
val h = handler ?: return
|
||||
if (host == null) return
|
||||
if (encoder.periodMs > 0 || dirty) sendNow()
|
||||
h.postDelayed(this, if (encoder.periodMs > 0) encoder.periodMs else 50)
|
||||
}
|
||||
}
|
||||
|
||||
private fun feedback(f: BtFeedback?) {
|
||||
f ?: return
|
||||
if (f.strong >= 0) rumble(f.strong, f.weak)
|
||||
if (f.lightbar != null) _status.value = _status.value.copy(lightbar = f.lightbar)
|
||||
}
|
||||
|
||||
private fun rumble(strong: Int, weak: Int) {
|
||||
val v = vibrator ?: return
|
||||
val amplitude = maxOf(strong, weak * 2 / 3).coerceIn(0, 255)
|
||||
runCatching {
|
||||
if (amplitude == 0) v.cancel()
|
||||
else v.vibrate(VibrationEffect.createOneShot(1_000, amplitude))
|
||||
}
|
||||
}
|
||||
|
||||
private fun publish(phase: Phase, device: BluetoothDevice? = null) {
|
||||
if (!running) {
|
||||
_status.value = Status(Phase.OFF)
|
||||
return
|
||||
}
|
||||
val name = device?.let { runCatching { it.name }.getOrNull() ?: it.address }
|
||||
val own = runCatching { adapter()?.name }.getOrNull()
|
||||
_status.value = Status(phase, name, _status.value.lightbar.takeIf { phase == Phase.CONNECTED }, own)
|
||||
}
|
||||
}
|
||||
@@ -1,559 +0,0 @@
|
||||
package com.droiddeck.launcher.input.bt
|
||||
|
||||
import java.util.zip.CRC32
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
class BtPadState {
|
||||
@JvmField var buttons = 0
|
||||
@JvmField var lx = 0f
|
||||
@JvmField var ly = 0f
|
||||
@JvmField var rx = 0f
|
||||
@JvmField var ry = 0f
|
||||
@JvmField var lt = 0f
|
||||
@JvmField var rt = 0f
|
||||
@JvmField var lpx = 0f
|
||||
@JvmField var lpy = 0f
|
||||
@JvmField var rpx = 0f
|
||||
@JvmField var rpy = 0f
|
||||
|
||||
fun isDown(bit: Int) = buttons and bit != 0
|
||||
|
||||
fun set(other: BtPadState) {
|
||||
buttons = other.buttons; lx = other.lx; ly = other.ly; rx = other.rx; ry = other.ry; lt = other.lt; rt = other.rt
|
||||
lpx = other.lpx; lpy = other.lpy; rpx = other.rpx; rpy = other.rpy
|
||||
}
|
||||
|
||||
fun merge(a: BtPadState, b: BtPadState) {
|
||||
buttons = a.buttons or b.buttons
|
||||
lx = stronger(a.lx, b.lx); ly = stronger(a.ly, b.ly)
|
||||
rx = stronger(a.rx, b.rx); ry = stronger(a.ry, b.ry)
|
||||
lt = maxOf(a.lt, b.lt, if (isDown(LT)) 1f else 0f)
|
||||
rt = maxOf(a.rt, b.rt, if (isDown(RT)) 1f else 0f)
|
||||
val left = if (b.isDown(LPAD_TOUCH)) b else a
|
||||
lpx = left.lpx; lpy = left.lpy
|
||||
val right = if (b.isDown(RPAD_TOUCH)) b else a
|
||||
rpx = right.rpx; rpy = right.rpy
|
||||
}
|
||||
|
||||
fun sameAs(o: BtPadState) = buttons == o.buttons && lx == o.lx && ly == o.ly && rx == o.rx && ry == o.ry && lt == o.lt && rt == o.rt &&
|
||||
lpx == o.lpx && lpy == o.lpy && rpx == o.rpx && rpy == o.rpy
|
||||
|
||||
fun hat(): Int {
|
||||
val x = (if (isDown(RIGHT)) 1 else 0) - (if (isDown(LEFT)) 1 else 0)
|
||||
val y = (if (isDown(DOWN)) 1 else 0) - (if (isDown(UP)) 1 else 0)
|
||||
return when {
|
||||
x == 0 && y == -1 -> 0
|
||||
x == 1 && y == -1 -> 1
|
||||
x == 1 && y == 0 -> 2
|
||||
x == 1 && y == 1 -> 3
|
||||
x == 0 && y == 1 -> 4
|
||||
x == -1 && y == 1 -> 5
|
||||
x == -1 && y == 0 -> 6
|
||||
x == -1 && y == -1 -> 7
|
||||
else -> -1
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val A = 1 shl 0
|
||||
const val B = 1 shl 1
|
||||
const val X = 1 shl 2
|
||||
const val Y = 1 shl 3
|
||||
const val LB = 1 shl 4
|
||||
const val RB = 1 shl 5
|
||||
const val LT = 1 shl 6
|
||||
const val RT = 1 shl 7
|
||||
const val SELECT = 1 shl 8
|
||||
const val START = 1 shl 9
|
||||
const val GUIDE = 1 shl 10
|
||||
const val L3 = 1 shl 11
|
||||
const val R3 = 1 shl 12
|
||||
const val UP = 1 shl 13
|
||||
const val DOWN = 1 shl 14
|
||||
const val LEFT = 1 shl 15
|
||||
const val RIGHT = 1 shl 16
|
||||
const val L4 = 1 shl 17
|
||||
const val R4 = 1 shl 18
|
||||
const val L5 = 1 shl 19
|
||||
const val R5 = 1 shl 20
|
||||
const val TOUCHPAD = 1 shl 21
|
||||
const val SHARE = 1 shl 22
|
||||
const val LPAD_TOUCH = 1 shl 23
|
||||
const val RPAD_TOUCH = 1 shl 24
|
||||
const val LPAD_CLICK = 1 shl 25
|
||||
const val RPAD_CLICK = 1 shl 26
|
||||
|
||||
private fun stronger(a: Float, b: Float) = if (Math.abs(b) > Math.abs(a)) b else a
|
||||
}
|
||||
}
|
||||
|
||||
class BtFeedback(val strong: Int, val weak: Int, val lightbar: Int? = null)
|
||||
|
||||
enum class BtPadProfile(val id: String, val vendorId: Int, val productId: Int, val version: Int) {
|
||||
GENERIC("generic", 0x1209, 0x0001, 0x0100),
|
||||
XBOX("xbox", 0x045E, 0x0B13, 0x0509),
|
||||
DUALSHOCK4("dualshock4", 0x054C, 0x09CC, 0x0100),
|
||||
DUALSENSE("dualsense", 0x054C, 0x0CE6, 0x0100),
|
||||
STEAM("steam", 0x28DE, 0x1303, 0x0100);
|
||||
|
||||
fun encoder(): BtPadEncoder = when (this) {
|
||||
GENERIC -> GenericEncoder()
|
||||
XBOX -> XboxEncoder()
|
||||
DUALSHOCK4 -> DualShock4Encoder()
|
||||
DUALSENSE -> DualSenseEncoder()
|
||||
STEAM -> SteamControllerEncoder()
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun byId(id: String?) = entries.firstOrNull { it.id == id } ?: GENERIC
|
||||
}
|
||||
}
|
||||
|
||||
abstract class BtPadEncoder {
|
||||
abstract val descriptor: ByteArray
|
||||
abstract val reports: List<Pair<Int, Int>>
|
||||
abstract fun inputId(): Int
|
||||
abstract fun input(s: BtPadState): ByteArray
|
||||
open val periodMs = 0L
|
||||
|
||||
open fun report(s: BtPadState, limit: Int): Pair<Int, ByteArray> {
|
||||
val v = input(s)
|
||||
return inputId() to if (v.size > limit) v.copyOf(limit) else v
|
||||
}
|
||||
open fun feature(id: Int): ByteArray? = null
|
||||
open fun setFeature(id: Int, data: ByteArray) {}
|
||||
open fun output(id: Int, data: ByteArray): BtFeedback? = null
|
||||
|
||||
protected fun axis8(v: Float) = ((v.coerceIn(-1f, 1f) + 1f) * 127.5f).roundToInt().coerceIn(0, 255)
|
||||
protected fun trigger8(v: Float) = (v.coerceIn(0f, 1f) * 255f).roundToInt()
|
||||
|
||||
protected fun ByteArray.le16(at: Int, v: Int) { this[at] = v.toByte(); this[at + 1] = (v shr 8).toByte() }
|
||||
protected fun ByteArray.le32(at: Int, v: Long) { for (i in 0 until 4) this[at + i] = (v shr (8 * i)).toByte() }
|
||||
|
||||
protected fun ByteArray.sealCrc(seed: Int, id: Int): ByteArray {
|
||||
val crc = CRC32()
|
||||
crc.update(seed)
|
||||
crc.update(id)
|
||||
crc.update(this, 0, size - 4)
|
||||
le32(size - 4, crc.value)
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
companion object {
|
||||
const val INPUT = 1
|
||||
const val OUTPUT = 2
|
||||
const val FEATURE = 3
|
||||
|
||||
fun bytes(vararg v: Int) = ByteArray(v.size) { v[it].toByte() }
|
||||
}
|
||||
}
|
||||
|
||||
private class GenericEncoder : BtPadEncoder() {
|
||||
override val reports = listOf(1 to INPUT)
|
||||
|
||||
override val descriptor = bytes(
|
||||
0x05, 0x01, 0x09, 0x05, 0xA1, 0x01, 0x85, 0x01,
|
||||
0x05, 0x09, 0x19, 0x01, 0x29, 0x18, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x18, 0x81, 0x02,
|
||||
0x05, 0x01, 0x09, 0x39, 0x15, 0x00, 0x25, 0x07, 0x35, 0x00, 0x46, 0x3B, 0x01, 0x65, 0x14, 0x75, 0x04, 0x95, 0x01, 0x81, 0x42,
|
||||
0x65, 0x00, 0x75, 0x04, 0x95, 0x01, 0x81, 0x03,
|
||||
0x09, 0x30, 0x09, 0x31, 0x09, 0x32, 0x09, 0x35, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, 0x04, 0x81, 0x02,
|
||||
0x05, 0x02, 0x09, 0xC5, 0x09, 0xC4, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, 0x02, 0x81, 0x02,
|
||||
0xC0,
|
||||
)
|
||||
|
||||
override fun inputId() = 1
|
||||
|
||||
override fun input(s: BtPadState): ByteArray {
|
||||
var b = 0
|
||||
GENERIC_ORDER.forEachIndexed { i, bit -> if (s.isDown(bit)) b = b or (1 shl i) }
|
||||
val hat = s.hat().let { if (it < 0) 8 else it }
|
||||
return bytes(
|
||||
b and 0xFF, (b shr 8) and 0xFF, (b shr 16) and 0xFF, hat,
|
||||
axis8(s.lx), axis8(s.ly), axis8(s.rx), axis8(s.ry), trigger8(s.lt), trigger8(s.rt),
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val GENERIC_ORDER = intArrayOf(
|
||||
BtPadState.A, BtPadState.B, 0, BtPadState.X, BtPadState.Y, 0, BtPadState.LB, BtPadState.RB,
|
||||
BtPadState.LT, BtPadState.RT, BtPadState.SELECT, BtPadState.START, BtPadState.GUIDE, BtPadState.L3, BtPadState.R3, 0,
|
||||
BtPadState.L4, BtPadState.R4, BtPadState.L5, BtPadState.R5, BtPadState.TOUCHPAD, BtPadState.SHARE, 0, 0,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private class XboxEncoder : BtPadEncoder() {
|
||||
override val reports = listOf(1 to INPUT, 3 to OUTPUT)
|
||||
|
||||
override val descriptor = bytes(
|
||||
0x05, 0x01, 0x09, 0x05, 0xA1, 0x01, 0x85, 0x01,
|
||||
0x09, 0x01, 0xA1, 0x00, 0x09, 0x30, 0x09, 0x31, 0x15, 0x00, 0x27, 0xFF, 0xFF, 0x00, 0x00, 0x95, 0x02, 0x75, 0x10, 0x81, 0x02, 0xC0,
|
||||
0x09, 0x01, 0xA1, 0x00, 0x09, 0x32, 0x09, 0x35, 0x15, 0x00, 0x27, 0xFF, 0xFF, 0x00, 0x00, 0x95, 0x02, 0x75, 0x10, 0x81, 0x02, 0xC0,
|
||||
0x05, 0x02, 0x09, 0xC5, 0x15, 0x00, 0x26, 0xFF, 0x03, 0x95, 0x01, 0x75, 0x0A, 0x81, 0x02, 0x15, 0x00, 0x25, 0x00, 0x75, 0x06, 0x95, 0x01, 0x81, 0x03,
|
||||
0x05, 0x02, 0x09, 0xC4, 0x15, 0x00, 0x26, 0xFF, 0x03, 0x95, 0x01, 0x75, 0x0A, 0x81, 0x02, 0x15, 0x00, 0x25, 0x00, 0x75, 0x06, 0x95, 0x01, 0x81, 0x03,
|
||||
0x05, 0x01, 0x09, 0x39, 0x15, 0x01, 0x25, 0x08, 0x35, 0x00, 0x46, 0x3B, 0x01, 0x66, 0x14, 0x00, 0x75, 0x04, 0x95, 0x01, 0x81, 0x42,
|
||||
0x75, 0x04, 0x95, 0x01, 0x15, 0x00, 0x25, 0x00, 0x35, 0x00, 0x45, 0x00, 0x65, 0x00, 0x81, 0x03,
|
||||
0x05, 0x09, 0x19, 0x01, 0x29, 0x0F, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x0F, 0x81, 0x02,
|
||||
0x15, 0x00, 0x25, 0x00, 0x75, 0x01, 0x95, 0x01, 0x81, 0x03,
|
||||
0x05, 0x0C, 0x0A, 0xB2, 0x00, 0x15, 0x00, 0x25, 0x01, 0x95, 0x01, 0x75, 0x01, 0x81, 0x02,
|
||||
0x15, 0x00, 0x25, 0x00, 0x75, 0x07, 0x95, 0x01, 0x81, 0x03,
|
||||
0x05, 0x0F, 0x09, 0x21, 0x85, 0x03, 0xA1, 0x02,
|
||||
0x09, 0x97, 0x15, 0x00, 0x25, 0x01, 0x75, 0x04, 0x95, 0x01, 0x91, 0x02,
|
||||
0x15, 0x00, 0x25, 0x00, 0x75, 0x04, 0x95, 0x01, 0x91, 0x03,
|
||||
0x09, 0x70, 0x15, 0x00, 0x25, 0x64, 0x75, 0x08, 0x95, 0x04, 0x91, 0x02,
|
||||
0x09, 0x50, 0x66, 0x01, 0x10, 0x55, 0x0E, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, 0x01, 0x91, 0x02,
|
||||
0x09, 0xA7, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, 0x01, 0x91, 0x02,
|
||||
0x65, 0x00, 0x55, 0x00, 0x09, 0x7C, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, 0x01, 0x91, 0x02,
|
||||
0xC0, 0xC0,
|
||||
)
|
||||
|
||||
override fun inputId() = 1
|
||||
|
||||
override fun input(s: BtPadState): ByteArray {
|
||||
val r = ByteArray(16)
|
||||
r.le16(0, axis16(s.lx)); r.le16(2, axis16(s.ly)); r.le16(4, axis16(s.rx)); r.le16(6, axis16(s.ry))
|
||||
r.le16(8, (s.lt.coerceIn(0f, 1f) * 1023f).roundToInt())
|
||||
r.le16(10, (s.rt.coerceIn(0f, 1f) * 1023f).roundToInt())
|
||||
r[12] = (s.hat() + 1).toByte()
|
||||
var b = 0
|
||||
XBOX_ORDER.forEachIndexed { i, bit -> if (bit != 0 && s.isDown(bit)) b = b or (1 shl i) }
|
||||
r.le16(13, b)
|
||||
r[15] = if (s.isDown(BtPadState.SHARE)) 1 else 0
|
||||
return r
|
||||
}
|
||||
|
||||
override fun output(id: Int, data: ByteArray): BtFeedback? {
|
||||
if (id != 3) return null
|
||||
val d = data
|
||||
if (d.size < 5) return null
|
||||
val enable = d[0].toInt()
|
||||
val strong = if (enable and 0x02 != 0) d[3].toInt() and 0xFF else 0
|
||||
val weak = if (enable and 0x01 != 0) d[4].toInt() and 0xFF else 0
|
||||
return BtFeedback(strong * 255 / 100, weak * 255 / 100)
|
||||
}
|
||||
|
||||
private fun axis16(v: Float) = ((v.coerceIn(-1f, 1f) + 1f) * 32767.5f).roundToInt().coerceIn(0, 65535)
|
||||
|
||||
companion object {
|
||||
private val XBOX_ORDER = intArrayOf(
|
||||
BtPadState.A, BtPadState.B, 0, BtPadState.X, BtPadState.Y, 0, BtPadState.LB, BtPadState.RB,
|
||||
0, 0, BtPadState.SELECT, BtPadState.START, BtPadState.GUIDE, BtPadState.L3, BtPadState.R3,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private abstract class SonyEncoder : BtPadEncoder() {
|
||||
@Volatile protected var enhanced = false
|
||||
protected var counter = 0
|
||||
protected var timestamp = 0L
|
||||
|
||||
override val periodMs = 8L
|
||||
|
||||
protected fun buttons(s: BtPadState): IntArray {
|
||||
val hat = s.hat().let { if (it < 0) 8 else it }
|
||||
var b0 = hat
|
||||
if (s.isDown(BtPadState.X)) b0 = b0 or 0x10
|
||||
if (s.isDown(BtPadState.A)) b0 = b0 or 0x20
|
||||
if (s.isDown(BtPadState.B)) b0 = b0 or 0x40
|
||||
if (s.isDown(BtPadState.Y)) b0 = b0 or 0x80
|
||||
var b1 = 0
|
||||
if (s.isDown(BtPadState.LB)) b1 = b1 or 0x01
|
||||
if (s.isDown(BtPadState.RB)) b1 = b1 or 0x02
|
||||
if (s.lt > 0.05f) b1 = b1 or 0x04
|
||||
if (s.rt > 0.05f) b1 = b1 or 0x08
|
||||
if (s.isDown(BtPadState.SELECT) || s.isDown(BtPadState.SHARE)) b1 = b1 or 0x10
|
||||
if (s.isDown(BtPadState.START)) b1 = b1 or 0x20
|
||||
if (s.isDown(BtPadState.L3)) b1 = b1 or 0x40
|
||||
if (s.isDown(BtPadState.R3)) b1 = b1 or 0x80
|
||||
var b2 = 0
|
||||
if (s.isDown(BtPadState.GUIDE)) b2 = b2 or 0x01
|
||||
if (s.isDown(BtPadState.TOUCHPAD)) b2 = b2 or 0x02
|
||||
return intArrayOf(b0, b1, b2)
|
||||
}
|
||||
|
||||
override fun report(s: BtPadState, limit: Int): Pair<Int, ByteArray> {
|
||||
val full = input(s)
|
||||
return if (full.size <= limit) inputId() to full else 1 to simple(s)
|
||||
}
|
||||
|
||||
protected fun simple(s: BtPadState): ByteArray {
|
||||
val b = buttons(s)
|
||||
counter = (counter + 1) and 0x3F
|
||||
return bytes(axis8(s.lx), axis8(s.ly), axis8(s.rx), axis8(s.ry), b[0], b[1], b[2] or (counter shl 2), trigger8(s.lt), trigger8(s.rt))
|
||||
}
|
||||
|
||||
protected fun calibration(): ByteArray {
|
||||
val r = ByteArray(40)
|
||||
val v = intArrayOf(0, 0, 0, GYRO, -GYRO, GYRO, -GYRO, GYRO, -GYRO, GYRO_SPEED, GYRO_SPEED, ACCEL, -ACCEL, ACCEL, -ACCEL, ACCEL, -ACCEL)
|
||||
v.forEachIndexed { i, x -> r.le16(i * 2, x) }
|
||||
return r.sealCrc(FEATURE_SEED, 0x05)
|
||||
}
|
||||
|
||||
override fun feature(id: Int): ByteArray? {
|
||||
val reply = reply(id) ?: return null
|
||||
enhanced = true
|
||||
return reply
|
||||
}
|
||||
|
||||
protected abstract fun reply(id: Int): ByteArray?
|
||||
|
||||
companion object {
|
||||
const val INPUT_SEED = 0xA1
|
||||
const val OUTPUT_SEED = 0xA2
|
||||
const val FEATURE_SEED = 0xA3
|
||||
const val GYRO = 8800
|
||||
const val GYRO_SPEED = 540
|
||||
const val ACCEL = 8192
|
||||
}
|
||||
}
|
||||
|
||||
private class DualShock4Encoder : SonyEncoder() {
|
||||
override val reports = listOf(0x01 to INPUT, 0x11 to INPUT, 0x11 to OUTPUT, 0x02 to FEATURE, 0xA3 to FEATURE, 0x05 to FEATURE, 0x12 to FEATURE)
|
||||
|
||||
override val descriptor = bytes(
|
||||
0x05, 0x01, 0x09, 0x05, 0xA1, 0x01, 0x85, 0x01,
|
||||
0x09, 0x30, 0x09, 0x31, 0x09, 0x32, 0x09, 0x35, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, 0x04, 0x81, 0x02,
|
||||
0x09, 0x39, 0x15, 0x00, 0x25, 0x07, 0x35, 0x00, 0x46, 0x3B, 0x01, 0x65, 0x14, 0x75, 0x04, 0x95, 0x01, 0x81, 0x42, 0x65, 0x00,
|
||||
0x05, 0x09, 0x19, 0x01, 0x29, 0x0E, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x0E, 0x81, 0x02,
|
||||
0x06, 0x00, 0xFF, 0x09, 0x20, 0x75, 0x06, 0x95, 0x01, 0x15, 0x00, 0x25, 0x7F, 0x81, 0x02,
|
||||
0x05, 0x01, 0x09, 0x33, 0x09, 0x34, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, 0x02, 0x81, 0x02,
|
||||
0x06, 0x04, 0xFF,
|
||||
0x85, 0x02, 0x09, 0x24, 0x95, 0x24, 0xB1, 0x02,
|
||||
0x85, 0xA3, 0x09, 0x25, 0x95, 0x30, 0xB1, 0x02,
|
||||
0x85, 0x05, 0x09, 0x26, 0x95, 0x28, 0xB1, 0x02,
|
||||
0x85, 0x12, 0x09, 0x27, 0x95, 0x0F, 0xB1, 0x02,
|
||||
0x85, 0x11, 0x09, 0x22, 0x95, 0x4D, 0x81, 0x02,
|
||||
0x09, 0x23, 0x95, 0x4D, 0x91, 0x02,
|
||||
0xC0,
|
||||
)
|
||||
|
||||
override fun inputId() = if (enhanced) 0x11 else 0x01
|
||||
|
||||
override fun input(s: BtPadState): ByteArray {
|
||||
if (!enhanced) return simple(s)
|
||||
val r = ByteArray(77)
|
||||
r[0] = 0xC0.toByte()
|
||||
val b = buttons(s)
|
||||
counter = (counter + 1) and 0x3F
|
||||
timestamp += 1500
|
||||
val c = 2
|
||||
r[c] = axis8(s.lx).toByte(); r[c + 1] = axis8(s.ly).toByte(); r[c + 2] = axis8(s.rx).toByte(); r[c + 3] = axis8(s.ry).toByte()
|
||||
r[c + 4] = b[0].toByte(); r[c + 5] = b[1].toByte(); r[c + 6] = (b[2] or (counter shl 2)).toByte()
|
||||
r[c + 7] = trigger8(s.lt).toByte(); r[c + 8] = trigger8(s.rt).toByte()
|
||||
r.le16(c + 9, timestamp.toInt())
|
||||
r.le16(c + 20, ACCEL)
|
||||
r[c + 29] = 0x09
|
||||
r[c + 32] = 1
|
||||
r[c + 34] = 0x80.toByte()
|
||||
r[c + 38] = 0x80.toByte()
|
||||
return r.sealCrc(INPUT_SEED, 0x11)
|
||||
}
|
||||
|
||||
override fun reply(id: Int): ByteArray? = when (id) {
|
||||
0x02 -> ByteArray(36).also { r ->
|
||||
val v = intArrayOf(0, 0, 0, GYRO, GYRO, GYRO, -GYRO, -GYRO, -GYRO, GYRO_SPEED, GYRO_SPEED, ACCEL, -ACCEL, ACCEL, -ACCEL, ACCEL, -ACCEL)
|
||||
v.forEachIndexed { i, x -> r.le16(i * 2, x) }
|
||||
}
|
||||
0x05 -> calibration()
|
||||
0xA3 -> ByteArray(48).also { r ->
|
||||
"Sep 21 2018".toByteArray().copyInto(r, 0)
|
||||
"04:50:51".toByteArray().copyInto(r, 16)
|
||||
r.le16(34, 0x0100)
|
||||
r.le16(40, 0xA00A)
|
||||
}
|
||||
0x12 -> ByteArray(15).also { r -> FAKE_MAC.copyInto(r, 0); r[6] = 0x08; r[7] = 0x25 }
|
||||
else -> null
|
||||
}
|
||||
|
||||
override fun output(id: Int, data: ByteArray): BtFeedback? {
|
||||
if (id != 0x11) return null
|
||||
enhanced = true
|
||||
val d = data
|
||||
if (d.size < 10) return null
|
||||
val flags = d[2].toInt()
|
||||
val light = if (flags and 0x02 != 0) rgb(d[7], d[8], d[9]) else null
|
||||
return BtFeedback(d[6].toInt() and 0xFF, d[5].toInt() and 0xFF, light)
|
||||
}
|
||||
}
|
||||
|
||||
private class DualSenseEncoder : SonyEncoder() {
|
||||
override val reports = listOf(0x01 to INPUT, 0x31 to INPUT, 0x31 to OUTPUT, 0x05 to FEATURE, 0x09 to FEATURE, 0x20 to FEATURE)
|
||||
|
||||
override val descriptor = bytes(
|
||||
0x05, 0x01, 0x09, 0x05, 0xA1, 0x01, 0x85, 0x01,
|
||||
0x09, 0x30, 0x09, 0x31, 0x09, 0x32, 0x09, 0x35, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, 0x04, 0x81, 0x02,
|
||||
0x09, 0x39, 0x15, 0x00, 0x25, 0x07, 0x35, 0x00, 0x46, 0x3B, 0x01, 0x65, 0x14, 0x75, 0x04, 0x95, 0x01, 0x81, 0x42, 0x65, 0x00,
|
||||
0x05, 0x09, 0x19, 0x01, 0x29, 0x0E, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x0E, 0x81, 0x02,
|
||||
0x06, 0x00, 0xFF, 0x09, 0x20, 0x75, 0x06, 0x95, 0x01, 0x15, 0x00, 0x25, 0x7F, 0x81, 0x02,
|
||||
0x05, 0x01, 0x09, 0x33, 0x09, 0x34, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, 0x02, 0x81, 0x02,
|
||||
0x06, 0x00, 0xFF,
|
||||
0x85, 0x31, 0x09, 0x31, 0x95, 0x4D, 0x81, 0x02,
|
||||
0x09, 0x32, 0x95, 0x4D, 0x91, 0x02,
|
||||
0x85, 0x05, 0x09, 0x33, 0x95, 0x28, 0xB1, 0x02,
|
||||
0x85, 0x09, 0x09, 0x34, 0x95, 0x13, 0xB1, 0x02,
|
||||
0x85, 0x20, 0x09, 0x35, 0x95, 0x3F, 0xB1, 0x02,
|
||||
0xC0,
|
||||
)
|
||||
|
||||
private var sequence = 0
|
||||
|
||||
override fun inputId() = if (enhanced) 0x31 else 0x01
|
||||
|
||||
override fun input(s: BtPadState): ByteArray {
|
||||
if (!enhanced) return simple(s)
|
||||
val r = ByteArray(77)
|
||||
sequence = (sequence + 1) and 0xFF
|
||||
timestamp += 24000
|
||||
r[0] = 0x10
|
||||
val c = 1
|
||||
r[c] = axis8(s.lx).toByte(); r[c + 1] = axis8(s.ly).toByte(); r[c + 2] = axis8(s.rx).toByte(); r[c + 3] = axis8(s.ry).toByte()
|
||||
r[c + 4] = trigger8(s.lt).toByte(); r[c + 5] = trigger8(s.rt).toByte()
|
||||
r[c + 6] = sequence.toByte()
|
||||
val b = buttons(s)
|
||||
r[c + 7] = b[0].toByte(); r[c + 8] = b[1].toByte(); r[c + 9] = b[2].toByte()
|
||||
r.le16(c + 23, ACCEL)
|
||||
r.le32(c + 27, timestamp)
|
||||
r[c + 32] = 0x80.toByte()
|
||||
r[c + 36] = 0x80.toByte()
|
||||
r[c + 52] = 0x09
|
||||
return r.sealCrc(INPUT_SEED, 0x31)
|
||||
}
|
||||
|
||||
override fun reply(id: Int): ByteArray? = when (id) {
|
||||
0x05 -> calibration()
|
||||
0x09 -> ByteArray(19).also { r -> FAKE_MAC.copyInto(r, 0) }.sealCrc(FEATURE_SEED, 0x09)
|
||||
0x20 -> ByteArray(63).also { r ->
|
||||
"Jun 19 2023".toByteArray().copyInto(r, 0)
|
||||
"14:47:34".toByteArray().copyInto(r, 11)
|
||||
r.le16(19, 0x0003)
|
||||
r.le32(23, 0x00000615L)
|
||||
r.le32(27, 0x0110002AL)
|
||||
r.le16(43, 0x0630)
|
||||
}.sealCrc(FEATURE_SEED, 0x20)
|
||||
else -> null
|
||||
}
|
||||
|
||||
override fun output(id: Int, data: ByteArray): BtFeedback? {
|
||||
if (id != 0x31) return null
|
||||
enhanced = true
|
||||
val d = data
|
||||
if (d.size < 49) return null
|
||||
val flags0 = d[2].toInt()
|
||||
val flags1 = d[3].toInt()
|
||||
val light = if (flags1 and 0x04 != 0) rgb(d[46], d[47], d[48]) else null
|
||||
return if (flags0 and 0x03 != 0) BtFeedback(d[5].toInt() and 0xFF, d[4].toInt() and 0xFF, light)
|
||||
else if (light != null) BtFeedback(-1, -1, light) else null
|
||||
}
|
||||
}
|
||||
|
||||
private class SteamControllerEncoder : BtPadEncoder() {
|
||||
override val descriptor = bytes(
|
||||
0x06, 0x00, 0xFF, 0x09, 0x01, 0xA1, 0x01, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08,
|
||||
0x85, 0x45, 0x09, 0x02, 0x95, 0x2D, 0x81, 0x02, 0x85, 0x47, 0x09, 0x03, 0x95, 0x2D, 0x81, 0x02,
|
||||
0x85, 0x80, 0x09, 0x04, 0x95, 0x09, 0x91, 0x02, 0x85, 0x81, 0x09, 0x05, 0x95, 0x07, 0x91, 0x02,
|
||||
0x85, 0x82, 0x09, 0x06, 0x95, 0x03, 0x91, 0x02, 0x85, 0x83, 0x09, 0x07, 0x95, 0x09, 0x91, 0x02,
|
||||
0x85, 0x84, 0x09, 0x08, 0x95, 0x08, 0x91, 0x02, 0x85, 0x85, 0x09, 0x09, 0x95, 0x03, 0x91, 0x02,
|
||||
0x85, 0x01, 0x09, 0x0A, 0x95, 0x3F, 0xB1, 0x02, 0xC0,
|
||||
)
|
||||
override val reports = listOf(0x45 to INPUT, 0x47 to INPUT, 0x80 to OUTPUT, 0x81 to OUTPUT, 0x82 to OUTPUT,
|
||||
0x83 to OUTPUT, 0x84 to OUTPUT, 0x85 to OUTPUT, 0x01 to FEATURE)
|
||||
override val periodMs = 8L
|
||||
|
||||
@Volatile private var pending = 0
|
||||
private var packet = 0
|
||||
private val start = System.nanoTime()
|
||||
|
||||
override fun inputId() = 0x45
|
||||
|
||||
override fun input(s: BtPadState): ByteArray {
|
||||
val r = ByteArray(45)
|
||||
packet++
|
||||
r[0] = packet.toByte()
|
||||
var b = LGRIP_TOUCH or RGRIP_TOUCH
|
||||
BUTTONS.forEach { (mine, theirs) -> if (s.isDown(mine)) b = b or theirs }
|
||||
if (s.lt >= 0.98f) b = b or LTRIGGER_CLICK
|
||||
if (s.rt >= 0.98f) b = b or RTRIGGER_CLICK
|
||||
if (Math.abs(s.lx) > 0.06f || Math.abs(s.ly) > 0.06f) b = b or LSTICK_TOUCH
|
||||
if (Math.abs(s.rx) > 0.06f || Math.abs(s.ry) > 0.06f) b = b or RSTICK_TOUCH
|
||||
r.le32(1, b.toLong())
|
||||
r.le16(5, (s.lt.coerceIn(0f, 1f) * 32767f).roundToInt())
|
||||
r.le16(7, (s.rt.coerceIn(0f, 1f) * 32767f).roundToInt())
|
||||
r.le16(9, stick(s.lx)); r.le16(11, stick(-s.ly)); r.le16(13, stick(s.rx)); r.le16(15, stick(-s.ry))
|
||||
if (s.isDown(BtPadState.LPAD_TOUCH)) {
|
||||
r.le16(17, stick(s.lpx)); r.le16(19, stick(-s.lpy))
|
||||
r.le16(21, if (s.isDown(BtPadState.LPAD_CLICK)) 32767 else 4000)
|
||||
}
|
||||
if (s.isDown(BtPadState.RPAD_TOUCH)) {
|
||||
r.le16(23, stick(s.rpx)); r.le16(25, stick(-s.rpy))
|
||||
r.le16(27, if (s.isDown(BtPadState.RPAD_CLICK)) 32767 else 4000)
|
||||
}
|
||||
r.le32(29, (System.nanoTime() - start) / 1000)
|
||||
r.le16(37, 16384)
|
||||
return r
|
||||
}
|
||||
|
||||
override fun setFeature(id: Int, data: ByteArray) {
|
||||
val d = data
|
||||
if (id == 1 && d.isNotEmpty()) pending = d[0].toInt() and 0xFF
|
||||
}
|
||||
|
||||
override fun feature(id: Int): ByteArray? {
|
||||
if (id != 1) return null
|
||||
val r = ByteArray(63)
|
||||
r[0] = pending.toByte()
|
||||
when (pending) {
|
||||
0x83 -> {
|
||||
val ids = intArrayOf(0x01, 0x02, 0x04, 0x09, 0x0A, 0x0B)
|
||||
val values = longArrayOf(0x1303, 0, FW_TIMESTAMP, 72, 0, 4000)
|
||||
r[1] = (ids.size * 5).toByte()
|
||||
ids.forEachIndexed { i, a -> r[2 + i * 5] = a.toByte(); r.le32(3 + i * 5, values[i]) }
|
||||
}
|
||||
0xAE -> { r[1] = 0x14; r[2] = 0x01; SERIAL.toByteArray().copyInto(r, 3) }
|
||||
0xBA -> { r[1] = 0x11; "DROIDDECKCHIP02".toByteArray().copyInto(r, 3) }
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
override fun output(id: Int, data: ByteArray): BtFeedback? {
|
||||
val d = data
|
||||
return when (id) {
|
||||
0x80 -> if (d.size >= 8) {
|
||||
val left = (d[3].toInt() and 0xFF) or ((d[4].toInt() and 0xFF) shl 8)
|
||||
val right = (d[6].toInt() and 0xFF) or ((d[7].toInt() and 0xFF) shl 8)
|
||||
BtFeedback(left shr 8, right shr 8)
|
||||
} else null
|
||||
in 0x81..0x85 -> BtFeedback(0, 120)
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
private fun stick(v: Float) = (v.coerceIn(-1f, 1f) * 32767f).roundToInt()
|
||||
|
||||
companion object {
|
||||
private const val LGRIP_TOUCH = 0x20000000
|
||||
private const val RGRIP_TOUCH = 0x10000000
|
||||
private const val LTRIGGER_CLICK = 0x08000000
|
||||
private const val RTRIGGER_CLICK = 0x00800000
|
||||
private const val LSTICK_TOUCH = 0x01000000
|
||||
private const val RSTICK_TOUCH = 0x00100000
|
||||
private const val FW_TIMESTAMP = 0x6AC686B3L
|
||||
private const val SERIAL = "DROIDDECKSC01"
|
||||
private val BUTTONS = listOf(
|
||||
BtPadState.A to 0x00000001, BtPadState.B to 0x00000002, BtPadState.X to 0x00000004, BtPadState.Y to 0x00000008,
|
||||
BtPadState.SHARE to 0x00000010, BtPadState.R3 to 0x00000020, BtPadState.SELECT to 0x00000040,
|
||||
BtPadState.R4 to 0x00000080, BtPadState.R5 to 0x00000100, BtPadState.RB to 0x00000200,
|
||||
BtPadState.DOWN to 0x00000400, BtPadState.RIGHT to 0x00000800, BtPadState.LEFT to 0x00001000,
|
||||
BtPadState.UP to 0x00002000, BtPadState.START to 0x00004000, BtPadState.L3 to 0x00008000,
|
||||
BtPadState.GUIDE to 0x00010000, BtPadState.L4 to 0x00020000, BtPadState.L5 to 0x00040000,
|
||||
BtPadState.LB to 0x00080000,
|
||||
BtPadState.RPAD_TOUCH to 0x00200000, BtPadState.RPAD_CLICK to 0x00400000,
|
||||
BtPadState.LPAD_TOUCH to 0x02000000, BtPadState.LPAD_CLICK to 0x04000000,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private val FAKE_MAC = BtPadEncoder.bytes(0x5D, 0x44, 0x33, 0x22, 0x11, 0xD0)
|
||||
|
||||
private fun rgb(r: Byte, g: Byte, b: Byte) =
|
||||
(0xFF shl 24) or ((r.toInt() and 0xFF) shl 16) or ((g.toInt() and 0xFF) shl 8) or (b.toInt() and 0xFF)
|
||||
@@ -207,7 +207,8 @@ object BattleNet {
|
||||
val taken = HashSet<File>()
|
||||
fun options(title: Title, folder: File) = listOfNotNull(folder, title.flavor?.let { File(folder, it) }?.takeIf { it.isDirectory })
|
||||
for ((code, game) in games) {
|
||||
val keep = saved[code]?.let(::File)?.takeIf { it in options(game.first, game.second) && it !in taken } ?: continue
|
||||
val want = saved[code]?.let { runCatching { File(it).canonicalFile }.getOrNull() } ?: continue
|
||||
val keep = options(game.first, game.second).firstOrNull { runCatching { it.canonicalFile }.getOrNull() == want }?.takeIf { it !in taken } ?: continue
|
||||
out[code] = keep
|
||||
taken.add(keep)
|
||||
}
|
||||
@@ -244,6 +245,14 @@ object BattleNet {
|
||||
"/" + rootfs.relativize(resolved).joinToString("/")
|
||||
}
|
||||
}.trimEnd('/')
|
||||
if (mapped?.startsWith("/") == true) {
|
||||
val rootfs = LinuxRuntime.rootDir(context)
|
||||
runCatching {
|
||||
val home = rootfs.canonicalFile.toPath()
|
||||
val host = File("$target/$relative").canonicalFile.toPath()
|
||||
if (host.startsWith(home)) File(rootfs, home.relativize(host).toString()) else null
|
||||
}.getOrNull()?.let { return it }
|
||||
}
|
||||
return com.droiddeck.launcher.frontend.AddedGames.hostPath(context, "$target/$relative")
|
||||
}
|
||||
|
||||
|
||||
@@ -112,9 +112,16 @@ object BwrapSpawner {
|
||||
return out
|
||||
}
|
||||
|
||||
internal fun withKernelPaths(sessionBinds: List<Bind>, canonical: (String) -> String): List<Bind> =
|
||||
sessionBinds + sessionBinds.filter { it.host == it.guest }.mapNotNull { bind ->
|
||||
runCatching { canonical(bind.host) }.getOrNull()
|
||||
?.takeIf { it != bind.guest && sessionBinds.none { other -> other.guest == it } }
|
||||
?.let { Bind(bind.host, it) }
|
||||
}
|
||||
|
||||
internal fun plan(context: Context, request: JSONObject, dir: File): Plan {
|
||||
val rootfs = LinuxRuntime.rootDir(context).path
|
||||
val session = LinuxRuntime.lastBinds(context).map { Bind.parse(it) }
|
||||
val session = withKernelPaths(LinuxRuntime.lastBinds(context).map { Bind.parse(it) }) { File(it).canonicalPath }
|
||||
val root = File(dir, "root").apply { mkdirs() }
|
||||
val binds = ArrayList<Bind>()
|
||||
var scratch = 0
|
||||
@@ -184,7 +191,10 @@ object BwrapSpawner {
|
||||
request.optJSONObject("env")?.let { e -> e.keys().forEach { k -> env[k] = e.getString(k) } }
|
||||
withoutRootfsSettings(env, rootfs)
|
||||
val envTool = request.optString("envTool").takeIf { it.startsWith("/") }
|
||||
if (envTool == null && binds.any { it.guest == "/dev" }) gpu(rootfs, root, env)?.forEach { addBind(it) }
|
||||
if (envTool == null && binds.any { it.guest == "/dev" }) {
|
||||
val glIcd = coveringBind(GL_ICD_DIR) != null && File(hostPath(binds, root.path, GL_ICD_DIR)).isDirectory
|
||||
gpu(rootfs, root, env, glIcd = glIcd)?.forEach { addBind(it) }
|
||||
}
|
||||
val libc = listOf("/usr/lib/aarch64-linux-gnu/libc.so.6", "/lib/aarch64-linux-gnu/libc.so.6").map { hostPath(binds, root.path, it) }
|
||||
if (envTool == null && preloadFits(rootfs, libc.firstOrNull { File(it).isFile } ?: libc.first())) preload(session, rootfs, env).forEach { addBind(it) }
|
||||
zypakShims(binds, root, dir).forEach { addBind(it) }
|
||||
@@ -211,6 +221,7 @@ object BwrapSpawner {
|
||||
}
|
||||
|
||||
private const val GPU_DIR = "/run/droiddeck-gpu"
|
||||
private const val GL_ICD_DIR = "/usr/lib/aarch64-linux-gnu/GL/vulkan/icd.d"
|
||||
|
||||
private val LIB_DIRS = listOf("usr/lib/aarch64-linux-gnu", "usr/lib")
|
||||
private val GPU_LIBS = listOf("libdisplay-info.so.3", "libdisplay-info.so.2", "libSPIRV-Tools.so", "libSPIRV-Tools-opt.so")
|
||||
@@ -220,9 +231,9 @@ object BwrapSpawner {
|
||||
|
||||
internal fun gpu(
|
||||
rootfs: String, root: File, env: MutableMap<String, String>,
|
||||
kgslAvailable: Boolean = File("/dev/kgsl-3d0").exists(),
|
||||
kgslAvailable: Boolean = File("/dev/kgsl-3d0").exists(), glIcd: Boolean = false,
|
||||
): List<Bind>? {
|
||||
env["VKBRIDGE_SOCKET"]?.let { sock -> if (File(sock).exists()) return bridgeGpu(rootfs, root, env, sock) }
|
||||
env["VKBRIDGE_SOCKET"]?.let { sock -> if (File(sock).exists()) return bridgeGpu(rootfs, root, env, sock, glIcd) }
|
||||
val driver = runtimeLib(rootfs, "libvulkan_freedreno.so")
|
||||
if (driver == null || !kgslAvailable) return null
|
||||
if (env.containsKey("VK_ICD_FILENAMES") || env.containsKey("VK_DRIVER_FILES")) return null
|
||||
@@ -235,6 +246,7 @@ object BwrapSpawner {
|
||||
val icd = File(root.parentFile, "freedreno_icd.json")
|
||||
icd.writeText("{\"file_format_version\": \"1.0.0\", \"ICD\": {\"library_path\": \"$GPU_DIR/libvulkan_freedreno.so\", \"api_version\": \"1.4.0\"}}\n")
|
||||
binds.add(Bind(icd.path, "$GPU_DIR/freedreno_icd.json"))
|
||||
if (glIcd) binds.add(icdDir(root, icd))
|
||||
env["VK_DRIVER_FILES"] = "$GPU_DIR/freedreno_icd.json"
|
||||
env["VK_ICD_FILENAMES"] = "$GPU_DIR/freedreno_icd.json"
|
||||
if (!env.containsKey("MESA_LOADER_DRIVER_OVERRIDE") && !env.containsKey("GALLIUM_DRIVER")) {
|
||||
@@ -245,7 +257,14 @@ object BwrapSpawner {
|
||||
return binds
|
||||
}
|
||||
|
||||
private fun bridgeGpu(rootfs: String, root: File, env: MutableMap<String, String>, socket: String): List<Bind>? {
|
||||
private fun icdDir(root: File, icd: File): Bind {
|
||||
val dir = File(root.parentFile, "icd.d")
|
||||
dir.mkdirs()
|
||||
icd.copyTo(File(dir, icd.name), overwrite = true)
|
||||
return Bind(dir.path, GL_ICD_DIR)
|
||||
}
|
||||
|
||||
private fun bridgeGpu(rootfs: String, root: File, env: MutableMap<String, String>, socket: String, glIcd: Boolean): List<Bind>? {
|
||||
val driver = File(rootfs, "usr/local/lib/vkbridge/libvulkan_droidbridge.so")
|
||||
if (!driver.isFile) { Log.w(TAG, "gpu: vkbridge session but no bridge ICD in the runtime"); return null }
|
||||
val binds = ArrayList<Bind>()
|
||||
@@ -258,6 +277,7 @@ object BwrapSpawner {
|
||||
}.getOrNull() ?: run { Log.w(TAG, "gpu: vkbridge session but the runtime's bridge manifest is unreadable"); return null }
|
||||
icd.writeText("{\"file_format_version\": \"1.0.0\", \"ICD\": {\"library_path\": \"$GPU_DIR/libvulkan_droidbridge.so\", \"api_version\": \"$api\"}}\n")
|
||||
binds.add(Bind(icd.path, "$GPU_DIR/vkbridge_icd.json"))
|
||||
if (glIcd) binds.add(icdDir(root, icd))
|
||||
env["VK_DRIVER_FILES"] = "$GPU_DIR/vkbridge_icd.json"
|
||||
env["VK_ICD_FILENAMES"] = "$GPU_DIR/vkbridge_icd.json"
|
||||
if (!env.containsKey("MESA_LOADER_DRIVER_OVERRIDE") && !env.containsKey("GALLIUM_DRIVER")) {
|
||||
@@ -416,6 +436,7 @@ object BwrapSpawner {
|
||||
"DDNATV_ROOT" to sandbox,
|
||||
"DDNATV_EXEC" to NativeGuest.execLoader.orEmpty(),
|
||||
"DDNATV_LINK_ROOT" to rootfs.path,
|
||||
"DDNATV_REAL_EXE" to program.path,
|
||||
"DDNATV_BINDS" to plan.binds.joinToString("|") { "${it.host}:${it.guest}" },
|
||||
"DDNATV_HOSTNAME" to SessionPrefs.guestHostname(context),
|
||||
"LD_LIBRARY_PATH" to SANDBOX_LIB_DIRS.map(::host).filter { it.isDirectory }.joinToString(":") { it.path },
|
||||
@@ -537,6 +558,9 @@ object BwrapSpawner {
|
||||
return f
|
||||
}
|
||||
|
||||
internal fun prootEnvironment(plan: Plan, startsThroughEnvTool: Boolean): Map<String, String> =
|
||||
if (startsThroughEnvTool) emptyMap() else plan.env - "LD_PRELOAD"
|
||||
|
||||
private fun run(context: Context, plan: Plan, client: LocalSocket, out: DataOutputStream, id: Int) {
|
||||
val verbose = plan.env["DROIDDECK_PROOT_VERBOSE"]?.toIntOrNull()
|
||||
val native = if (NativeGuest.forSession(context)) nativeLaunch(context, plan) else null
|
||||
@@ -558,7 +582,7 @@ object BwrapSpawner {
|
||||
ProcessBuilder(cmd).redirectErrorStream(true).directory(plan.root).also { b ->
|
||||
b.environment().apply {
|
||||
clear()
|
||||
if (!envTool) putAll(plan.env)
|
||||
putAll(prootEnvironment(plan, envTool))
|
||||
put("PROOT_LOADER", LinuxRuntime.prootLoader(context).path)
|
||||
put("PROOT_TMP_DIR", LinuxRuntime.prootTempDir(context).path)
|
||||
if (SessionPrefs.prootNoSeccomp(context)) put("PROOT_NO_SECCOMP", "1")
|
||||
|
||||
@@ -109,9 +109,15 @@ object DesktopCatalog {
|
||||
FileUtils.readString(marker(context, id))?.trim()?.takeIf { it.isNotEmpty() }
|
||||
|
||||
fun protonSeedNeeded(context: Context): Boolean =
|
||||
installed(context, PROTON_SEED_ID) == null &&
|
||||
if (com.droiddeck.launcher.session.SessionPrefs.ownProtonFirst(context)) ownProtonMissing(context)
|
||||
else installed(context, PROTON_SEED_ID) == null &&
|
||||
!File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/steamapps/appmanifest_4427310.acf").isFile
|
||||
|
||||
fun ownProtonMissing(context: Context): Boolean {
|
||||
val extras = com.droiddeck.launcher.session.ProtonExtras
|
||||
return extras.installedAll(context, extras.tools.first { it.id == extras.OWN }).isEmpty()
|
||||
}
|
||||
|
||||
const val DESKTOP_ID = "desktop-kde"
|
||||
const val EMULATORS_ID = "emulators"
|
||||
private const val EMULATORS_SCRIPT = "/usr/local/bin/droiddeck-emulators"
|
||||
|
||||
@@ -32,6 +32,9 @@ object DesktopLanguage {
|
||||
|
||||
internal fun baseUrl(desktopUrl: String) = desktopUrl.substringBeforeLast('/') + "/"
|
||||
|
||||
/** The index carries every pack's sha256, so it never goes through a download mirror. */
|
||||
internal fun fetchIndex(base: String): Map<String, Pack>? = Downloader.downloadDirect(base + INDEX)?.let(::parseIndex)
|
||||
|
||||
private fun marker(root: File, tag: String, name: String) = File(root, ".droiddeck-i18n-$tag-$name")
|
||||
|
||||
/** Installs the desktop's translations for [locale]; false when a download failed and is worth retrying. */
|
||||
@@ -44,7 +47,7 @@ object DesktopLanguage {
|
||||
val pending = candidates(locale).filterNot { marker(root, tag, it).isFile }
|
||||
if (pending.isEmpty()) return true
|
||||
val base = baseUrl(BuildConfig.DESKTOP_KDE_URL)
|
||||
val index = parseIndex(Downloader.downloadString(base + INDEX) ?: return false)
|
||||
val index = fetchIndex(base) ?: return false
|
||||
var complete = true
|
||||
for (name in pending) {
|
||||
val pack = index[name]
|
||||
|
||||
@@ -199,6 +199,7 @@ public final class LinuxRuntime {
|
||||
}
|
||||
|
||||
public static List<String> prootPrefix(Context context, File root, String cwd, boolean fakeRoot) {
|
||||
NativeGuest.relinkAfterProot(root);
|
||||
List<String> cmd = new ArrayList<>();
|
||||
cmd.addAll(com.droiddeck.launcher.core.HostProcess.dataExecutable(prootBinary(context).getPath()));
|
||||
cmd.add("--kill-on-exit");
|
||||
@@ -511,7 +512,7 @@ public final class LinuxRuntime {
|
||||
public static List<File> cpuTempZones() {
|
||||
java.util.Map<String, String> replaced = replacedZoneTypes();
|
||||
List<File> zones = new ArrayList<>();
|
||||
for (java.util.Map.Entry<String, File> zone : new java.util.TreeMap<>(thermalZones()).entrySet()) {
|
||||
for (java.util.Map.Entry<String, File> zone : thermalZones().entrySet()) {
|
||||
String type = zone.getKey();
|
||||
if (type.contains("cpu") && !type.contains("gpu") && !replaced.containsKey(zone.getValue().getName())) {
|
||||
zones.add(zone.getValue());
|
||||
@@ -554,23 +555,31 @@ public final class LinuxRuntime {
|
||||
private static String thermalZone(String sensor) {
|
||||
java.util.Map<String, File> zones = thermalZones();
|
||||
File zone = zones.get(sensor);
|
||||
for (java.util.Map.Entry<String, File> e : new java.util.TreeMap<>(zones).entrySet()) {
|
||||
for (java.util.Map.Entry<String, File> e : zones.entrySet()) {
|
||||
if (zone == null && e.getKey().contains(sensor)) zone = e.getValue();
|
||||
}
|
||||
return zone != null ? new File(zone, "temp").getPath() : null;
|
||||
}
|
||||
|
||||
private static java.util.Map<String, File> thermalZones() {
|
||||
private static volatile java.util.SortedMap<String, File> thermalZoneTypes;
|
||||
|
||||
private static java.util.SortedMap<String, File> thermalZones() {
|
||||
java.util.SortedMap<String, File> known = thermalZoneTypes;
|
||||
if (known != null) return known;
|
||||
java.util.Map<String, File> byType = new java.util.HashMap<>();
|
||||
File[] zones = new File("/sys/class/thermal").listFiles((dir, n) -> n.startsWith("thermal_zone"));
|
||||
if (zones == null) return byType;
|
||||
if (zones == null) return java.util.Collections.emptySortedMap();
|
||||
boolean complete = true;
|
||||
for (File zone : zones) {
|
||||
try (java.io.BufferedReader r = new java.io.BufferedReader(new java.io.FileReader(new File(zone, "type")))) {
|
||||
byType.putIfAbsent(String.valueOf(r.readLine()).trim().toLowerCase(java.util.Locale.ROOT), zone);
|
||||
} catch (IOException ignored) {
|
||||
} catch (IOException e) {
|
||||
complete = false;
|
||||
}
|
||||
}
|
||||
return byType;
|
||||
java.util.SortedMap<String, File> sorted = java.util.Collections.unmodifiableSortedMap(new java.util.TreeMap<>(byType));
|
||||
if (complete && !sorted.isEmpty()) thermalZoneTypes = sorted;
|
||||
return sorted;
|
||||
}
|
||||
|
||||
private static void bindSystemFonts(List<String> cmd, File root) {
|
||||
|
||||
@@ -73,10 +73,10 @@ object NativeGuest {
|
||||
fun libraryPath(root: File): String = LIB_DIRS.joinToString(":") { File(root, it).path }
|
||||
|
||||
/** Environment every native process starts with; a guest `env -i` is re-seeded by the hook. */
|
||||
fun environment(root: File, preload: List<String> = emptyList()): Map<String, String> = linkedMapOf(
|
||||
fun environment(root: File, program: String, preload: List<String> = emptyList()): Map<String, String> = linkedMapOf(
|
||||
"DDNATV_ROOT" to root.path,
|
||||
"DDNATV_EXEC" to execLoader.orEmpty(),
|
||||
"LD_LIBRARY_PATH" to libraryPath(root),
|
||||
"DDNATV_REAL_EXE" to hostProgram(root, program).path,
|
||||
"LD_PRELOAD" to (preload.map { File(root, it.removePrefix("/")).path } + hook(root).path).joinToString(":"),
|
||||
).filterValues { it.isNotEmpty() }
|
||||
|
||||
@@ -84,23 +84,25 @@ object NativeGuest {
|
||||
* The host command line for the guest program at [program] (an absolute guest path to a real
|
||||
* file, not a symlink).
|
||||
*/
|
||||
fun command(root: File, program: String, args: List<String>): List<String> {
|
||||
fun command(root: File, program: String, args: List<String>, libraryPath: String = libraryPath(root)): List<String> {
|
||||
val loader = checkNotNull(loader(root)) { "no glibc loader in ${root.path}" }
|
||||
val host = File(root, program.removePrefix("/"))
|
||||
val launch = listOf(loader.path, "--argv0", host.name, host.path) + args
|
||||
val host = hostProgram(root, program)
|
||||
val launch = listOf(loader.path, "--library-path", libraryPath, "--argv0", host.name, host.path) + args
|
||||
return simulator(root)?.let { it + launch } ?: (execPrefix(loader.path) + launch)
|
||||
}
|
||||
|
||||
private fun hostProgram(root: File, program: String): File = File(root, program.removePrefix("/"))
|
||||
|
||||
/** The environment of the session process: the hook's root, the mounts proot used to make, the preload list. */
|
||||
fun sessionEnvironment(root: File, binds: List<String>, hostname: String? = null): Map<String, String> {
|
||||
fun sessionEnvironment(root: File, binds: List<String>, program: String, hostname: String? = null): Map<String, String> {
|
||||
val preload = preloadList(root)
|
||||
return linkedMapOf(
|
||||
"DDNATV_ROOT" to root.path,
|
||||
"DDNATV_EXEC" to execLoader.orEmpty(),
|
||||
"DDNATV_REAL_EXE" to hostProgram(root, program).path,
|
||||
"DDNATV_HOSTNAME" to hostname.orEmpty(),
|
||||
"DDNATV_BINDS" to binds.joinToString("|") { if (it.contains(':')) it else "$it:$it" },
|
||||
"DDNATV_PRELOAD" to preload.joinToString(":"),
|
||||
"LD_LIBRARY_PATH" to libraryPath(root),
|
||||
"LD_PRELOAD" to (preload.map { File(root, it.removePrefix("/")).path } + hook(root).path).joinToString(":"),
|
||||
).filterValues { it.isNotEmpty() }
|
||||
}
|
||||
@@ -116,7 +118,7 @@ object NativeGuest {
|
||||
.also { builder ->
|
||||
builder.environment().apply {
|
||||
remove("LD_AUDIT")
|
||||
putAll(sessionEnvironment(root, binds, SessionPrefs.guestHostname(context)))
|
||||
putAll(sessionEnvironment(root, binds, guest.first(), SessionPrefs.guestHostname(context)))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,8 +169,15 @@ object NativeGuest {
|
||||
}
|
||||
}
|
||||
|
||||
private const val RELINK_STAMP = "etc/droiddeck/native-symlinks"
|
||||
|
||||
@JvmStatic
|
||||
fun relinkAfterProot(root: File) {
|
||||
File(root, RELINK_STAMP).delete()
|
||||
}
|
||||
|
||||
private val HOST_LINK_TARGETS = listOf("/proc", "/dev", "/sys", "/sdcard", "/storage", "/data", "/system", "/vendor", "/apex",
|
||||
"/system_ext", "/product", "/odm", "/linkerconfig", "/mnt")
|
||||
"/system_ext", "/product", "/odm", "/linkerconfig", "/mnt", "/root/Storage")
|
||||
|
||||
/**
|
||||
* Symbolic links the kernel follows by itself (ld.so, Steam, anything that skips the hook) read
|
||||
@@ -176,9 +185,9 @@ object NativeGuest {
|
||||
* which reads the target inside the rootfs, so each is rewritten as a relative link, which
|
||||
* resolves the same way under proot and without it. Rerun when the runtime changes.
|
||||
*/
|
||||
fun relinkAbsoluteSymlinks(context: Context, root: File): Int {
|
||||
val stamp = File(root, "etc/droiddeck/native-symlinks")
|
||||
val version = com.droiddeck.launcher.runtime.LinuxRuntimeInstaller.installedVersion(context).orEmpty() + "/2"
|
||||
fun relinkAbsoluteSymlinks(context: Context, root: File, commands: () -> Sequence<List<String>> = ::procCommands): Int {
|
||||
val stamp = File(root, RELINK_STAMP)
|
||||
val version = com.droiddeck.launcher.runtime.LinuxRuntimeInstaller.installedVersion(context).orEmpty() + "/3"
|
||||
if (stamp.isFile && stamp.readText() == version) return 0
|
||||
val rootPath = root.toPath()
|
||||
var rewritten = 0
|
||||
@@ -204,11 +213,20 @@ object NativeGuest {
|
||||
|
||||
override fun visitFileFailed(file: java.nio.file.Path, exc: java.io.IOException) = java.nio.file.FileVisitResult.CONTINUE
|
||||
})
|
||||
stamp.parentFile?.mkdirs()
|
||||
stamp.writeText(version)
|
||||
if (!prootRunning(LinuxRuntime.prootBinary(context).path, commands())) {
|
||||
stamp.parentFile?.mkdirs()
|
||||
stamp.writeText(version)
|
||||
}
|
||||
return rewritten
|
||||
}
|
||||
|
||||
internal fun prootRunning(proot: String, commands: Sequence<List<String>>): Boolean =
|
||||
commands.any { args -> args.take(2).any { it == proot } }
|
||||
|
||||
private fun procCommands(): Sequence<List<String>> = (File("/proc").listFiles() ?: emptyArray()).asSequence()
|
||||
.filter { it.name.all(Char::isDigit) }
|
||||
.mapNotNull { runCatching { File(it, "cmdline").readText().split('\u0000') }.getOrNull() }
|
||||
|
||||
/**
|
||||
* The guest path that host path [target] stands for in a session with [binds] ("src:dst"), or null
|
||||
* when it is a guest path already: the rootfs, or the longest mount source holding it (the first
|
||||
@@ -273,12 +291,14 @@ object NativeGuest {
|
||||
|
||||
fun builder(root: File, cwd: String, argv: List<String>, env: Map<String, String>, preload: List<String> = emptyList()): ProcessBuilder {
|
||||
val program = argv.first()
|
||||
val cmd = command(root, program, argv.drop(1))
|
||||
val callerDirs = env["LD_LIBRARY_PATH"]?.takeIf { it.isNotEmpty() }?.split(':').orEmpty()
|
||||
val rootDirs = libraryPath(root).split(':').filterNot { it in callerDirs }
|
||||
val cmd = command(root, program, argv.drop(1), (callerDirs + rootDirs).joinToString(":"))
|
||||
val builder = ProcessBuilder(cmd).redirectErrorStream(false)
|
||||
builder.directory(File(root, cwd.removePrefix("/")).takeIf { it.isDirectory } ?: root)
|
||||
builder.environment().apply {
|
||||
clear()
|
||||
putAll(environment(root, preload))
|
||||
putAll(environment(root, program, preload))
|
||||
putAll(env)
|
||||
}
|
||||
return builder
|
||||
|
||||
@@ -22,7 +22,7 @@ class RuntimeInstallService : Service() {
|
||||
if (intent?.action == ACTION_PACKAGE) return holdPackage(startId)
|
||||
val removal = intent?.action == ACTION_REMOVE
|
||||
val release = intent?.let(::releaseFrom)
|
||||
startForeground(NOTIFICATION_ID, notification(getString(if (LinuxRuntimeInstaller.isMaintaining()) R.string.desktop_removing else if (removal) R.string.rtinst_removing else R.string.user_apps_starting), -1))
|
||||
val foreground = enterForeground(notification(getString(if (LinuxRuntimeInstaller.isMaintaining()) R.string.desktop_removing else if (removal) R.string.rtinst_removing else R.string.user_apps_starting), -1))
|
||||
if (release == null && !removal) {
|
||||
stopSelf(startId)
|
||||
return START_NOT_STICKY
|
||||
@@ -31,7 +31,7 @@ class RuntimeInstallService : Service() {
|
||||
val manager = getSystemService(NotificationManager::class.java)
|
||||
var shown = ""
|
||||
val progress = LinuxRuntimeInstaller.ProgressListener { stage, percent ->
|
||||
if ("$stage:$percent" != shown) {
|
||||
if (foreground && "$stage:$percent" != shown) {
|
||||
shown = "$stage:$percent"
|
||||
manager?.notify(NOTIFICATION_ID, notification(stage, percent))
|
||||
}
|
||||
@@ -46,7 +46,10 @@ class RuntimeInstallService : Service() {
|
||||
}
|
||||
|
||||
private fun holdPackage(startId: Int): Int {
|
||||
startForeground(NOTIFICATION_ID, notification(packageStage, packagePercent, packageTitle))
|
||||
if (!enterForeground(notification(packageStage, packagePercent, packageTitle))) {
|
||||
stopSelf(startId)
|
||||
return START_NOT_STICKY
|
||||
}
|
||||
Thread({
|
||||
val manager = getSystemService(NotificationManager::class.java)
|
||||
var shown = ""
|
||||
@@ -65,6 +68,15 @@ class RuntimeInstallService : Service() {
|
||||
return START_NOT_STICKY
|
||||
}
|
||||
|
||||
/** Android 12+ refuses a foreground start while the app is in the background; the work then goes on without the notification. */
|
||||
private fun enterForeground(notification: Notification): Boolean = try {
|
||||
startForeground(NOTIFICATION_ID, notification)
|
||||
true
|
||||
} catch (e: IllegalStateException) {
|
||||
android.util.Log.w("RuntimeInstallService", "running without a foreground service: $e")
|
||||
false
|
||||
}
|
||||
|
||||
private fun notification(stage: String, percent: Int, title: String? = null): Notification {
|
||||
val manager = getSystemService(NotificationManager::class.java)
|
||||
manager?.createNotificationChannel(NotificationChannel(CHANNEL_ID, getString(R.string.setup_runtime),
|
||||
|
||||
@@ -328,7 +328,7 @@ object BottomDesktop {
|
||||
LinuxRuntime.commandWithBinds(context, current.root, binds, guest)
|
||||
}
|
||||
val environment = if (current.nativeUserland) {
|
||||
com.droiddeck.launcher.runtime.NativeGuest.sessionEnvironment(current.root, binds, SessionPrefs.guestHostname(context))
|
||||
com.droiddeck.launcher.runtime.NativeGuest.sessionEnvironment(current.root, binds, guest.first(), SessionPrefs.guestHostname(context))
|
||||
.map { (k, v) -> "$k=$v" }.toTypedArray()
|
||||
} else current.hostEnvironment
|
||||
val line = command.joinToString(" ") { it.replace("\\", "\\\\").replace(" ", "\\ ") }
|
||||
|
||||
@@ -39,6 +39,10 @@ internal object BuildWatermarkSetting {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
notifyChanged(context)
|
||||
}
|
||||
|
||||
fun notifyChanged(context: Context) {
|
||||
context.sendBroadcast(Intent(CHANGED).setPackage(context.packageName))
|
||||
}
|
||||
}
|
||||
Loaded 100 of 600 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user