mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 20:45:43 +00:00
Compare commits
133
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc9ae46bcd | ||
|
|
a56d4e38be | ||
|
|
ed6b123984 | ||
|
|
611d2d75d1 | ||
|
|
f39267e8b0 | ||
|
|
9fee179a80 | ||
|
|
e72496f34d | ||
|
|
3f0952fece | ||
|
|
d55da2f3c7 | ||
|
|
22b1c21a02 | ||
|
|
a2118089c3 | ||
|
|
40b2db8007 | ||
|
|
91b2f5483d | ||
|
|
9dfbc05933 | ||
|
|
8ec6e646d9 | ||
|
|
41412450fd | ||
|
|
bf772b7c55 | ||
|
|
29b04b66eb | ||
|
|
044c8ee475 | ||
|
|
ca499115ac | ||
|
|
d7898360e3 | ||
|
|
fcd197934a | ||
|
|
768661928e | ||
|
|
18cd1cf07f | ||
|
|
41f15b03bb | ||
|
|
5c887bfc59 | ||
|
|
430d777c5c | ||
|
|
5f129fb4db | ||
|
|
7404fba5a3 | ||
|
|
54ca518553 | ||
|
|
72c8b8426d | ||
|
|
6dc3d01674 | ||
|
|
df2cfa40b3 | ||
|
|
e101a78791 | ||
|
|
aaa9fb129c | ||
|
|
23d7e639ca | ||
|
|
4ef23ed0e9 | ||
|
|
ff35cce127 | ||
|
|
0951b602b7 | ||
|
|
57055be6fb | ||
|
|
c6743730aa | ||
|
|
780c5658d0 | ||
|
|
a9e8a01bb6 | ||
|
|
861121144c | ||
|
|
d7fcea74b4 | ||
|
|
44b429ca20 | ||
|
|
c91b100bc1 | ||
|
|
90df30f4d7 | ||
|
|
2b6ded9fd4 | ||
|
|
38c2c00c86 | ||
|
|
678057d727 | ||
|
|
ae94009382 | ||
|
|
fd93a35b72 | ||
|
|
12fa3ac343 | ||
|
|
422b339af8 | ||
|
|
1d155b2fe0 | ||
|
|
131a351f3f | ||
|
|
a4c2fa8aec | ||
|
|
fe4f619973 | ||
|
|
80fc5dec07 | ||
|
|
a847ae5f39 | ||
|
|
9b7ce457a5 | ||
|
|
d2031ba384 | ||
|
|
e9f3d8ec95 | ||
|
|
22642605ec | ||
|
|
30fddaf53a | ||
|
|
c833514757 | ||
|
|
97a998a3b9 | ||
|
|
31ee95250c | ||
|
|
689ecc40ad | ||
|
|
3bef9a4200 | ||
|
|
cd1e9dde15 | ||
|
|
16e92db234 | ||
|
|
e0d9f8537a | ||
|
|
6349a171b5 | ||
|
|
9a76e75ee9 | ||
|
|
55d97d82fd | ||
|
|
9e98ed45dd | ||
|
|
53bd564298 | ||
|
|
3e32e71af4 | ||
|
|
d750412e0f | ||
|
|
378c4dc84a | ||
|
|
7761d0aba7 | ||
|
|
efb1b5437a | ||
|
|
8154a79420 | ||
|
|
01b2527e0f | ||
|
|
0c9b113290 | ||
|
|
f632f2b577 | ||
|
|
22ff7377ea | ||
|
|
f3e8ce8de0 | ||
|
|
183ae70246 | ||
|
|
e20dd00d29 | ||
|
|
e0a20311d5 | ||
|
|
b9cc1c80af | ||
|
|
9a7a469ed6 | ||
|
|
00264207ed | ||
|
|
992f251a6b | ||
|
|
995aea5740 | ||
|
|
4c977a0c9c | ||
|
|
08b4d9121d | ||
|
|
31503e610b | ||
|
|
62926245a0 | ||
|
|
f337d284e8 | ||
|
|
734a2679ef | ||
|
|
0fb426ac45 | ||
|
|
39ce344c9b | ||
|
|
c1e27b4092 | ||
|
|
300ed8061f | ||
|
|
4352645f3c | ||
|
|
fabbe8137d | ||
|
|
0c7bd64b48 | ||
|
|
2cb19a34cf | ||
|
|
5b08b4714f | ||
|
|
e40f898bb2 | ||
|
|
9a8bd7b482 | ||
|
|
720a2f56ad | ||
|
|
e597e01e8e | ||
|
|
49d470588c | ||
|
|
e9078c4612 | ||
|
|
30e5c27b11 | ||
|
|
a9a92dfea0 | ||
|
|
f4cbe28532 | ||
|
|
06717ec356 | ||
|
|
068d7d7fdf | ||
|
|
df2eea3985 | ||
|
|
f5bde33adc | ||
|
|
555df00917 | ||
|
|
c0719a5d9e | ||
|
|
ea3365232f | ||
|
|
898fdf7606 | ||
|
|
24adee99f8 | ||
|
|
7b0b811db1 | ||
|
|
ce4647d990 |
No files matched your search
@@ -740,7 +740,8 @@ jobs:
|
|||||||
echo "version=$(grep -o "org.robolectric:robolectric:[0-9.]*" app/build.gradle | cut -d: -f3)" >> "$GITHUB_OUTPUT"
|
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.
|
# Robolectric downloads these from Maven Central on first use without retrying, and 429s fail whole test classes.
|
||||||
# The cache path sits beside the workspace because runner homes are at different depths from it, and
|
# 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.
|
# actions/cache stores paths relative to the workspace. It is passed as an absolute path: the save action rejects
|
||||||
|
# "..". Runners that keep their own ~/.m2 skip the cache.
|
||||||
- name: Place Robolectric's Android jars beside the workspace
|
- name: Place Robolectric's Android jars beside the workspace
|
||||||
id: robolectric-jars
|
id: robolectric-jars
|
||||||
run: |
|
run: |
|
||||||
@@ -751,7 +752,9 @@ jobs:
|
|||||||
echo "cache=false" >> "$GITHUB_OUTPUT"
|
echo "cache=false" >> "$GITHUB_OUTPUT"
|
||||||
else
|
else
|
||||||
mkdir -p "$jars" "$(dirname "$m2")"
|
mkdir -p "$jars" "$(dirname "$m2")"
|
||||||
ln -sfn "$(cd "$jars" && pwd)" "$m2"
|
jars=$(cd "$jars" && pwd)
|
||||||
|
ln -sfn "$jars" "$m2"
|
||||||
|
echo "path=$jars" >> "$GITHUB_OUTPUT"
|
||||||
echo "cache=true" >> "$GITHUB_OUTPUT"
|
echo "cache=true" >> "$GITHUB_OUTPUT"
|
||||||
fi
|
fi
|
||||||
- name: Restore Robolectric's Android jars
|
- name: Restore Robolectric's Android jars
|
||||||
@@ -759,7 +762,7 @@ jobs:
|
|||||||
if: steps.robolectric-jars.outputs.cache == 'true'
|
if: steps.robolectric-jars.outputs.cache == 'true'
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@v4
|
||||||
with:
|
with:
|
||||||
path: ../robolectric-jars
|
path: ${{ steps.robolectric-jars.outputs.path }}
|
||||||
key: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-${{ github.run_id }}
|
key: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-${{ github.run_id }}
|
||||||
restore-keys: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-
|
restore-keys: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-
|
||||||
- name: Count the restored Robolectric jars
|
- name: Count the restored Robolectric jars
|
||||||
@@ -773,7 +776,16 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
mkdir -p app/build
|
mkdir -p app/build
|
||||||
./gradlew testReleaseUnitTest --console=plain --info --stacktrace -Drobolectric.logging=stderr -PndkVersion="$NDK_VERSION" 2>&1 | tee app/build/unit-tests.log
|
# A Maven 429 fails every test class that needs the missing jar. The jars an attempt did get stay for the next.
|
||||||
|
for wait in 60 180 0; do
|
||||||
|
status=0
|
||||||
|
./gradlew testReleaseUnitTest --console=plain --info --stacktrace -Drobolectric.logging=stderr -PndkVersion="$NDK_VERSION" 2>&1 | tee app/build/unit-tests.log || status=$?
|
||||||
|
if [ "$status" = 0 ] || [ "$wait" = 0 ] || ! grep -Eq '^[[:space:]]*(Caused by: org\.gradle\.internal\.resource\.transport\.http\.HttpErrorStatusCodeException: Could not GET .*https://repo\.maven\.apache\.org/.*Received status code 429 from server|Caused by: java\.io\.IOException: Server returned HTTP response code: 429 for URL: https://repo\.maven\.apache\.org/)' app/build/unit-tests.log; then
|
||||||
|
exit "$status"
|
||||||
|
fi
|
||||||
|
echo "::warning::Maven Central answered 429; running the unit tests again in ${wait}s"
|
||||||
|
sleep "$wait"
|
||||||
|
done
|
||||||
|
|
||||||
# actions/cache only saves when the job succeeds, so a run whose tests died on a Maven 429 never filled the cache.
|
# 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.
|
# Save the complete jars even after a failed test step, when this run added some; a partial download is dropped first.
|
||||||
@@ -800,7 +812,7 @@ jobs:
|
|||||||
if: always() && steps.robolectric-jars-final.outputs.save == 'true'
|
if: always() && steps.robolectric-jars-final.outputs.save == 'true'
|
||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@v4
|
||||||
with:
|
with:
|
||||||
path: ../robolectric-jars
|
path: ${{ steps.robolectric-jars.outputs.path }}
|
||||||
key: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-${{ github.run_id }}
|
key: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-${{ github.run_id }}
|
||||||
|
|
||||||
- name: Upload unit test diagnostics
|
- name: Upload unit test diagnostics
|
||||||
|
|||||||
@@ -107,6 +107,18 @@ DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. V
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><b>Recomps</b></summary>
|
||||||
|
|
||||||
|
- The Recomps tab lists the community catalogs below, read straight from their sites. Each entry shows which catalog it came from.
|
||||||
|
- [Decomp Buddy](https://decompbuddy.com) ([TanookiStudios/decomp-buddy](https://github.com/TanookiStudios/decomp-buddy), GPL-3.0) by Maddie at [Tanooki Studios](https://tanookistudios.com): its `catalog.json` and `plans.json` supply most entries, their exact release files, programs and scanned checksums, and the game files each needs. Matching a PC port to a Steam, GOG or Epic install follows its `src/stores.js` title rules, and arm64 Linux files are found the way its `armSibling` finds them.
|
||||||
|
- [Recomp Launcher](https://recomplauncher.com) ([elripalda/RecompLauncher](https://github.com/elripalda/RecompLauncher), GPL-3.0) by [@elripalda](https://github.com/elripalda), [@Xarishark](https://github.com/Xarishark) and contributors: its `pc-catalog.json` supplies the Windows and Linux recomps, their release pins and checksums, start programs, setup notes and the game data each needs.
|
||||||
|
- A PC game's Steam, GOG and Epic IDs come from [Wikidata](https://www.wikidata.org) (CC0), by the IGDB slug Recomp Launcher gives, and GOG product slugs from GOG's public products API.
|
||||||
|
- [Recompa](https://recompa.app) ([kalasyan/recompa](https://github.com/kalasyan/recompa), GPL-3.0) by [@kalasyan](https://github.com/kalasyan): its `index.json` supplies the Android ports, their APK checksums, package names and signing certificates, and the ROMs or files each needs.
|
||||||
|
- Every game's build is downloaded from its own developers' releases and keeps its own licence. DroidDeck ships no ROMs or game files.
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary><b>Audio, video and HUD</b></summary>
|
<summary><b>Audio, video and HUD</b></summary>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.droiddeck.launcher.ui
|
package com.droiddeck.launcher.ui
|
||||||
|
|
||||||
|
import com.droiddeck.launcher.runtime.RecompData
|
||||||
|
import com.droiddeck.launcher.stores.Store
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
@@ -70,6 +72,7 @@ internal val previewCases: List<PreviewCase> = listOf(
|
|||||||
PreviewCase("library-empty", storesLoaded) { Launcher("games", games = emptyList()) },
|
PreviewCase("library-empty", storesLoaded) { Launcher("games", games = emptyList()) },
|
||||||
PreviewCase("stores", storesLoaded) { Launcher("stores") },
|
PreviewCase("stores", storesLoaded) { Launcher("stores") },
|
||||||
PreviewCase("downloads") { Launcher("downloads") },
|
PreviewCase("downloads") { Launcher("downloads") },
|
||||||
|
PreviewCase("recomps") { RecompsTab() },
|
||||||
PreviewCase("settings") { Launcher("setup") },
|
PreviewCase("settings") { Launcher("setup") },
|
||||||
PreviewCase("runtime-missing") { Launcher("setup", ready = false) },
|
PreviewCase("runtime-missing") { Launcher("setup", ready = false) },
|
||||||
PreviewCase("session-menu-controller") { SessionMenu(SessionDrawerPage.CONTROLLER) },
|
PreviewCase("session-menu-controller") { SessionMenu(SessionDrawerPage.CONTROLLER) },
|
||||||
@@ -81,3 +84,34 @@ internal val previewCases: List<PreviewCase> = listOf(
|
|||||||
PreviewCase("session-menu-docked-display") { DockedMenu(SessionDrawerPage.DISPLAY) },
|
PreviewCase("session-menu-docked-display") { DockedMenu(SessionDrawerPage.DISPLAY) },
|
||||||
PreviewCase("bottom-panel-bar") { BottomPanelBar() },
|
PreviewCase("bottom-panel-bar") { BottomPanelBar() },
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/** The Recomps tab with one recomp installed, one game installed from Steam, one owned on GOG and an Android port. */
|
||||||
|
@Composable
|
||||||
|
private fun RecompsTab(): Unit {
|
||||||
|
androidx.compose.runtime.remember {
|
||||||
|
fun entry(id: String, name: String, game: String, origin: String, platform: com.droiddeck.launcher.runtime.RecompCatalog.Platform,
|
||||||
|
needs: String, sources: List<String>) =
|
||||||
|
com.droiddeck.launcher.runtime.RecompCatalog.Entry(id, name, game, origin, if (origin == "PC") "port" else "recomp", "o/$id", "", "",
|
||||||
|
null, listOf(com.droiddeck.launcher.runtime.RecompCatalog.Build(platform, Regex("x"))),
|
||||||
|
com.droiddeck.launcher.runtime.RecompCatalog.Data(com.droiddeck.launcher.runtime.RecompCatalog.DataKind.ROM, needs), sources)
|
||||||
|
val list = listOf(
|
||||||
|
entry("zelda64recomp", "Zelda 64: Recompiled", "The Legend of Zelda: Majora's Mask", "N64", com.droiddeck.launcher.runtime.RecompCatalog.Platform.LINUX_ARM64, "Majora's Mask (USA) N64 ROM", listOf("recomp-launcher")),
|
||||||
|
entry("ironwail", "Ironwail", "Quake", "PC", com.droiddeck.launcher.runtime.RecompCatalog.Platform.LINUX_X64, "Quake's id1 folder", listOf("recomp-launcher")),
|
||||||
|
entry("fallout2-ce", "Fallout 2 Community Edition", "Fallout 2", "PC", com.droiddeck.launcher.runtime.RecompCatalog.Platform.WINDOWS_X64, "Fallout 2's master.dat", listOf("recomp-launcher", "recompa")),
|
||||||
|
entry("shipwright", "Ship of Harkinian", "The Legend of Zelda: Ocarina of Time", "N64", com.droiddeck.launcher.runtime.RecompCatalog.Platform.ANDROID, "Ocarina of Time ROM", listOf("recompa")),
|
||||||
|
)
|
||||||
|
val states: Map<String, RecompData.State> = mapOf(
|
||||||
|
"zelda64recomp" to RecompData.State.BringYourOwn(list[0].data),
|
||||||
|
"ironwail" to RecompData.State.Found(Store.STEAM, java.io.File("/q"), "/root/.local/share/Steam/steamapps/common/Quake", exact = true, checked = true),
|
||||||
|
"fallout2-ce" to RecompData.State.Owned(Store.GOG, null, exact = true),
|
||||||
|
"shipwright" to RecompData.State.BringYourOwn(list[3].data),
|
||||||
|
)
|
||||||
|
val installed = mapOf("zelda64recomp" to com.droiddeck.launcher.runtime.RecompInstaller.Installed(
|
||||||
|
"zelda64recomp", "script:zelda-64-recompiled", "v1.2.1", "", "linux-arm64", java.io.File("/z")))
|
||||||
|
val newer = mapOf("zelda64recomp" to com.droiddeck.launcher.runtime.RecompInstaller.Release("v1.2.2", "", "", "", null))
|
||||||
|
com.droiddeck.launcher.store.RecompsState.show(list, installed, states, newer)
|
||||||
|
}
|
||||||
|
Launcher("recomps")
|
||||||
|
}
|
||||||
|
|
||||||
|
@DroidDeckPreviews @Composable private fun RecompsTabPreview() = RecompsTab()
|
||||||
@@ -33,6 +33,9 @@
|
|||||||
<uses-permission android:name="android.permission.REORDER_TASKS" />
|
<uses-permission android:name="android.permission.REORDER_TASKS" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
|
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
|
||||||
|
<!-- Granted only with adb shell pm grant; lets the agent turn Wireless debugging on where Settings hides it (Quest). -->
|
||||||
|
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"
|
||||||
|
tools:ignore="ProtectedPermissions" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
|||||||
@@ -4130,6 +4130,24 @@ EXPORT ssize_t read(int fd, void *buf, size_t count) {
|
|||||||
return read_input(fd, buf, count);
|
return read_input(fd, buf, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// glibc's fortify failure; bionic (DroidDeck-Bionic preloads this library into its Wine processes) has no
|
||||||
|
// __chk_fail, and a library naming it there cannot be loaded, which stops every Wine program from starting.
|
||||||
|
#if defined(__BIONIC__)
|
||||||
|
[[noreturn]] static void fakeinput_chk_fail(void) { abort(); }
|
||||||
|
#else
|
||||||
|
extern "C" [[noreturn]] void __chk_fail(void);
|
||||||
|
[[noreturn]] static void fakeinput_chk_fail(void) { __chk_fail(); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Programs built with _FORTIFY_SOURCE (Flatpak runtimes among them) call these instead of read, poll
|
||||||
|
* and ppoll, and glibc's versions go straight to the kernel. */
|
||||||
|
EXPORT ssize_t __read_chk(int fd, void *buf, size_t count, size_t buflen) {
|
||||||
|
static auto next_read_chk = reinterpret_cast<ssize_t (*)(int, void *, size_t, size_t)>(dlsym(RTLD_NEXT, "__read_chk"));
|
||||||
|
if (count > buflen) fakeinput_chk_fail();
|
||||||
|
if (next_read_chk && !is_fake_input_fd(fd)) return next_read_chk(fd, buf, count, buflen);
|
||||||
|
return read_input(fd, buf, count);
|
||||||
|
}
|
||||||
|
|
||||||
EXPORT ssize_t readv(int fd, const struct iovec *iov, int iovcnt) {
|
EXPORT ssize_t readv(int fd, const struct iovec *iov, int iovcnt) {
|
||||||
if (!is_fake_input_fd(fd)) return syscall(SYS_readv, fd, iov, iovcnt);
|
if (!is_fake_input_fd(fd)) return syscall(SYS_readv, fd, iov, iovcnt);
|
||||||
if (iovcnt < 0 || iovcnt > IOV_MAX) {
|
if (iovcnt < 0 || iovcnt > IOV_MAX) {
|
||||||
@@ -4378,6 +4396,17 @@ EXPORT int ppoll(struct pollfd *fds, nfds_t nfds,
|
|||||||
return my_ppoll(fds, nfds, timeout, sigmask);
|
return my_ppoll(fds, nfds, timeout, sigmask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EXPORT int __poll_chk(struct pollfd *fds, nfds_t nfds, int timeout, size_t fdslen) {
|
||||||
|
if (fdslen / sizeof(*fds) < nfds) fakeinput_chk_fail();
|
||||||
|
return poll(fds, nfds, timeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
EXPORT int __ppoll_chk(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
|
||||||
|
const sigset_t *sigmask, size_t fdslen) {
|
||||||
|
if (fdslen / sizeof(*fds) < nfds) fakeinput_chk_fail();
|
||||||
|
return ppoll(fds, nfds, timeout, sigmask);
|
||||||
|
}
|
||||||
|
|
||||||
EXPORT int select(int nfds, fd_set *readfds, fd_set *writefds,
|
EXPORT int select(int nfds, fd_set *readfds, fd_set *writefds,
|
||||||
fd_set *exceptfds, struct timeval *timeout) {
|
fd_set *exceptfds, struct timeval *timeout) {
|
||||||
const auto my_select = next_symbol<decltype(&::select)>(Next::select);
|
const auto my_select = next_symbol<decltype(&::select)>(Next::select);
|
||||||
|
|||||||
@@ -27,7 +27,31 @@ VkImageMemoryBarrier bar(VkImage img, VkImageLayout from, VkImageLayout to,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Engine::Engine() = default;
|
Engine::Engine() = default;
|
||||||
Engine::~Engine() { destroyRing(); fg_.destroy(); }
|
Engine::~Engine() { (void)destroy(); }
|
||||||
|
|
||||||
|
bool Engine::destroy() {
|
||||||
|
if (!fg_.destroy()) {
|
||||||
|
DDFG_LOGE("native: retaining the input ring because GPU completion is unknown");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!destroyRing(true)) {
|
||||||
|
DDFG_LOGE("native: could not release the input ring during teardown");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
dev_ = VK_NULL_HANDLE;
|
||||||
|
unavailable_ = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Engine::abandon() {
|
||||||
|
fg_.abandon();
|
||||||
|
ring_[0] = Slot{};
|
||||||
|
ring_[1] = Slot{};
|
||||||
|
dev_ = VK_NULL_HANDLE;
|
||||||
|
queue_ = VK_NULL_HANDLE;
|
||||||
|
phys_ = VK_NULL_HANDLE;
|
||||||
|
unavailable_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
bool Engine::init(const VkTable& table, VkPhysicalDevice phys, VkDevice dev,
|
bool Engine::init(const VkTable& table, VkPhysicalDevice phys, VkDevice dev,
|
||||||
uint32_t queueFamily, VkQueue queue) {
|
uint32_t queueFamily, VkQueue queue) {
|
||||||
@@ -59,15 +83,29 @@ bool Engine::prepare(uint32_t w, uint32_t h, VkFormat fmt) {
|
|||||||
if (unavailable_ || w == 0 || h == 0 || fmt == VK_FORMAT_UNDEFINED) return false;
|
if (unavailable_ || w == 0 || h == 0 || fmt == VK_FORMAT_UNDEFINED) return false;
|
||||||
if (builtW_ == w && builtH_ == h && builtFmt_ == fmt && fg_.valid()) return true;
|
if (builtW_ == w && builtH_ == h && builtFmt_ == fmt && fg_.valid()) return true;
|
||||||
|
|
||||||
|
const bool formatChanged = fmt != builtFmt_;
|
||||||
if (!fg_.onResize(VkExtent2D{w, h}, fmt, false)) {
|
if (!fg_.onResize(VkExtent2D{w, h}, fmt, formatChanged)) {
|
||||||
DDFG_LOGE("native: onResize %ux%u failed; frame generation unavailable", w, h);
|
DDFG_LOGE("native: onResize %ux%u failed; frame generation unavailable", w, h);
|
||||||
unavailable_ = true;
|
unavailable_ = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
destroyRing();
|
bool deviceLost = false;
|
||||||
|
if (!destroyRing(false, &deviceLost)) {
|
||||||
|
DDFG_LOGE("native: could not safely release the previous input ring");
|
||||||
|
unavailable_ = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (deviceLost) {
|
||||||
|
DDFG_LOGE("native: device lost while releasing the input ring");
|
||||||
|
unavailable_ = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
for (Slot& s : ring_) {
|
for (Slot& s : ring_) {
|
||||||
if (!makeSlot(s, w, h, fmt)) { destroyRing(); unavailable_ = true; return false; }
|
if (!makeSlot(s, w, h, fmt)) {
|
||||||
|
destroyRing(true);
|
||||||
|
unavailable_ = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
builtW_ = w; builtH_ = h; builtFmt_ = fmt;
|
builtW_ = w; builtH_ = h; builtFmt_ = fmt;
|
||||||
history_ = 0; curr_ = 0; frames_ = 0;
|
history_ = 0; curr_ = 0; frames_ = 0;
|
||||||
@@ -178,11 +216,37 @@ void Engine::destroySlot(Slot& s) {
|
|||||||
s = Slot{};
|
s = Slot{};
|
||||||
}
|
}
|
||||||
|
|
||||||
void Engine::destroyRing() {
|
bool Engine::destroyRing(bool deviceIdleConfirmed, bool* deviceLost) {
|
||||||
if (dev_ == VK_NULL_HANDLE || !dd_.DeviceWaitIdle) return;
|
if (deviceLost) *deviceLost = false;
|
||||||
if (ring_[0].img || ring_[1].img) dd_.DeviceWaitIdle(dev_);
|
const bool hasResources = ring_[0].img || ring_[0].mem || ring_[0].view ||
|
||||||
destroySlot(ring_[0]); destroySlot(ring_[1]);
|
ring_[1].img || ring_[1].mem || ring_[1].view;
|
||||||
|
if (!hasResources) {
|
||||||
|
history_ = 0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (dev_ == VK_NULL_HANDLE) {
|
||||||
|
DDFG_LOGE("native: cannot release the input ring without a valid device");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!deviceIdleConfirmed) {
|
||||||
|
if (!dd_.DeviceWaitIdle) {
|
||||||
|
DDFG_LOGE("native: cannot release the input ring without vkDeviceWaitIdle");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const VkResult result = dd_.DeviceWaitIdle(dev_);
|
||||||
|
if (result == VK_ERROR_DEVICE_LOST) {
|
||||||
|
if (deviceLost) *deviceLost = true;
|
||||||
|
unavailable_ = true;
|
||||||
|
} else if (result != VK_SUCCESS) {
|
||||||
|
DDFG_LOGE("native: DeviceWaitIdle failed (%d); retaining the input ring", (int)result);
|
||||||
|
unavailable_ = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
destroySlot(ring_[0]);
|
||||||
|
destroySlot(ring_[1]);
|
||||||
history_ = 0;
|
history_ = 0;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -36,13 +36,15 @@ public:
|
|||||||
uint32_t width, uint32_t height);
|
uint32_t width, uint32_t height);
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
|
bool destroy();
|
||||||
|
void abandon();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct Slot { VkImage img = VK_NULL_HANDLE; VkDeviceMemory mem = VK_NULL_HANDLE;
|
struct Slot { VkImage img = VK_NULL_HANDLE; VkDeviceMemory mem = VK_NULL_HANDLE;
|
||||||
VkImageView view = VK_NULL_HANDLE; bool valid = false; };
|
VkImageView view = VK_NULL_HANDLE; bool valid = false; };
|
||||||
bool makeSlot(Slot& s, uint32_t w, uint32_t h, VkFormat fmt);
|
bool makeSlot(Slot& s, uint32_t w, uint32_t h, VkFormat fmt);
|
||||||
void destroySlot(Slot& s);
|
void destroySlot(Slot& s);
|
||||||
void destroyRing();
|
bool destroyRing(bool deviceIdleConfirmed = false, bool* deviceLost = nullptr);
|
||||||
uint32_t memType(uint32_t bits, VkMemoryPropertyFlags props) const;
|
uint32_t memType(uint32_t bits, VkMemoryPropertyFlags props) const;
|
||||||
|
|
||||||
DeviceDispatch dd_{};
|
DeviceDispatch dd_{};
|
||||||
|
|||||||
@@ -6,8 +6,216 @@ static const uint32_t OF3_LUMA_SPV[] = {0x07230203u,0x00010300u,0x0008000bu,0x00
|
|||||||
static const size_t OF3_LUMA_LEN = 481;
|
static const size_t OF3_LUMA_LEN = 481;
|
||||||
static const uint32_t OF3_DOWNSAMPLE_SPV[] = {0x07230203u,0x00010300u,0x0008000bu,0x0000008au,0x00000000u,0x00020011u,0x00000001u,0x00020011u,0x00000032u,0x0006000bu,0x00000001u,0x4c534c47u,0x6474732eu,0x3035342eu,0x00000000u,0x0003000eu,0x00000000u,0x00000001u,0x0006000fu,0x00000005u,0x00000004u,0x6e69616du,0x00000000u,0x0000000du,0x00060010u,0x00000004u,0x00000011u,0x00000010u,0x00000010u,0x00000001u,0x00030003u,0x00000002u,0x000001c2u,0x00040005u,0x00000004u,0x6e69616du,0x00000000u,0x00030005u,0x00000009u,0x00646967u,0x00080005u,0x0000000du,0x475f6c67u,0x61626f6cu,0x766e496cu,0x7461636fu,0x496e6f69u,0x00000044u,0x00030005u,0x00000012u,0x006d6964u,0x00040005u,0x00000016u,0x74734475u,0x00000000u,0x00040005u,0x00000030u,0x44637273u,0x00006d69u,0x00040005u,0x00000034u,0x63725375u,0x00000000u,0x00040005u,0x0000003au,0x65736162u,0x00000000u,0x00030005u,0x00000044u,0x00000068u,0x00030005u,0x0000004au,0x00000061u,0x00030005u,0x00000059u,0x00000062u,0x00030005u,0x00000065u,0x00000063u,0x00030005u,0x00000071u,0x00000064u,0x00040047u,0x0000000du,0x0000000bu,0x0000001cu,0x00030047u,0x00000016u,0x00000019u,0x00040047u,0x00000016u,0x00000021u,0x00000030u,0x00040047u,0x00000016u,0x00000022u,0x00000000u,0x00040047u,0x00000034u,0x00000021u,0x00000020u,0x00040047u,0x00000034u,0x00000022u,0x00000000u,0x00040047u,0x00000089u,0x0000000bu,0x00000019u,0x00020013u,0x00000002u,0x00030021u,0x00000003u,0x00000002u,0x00040015u,0x00000006u,0x00000020u,0x00000001u,0x00040017u,0x00000007u,0x00000006u,0x00000002u,0x00040020u,0x00000008u,0x00000007u,0x00000007u,0x00040015u,0x0000000au,0x00000020u,0x00000000u,0x00040017u,0x0000000bu,0x0000000au,0x00000003u,0x00040020u,0x0000000cu,0x00000001u,0x0000000bu,0x0004003bu,0x0000000cu,0x0000000du,0x00000001u,0x00040017u,0x0000000eu,0x0000000au,0x00000002u,0x00030016u,0x00000013u,0x00000020u,0x00090019u,0x00000014u,0x00000013u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000002u,0x00000003u,0x00040020u,0x00000015u,0x00000000u,0x00000014u,0x0004003bu,0x00000015u,0x00000016u,0x00000000u,0x00020014u,0x00000019u,0x0004002bu,0x0000000au,0x0000001au,0x00000000u,0x00040020u,0x0000001bu,0x00000007u,0x00000006u,0x0004002bu,0x0000000au,0x00000024u,0x00000001u,0x00040017u,0x0000002eu,0x00000013u,0x00000002u,0x00040020u,0x0000002fu,0x00000007u,0x0000002eu,0x00090019u,0x00000031u,0x00000013u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000001u,0x00000000u,0x0003001bu,0x00000032u,0x00000031u,0x00040020u,0x00000033u,0x00000000u,0x00000032u,0x0004003bu,0x00000033u,0x00000034u,0x00000000u,0x0004002bu,0x00000006u,0x00000036u,0x00000000u,0x0004002bu,0x00000013u,0x0000003du,0x40000000u,0x0004002bu,0x00000013u,0x0000003fu,0x3f800000u,0x0004002bu,0x00000013u,0x00000045u,0x3f000000u,0x00040020u,0x00000049u,0x00000007u,0x00000013u,0x0004002bu,0x00000013u,0x00000055u,0x00000000u,0x00040017u,0x00000056u,0x00000013u,0x00000004u,0x0004002bu,0x00000013u,0x00000085u,0x3e800000u,0x0004002bu,0x0000000au,0x00000088u,0x00000010u,0x0006002cu,0x0000000bu,0x00000089u,0x00000088u,0x00000088u,0x00000024u,0x00050036u,0x00000002u,0x00000004u,0x00000000u,0x00000003u,0x000200f8u,0x00000005u,0x0004003bu,0x00000008u,0x00000009u,0x00000007u,0x0004003bu,0x00000008u,0x00000012u,0x00000007u,0x0004003bu,0x0000002fu,0x00000030u,0x00000007u,0x0004003bu,0x0000002fu,0x0000003au,0x00000007u,0x0004003bu,0x0000002fu,0x00000044u,0x00000007u,0x0004003bu,0x00000049u,0x0000004au,0x00000007u,0x0004003bu,0x00000049u,0x00000059u,0x00000007u,0x0004003bu,0x00000049u,0x00000065u,0x00000007u,0x0004003bu,0x00000049u,0x00000071u,0x00000007u,0x0004003du,0x0000000bu,0x0000000fu,0x0000000du,0x0007004fu,0x0000000eu,0x00000010u,0x0000000fu,0x0000000fu,0x00000000u,0x00000001u,0x0004007cu,0x00000007u,0x00000011u,0x00000010u,0x0003003eu,0x00000009u,0x00000011u,0x0004003du,0x00000014u,0x00000017u,0x00000016u,0x00040068u,0x00000007u,0x00000018u,0x00000017u,0x0003003eu,0x00000012u,0x00000018u,0x00050041u,0x0000001bu,0x0000001cu,0x00000009u,0x0000001au,0x0004003du,0x00000006u,0x0000001du,0x0000001cu,0x00050041u,0x0000001bu,0x0000001eu,0x00000012u,0x0000001au,0x0004003du,0x00000006u,0x0000001fu,0x0000001eu,0x000500afu,0x00000019u,0x00000020u,0x0000001du,0x0000001fu,0x000400a8u,0x00000019u,0x00000021u,0x00000020u,0x000300f7u,0x00000023u,0x00000000u,0x000400fau,0x00000021u,0x00000022u,0x00000023u,0x000200f8u,0x00000022u,0x00050041u,0x0000001bu,0x00000025u,0x00000009u,0x00000024u,0x0004003du,0x00000006u,0x00000026u,0x00000025u,0x00050041u,0x0000001bu,0x00000027u,0x00000012u,0x00000024u,0x0004003du,0x00000006u,0x00000028u,0x00000027u,0x000500afu,0x00000019u,0x00000029u,0x00000026u,0x00000028u,0x000200f9u,0x00000023u,0x000200f8u,0x00000023u,0x000700f5u,0x00000019u,0x0000002au,0x00000020u,0x00000005u,0x00000029u,0x00000022u,0x000300f7u,0x0000002cu,0x00000000u,0x000400fau,0x0000002au,0x0000002bu,0x0000002cu,0x000200f8u,0x0000002bu,0x000100fdu,0x000200f8u,0x0000002cu,0x0004003du,0x00000032u,0x00000035u,0x00000034u,0x00040064u,0x00000031u,0x00000037u,0x00000035u,0x0005006Line truncated
|
static const uint32_t OF3_DOWNSAMPLE_SPV[] = {0x07230203u,0x00010300u,0x0008000bu,0x0000008au,0x00000000u,0x00020011u,0x00000001u,0x00020011u,0x00000032u,0x0006000bu,0x00000001u,0x4c534c47u,0x6474732eu,0x3035342eu,0x00000000u,0x0003000eu,0x00000000u,0x00000001u,0x0006000fu,0x00000005u,0x00000004u,0x6e69616du,0x00000000u,0x0000000du,0x00060010u,0x00000004u,0x00000011u,0x00000010u,0x00000010u,0x00000001u,0x00030003u,0x00000002u,0x000001c2u,0x00040005u,0x00000004u,0x6e69616du,0x00000000u,0x00030005u,0x00000009u,0x00646967u,0x00080005u,0x0000000du,0x475f6c67u,0x61626f6cu,0x766e496cu,0x7461636fu,0x496e6f69u,0x00000044u,0x00030005u,0x00000012u,0x006d6964u,0x00040005u,0x00000016u,0x74734475u,0x00000000u,0x00040005u,0x00000030u,0x44637273u,0x00006d69u,0x00040005u,0x00000034u,0x63725375u,0x00000000u,0x00040005u,0x0000003au,0x65736162u,0x00000000u,0x00030005u,0x00000044u,0x00000068u,0x00030005u,0x0000004au,0x00000061u,0x00030005u,0x00000059u,0x00000062u,0x00030005u,0x00000065u,0x00000063u,0x00030005u,0x00000071u,0x00000064u,0x00040047u,0x0000000du,0x0000000bu,0x0000001cu,0x00030047u,0x00000016u,0x00000019u,0x00040047u,0x00000016u,0x00000021u,0x00000030u,0x00040047u,0x00000016u,0x00000022u,0x00000000u,0x00040047u,0x00000034u,0x00000021u,0x00000020u,0x00040047u,0x00000034u,0x00000022u,0x00000000u,0x00040047u,0x00000089u,0x0000000bu,0x00000019u,0x00020013u,0x00000002u,0x00030021u,0x00000003u,0x00000002u,0x00040015u,0x00000006u,0x00000020u,0x00000001u,0x00040017u,0x00000007u,0x00000006u,0x00000002u,0x00040020u,0x00000008u,0x00000007u,0x00000007u,0x00040015u,0x0000000au,0x00000020u,0x00000000u,0x00040017u,0x0000000bu,0x0000000au,0x00000003u,0x00040020u,0x0000000cu,0x00000001u,0x0000000bu,0x0004003bu,0x0000000cu,0x0000000du,0x00000001u,0x00040017u,0x0000000eu,0x0000000au,0x00000002u,0x00030016u,0x00000013u,0x00000020u,0x00090019u,0x00000014u,0x00000013u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000002u,0x00000003u,0x00040020u,0x00000015u,0x00000000u,0x00000014u,0x0004003bu,0x00000015u,0x00000016u,0x00000000u,0x00020014u,0x00000019u,0x0004002bu,0x0000000au,0x0000001au,0x00000000u,0x00040020u,0x0000001bu,0x00000007u,0x00000006u,0x0004002bu,0x0000000au,0x00000024u,0x00000001u,0x00040017u,0x0000002eu,0x00000013u,0x00000002u,0x00040020u,0x0000002fu,0x00000007u,0x0000002eu,0x00090019u,0x00000031u,0x00000013u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000001u,0x00000000u,0x0003001bu,0x00000032u,0x00000031u,0x00040020u,0x00000033u,0x00000000u,0x00000032u,0x0004003bu,0x00000033u,0x00000034u,0x00000000u,0x0004002bu,0x00000006u,0x00000036u,0x00000000u,0x0004002bu,0x00000013u,0x0000003du,0x40000000u,0x0004002bu,0x00000013u,0x0000003fu,0x3f800000u,0x0004002bu,0x00000013u,0x00000045u,0x3f000000u,0x00040020u,0x00000049u,0x00000007u,0x00000013u,0x0004002bu,0x00000013u,0x00000055u,0x00000000u,0x00040017u,0x00000056u,0x00000013u,0x00000004u,0x0004002bu,0x00000013u,0x00000085u,0x3e800000u,0x0004002bu,0x0000000au,0x00000088u,0x00000010u,0x0006002cu,0x0000000bu,0x00000089u,0x00000088u,0x00000088u,0x00000024u,0x00050036u,0x00000002u,0x00000004u,0x00000000u,0x00000003u,0x000200f8u,0x00000005u,0x0004003bu,0x00000008u,0x00000009u,0x00000007u,0x0004003bu,0x00000008u,0x00000012u,0x00000007u,0x0004003bu,0x0000002fu,0x00000030u,0x00000007u,0x0004003bu,0x0000002fu,0x0000003au,0x00000007u,0x0004003bu,0x0000002fu,0x00000044u,0x00000007u,0x0004003bu,0x00000049u,0x0000004au,0x00000007u,0x0004003bu,0x00000049u,0x00000059u,0x00000007u,0x0004003bu,0x00000049u,0x00000065u,0x00000007u,0x0004003bu,0x00000049u,0x00000071u,0x00000007u,0x0004003du,0x0000000bu,0x0000000fu,0x0000000du,0x0007004fu,0x0000000eu,0x00000010u,0x0000000fu,0x0000000fu,0x00000000u,0x00000001u,0x0004007cu,0x00000007u,0x00000011u,0x00000010u,0x0003003eu,0x00000009u,0x00000011u,0x0004003du,0x00000014u,0x00000017u,0x00000016u,0x00040068u,0x00000007u,0x00000018u,0x00000017u,0x0003003eu,0x00000012u,0x00000018u,0x00050041u,0x0000001bu,0x0000001cu,0x00000009u,0x0000001au,0x0004003du,0x00000006u,0x0000001du,0x0000001cu,0x00050041u,0x0000001bu,0x0000001eu,0x00000012u,0x0000001au,0x0004003du,0x00000006u,0x0000001fu,0x0000001eu,0x000500afu,0x00000019u,0x00000020u,0x0000001du,0x0000001fu,0x000400a8u,0x00000019u,0x00000021u,0x00000020u,0x000300f7u,0x00000023u,0x00000000u,0x000400fau,0x00000021u,0x00000022u,0x00000023u,0x000200f8u,0x00000022u,0x00050041u,0x0000001bu,0x00000025u,0x00000009u,0x00000024u,0x0004003du,0x00000006u,0x00000026u,0x00000025u,0x00050041u,0x0000001bu,0x00000027u,0x00000012u,0x00000024u,0x0004003du,0x00000006u,0x00000028u,0x00000027u,0x000500afu,0x00000019u,0x00000029u,0x00000026u,0x00000028u,0x000200f9u,0x00000023u,0x000200f8u,0x00000023u,0x000700f5u,0x00000019u,0x0000002au,0x00000020u,0x00000005u,0x00000029u,0x00000022u,0x000300f7u,0x0000002cu,0x00000000u,0x000400fau,0x0000002au,0x0000002bu,0x0000002cu,0x000200f8u,0x0000002bu,0x000100fdu,0x000200f8u,0x0000002cu,0x0004003du,0x00000032u,0x00000035u,0x00000034u,0x00040064u,0x00000031u,0x00000037u,0x00000035u,0x0005006Line truncated
|
||||||
static const size_t OF3_DOWNSAMPLE_LEN = 753;
|
static const size_t OF3_DOWNSAMPLE_LEN = 753;
|
||||||
static const uint32_t OF3_FLOW_SPV[] = {0x07230203u,0x00010300u,0x0008000bu,0x00000185u,0x00000000u,0x00020011u,0x00000001u,0x00020011u,0x00000032u,0x0006000bu,0x00000001u,0x4c534c47u,0x6474732eu,0x3035342eu,0x00000000u,0x0003000eu,0x00000000u,0x00000001u,0x0006000fu,0x00000005u,0x00000004u,0x6e69616du,0x00000000u,0x0000000du,0x00060010u,0x00000004u,0x00000011u,0x00000010u,0x00000010u,0x00000001u,0x00030003u,0x00000002u,0x000001c2u,0x00040005u,0x00000004u,0x6e69616du,0x00000000u,0x00030005u,0x00000009u,0x00646967u,0x00080005u,0x0000000du,0x475f6c67u,0x61626f6cu,0x766e496cu,0x7461636fu,0x496e6f69u,0x00000044u,0x00030005u,0x00000012u,0x006d6964u,0x00040005u,0x00000016u,0x6f6c4675u,0x00000077u,0x00040005u,0x00000030u,0x44766e69u,0x00006d69u,0x00030005u,0x00000036u,0x00007675u,0x00040005u,0x0000003fu,0x654c6f74u,0x006c6576u,0x00030005u,0x00000040u,0x00000055u,0x00060006u,0x00000040u,0x00000000u,0x776f6c66u,0x6c616353u,0x00000065u,0x00050006u,0x00000040u,0x00000001u,0x6576656cu,0x0000006cu,0x00050006u,0x00000040u,0x00000002u,0x30646170u,0x00000000u,0x00050006u,0x00000040u,0x00000003u,0x31646170u,0x00000000u,0x00030005u,0x00000042u,0x00000000u,0x00050005u,0x0000004au,0x64657270u,0x6c6c7546u,0x00000000u,0x00050005u,0x0000004eu,0x65725075u,0x74636964u,0x0000726fu,0x00050005u,0x00000055u,0x64657270u,0x6576654cu,0x0000006cu,0x00040005u,0x00000059u,0x74736562u,0x00646153u,0x00050005u,0x0000005bu,0x74736562u,0x70736944u,0x00000000u,0x00030005u,0x0000005du,0x00007973u,0x00030005u,0x00000067u,0x00007873u,0x00040005u,0x0000006fu,0x646e6163u,0x00000000u,0x00030005u,0x00000077u,0x00646173u,0x00030005u,0x00000078u,0x00007962u,0x00030005u,0x00000081u,0x00007862u,0x00030005u,0x00000089u,0x00006f62u,0x00030005u,0x0000008fu,0x00000070u,0x00050005u,0x00000090u,0x6d754c75u,0x65725061u,0x00000076u,0x00030005u,0x00000099u,0x00000063u,0x00050005u,0x0000009au,0x6d754c75u,0x72754361u,0x00000072u,0x00040005u,0x000000cau,0x43646173u,0x00000000u,0x00040005u,0x000000ccu,0x58646173u,0x0000006du,0x00040005u,0x000000cdu,0x58646173u,0x00000070u,0x00040005u,0x000000ceu,0x59646173u,0x0000006du,0x00040005u,0x000000cfu,0x59646173u,0x00000070u,0x00030005u,0x000000d0u,0x00007962u,0x00030005u,0x000000d8u,0x00007862u,0x00030005u,0x000000e0u,0x00006f62u,0x00030005u,0x000000e6u,0x00000070u,0x00040005u,0x000000efu,0x646e6163u,0x00006d58u,0x00040005u,0x000000f4u,0x646e6163u,0x00007058u,0x00040005u,0x000000f8u,0x646e6163u,0x00006d59u,0x00040005u,0x000000fcu,0x646e6163u,0x00007059u,0x00030005u,0x00000148u,0x00007864u,0x00030005u,0x00000149u,0x00007964u,0x00040005u,0x0000014au,0x6f6e6564u,0x0000586du,0x00040005u,0x00000152u,0x6f6e6564u,0x0000596du,0x00050005u,0x00000176u,0x776f6c66u,0x6c6c7546u,0x00000000u,0x00040047u,0x0000000du,0x0000000bu,0x0000001cu,0x00030047u,0x00000016u,0x00000019u,0x00040047u,0x00000016u,0x00000021u,0x00000030u,0x00040047u,0x00000016u,0x00000022u,0x00000000u,0x00030047u,0x00000040u,0x00000002u,0x00050048u,0x00000040u,0x00000000u,0x00000023u,0x00000000u,0x00050048u,0x00000040u,0x00000001u,0x00000023u,0x00000004u,0x00050048u,0x00000040u,0x00000002u,0x00000023u,0x00000008u,0x00050048u,0x00000040u,0x00000003u,0x00000023u,0x0000000cu,0x00040047u,0x00000042u,0x00000021u,0x00000000u,0x00040047u,0x00000042u,0x00000022u,0x00000000u,0x00040047u,0x0000004eu,0x00000021u,0x00000022u,0x00040047u,0x0000004eu,0x00000022u,0x00000000u,0x00040047u,0x00000090u,0x00000021u,0x00000020u,0x00040047u,0x00000090u,0x00000022u,0x00000000u,0x00040047u,0x0000009au,0x00000021u,0x00000021u,0x00040047u,0x0000009au,0x00000022u,0x00000000u,0x00040047u,0x00000184u,0x0000000bu,0x00000019u,0x00020013u,0x00000002u,0x00030021u,0x00000003u,0x00000002u,0x00040015u,0x00000006u,0x00000020u,0x00000001u,0x00040017u,0x00000007u,0x00000006u,0x00000002u,0x00040020u,0x00000008u,0x00000007u,0x00000007u,0x00040015u,0x0000000au,0x00000020u,0x00000000u,0x00040017u,0x0000000bu,0x0000000au,0x00000003u,0x00040020u,0x0000000cu,0x00000001u,0x0000000bu,0x0004003bu,0x0000000cu,0x0000000du,0x00000001u,0x00040017u,0x0000000eu,0x0000000au,0x00000002u,0x00030016u,0x00000013u,0x00000020u,0x00090019u,0x00000014u,0x00000013u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000002u,0x00000002u,0x00040020u,0x00000015u,0x00000000u,0x00000014u,0x0004003bu,0x00000015u,0x00000016u,0x00000000u,0x00020014u,0x00000019u,0x0004002bu,0x0000000au,0x0000001au,0x00000000u,0x00040020u,0x0000001bu,0x00000007u,0x00000006u,0x0004002bu,0x0000000au,0x00000024u,0x00000001u,0x00040017u,0x0000002eu,0x00000013u,0x00000002u,0x00040020u,0x0000002fu,0x00000007u,0x0000002eu,0x0004002bu,0x00000013u,0x00000031u,0x3f800000u,0x0004002bu,0x00000013u,0x00000039u,0x3f000000u,0x00040020u,0x0000003eu,0x00000007u,0x00000013u,0x0006001eu,0x00000040u,0x00000013u,0x0000000au,0x0000000au,0x0000000au,0x00040020u,0x00000041u,0x00000002u,0x00000040u,0x0004003bu,0x00000041u,0x00000042u,0x00000002u,0x0004002bu,0x00000006u,0x00000043u,0x00000001u,0x00040020u,0x00000044u,0x00000002u,0x0000000au,0x00090019u,0x0000004bu,0x00000013u,0x00000001u,0x0Line truncated
|
static const uint32_t OF3_FLOW_SPV[] = {
|
||||||
static const size_t OF3_FLOW_LEN = 2253;
|
0x07230203u,0x00010300u,0x0008000bu,0x000001feu,0x00000000u,0x00020011u,0x00000001u,0x00020011u,
|
||||||
|
0x00000032u,0x0006000bu,0x00000001u,0x4c534c47u,0x6474732eu,0x3035342eu,0x00000000u,0x0003000eu,
|
||||||
|
0x00000000u,0x00000001u,0x0006000fu,0x00000005u,0x00000004u,0x6e69616du,0x00000000u,0x0000000du,
|
||||||
|
0x00060010u,0x00000004u,0x00000011u,0x00000010u,0x00000010u,0x00000001u,0x00030003u,0x00000002u,
|
||||||
|
0x000001c2u,0x00040005u,0x00000004u,0x6e69616du,0x00000000u,0x00080005u,0x0000000du,0x475f6c67u,
|
||||||
|
0x61626f6cu,0x766e496cu,0x7461636fu,0x496e6f69u,0x00000044u,0x00040005u,0x00000016u,0x6f6c4675u,
|
||||||
|
0x00000077u,0x00030005u,0x00000040u,0x00000055u,0x00060006u,0x00000040u,0x00000000u,0x776f6c66u,
|
||||||
|
0x6c616353u,0x00000065u,0x00050006u,0x00000040u,0x00000001u,0x6576656cu,0x0000006cu,0x00050006u,
|
||||||
|
0x00000040u,0x00000002u,0x30646170u,0x00000000u,0x00050006u,0x00000040u,0x00000003u,0x31646170u,
|
||||||
|
0x00000000u,0x00030005u,0x00000042u,0x00000000u,0x00050005u,0x0000004eu,0x65725075u,0x74636964u,
|
||||||
|
0x0000726fu,0x00050005u,0x0000007bu,0x76657270u,0x63746150u,0x00000068u,0x00050005u,0x0000007du,
|
||||||
|
0x6d754c75u,0x65725061u,0x00000076u,0x00050005u,0x000000c9u,0x6d754c75u,0x72754361u,0x00000072u,
|
||||||
|
0x00040047u,0x0000000du,0x0000000bu,0x0000001cu,0x00030047u,0x00000016u,0x00000019u,0x00040047u,
|
||||||
|
0x00000016u,0x00000021u,0x00000030u,0x00040047u,0x00000016u,0x00000022u,0x00000000u,0x00030047u,
|
||||||
|
0x00000040u,0x00000002u,0x00050048u,0x00000040u,0x00000000u,0x00000023u,0x00000000u,0x00050048u,
|
||||||
|
0x00000040u,0x00000001u,0x00000023u,0x00000004u,0x00050048u,0x00000040u,0x00000002u,0x00000023u,
|
||||||
|
0x00000008u,0x00050048u,0x00000040u,0x00000003u,0x00000023u,0x0000000cu,0x00040047u,0x00000042u,
|
||||||
|
0x00000021u,0x00000000u,0x00040047u,0x00000042u,0x00000022u,0x00000000u,0x00040047u,0x0000004eu,
|
||||||
|
0x00000021u,0x00000022u,0x00040047u,0x0000004eu,0x00000022u,0x00000000u,0x00040047u,0x0000007du,
|
||||||
|
0x00000021u,0x00000020u,0x00040047u,0x0000007du,0x00000022u,0x00000000u,0x00040047u,0x000000c9u,
|
||||||
|
0x00000021u,0x00000021u,0x00040047u,0x000000c9u,0x00000022u,0x00000000u,0x00040047u,0x000001b3u,
|
||||||
|
0x0000000bu,0x00000019u,0x00020013u,0x00000002u,0x00030021u,0x00000003u,0x00000002u,0x00040015u,
|
||||||
|
0x00000006u,0x00000020u,0x00000001u,0x00040017u,0x00000007u,0x00000006u,0x00000002u,0x00040015u,
|
||||||
|
0x0000000au,0x00000020u,0x00000000u,0x00040017u,0x0000000bu,0x0000000au,0x00000003u,0x00040020u,
|
||||||
|
0x0000000cu,0x00000001u,0x0000000bu,0x0004003bu,0x0000000cu,0x0000000du,0x00000001u,0x00040017u,
|
||||||
|
0x0000000eu,0x0000000au,0x00000002u,0x00030016u,0x00000013u,0x00000020u,0x00090019u,0x00000014u,
|
||||||
|
0x00000013u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000002u,0x00000002u,0x00040020u,
|
||||||
|
0x00000015u,0x00000000u,0x00000014u,0x0004003bu,0x00000015u,0x00000016u,0x00000000u,0x00020014u,
|
||||||
|
0x00000019u,0x0004002bu,0x0000000au,0x0000001au,0x00000000u,0x0004002bu,0x0000000au,0x00000024u,
|
||||||
|
0x00000001u,0x00040017u,0x0000002eu,0x00000013u,0x00000002u,0x0004002bu,0x00000013u,0x00000031u,
|
||||||
|
0x3f800000u,0x0004002bu,0x00000013u,0x00000039u,0x3f000000u,0x00040020u,0x0000003eu,0x00000007u,
|
||||||
|
0x00000013u,0x0006001eu,0x00000040u,0x00000013u,0x0000000au,0x0000000au,0x0000000au,0x00040020u,
|
||||||
|
0x00000041u,0x00000002u,0x00000040u,0x0004003bu,0x00000041u,0x00000042u,0x00000002u,0x0004002bu,
|
||||||
|
0x00000006u,0x00000043u,0x00000001u,0x00040020u,0x00000044u,0x00000002u,0x0000000au,0x00090019u,
|
||||||
|
0x0000004bu,0x00000013u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000001u,0x00000000u,
|
||||||
|
0x0003001bu,0x0000004cu,0x0000004bu,0x00040020u,0x0000004du,0x00000000u,0x0000004cu,0x0004003bu,
|
||||||
|
0x0000004du,0x0000004eu,0x00000000u,0x0004002bu,0x00000013u,0x00000051u,0x00000000u,0x00040017u,
|
||||||
|
0x00000052u,0x00000013u,0x00000004u,0x0004002bu,0x00000006u,0x0000005au,0xffffffffu,0x0004002bu,
|
||||||
|
0x00000006u,0x0000006du,0x00000003u,0x0004002bu,0x0000000au,0x00000078u,0x00000009u,0x0004001cu,
|
||||||
|
0x00000079u,0x00000013u,0x00000078u,0x00040020u,0x0000007au,0x00000007u,0x00000079u,0x0004003bu,
|
||||||
|
0x0000004du,0x0000007du,0x00000000u,0x0004002bu,0x00000013u,0x0000008cu,0x7f7fffffu,0x0004002bu,
|
||||||
|
0x00000006u,0x00000090u,0xfffffffdu,0x0004003bu,0x0000004du,0x000000c9u,0x00000000u,0x0004002bu,
|
||||||
|
0x00000013u,0x000000deu,0x3bc49ba6u,0x0004002bu,0x00000013u,0x00000120u,0xbf800000u,0x0005002cu,
|
||||||
|
0x0000002eu,0x00000121u,0x00000120u,0x00000051u,0x0005002cu,0x0000002eu,0x00000125u,0x00000031u,
|
||||||
|
0x00000051u,0x0005002cu,0x0000002eu,0x00000129u,0x00000051u,0x00000120u,0x0005002cu,0x0000002eu,
|
||||||
|
0x0000012du,0x00000051u,0x00000031u,0x0004002bu,0x00000013u,0x0000017bu,0x40000000u,0x0004002bu,
|
||||||
|
0x00000013u,0x00000189u,0x358637bdu,0x0004002bu,0x00000013u,0x00000193u,0xbf000000u,0x0004002bu,
|
||||||
|
0x0000000au,0x000001b2u,0x00000010u,0x0006002cu,0x0000000bu,0x000001b3u,0x000001b2u,0x000001b2u,
|
||||||
|
0x00000024u,0x0005002cu,0x0000002eu,0x000001efu,0x00000031u,0x00000031u,0x0005002cu,0x0000002eu,
|
||||||
|
0x000001f0u,0x00000039u,0x00000039u,0x00040017u,0x000001fbu,0x00000019u,0x00000002u,0x00050036u,
|
||||||
|
0x00000002u,0x00000004u,0x00000000u,0x00000003u,0x000200f8u,0x00000005u,0x0004003bu,0x0000007au,
|
||||||
|
0x0000007bu,0x00000007u,0x000300f7u,0x000001b4u,0x00000000u,0x000300fbu,0x0000001au,0x000001b5u,
|
||||||
|
0x000200f8u,0x000001b5u,0x0004003du,0x0000000bu,0x0000000fu,0x0000000du,0x0007004fu,0x0000000eu,
|
||||||
|
0x00000010u,0x0000000fu,0x0000000fu,0x00000000u,0x00000001u,0x0004007cu,0x00000007u,0x00000011u,
|
||||||
|
0x00000010u,0x0004003du,0x00000014u,0x00000017u,0x00000016u,0x00040068u,0x00000007u,0x00000018u,
|
||||||
|
0x00000017u,0x00050051u,0x00000006u,0x0000001du,0x00000011u,0x00000000u,0x00050051u,0x00000006u,
|
||||||
|
0x0000001fu,0x00000018u,0x00000000u,0x000500afu,0x00000019u,0x00000020u,0x0000001du,0x0000001fu,
|
||||||
|
0x000400a8u,0x00000019u,0x00000021u,0x00000020u,0x000300f7u,0x00000023u,0x00000000u,0x000400fau,
|
||||||
|
0x00000021u,0x00000022u,0x00000023u,0x000200f8u,0x00000022u,0x00050051u,0x00000006u,0x00000026u,
|
||||||
|
0x00000011u,0x00000001u,0x00050051u,0x00000006u,0x00000028u,0x00000018u,0x00000001u,0x000500afu,
|
||||||
|
0x00000019u,0x00000029u,0x00000026u,0x00000028u,0x000200f9u,0x00000023u,0x000200f8u,0x00000023u,
|
||||||
|
0x000700f5u,0x00000019u,0x0000002au,0x00000020u,0x000001b5u,0x00000029u,0x00000022u,0x000300f7u,
|
||||||
|
0x0000002cu,0x00000000u,0x000400fau,0x0000002au,0x0000002bu,0x0000002cu,0x000200f8u,0x0000002bu,
|
||||||
|
0x000200f9u,0x000001b4u,0x000200f8u,0x0000002cu,0x0004006fu,0x0000002eu,0x00000033u,0x00000018u,
|
||||||
|
0x00050088u,0x0000002eu,0x00000035u,0x000001efu,0x00000033u,0x0004006fu,0x0000002eu,0x00000038u,
|
||||||
|
0x00000011u,0x00050081u,0x0000002eu,0x0000003bu,0x00000038u,0x000001f0u,0x00050085u,0x0000002eu,
|
||||||
|
0x0000003du,0x0000003bu,0x00000035u,0x00050041u,0x00000044u,0x00000045u,0x00000042u,0x00000043u,
|
||||||
|
0x0004003du,0x0000000au,0x00000046u,0x00000045u,0x00040070u,0x00000013u,0x00000047u,0x00000046u,
|
||||||
|
0x0004007fu,0x00000013u,0x00000048u,0x00000047u,0x0006000cu,0x00000013u,0x00000049u,0x00000001u,
|
||||||
|
0x0000001du,0x00000048u,0x0004003du,0x0000004cu,0x0000004fu,0x0000004eu,0x00070058u,0x00000052u,
|
||||||
|
0x00000053u,0x0000004fu,0x0000003du,0x00000002u,0x00000051u,0x0007004fu,0x0000002eu,0x00000054u,
|
||||||
|
0x00000053u,0x00000053u,0x00000000u,0x00000001u,0x0005008eu,0x0000002eu,0x00000058u,0x00000054u,
|
||||||
|
0x00000049u,0x000200f9u,0x0000005bu,0x000200f8u,0x0000005bu,0x000700f5u,0x00000006u,0x000001beu,
|
||||||
|
0x0000005au,0x0000002cu,0x0000008au,0x0000005eu,0x000500b3u,0x00000019u,0x00000061u,0x000001beu,
|
||||||
|
0x00000043u,0x000400f6u,0x0000005du,0x0000005eu,0x00000000u,0x000400fau,0x00000061u,0x0000005cu,
|
||||||
|
0x0000005du,0x000200f8u,0x0000005cu,0x000200f9u,0x00000063u,0x000200f8u,0x00000063u,0x000700f5u,
|
||||||
|
0x00000006u,0x000001e4u,0x0000005au,0x0000005cu,0x00000070u,0x00000064u,0x000500b3u,0x00000019u,
|
||||||
|
0x00000069u,0x000001e4u,0x00000043u,0x000400f6u,0x00000065u,0x00000064u,0x00000000u,0x000400fau,
|
||||||
|
0x00000069u,0x00000064u,0x00000065u,0x000200f8u,0x00000064u,0x00050080u,0x00000006u,0x0000006cu,
|
||||||
|
0x000001beu,0x00000043u,0x00050084u,0x00000006u,0x0000006eu,0x0000006cu,0x0000006du,0x00050080u,
|
||||||
|
0x00000006u,0x00000070u,0x000001e4u,0x00000043u,0x00050080u,0x00000006u,0x00000071u,0x0000006eu,
|
||||||
|
0x00000070u,0x0004006fu,0x00000013u,0x00000074u,0x000001e4u,0x0004006fu,0x00000013u,0x00000076u,
|
||||||
|
0x000001beu,0x00050050u,0x0000002eu,0x00000077u,0x00000074u,0x00000076u,0x0004003du,0x0000004cu,
|
||||||
|
0x0000007eu,0x0000007du,0x00050085u,0x0000002eu,0x00000082u,0x00000077u,0x00000035u,0x00050081u,
|
||||||
|
0x0000002eu,0x00000083u,0x0000003du,0x00000082u,0x00070058u,0x00000052u,0x00000084u,0x0000007eu,
|
||||||
|
0x00000083u,0x00000002u,0x00000051u,0x00050051u,0x00000013u,0x00000085u,0x00000084u,0x00000000u,
|
||||||
|
0x00050041u,0x0000003eu,0x00000086u,0x0000007bu,0x00000071u,0x0003003eu,0x00000086u,0x00000085u,
|
||||||
|
0x000200f9u,0x00000063u,0x000200f8u,0x00000065u,0x000200f9u,0x0000005eu,0x000200f8u,0x0000005eu,
|
||||||
|
0x00050080u,0x00000006u,0x0000008au,0x000001beu,0x00000043u,0x000200f9u,0x0000005bu,0x000200f8u,
|
||||||
|
0x0000005du,0x000200f9u,0x00000091u,0x000200f8u,0x00000091u,0x000700f5u,0x0000002eu,0x000001cfu,
|
||||||
|
0x00000058u,0x0000005du,0x000001e6u,0x00000094u,0x000700f5u,0x00000013u,0x000001c0u,0x0000008cu,
|
||||||
|
0x0000005du,0x000001dfu,0x00000094u,0x000700f5u,0x00000006u,0x000001bfu,0x00000090u,0x0000005du,
|
||||||
|
0x000000f3u,0x00000094u,0x000500b3u,0x00000019u,0x00000097u,0x000001bfu,0x0000006du,0x000400f6u,
|
||||||
|
0x00000093u,0x00000094u,0x00000000u,0x000400fau,0x00000097u,0x00000092u,0x00000093u,0x000200f8u,
|
||||||
|
0x00000092u,0x000200f9u,0x00000099u,0x000200f8u,0x00000099u,0x000700f5u,0x00000013u,0x000001dfu,
|
||||||
|
0x000001c0u,0x00000092u,0x000001fau,0x0000009cu,0x000700f5u,0x00000006u,0x000001d8u,0x00000090u,
|
||||||
|
0x00000092u,0x000000f1u,0x0000009cu,0x000700f5u,0x0000002eu,0x000001e6u,0x000001cfu,0x00000092u,
|
||||||
|
0x000001fdu,0x0000009cu,0x000500b3u,0x00000019u,0x0000009fu,0x000001d8u,0x0000006du,0x000400f6u,
|
||||||
|
0x0000009bu,0x0000009cu,0x00000000u,0x000400fau,0x0000009fu,0x0000009au,0x0000009bu,0x000200f8u,
|
||||||
|
0x0000009au,0x0004006fu,0x00000013u,0x000000a3u,0x000001d8u,0x0004006fu,0x00000013u,0x000000a5u,
|
||||||
|
0x000001bfu,0x00050050u,0x0000002eu,0x000000a6u,0x000000a3u,0x000000a5u,0x00050081u,0x0000002eu,
|
||||||
|
0x000000a7u,0x00000058u,0x000000a6u,0x000200f9u,0x000000aau,0x000200f8u,0x000000aau,0x000700f5u,
|
||||||
|
0x00000013u,0x000001ddu,0x00000051u,0x0000009au,0x000001e3u,0x000000adu,0x000700f5u,0x00000006u,
|
||||||
|
0x000001dau,0x0000005au,0x0000009au,0x000000ddu,0x000000adu,0x000500b3u,0x00000019u,0x000000b0u,
|
||||||
|
0x000001dau,0x00000043u,0x000400f6u,0x000000acu,0x000000adu,0x00000000u,0x000400fau,0x000000b0u,
|
||||||
|
0x000000abu,0x000000acu,0x000200f8u,0x000000abu,0x000200f9u,0x000000b2u,0x000200f8u,0x000000b2u,
|
||||||
|
0x000700f5u,0x00000013u,0x000001e3u,0x000001ddu,0x000000abu,0x000000d9u,0x000000b3u,0x000700f5u,
|
||||||
|
0x00000006u,0x000001e1u,0x0000005au,0x000000abu,0x000000c4u,0x000000b3u,0x000500b3u,0x00000019u,
|
||||||
|
0x000000b8u,0x000001e1u,0x00000043u,0x000400f6u,0x000000b4u,0x000000b3u,0x00000000u,0x000400fau,
|
||||||
|
0x000000b8u,0x000000b3u,0x000000b4u,0x000200f8u,0x000000b3u,0x0004006fu,0x00000013u,0x000000bbu,
|
||||||
|
0x000001e1u,0x0004006fu,0x00000013u,0x000000bdu,0x000001dau,0x00050050u,0x0000002eu,0x000000beu,
|
||||||
|
0x000000bbu,0x000000bdu,0x00050080u,0x00000006u,0x000000c1u,0x000001dau,0x00000043u,0x00050084u,
|
||||||
|
0x00000006u,0x000000c2u,0x000000c1u,0x0000006du,0x00050080u,0x00000006u,0x000000c4u,0x000001e1u,
|
||||||
|
0x00000043u,0x00050080u,0x00000006u,0x000000c5u,0x000000c2u,0x000000c4u,0x00050041u,0x0000003eu,
|
||||||
|
0x000000c6u,0x0000007bu,0x000000c5u,0x0004003du,0x00000013u,0x000000c7u,0x000000c6u,0x0004003du,
|
||||||
|
0x0000004cu,0x000000cau,0x000000c9u,0x00050081u,0x0000002eu,0x000000ceu,0x000000beu,0x000000a7u,
|
||||||
|
0x00050085u,0x0000002eu,0x000000d0u,0x000000ceu,0x00000035u,0x00050081u,0x0000002eu,0x000000d1u,
|
||||||
|
0x0000003du,0x000000d0u,0x00070058u,0x00000052u,0x000000d2u,0x000000cau,0x000000d1u,0x00000002u,
|
||||||
|
0x00000051u,0x00050051u,0x00000013u,0x000000d3u,0x000000d2u,0x00000000u,0x00050083u,0x00000013u,
|
||||||
|
0x000000d6u,0x000000c7u,0x000000d3u,0x0006000cu,0x00000013u,0x000000d7u,0x00000001u,0x00000004u,
|
||||||
|
0x000000d6u,0x00050081u,0x00000013u,0x000000d9u,0x000001e3u,0x000000d7u,0x000200f9u,0x000000b2u,
|
||||||
|
0x000200f8u,0x000000b4u,0x000200f9u,0x000000adu,0x000200f8u,0x000000adu,0x00050080u,0x00000006u,
|
||||||
|
0x000000ddu,0x000001dau,0x00000043u,0x000200f9u,0x000000aau,0x000200f8u,0x000000acu,0x0006000cu,
|
||||||
|
0x00000013u,0x000000e1u,0x00000001u,0x00000004u,0x000000a3u,0x0006000cu,0x00000013u,0x000000e4u,
|
||||||
|
0x00000001u,0x00000004u,0x000000a5u,0x00050081u,0x00000013u,0x000000e5u,0x000000e1u,0x000000e4u,
|
||||||
|
0x00050085u,0x00000013u,0x000000e6u,0x000000deu,0x000000e5u,0x00050081u,0x00000013u,0x000000e8u,
|
||||||
|
0x000001ddu,0x000000e6u,0x000500b8u,0x00000019u,0x000000ebu,0x000000e8u,0x000001dfu,0x000600a9u,
|
||||||
|
0x00000013u,0x000001fau,0x000000ebu,0x000000e8u,0x000001dfu,0x00050050u,0x000001fbu,0x000001fcu,
|
||||||
|
0x000000ebu,0x000000ebu,0x000600a9u,0x0000002eu,0x000001fdu,0x000001fcu,0x000000a7u,0x000001e6u,
|
||||||
|
0x000200f9u,0x0000009cu,0x000200f8u,0x0000009cu,0x00050080u,0x00000006u,0x000000f1u,0x000001d8u,
|
||||||
|
0x00000043u,0x000200f9u,0x00000099u,0x000200f8u,0x0000009bu,0x000200f9u,0x00000094u,0x000200f8u,
|
||||||
|
0x00000094u,0x00050080u,0x00000006u,0x000000f3u,0x000001bfu,0x00000043u,0x000200f9u,0x00000091u,
|
||||||
|
0x000200f8u,0x00000093u,0x000500aau,0x00000019u,0x000000f6u,0x00000046u,0x0000001au,0x000300f7u,
|
||||||
|
0x000000f8u,0x00000000u,0x000400fau,0x000000f6u,0x000000f7u,0x000000f8u,0x000200f8u,0x000000f7u,
|
||||||
|
0x000200f9u,0x00000100u,0x000200f8u,0x00000100u,0x000700f5u,0x00000013u,0x000001c5u,0x00000051u,
|
||||||
|
0x000000f7u,0x000001d7u,0x00000103u,0x000700f5u,0x00000013u,0x000001c4u,0x00000051u,0x000000f7u,
|
||||||
|
0x000001d6u,0x00000103u,0x000700f5u,0x00000013u,0x000001c3u,0x00000051u,0x000000f7u,0x000001d5u,
|
||||||
|
0x00000103u,0x000700f5u,0x00000013u,0x000001c2u,0x00000051u,0x000000f7u,0x000001d4u,0x00000103u,
|
||||||
|
0x000700f5u,0x00000006u,0x000001c1u,0x0000005au,0x000000f7u,0x0000016eu,0x00000103u,0x000500b3u,
|
||||||
|
0x00000019u,0x00000106u,0x000001c1u,0x00000043u,0x000400f6u,0x00000102u,0x00000103u,0x00000000u,
|
||||||
|
0x000400fau,0x00000106u,0x00000101u,0x00000102u,0x000200f8u,0x00000101u,0x000200f9u,0x00000108u,
|
||||||
|
0x000200f8u,0x00000108u,0x000700f5u,0x00000013u,0x000001d7u,0x000001c5u,0x00000101u,0x0000016au,
|
||||||
|
0x00000109u,0x000700f5u,0x00000013u,0x000001d6u,0x000001c4u,0x00000101u,0x0000015bu,0x00000109u,
|
||||||
|
0x000700f5u,0x00000013u,0x000001d5u,0x000001c3u,0x00000101u,0x0000014cu,0x00000109u,0x000700f5u,
|
||||||
|
0x00000013u,0x000001d4u,0x000001c2u,0x00000101u,0x0000013du,0x00000109u,0x000700f5u,0x00000006u,
|
||||||
|
0x000001d1u,0x0000005au,0x00000101u,0x0000011au,0x00000109u,0x000500b3u,0x00000019u,0x0000010eu,
|
||||||
|
0x000001d1u,0x00000043u,0x000400f6u,0x0000010au,0x00000109u,0x00000000u,0x000400fau,0x0000010eu,
|
||||||
|
0x00000109u,0x0000010au,0x000200f8u,0x00000109u,0x0004006fu,0x00000013u,0x00000111u,0x000001d1u,
|
||||||
|
0x0004006fu,0x00000013u,0x00000113u,0x000001c1u,0x00050050u,0x0000002eu,0x00000114u,0x00000111u,
|
||||||
|
0x00000113u,0x00050080u,0x00000006u,0x00000117u,0x000001c1u,0x00000043u,0x00050084u,0x00000006u,
|
||||||
|
0x00000118u,0x00000117u,0x0000006du,0x00050080u,0x00000006u,0x0000011au,0x000001d1u,0x00000043u,
|
||||||
|
0x00050080u,0x00000006u,0x0000011bu,0x00000118u,0x0000011au,0x00050041u,0x0000003eu,0x0000011cu,
|
||||||
|
0x0000007bu,0x0000011bu,0x0004003du,0x00000013u,0x0000011du,0x0000011cu,0x00050081u,0x0000002eu,
|
||||||
|
0x00000122u,0x000001cfu,0x00000121u,0x00050081u,0x0000002eu,0x00000126u,0x000001cfu,0x00000125u,
|
||||||
|
0x00050081u,0x0000002eu,0x0000012au,0x000001cfu,0x00000129u,0x00050081u,0x0000002eu,0x0000012eu,
|
||||||
|
0x000001cfu,0x0000012du,0x0004003du,0x0000004cu,0x00000130u,0x000000c9u,0x00050081u,0x0000002eu,
|
||||||
|
0x00000134u,0x00000114u,0x00000122u,0x00050085u,0x0000002eu,0x00000136u,0x00000134u,0x00000035u,
|
||||||
|
0x00050081u,0x0000002eu,0x00000137u,0x0000003du,0x00000136u,0x00070058u,0x00000052u,0x00000138u,
|
||||||
|
0x00000130u,0x00000137u,0x00000002u,0x00000051u,0x00050051u,0x00000013u,0x00000139u,0x00000138u,
|
||||||
|
0x00000000u,0x00050083u,0x00000013u,0x0000013au,0x0000011du,0x00000139u,0x0006000cu,0x00000013u,
|
||||||
|
0x0000013bu,0x00000001u,0x00000004u,0x0000013au,0x00050081u,0x00000013u,0x0000013du,0x000001d4u,
|
||||||
|
0x0000013bu,0x0004003du,0x0000004cu,0x0000013fu,0x000000c9u,0x00050081u,0x0000002eu,0x00000143u,
|
||||||
|
0x00000114u,0x00000126u,0x00050085u,0x0000002eu,0x00000145u,0x00000143u,0x00000035u,0x00050081u,
|
||||||
|
0x0000002eu,0x00000146u,0x0000003du,0x00000145u,0x00070058u,0x00000052u,0x00000147u,0x0000013fu,
|
||||||
|
0x00000146u,0x00000002u,0x00000051u,0x00050051u,0x00000013u,0x00000148u,0x00000147u,0x00000000u,
|
||||||
|
0x00050083u,0x00000013u,0x00000149u,0x0000011du,0x00000148u,0x0006000cu,0x00000013u,0x0000014au,
|
||||||
|
0x00000001u,0x00000004u,0x00000149u,0x00050081u,0x00000013u,0x0000014cu,0x000001d5u,0x0000014au,
|
||||||
|
0x0004003du,0x0000004cu,0x0000014eu,0x000000c9u,0x00050081u,0x0000002eu,0x00000152u,0x00000114u,
|
||||||
|
0x0000012au,0x00050085u,0x0000002eu,0x00000154u,0x00000152u,0x00000035u,0x00050081u,0x0000002eu,
|
||||||
|
0x00000155u,0x0000003du,0x00000154u,0x00070058u,0x00000052u,0x00000156u,0x0000014eu,0x00000155u,
|
||||||
|
0x00000002u,0x00000051u,0x00050051u,0x00000013u,0x00000157u,0x00000156u,0x00000000u,0x00050083u,
|
||||||
|
0x00000013u,0x00000158u,0x0000011du,0x00000157u,0x0006000cu,0x00000013u,0x00000159u,0x00000001u,
|
||||||
|
0x00000004u,0x00000158u,0x00050081u,0x00000013u,0x0000015bu,0x000001d6u,0x00000159u,0x0004003du,
|
||||||
|
0x0000004cu,0x0000015du,0x000000c9u,0x00050081u,0x0000002eu,0x00000161u,0x00000114u,0x0000012eu,
|
||||||
|
0x00050085u,0x0000002eu,0x00000163u,0x00000161u,0x00000035u,0x00050081u,0x0000002eu,0x00000164u,
|
||||||
|
0x0000003du,0x00000163u,0x00070058u,0x00000052u,0x00000165u,0x0000015du,0x00000164u,0x00000002u,
|
||||||
|
0x00000051u,0x00050051u,0x00000013u,0x00000166u,0x00000165u,0x00000000u,0x00050083u,0x00000013u,
|
||||||
|
0x00000167u,0x0000011du,0x00000166u,0x0006000cu,0x00000013u,0x00000168u,0x00000001u,0x00000004u,
|
||||||
|
0x00000167u,0x00050081u,0x00000013u,0x0000016au,0x000001d7u,0x00000168u,0x000200f9u,0x00000108u,
|
||||||
|
0x000200f8u,0x0000010au,0x000200f9u,0x00000103u,0x000200f8u,0x00000103u,0x00050080u,0x00000006u,
|
||||||
|
0x0000016eu,0x000001c1u,0x00000043u,0x000200f9u,0x00000100u,0x000200f8u,0x00000102u,0x00050081u,
|
||||||
|
0x00000013u,0x00000170u,0x000001c2u,0x000000deu,0x00050081u,0x00000013u,0x00000172u,0x000001c3u,
|
||||||
|
0x000000deu,0x00050081u,0x00000013u,0x00000174u,0x000001c4u,0x000000deu,0x00050081u,0x00000013u,
|
||||||
|
0x00000176u,0x000001c5u,0x000000deu,0x00050085u,0x00000013u,0x0000017du,0x0000017bu,0x000001c0u,
|
||||||
|
0x00050083u,0x00000013u,0x0000017eu,0x00000170u,0x0000017du,0x00050081u,0x00000013u,0x00000180u,
|
||||||
|
0x0000017eu,0x00000172u,0x00050083u,0x00000013u,0x00000185u,0x00000174u,0x0000017du,0x00050081u,
|
||||||
|
0x00000013u,0x00000187u,0x00000185u,0x00000176u,0x000500bau,0x00000019u,0x0000018au,0x00000180u,
|
||||||
|
0x00000189u,0x000300f7u,0x0000018cu,0x00000000u,0x000400fau,0x0000018au,0x0000018bu,0x0000018cu,
|
||||||
|
0x000200f8u,0x0000018bu,0x00050083u,0x00000013u,0x000001f8u,0x000001c2u,0x000001c3u,0x00050085u,
|
||||||
|
0x00000013u,0x00000190u,0x00000039u,0x000001f8u,0x00050088u,0x00000013u,0x00000192u,0x00000190u,
|
||||||
|
0x00000180u,0x0008000cu,0x00000013u,0x00000194u,0x00000001u,0x0000002bu,0x00000192u,0x00000193u,
|
||||||
|
0x00000039u,0x000200f9u,0x0000018cu,0x000200f8u,0x0000018cu,0x000700f5u,0x00000013u,0x000001c9u,
|
||||||
|
0x00000051u,0x00000102u,0x00000194u,0x0000018bu,0x000500bau,0x00000019u,0x00000196u,0x00000187u,
|
||||||
|
0x00000189u,0x000300f7u,0x00000198u,0x00000000u,0x000400fau,0x00000196u,0x00000197u,0x00000198u,
|
||||||
|
0x000200f8u,0x00000197u,0x00050083u,0x00000013u,0x000001f9u,0x000001c4u,0x000001c5u,0x00050085u,
|
||||||
|
0x00000013u,0x0000019cu,0x00000039u,0x000001f9u,0x00050088u,0x00000013u,0x0000019eu,0x0000019cu,
|
||||||
|
0x00000187u,0x0008000cu,0x00000013u,0x0000019fu,0x00000001u,0x0000002bu,0x0000019eu,0x00000193u,
|
||||||
|
0x00000039u,0x000200f9u,0x00000198u,0x000200f8u,0x00000198u,0x000700f5u,0x00000013u,0x000001cau,
|
||||||
|
0x00000051u,0x0000018cu,0x0000019fu,0x00000197u,0x00050050u,0x0000002eu,0x000001a2u,0x000001c9u,
|
||||||
|
0x000001cau,0x00050081u,0x0000002eu,0x000001a4u,0x000001cfu,0x000001a2u,0x000200f9u,0x000000f8u,
|
||||||
|
0x000200f8u,0x000000f8u,0x000700f5u,0x0000002eu,0x000001d0u,0x000001cfu,0x00000093u,0x000001a4u,
|
||||||
|
0x00000198u,0x0006000cu,0x00000013u,0x000001aau,0x00000001u,0x0000001du,0x00000047u,0x0005008eu,
|
||||||
|
0x0000002eu,0x000001abu,0x000001d0u,0x000001aau,0x0004003du,0x00000014u,0x000001acu,0x00000016u,
|
||||||
|
0x00050051u,0x00000013u,0x000001afu,0x000001abu,0x00000000u,0x00050051u,0x00000013u,0x000001b0u,
|
||||||
|
0x000001abu,0x00000001u,0x00070050u,0x00000052u,0x000001b1u,0x000001afu,0x000001b0u,0x00000051u,
|
||||||
|
0x00000051u,0x00040063u,0x000001acu,0x00000011u,0x000001b1u,0x000200f9u,0x000001b4u,0x000200f8u,
|
||||||
|
0x000001b4u,0x000100fdu,0x00010038u
|
||||||
|
};
|
||||||
|
static const size_t OF3_FLOW_LEN = sizeof(OF3_FLOW_SPV) / sizeof(OF3_FLOW_SPV[0]);
|
||||||
static const uint32_t OF3_EXPAND_SPV[] = {0x07230203u,0x00010300u,0x0008000bu,0x00000124u,0x00000000u,0x00020011u,0x00000001u,0x00020011u,0x00000032u,0x0006000bu,0x00000001u,0x4c534c47u,0x6474732eu,0x3035342eu,0x00000000u,0x0003000eu,0x00000000u,0x00000001u,0x0006000fu,0x00000005u,0x00000004u,0x6e69616du,0x00000000u,0x00000049u,0x00060010u,0x00000004u,0x00000011u,0x00000010u,0x00000010u,0x00000001u,0x00030003u,0x00000002u,0x000001c2u,0x00040005u,0x00000004u,0x6e69616du,0x00000000u,0x00080005u,0x0000000eu,0x3564656du,0x3b316628u,0x663b3166u,0x31663b31u,0x3b31663bu,0x00000000u,0x00030005u,0x00000009u,0x00000061u,0x00030005u,0x0000000au,0x00000062u,0x00030005u,0x0000000bu,0x00000063u,0x00030005u,0x0000000cu,0x00000064u,0x00030005u,0x0000000du,0x00000065u,0x00030005u,0x00000010u,0x00000078u,0x00030005u,0x00000034u,0x00000079u,0x00030005u,0x00000045u,0x00646967u,0x00080005u,0x00000049u,0x475f6c67u,0x61626f6cu,0x766e496cu,0x7461636fu,0x496e6f69u,0x00000044u,0x00030005u,0x0000004eu,0x006d6964u,0x00040005u,0x00000051u,0x64774675u,0x00000000u,0x00030005u,0x0000006bu,0x00007675u,0x00030005u,0x00000074u,0x00007366u,0x00050005u,0x00000079u,0x6f6c4675u,0x6e694677u,0x00000065u,0x00030005u,0x00000081u,0x00000063u,0x00030005u,0x00000088u,0x00006d78u,0x00030005u,0x00000091u,0x00007078u,0x00030005u,0x0000009au,0x00006d79u,0x00030005u,0x000000a3u,0x00007079u,0x00030005u,0x000000acu,0x00000064u,0x00040005u,0x000000adu,0x61726170u,0x0000006du,0x00040005u,0x000000b0u,0x61726170u,0x0000006du,0x00040005u,0x000000b3u,0x61726170u,0x0000006du,0x00040005u,0x000000b6u,0x61726170u,0x0000006du,0x00040005u,0x000000b9u,0x61726170u,0x0000006du,0x00040005u,0x000000bdu,0x61726170u,0x0000006du,0x00040005u,0x000000c0u,0x61726170u,0x0000006du,0x00040005u,0x000000c3u,0x61726170u,0x0000006du,0x00040005u,0x000000c6u,0x61726170u,0x0000006du,0x00040005u,0x000000c9u,0x61726170u,0x0000006du,0x00030005u,0x000000ceu,0x00000071u,0x00030005u,0x000000d2u,0x00787067u,0x00030005u,0x000000d3u,0x00004d47u,0x00050006u,0x000000d3u,0x00000000u,0x694c6d67u,0x0000006eu,0x00050006u,0x000000d3u,0x00000001u,0x694c6d67u,0x0000546eu,0x00050006u,0x000000d3u,0x00000002u,0x70416d67u,0x00000070u,0x00050006u,0x000000d3u,0x00000003u,0x70416d67u,0x00005470u,0x00030005u,0x000000d5u,0x00000000u,0x00030005u,0x000000fdu,0x00003241u,0x00040005u,0x0000010bu,0x6c6c7566u,0x00000000u,0x00040005u,0x00000117u,0x64774275u,0x00000000u,0x00030005u,0x00000121u,0x00000055u,0x00060006u,0x00000121u,0x00000000u,0x776f6c66u,0x6c616353u,0x00000065u,0x00050006u,0x00000121u,0x00000001u,0x6576656cu,0x0000006cu,0x00050006u,0x00000121u,0x00000002u,0x30646170u,0x00000000u,0x00050006u,0x00000121u,0x00000003u,0x31646170u,0x00000000u,0x00030005u,0x00000123u,0x00000000u,0x00040047u,0x00000049u,0x0000000bu,0x0000001cu,0x00030047u,0x00000051u,0x00000019u,0x00040047u,0x00000051u,0x00000021u,0x00000030u,0x00040047u,0x00000051u,0x00000022u,0x00000000u,0x00040047u,0x00000079u,0x00000021u,0x00000020u,0x00040047u,0x00000079u,0x00000022u,0x00000000u,0x00030047u,0x000000d3u,0x00000002u,0x00050048u,0x000000d3u,0x00000000u,0x00000023u,0x00000000u,0x00050048u,0x000000d3u,0x00000001u,0x00000023u,0x00000010u,0x00050048u,0x000000d3u,0x00000002u,0x00000023u,0x00000020u,0x00050048u,0x000000d3u,0x00000003u,0x00000023u,0x00000030u,0x00040047u,0x000000d5u,0x00000021u,0x00000001u,0x00040047u,0x000000d5u,0x00000022u,0x00000000u,0x00030047u,0x00000117u,0x00000019u,0x00040047u,0x00000117u,0x00000021u,0x00000031u,0x00040047u,0x00000117u,0x00000022u,0x00000000u,0x00040047u,0x00000120u,0x0000000bu,0x00000019u,0x00030047u,0x00000121u,0x00000002u,0x00050048u,0x00000121u,0x00000000u,0x00000023u,0x00000000u,0x00050048u,0x00000121u,0x00000001u,0x00000023u,0x00000004u,0x00050048u,0x00000121u,0x00000002u,0x00000023u,0x00000008u,0x00050048u,0x00000121u,0x00000003u,0x00000023u,0x0000000cu,0x00040047u,0x00000123u,0x00000021u,0x00000000u,0x00040047u,0x00000123u,0x00000022u,0x00000000u,0x00020013u,0x00000002u,0x00030021u,0x00000003u,0x00000002u,0x00030016u,0x00000006u,0x00000020u,0x00040020u,0x00000007u,0x00000007u,0x00000006u,0x00080021u,0x00000008u,0x00000006u,0x00000007u,0x00000007u,0x00000007u,0x00000007u,0x00000007u,0x00040015u,0x00000042u,0x00000020u,0x00000001u,0x00040017u,0x00000043u,0x00000042u,0x00000002u,0x00040020u,0x00000044u,0x00000007u,0x00000043u,0x00040015u,0x00000046u,0x00000020u,0x00000000u,0x00040017u,0x00000047u,0x00000046u,0x00000003u,0x00040020u,0x00000048u,0x00000001u,0x00000047u,0x0004003bu,0x00000048u,0x00000049u,0x00000001u,0x00040017u,0x0000004au,0x00000046u,0x00000002u,0x00090019u,0x0000004fu,0x00000006u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000002u,0x00000002u,0x00040020u,0x00000050u,0x00000000u,0x0000004fu,0x0004003bu,0x00000050u,0x00000051u,0x00000000u,0x00020014u,0x00000054u,0x0004002bu,0x00000046u,0x00000055u,0x00000000u,0x00040020u,0x00000056u,0x00000007u,0x00000042u,0x0004002bu,0x00000046u,0x0000005fu,0x00000001u,0x00040017u,0x00000069u,0x00000006u,0x00000002u,0x00040020u,0x0000006au,0x00000007u,0Line truncated
|
static const uint32_t OF3_EXPAND_SPV[] = {0x07230203u,0x00010300u,0x0008000bu,0x00000124u,0x00000000u,0x00020011u,0x00000001u,0x00020011u,0x00000032u,0x0006000bu,0x00000001u,0x4c534c47u,0x6474732eu,0x3035342eu,0x00000000u,0x0003000eu,0x00000000u,0x00000001u,0x0006000fu,0x00000005u,0x00000004u,0x6e69616du,0x00000000u,0x00000049u,0x00060010u,0x00000004u,0x00000011u,0x00000010u,0x00000010u,0x00000001u,0x00030003u,0x00000002u,0x000001c2u,0x00040005u,0x00000004u,0x6e69616du,0x00000000u,0x00080005u,0x0000000eu,0x3564656du,0x3b316628u,0x663b3166u,0x31663b31u,0x3b31663bu,0x00000000u,0x00030005u,0x00000009u,0x00000061u,0x00030005u,0x0000000au,0x00000062u,0x00030005u,0x0000000bu,0x00000063u,0x00030005u,0x0000000cu,0x00000064u,0x00030005u,0x0000000du,0x00000065u,0x00030005u,0x00000010u,0x00000078u,0x00030005u,0x00000034u,0x00000079u,0x00030005u,0x00000045u,0x00646967u,0x00080005u,0x00000049u,0x475f6c67u,0x61626f6cu,0x766e496cu,0x7461636fu,0x496e6f69u,0x00000044u,0x00030005u,0x0000004eu,0x006d6964u,0x00040005u,0x00000051u,0x64774675u,0x00000000u,0x00030005u,0x0000006bu,0x00007675u,0x00030005u,0x00000074u,0x00007366u,0x00050005u,0x00000079u,0x6f6c4675u,0x6e694677u,0x00000065u,0x00030005u,0x00000081u,0x00000063u,0x00030005u,0x00000088u,0x00006d78u,0x00030005u,0x00000091u,0x00007078u,0x00030005u,0x0000009au,0x00006d79u,0x00030005u,0x000000a3u,0x00007079u,0x00030005u,0x000000acu,0x00000064u,0x00040005u,0x000000adu,0x61726170u,0x0000006du,0x00040005u,0x000000b0u,0x61726170u,0x0000006du,0x00040005u,0x000000b3u,0x61726170u,0x0000006du,0x00040005u,0x000000b6u,0x61726170u,0x0000006du,0x00040005u,0x000000b9u,0x61726170u,0x0000006du,0x00040005u,0x000000bdu,0x61726170u,0x0000006du,0x00040005u,0x000000c0u,0x61726170u,0x0000006du,0x00040005u,0x000000c3u,0x61726170u,0x0000006du,0x00040005u,0x000000c6u,0x61726170u,0x0000006du,0x00040005u,0x000000c9u,0x61726170u,0x0000006du,0x00030005u,0x000000ceu,0x00000071u,0x00030005u,0x000000d2u,0x00787067u,0x00030005u,0x000000d3u,0x00004d47u,0x00050006u,0x000000d3u,0x00000000u,0x694c6d67u,0x0000006eu,0x00050006u,0x000000d3u,0x00000001u,0x694c6d67u,0x0000546eu,0x00050006u,0x000000d3u,0x00000002u,0x70416d67u,0x00000070u,0x00050006u,0x000000d3u,0x00000003u,0x70416d67u,0x00005470u,0x00030005u,0x000000d5u,0x00000000u,0x00030005u,0x000000fdu,0x00003241u,0x00040005u,0x0000010bu,0x6c6c7566u,0x00000000u,0x00040005u,0x00000117u,0x64774275u,0x00000000u,0x00030005u,0x00000121u,0x00000055u,0x00060006u,0x00000121u,0x00000000u,0x776f6c66u,0x6c616353u,0x00000065u,0x00050006u,0x00000121u,0x00000001u,0x6576656cu,0x0000006cu,0x00050006u,0x00000121u,0x00000002u,0x30646170u,0x00000000u,0x00050006u,0x00000121u,0x00000003u,0x31646170u,0x00000000u,0x00030005u,0x00000123u,0x00000000u,0x00040047u,0x00000049u,0x0000000bu,0x0000001cu,0x00030047u,0x00000051u,0x00000019u,0x00040047u,0x00000051u,0x00000021u,0x00000030u,0x00040047u,0x00000051u,0x00000022u,0x00000000u,0x00040047u,0x00000079u,0x00000021u,0x00000020u,0x00040047u,0x00000079u,0x00000022u,0x00000000u,0x00030047u,0x000000d3u,0x00000002u,0x00050048u,0x000000d3u,0x00000000u,0x00000023u,0x00000000u,0x00050048u,0x000000d3u,0x00000001u,0x00000023u,0x00000010u,0x00050048u,0x000000d3u,0x00000002u,0x00000023u,0x00000020u,0x00050048u,0x000000d3u,0x00000003u,0x00000023u,0x00000030u,0x00040047u,0x000000d5u,0x00000021u,0x00000001u,0x00040047u,0x000000d5u,0x00000022u,0x00000000u,0x00030047u,0x00000117u,0x00000019u,0x00040047u,0x00000117u,0x00000021u,0x00000031u,0x00040047u,0x00000117u,0x00000022u,0x00000000u,0x00040047u,0x00000120u,0x0000000bu,0x00000019u,0x00030047u,0x00000121u,0x00000002u,0x00050048u,0x00000121u,0x00000000u,0x00000023u,0x00000000u,0x00050048u,0x00000121u,0x00000001u,0x00000023u,0x00000004u,0x00050048u,0x00000121u,0x00000002u,0x00000023u,0x00000008u,0x00050048u,0x00000121u,0x00000003u,0x00000023u,0x0000000cu,0x00040047u,0x00000123u,0x00000021u,0x00000000u,0x00040047u,0x00000123u,0x00000022u,0x00000000u,0x00020013u,0x00000002u,0x00030021u,0x00000003u,0x00000002u,0x00030016u,0x00000006u,0x00000020u,0x00040020u,0x00000007u,0x00000007u,0x00000006u,0x00080021u,0x00000008u,0x00000006u,0x00000007u,0x00000007u,0x00000007u,0x00000007u,0x00000007u,0x00040015u,0x00000042u,0x00000020u,0x00000001u,0x00040017u,0x00000043u,0x00000042u,0x00000002u,0x00040020u,0x00000044u,0x00000007u,0x00000043u,0x00040015u,0x00000046u,0x00000020u,0x00000000u,0x00040017u,0x00000047u,0x00000046u,0x00000003u,0x00040020u,0x00000048u,0x00000001u,0x00000047u,0x0004003bu,0x00000048u,0x00000049u,0x00000001u,0x00040017u,0x0000004au,0x00000046u,0x00000002u,0x00090019u,0x0000004fu,0x00000006u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000002u,0x00000002u,0x00040020u,0x00000050u,0x00000000u,0x0000004fu,0x0004003bu,0x00000050u,0x00000051u,0x00000000u,0x00020014u,0x00000054u,0x0004002bu,0x00000046u,0x00000055u,0x00000000u,0x00040020u,0x00000056u,0x00000007u,0x00000042u,0x0004002bu,0x00000046u,0x0000005fu,0x00000001u,0x00040017u,0x00000069u,0x00000006u,0x00000002u,0x00040020u,0x0000006au,0x00000007u,0Line truncated
|
||||||
static const size_t OF3_EXPAND_LEN = 1798;
|
static const size_t OF3_EXPAND_LEN = 1798;
|
||||||
static const uint32_t OF3_FLOW_M4_SPV[] = {0x07230203u,0x00010300u,0x0008000bu,0x00000151u,0x00000000u,0x00020011u,0x00000001u,0x00020011u,0x00000032u,0x0006000bu,0x00000001u,0x4c534c47u,0x6474732eu,0x3035342eu,0x00000000u,0x0003000eu,0x00000000u,0x00000001u,0x0006000fu,0x00000005u,0x00000004u,0x6e69616du,0x00000000u,0x000000f6u,0x00060010u,0x00000004u,0x00000011u,0x00000010u,0x00000010u,0x00000001u,0x00030003u,0x00000002u,0x000001c2u,0x00040005u,0x00000004u,0x6e69616du,0x00000000u,0x00080005u,0x00000010u,0x636f6c62u,0x6461536bu,0x31327328u,0x3132733bu,0x3266763bu,0x0000003bu,0x00030005u,0x0000000du,0x00000061u,0x00030005u,0x0000000eu,0x00000062u,0x00040005u,0x0000000fu,0x646e6163u,0x00000000u,0x00070005u,0x00000016u,0x766c6f73u,0x32732865u,0x32733b31u,0x66763b31u,0x00003b32u,0x00030005u,0x00000013u,0x00000061u,0x00030005u,0x00000014u,0x00000062u,0x00040005u,0x00000015u,0x64657270u,0x00000000u,0x00030005u,0x00000019u,0x00646173u,0x00030005u,0x0000001du,0x00007962u,0x00030005u,0x00000028u,0x00007862u,0x00030005u,0x00000030u,0x00006f62u,0x00030005u,0x00000036u,0x00006170u,0x00030005u,0x00000039u,0x00765567u,0x00050005u,0x0000003cu,0x766e4967u,0x616d754cu,0x00000000u,0x00030005u,0x00000045u,0x00006270u,0x00040005u,0x0000005du,0x74736562u,0x00646153u,0x00050005u,0x0000005fu,0x74736562u,0x70736944u,0x00000000u,0x00030005u,0x00000061u,0x00007973u,0x00030005u,0x0000006bu,0x00007873u,0x00040005u,0x00000073u,0x646e6163u,0x00000000u,0x00030005u,0x0000007bu,0x00646173u,0x00040005u,0x0000007cu,0x61726170u,0x0000006du,0x00030005u,0x00000095u,0x00000055u,0x00060006u,0x00000095u,0x00000000u,0x776f6c66u,0x6c616353u,0x00000065u,0x00050006u,0x00000095u,0x00000001u,0x6576656cu,0x0000006cu,0x00050006u,0x00000095u,0x00000002u,0x6c63636fu,0x00006f4cu,0x00050006u,0x00000095u,0x00000003u,0x6c63636fu,0x00006948u,0x00030005u,0x00000097u,0x00000000u,0x00040005u,0x0000009eu,0x43646173u,0x00000000u,0x00040005u,0x000000a1u,0x58646173u,0x0000006du,0x00040005u,0x000000a6u,0x61726170u,0x0000006du,0x00040005u,0x000000a9u,0x58646173u,0x00000070u,0x00040005u,0x000000aeu,0x61726170u,0x0000006du,0x00040005u,0x000000b1u,0x59646173u,0x0000006du,0x00040005u,0x000000b5u,0x61726170u,0x0000006du,0x00040005u,0x000000b8u,0x59646173u,0x00000070u,0x00040005u,0x000000bcu,0x61726170u,0x0000006du,0x00030005u,0x000000bfu,0x00007864u,0x00030005u,0x000000c0u,0x00007964u,0x00040005u,0x000000c1u,0x6f6e6564u,0x0000586du,0x00040005u,0x000000c9u,0x6f6e6564u,0x0000596du,0x00030005u,0x000000f3u,0x00646967u,0x00080005u,0x000000f6u,0x475f6c67u,0x61626f6cu,0x766e496cu,0x7461636fu,0x496e6f69u,0x00000044u,0x00030005u,0x000000fbu,0x006d6964u,0x00040005u,0x000000feu,0x6f6c4675u,0x00000077u,0x00050005u,0x0000011au,0x6d754c75u,0x72754361u,0x00000072u,0x00040005u,0x00000122u,0x654c6f74u,0x006c6576u,0x00040005u,0x00000129u,0x64657270u,0x00000000u,0x00050005u,0x0000012au,0x65725075u,0x74636964u,0x0000726fu,0x00030005u,0x0000012eu,0x00647766u,0x00050005u,0x0000012fu,0x6d754c75u,0x65725061u,0x00000076u,0x00040005u,0x00000134u,0x61726170u,0x0000006du,0x00030005u,0x00000136u,0x00647762u,0x00040005u,0x0000013bu,0x61726170u,0x0000006du,0x00040005u,0x0000013du,0x75466f74u,0x00006c6cu,0x00030047u,0x00000095u,0x00000002u,0x00050048u,0x00000095u,0x00000000u,0x00000023u,0x00000000u,0x00050048u,0x00000095u,0x00000001u,0x00000023u,0x00000004u,0x00050048u,0x00000095u,0x00000002u,0x00000023u,0x00000008u,0x00050048u,0x00000095u,0x00000003u,0x00000023u,0x0000000cu,0x00040047u,0x00000097u,0x00000021u,0x00000000u,0x00040047u,0x00000097u,0x00000022u,0x00000000u,0x00040047u,0x000000f6u,0x0000000bu,0x0000001cu,0x00030047u,0x000000feu,0x00000019u,0x00040047u,0x000000feu,0x00000021u,0x00000030u,0x00040047u,0x000000feu,0x00000022u,0x00000000u,0x00040047u,0x0000011au,0x00000021u,0x00000021u,0x00040047u,0x0000011au,0x00000022u,0x00000000u,0x00040047u,0x0000012au,0x00000021u,0x00000022u,0x00040047u,0x0000012au,0x00000022u,0x00000000u,0x00040047u,0x0000012fu,0x00000021u,0x00000020u,0x00040047u,0x0000012fu,0x00000022u,0x00000000u,0x00040047u,0x00000150u,0x0000000bu,0x00000019u,0x00020013u,0x00000002u,0x00030021u,0x00000003u,0x00000002u,0x00030016u,0x00000006u,0x00000020u,0x00090019u,0x00000007u,0x00000006u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000001u,0x00000000u,0x0003001bu,0x00000008u,0x00000007u,0x00040020u,0x00000009u,0x00000000u,0x00000008u,0x00040017u,0x0000000au,0x00000006u,0x00000002u,0x00040020u,0x0000000bu,0x00000007u,0x0000000au,0x00060021u,0x0000000cu,0x00000006u,0x00000009u,0x00000009u,0x0000000bu,0x00060021u,0x00000012u,0x0000000au,0x00000009u,0x00000009u,0x0000000bu,0x00040020u,0x00000018u,0x00000007u,0x00000006u,0x0004002bu,0x00000006u,0x0000001au,0x00000000u,0x00040015u,0x0000001bu,0x00000020u,0x00000001u,0x00040020u,0x0000001cu,0x00000007u,0x0000001bu,0x0004002bu,0x0000001bu,0x0000001eu,0xffffffffu,0x0004002bu,0x0000001bu,0x00000025u,0x00000001u,0x00020014u,0x00000026u,0x00040020u,0x00000038u,0x00000006u,0x0000000au,0x0004003bu,0x00000038u,0x00000039u,0x00000006u,0x0004003bu,Line truncated
|
static const uint32_t OF3_FLOW_M4_SPV[] = {0x07230203u,0x00010300u,0x0008000bu,0x00000151u,0x00000000u,0x00020011u,0x00000001u,0x00020011u,0x00000032u,0x0006000bu,0x00000001u,0x4c534c47u,0x6474732eu,0x3035342eu,0x00000000u,0x0003000eu,0x00000000u,0x00000001u,0x0006000fu,0x00000005u,0x00000004u,0x6e69616du,0x00000000u,0x000000f6u,0x00060010u,0x00000004u,0x00000011u,0x00000010u,0x00000010u,0x00000001u,0x00030003u,0x00000002u,0x000001c2u,0x00040005u,0x00000004u,0x6e69616du,0x00000000u,0x00080005u,0x00000010u,0x636f6c62u,0x6461536bu,0x31327328u,0x3132733bu,0x3266763bu,0x0000003bu,0x00030005u,0x0000000du,0x00000061u,0x00030005u,0x0000000eu,0x00000062u,0x00040005u,0x0000000fu,0x646e6163u,0x00000000u,0x00070005u,0x00000016u,0x766c6f73u,0x32732865u,0x32733b31u,0x66763b31u,0x00003b32u,0x00030005u,0x00000013u,0x00000061u,0x00030005u,0x00000014u,0x00000062u,0x00040005u,0x00000015u,0x64657270u,0x00000000u,0x00030005u,0x00000019u,0x00646173u,0x00030005u,0x0000001du,0x00007962u,0x00030005u,0x00000028u,0x00007862u,0x00030005u,0x00000030u,0x00006f62u,0x00030005u,0x00000036u,0x00006170u,0x00030005u,0x00000039u,0x00765567u,0x00050005u,0x0000003cu,0x766e4967u,0x616d754cu,0x00000000u,0x00030005u,0x00000045u,0x00006270u,0x00040005u,0x0000005du,0x74736562u,0x00646153u,0x00050005u,0x0000005fu,0x74736562u,0x70736944u,0x00000000u,0x00030005u,0x00000061u,0x00007973u,0x00030005u,0x0000006bu,0x00007873u,0x00040005u,0x00000073u,0x646e6163u,0x00000000u,0x00030005u,0x0000007bu,0x00646173u,0x00040005u,0x0000007cu,0x61726170u,0x0000006du,0x00030005u,0x00000095u,0x00000055u,0x00060006u,0x00000095u,0x00000000u,0x776f6c66u,0x6c616353u,0x00000065u,0x00050006u,0x00000095u,0x00000001u,0x6576656cu,0x0000006cu,0x00050006u,0x00000095u,0x00000002u,0x6c63636fu,0x00006f4cu,0x00050006u,0x00000095u,0x00000003u,0x6c63636fu,0x00006948u,0x00030005u,0x00000097u,0x00000000u,0x00040005u,0x0000009eu,0x43646173u,0x00000000u,0x00040005u,0x000000a1u,0x58646173u,0x0000006du,0x00040005u,0x000000a6u,0x61726170u,0x0000006du,0x00040005u,0x000000a9u,0x58646173u,0x00000070u,0x00040005u,0x000000aeu,0x61726170u,0x0000006du,0x00040005u,0x000000b1u,0x59646173u,0x0000006du,0x00040005u,0x000000b5u,0x61726170u,0x0000006du,0x00040005u,0x000000b8u,0x59646173u,0x00000070u,0x00040005u,0x000000bcu,0x61726170u,0x0000006du,0x00030005u,0x000000bfu,0x00007864u,0x00030005u,0x000000c0u,0x00007964u,0x00040005u,0x000000c1u,0x6f6e6564u,0x0000586du,0x00040005u,0x000000c9u,0x6f6e6564u,0x0000596du,0x00030005u,0x000000f3u,0x00646967u,0x00080005u,0x000000f6u,0x475f6c67u,0x61626f6cu,0x766e496cu,0x7461636fu,0x496e6f69u,0x00000044u,0x00030005u,0x000000fbu,0x006d6964u,0x00040005u,0x000000feu,0x6f6c4675u,0x00000077u,0x00050005u,0x0000011au,0x6d754c75u,0x72754361u,0x00000072u,0x00040005u,0x00000122u,0x654c6f74u,0x006c6576u,0x00040005u,0x00000129u,0x64657270u,0x00000000u,0x00050005u,0x0000012au,0x65725075u,0x74636964u,0x0000726fu,0x00030005u,0x0000012eu,0x00647766u,0x00050005u,0x0000012fu,0x6d754c75u,0x65725061u,0x00000076u,0x00040005u,0x00000134u,0x61726170u,0x0000006du,0x00030005u,0x00000136u,0x00647762u,0x00040005u,0x0000013bu,0x61726170u,0x0000006du,0x00040005u,0x0000013du,0x75466f74u,0x00006c6cu,0x00030047u,0x00000095u,0x00000002u,0x00050048u,0x00000095u,0x00000000u,0x00000023u,0x00000000u,0x00050048u,0x00000095u,0x00000001u,0x00000023u,0x00000004u,0x00050048u,0x00000095u,0x00000002u,0x00000023u,0x00000008u,0x00050048u,0x00000095u,0x00000003u,0x00000023u,0x0000000cu,0x00040047u,0x00000097u,0x00000021u,0x00000000u,0x00040047u,0x00000097u,0x00000022u,0x00000000u,0x00040047u,0x000000f6u,0x0000000bu,0x0000001cu,0x00030047u,0x000000feu,0x00000019u,0x00040047u,0x000000feu,0x00000021u,0x00000030u,0x00040047u,0x000000feu,0x00000022u,0x00000000u,0x00040047u,0x0000011au,0x00000021u,0x00000021u,0x00040047u,0x0000011au,0x00000022u,0x00000000u,0x00040047u,0x0000012au,0x00000021u,0x00000022u,0x00040047u,0x0000012au,0x00000022u,0x00000000u,0x00040047u,0x0000012fu,0x00000021u,0x00000020u,0x00040047u,0x0000012fu,0x00000022u,0x00000000u,0x00040047u,0x00000150u,0x0000000bu,0x00000019u,0x00020013u,0x00000002u,0x00030021u,0x00000003u,0x00000002u,0x00030016u,0x00000006u,0x00000020u,0x00090019u,0x00000007u,0x00000006u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000001u,0x00000000u,0x0003001bu,0x00000008u,0x00000007u,0x00040020u,0x00000009u,0x00000000u,0x00000008u,0x00040017u,0x0000000au,0x00000006u,0x00000002u,0x00040020u,0x0000000bu,0x00000007u,0x0000000au,0x00060021u,0x0000000cu,0x00000006u,0x00000009u,0x00000009u,0x0000000bu,0x00060021u,0x00000012u,0x0000000au,0x00000009u,0x00000009u,0x0000000bu,0x00040020u,0x00000018u,0x00000007u,0x00000006u,0x0004002bu,0x00000006u,0x0000001au,0x00000000u,0x00040015u,0x0000001bu,0x00000020u,0x00000001u,0x00040020u,0x0000001cu,0x00000007u,0x0000001bu,0x0004002bu,0x0000001bu,0x0000001eu,0xffffffffu,0x0004002bu,0x0000001bu,0x00000025u,0x00000001u,0x00020014u,0x00000026u,0x00040020u,0x00000038u,0x00000006u,0x0000000au,0x0004003bu,0x00000038u,0x00000039u,0x00000006u,0x0004003bu,Line truncated
|
||||||
@@ -18,8 +226,8 @@ static const uint32_t OF3_GM_REDUCE_SPV[] = {0x07230203u,0x00010300u,0x0008000bu
|
|||||||
static const size_t OF3_GM_REDUCE_LEN = 2584;
|
static const size_t OF3_GM_REDUCE_LEN = 2584;
|
||||||
static const uint32_t OF3_GM_PREWARP_SPV[] = {0x07230203u,0x00010300u,0x0008000bu,0x00000074u,0x00000000u,0x00020011u,0x00000001u,0x00020011u,0x00000032u,0x0006000bu,0x00000001u,0x4c534c47u,0x6474732eu,0x3035342eu,0x00000000u,0x0003000eu,0x00000000u,0x00000001u,0x0006000fu,0x00000005u,0x00000004u,0x6e69616du,0x00000000u,0x0000000du,0x00060010u,0x00000004u,0x00000011u,0x00000010u,0x00000010u,0x00000001u,0x00030003u,0x00000002u,0x000001c2u,0x00040005u,0x00000004u,0x6e69616du,0x00000000u,0x00030005u,0x00000009u,0x00646967u,0x00080005u,0x0000000du,0x475f6c67u,0x61626f6cu,0x766e496cu,0x7461636fu,0x496e6f69u,0x00000044u,0x00030005u,0x00000012u,0x006d6964u,0x00040005u,0x00000016u,0x74734475u,0x00000000u,0x00030005u,0x00000030u,0x00007675u,0x00030005u,0x00000039u,0x00000071u,0x00040005u,0x0000003du,0x6c6f6370u,0x00000030u,0x00030005u,0x0000003fu,0x00004d47u,0x00050006u,0x0000003fu,0x00000000u,0x694c6d67u,0x0000006eu,0x00050006u,0x0000003fu,0x00000001u,0x694c6d67u,0x0000546eu,0x00050006u,0x0000003fu,0x00000002u,0x70416d67u,0x00000070u,0x00050006u,0x0000003fu,0x00000003u,0x70416d67u,0x00005470u,0x00030005u,0x00000041u,0x00000000u,0x00040005u,0x00000049u,0x6c6f6370u,0x00000031u,0x00040005u,0x00000051u,0x72537675u,0x00000063u,0x00030005u,0x00000064u,0x00000076u,0x00040005u,0x00000068u,0x72754375u,0x00000072u,0x00040047u,0x0000000du,0x0000000bu,0x0000001cu,0x00030047u,0x00000016u,0x00000019u,0x00040047u,0x00000016u,0x00000021u,0x00000030u,0x00040047u,0x00000016u,0x00000022u,0x00000000u,0x00030047u,0x0000003fu,0x00000002u,0x00050048u,0x0000003fu,0x00000000u,0x00000023u,0x00000000u,0x00050048u,0x0000003fu,0x00000001u,0x00000023u,0x00000010u,0x00050048u,0x0000003fu,0x00000002u,0x00000023u,0x00000020u,0x00050048u,0x0000003fu,0x00000003u,0x00000023u,0x00000030u,0x00040047u,0x00000041u,0x00000021u,0x00000001u,0x00040047u,0x00000041u,0x00000022u,0x00000000u,0x00040047u,0x00000068u,0x00000021u,0x00000020u,0x00040047u,0x00000068u,0x00000022u,0x00000000u,0x00040047u,0x00000073u,0x0000000bu,0x00000019u,0x00020013u,0x00000002u,0x00030021u,0x00000003u,0x00000002u,0x00040015u,0x00000006u,0x00000020u,0x00000001u,0x00040017u,0x00000007u,0x00000006u,0x00000002u,0x00040020u,0x00000008u,0x00000007u,0x00000007u,0x00040015u,0x0000000au,0x00000020u,0x00000000u,0x00040017u,0x0000000bu,0x0000000au,0x00000003u,0x00040020u,0x0000000cu,0x00000001u,0x0000000bu,0x0004003bu,0x0000000cu,0x0000000du,0x00000001u,0x00040017u,0x0000000eu,0x0000000au,0x00000002u,0x00030016u,0x00000013u,0x00000020u,0x00090019u,0x00000014u,0x00000013u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000002u,0x00000003u,0x00040020u,0x00000015u,0x00000000u,0x00000014u,0x0004003bu,0x00000015u,0x00000016u,0x00000000u,0x00020014u,0x00000019u,0x0004002bu,0x0000000au,0x0000001au,0x00000000u,0x00040020u,0x0000001bu,0x00000007u,0x00000006u,0x0004002bu,0x0000000au,0x00000024u,0x00000001u,0x00040017u,0x0000002eu,0x00000013u,0x00000002u,0x00040020u,0x0000002fu,0x00000007u,0x0000002eu,0x0004002bu,0x00000013u,0x00000033u,0x3f000000u,0x00040017u,0x0000003eu,0x00000013u,0x00000004u,0x0006001eu,0x0000003fu,0x0000003eu,0x0000003eu,0x0000003eu,0x0000003eu,0x00040020u,0x00000040u,0x00000002u,0x0000003fu,0x0004003bu,0x00000040u,0x00000041u,0x00000002u,0x0004002bu,0x00000006u,0x00000042u,0x00000002u,0x00040020u,0x00000043u,0x00000002u,0x00000013u,0x0004002bu,0x0000000au,0x0000004au,0x00000002u,0x0004002bu,0x0000000au,0x0000004du,0x00000003u,0x00040020u,0x00000054u,0x00000007u,0x00000013u,0x0004002bu,0x00000006u,0x0000005eu,0x00000003u,0x00040020u,0x0000005fu,0x00000002u,0x0000003eu,0x00090019u,0x00000065u,0x00000013u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000001u,0x00000000u,0x0003001bu,0x00000066u,0x00000065u,0x00040020u,0x00000067u,0x00000000u,0x00000066u,0x0004003bu,0x00000067u,0x00000068u,0x00000000u,0x0004002bu,0x00000013u,0x0000006bu,0x00000000u,0x0004002bu,0x0000000au,0x00000072u,0x00000010u,0x0006002cu,0x0000000bu,0x00000073u,0x00000072u,0x00000072u,0x00000024u,0x00050036u,0x00000002u,0x00000004u,0x00000000u,0x00000003u,0x000200f8u,0x00000005u,0x0004003bu,0x00000008u,0x00000009u,0x00000007u,0x0004003bu,0x00000008u,0x00000012u,0x00000007u,0x0004003bu,0x0000002fu,0x00000030u,0x00000007u,0x0004003bu,0x0000002fu,0x00000039u,0x00000007u,0x0004003bu,0x0000002fu,0x0000003du,0x00000007u,0x0004003bu,0x0000002fu,0x00000049u,0x00000007u,0x0004003bu,0x0000002fu,0x00000051u,0x00000007u,0x0004003bu,0x00000054u,0x00000064u,0x00000007u,0x0004003du,0x0000000bu,0x0000000fu,0x0000000du,0x0007004fu,0x0000000eu,0x00000010u,0x0000000fu,0x0000000fu,0x00000000u,0x00000001u,0x0004007cu,0x00000007u,0x00000011u,0x00000010u,0x0003003eu,0x00000009u,0x00000011u,0x0004003du,0x00000014u,0x00000017u,0x00000016u,0x00040068u,0x00000007u,0x00000018u,0x00000017u,0x0003003eu,0x00000012u,0x00000018u,0x00050041u,0x0000001bu,0x0000001cu,0x00000009u,0x0000001au,0x0004003du,0x00000006u,0x0000001du,0x0000001cu,0x00050041u,0x0000001bu,0x0000001eu,0x00000012u,0x0000001au,0x0004003du,0x00000006u,0x0000001fu,0x0000001Line truncated
|
static const uint32_t OF3_GM_PREWARP_SPV[] = {0x07230203u,0x00010300u,0x0008000bu,0x00000074u,0x00000000u,0x00020011u,0x00000001u,0x00020011u,0x00000032u,0x0006000bu,0x00000001u,0x4c534c47u,0x6474732eu,0x3035342eu,0x00000000u,0x0003000eu,0x00000000u,0x00000001u,0x0006000fu,0x00000005u,0x00000004u,0x6e69616du,0x00000000u,0x0000000du,0x00060010u,0x00000004u,0x00000011u,0x00000010u,0x00000010u,0x00000001u,0x00030003u,0x00000002u,0x000001c2u,0x00040005u,0x00000004u,0x6e69616du,0x00000000u,0x00030005u,0x00000009u,0x00646967u,0x00080005u,0x0000000du,0x475f6c67u,0x61626f6cu,0x766e496cu,0x7461636fu,0x496e6f69u,0x00000044u,0x00030005u,0x00000012u,0x006d6964u,0x00040005u,0x00000016u,0x74734475u,0x00000000u,0x00030005u,0x00000030u,0x00007675u,0x00030005u,0x00000039u,0x00000071u,0x00040005u,0x0000003du,0x6c6f6370u,0x00000030u,0x00030005u,0x0000003fu,0x00004d47u,0x00050006u,0x0000003fu,0x00000000u,0x694c6d67u,0x0000006eu,0x00050006u,0x0000003fu,0x00000001u,0x694c6d67u,0x0000546eu,0x00050006u,0x0000003fu,0x00000002u,0x70416d67u,0x00000070u,0x00050006u,0x0000003fu,0x00000003u,0x70416d67u,0x00005470u,0x00030005u,0x00000041u,0x00000000u,0x00040005u,0x00000049u,0x6c6f6370u,0x00000031u,0x00040005u,0x00000051u,0x72537675u,0x00000063u,0x00030005u,0x00000064u,0x00000076u,0x00040005u,0x00000068u,0x72754375u,0x00000072u,0x00040047u,0x0000000du,0x0000000bu,0x0000001cu,0x00030047u,0x00000016u,0x00000019u,0x00040047u,0x00000016u,0x00000021u,0x00000030u,0x00040047u,0x00000016u,0x00000022u,0x00000000u,0x00030047u,0x0000003fu,0x00000002u,0x00050048u,0x0000003fu,0x00000000u,0x00000023u,0x00000000u,0x00050048u,0x0000003fu,0x00000001u,0x00000023u,0x00000010u,0x00050048u,0x0000003fu,0x00000002u,0x00000023u,0x00000020u,0x00050048u,0x0000003fu,0x00000003u,0x00000023u,0x00000030u,0x00040047u,0x00000041u,0x00000021u,0x00000001u,0x00040047u,0x00000041u,0x00000022u,0x00000000u,0x00040047u,0x00000068u,0x00000021u,0x00000020u,0x00040047u,0x00000068u,0x00000022u,0x00000000u,0x00040047u,0x00000073u,0x0000000bu,0x00000019u,0x00020013u,0x00000002u,0x00030021u,0x00000003u,0x00000002u,0x00040015u,0x00000006u,0x00000020u,0x00000001u,0x00040017u,0x00000007u,0x00000006u,0x00000002u,0x00040020u,0x00000008u,0x00000007u,0x00000007u,0x00040015u,0x0000000au,0x00000020u,0x00000000u,0x00040017u,0x0000000bu,0x0000000au,0x00000003u,0x00040020u,0x0000000cu,0x00000001u,0x0000000bu,0x0004003bu,0x0000000cu,0x0000000du,0x00000001u,0x00040017u,0x0000000eu,0x0000000au,0x00000002u,0x00030016u,0x00000013u,0x00000020u,0x00090019u,0x00000014u,0x00000013u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000002u,0x00000003u,0x00040020u,0x00000015u,0x00000000u,0x00000014u,0x0004003bu,0x00000015u,0x00000016u,0x00000000u,0x00020014u,0x00000019u,0x0004002bu,0x0000000au,0x0000001au,0x00000000u,0x00040020u,0x0000001bu,0x00000007u,0x00000006u,0x0004002bu,0x0000000au,0x00000024u,0x00000001u,0x00040017u,0x0000002eu,0x00000013u,0x00000002u,0x00040020u,0x0000002fu,0x00000007u,0x0000002eu,0x0004002bu,0x00000013u,0x00000033u,0x3f000000u,0x00040017u,0x0000003eu,0x00000013u,0x00000004u,0x0006001eu,0x0000003fu,0x0000003eu,0x0000003eu,0x0000003eu,0x0000003eu,0x00040020u,0x00000040u,0x00000002u,0x0000003fu,0x0004003bu,0x00000040u,0x00000041u,0x00000002u,0x0004002bu,0x00000006u,0x00000042u,0x00000002u,0x00040020u,0x00000043u,0x00000002u,0x00000013u,0x0004002bu,0x0000000au,0x0000004au,0x00000002u,0x0004002bu,0x0000000au,0x0000004du,0x00000003u,0x00040020u,0x00000054u,0x00000007u,0x00000013u,0x0004002bu,0x00000006u,0x0000005eu,0x00000003u,0x00040020u,0x0000005fu,0x00000002u,0x0000003eu,0x00090019u,0x00000065u,0x00000013u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000001u,0x00000000u,0x0003001bu,0x00000066u,0x00000065u,0x00040020u,0x00000067u,0x00000000u,0x00000066u,0x0004003bu,0x00000067u,0x00000068u,0x00000000u,0x0004002bu,0x00000013u,0x0000006bu,0x00000000u,0x0004002bu,0x0000000au,0x00000072u,0x00000010u,0x0006002cu,0x0000000bu,0x00000073u,0x00000072u,0x00000072u,0x00000024u,0x00050036u,0x00000002u,0x00000004u,0x00000000u,0x00000003u,0x000200f8u,0x00000005u,0x0004003bu,0x00000008u,0x00000009u,0x00000007u,0x0004003bu,0x00000008u,0x00000012u,0x00000007u,0x0004003bu,0x0000002fu,0x00000030u,0x00000007u,0x0004003bu,0x0000002fu,0x00000039u,0x00000007u,0x0004003bu,0x0000002fu,0x0000003du,0x00000007u,0x0004003bu,0x0000002fu,0x00000049u,0x00000007u,0x0004003bu,0x0000002fu,0x00000051u,0x00000007u,0x0004003bu,0x00000054u,0x00000064u,0x00000007u,0x0004003du,0x0000000bu,0x0000000fu,0x0000000du,0x0007004fu,0x0000000eu,0x00000010u,0x0000000fu,0x0000000fu,0x00000000u,0x00000001u,0x0004007cu,0x00000007u,0x00000011u,0x00000010u,0x0003003eu,0x00000009u,0x00000011u,0x0004003du,0x00000014u,0x00000017u,0x00000016u,0x00040068u,0x00000007u,0x00000018u,0x00000017u,0x0003003eu,0x00000012u,0x00000018u,0x00050041u,0x0000001bu,0x0000001cu,0x00000009u,0x0000001au,0x0004003du,0x00000006u,0x0000001du,0x0000001cu,0x00050041u,0x0000001bu,0x0000001eu,0x00000012u,0x0000001au,0x0004003du,0x00000006u,0x0000001fu,0x0000001Line truncated
|
||||||
static const size_t OF3_GM_PREWARP_LEN = 706;
|
static const size_t OF3_GM_PREWARP_LEN = 706;
|
||||||
static const uint32_t OF3_FLOWREG_SPV[] = {0x07230203u,0x00010300u,0x0008000bu,0x00000144u,0x00000000u,0x00020011u,0x00000001u,0x00020011u,0x00000032u,0x0006000bu,0x00000001u,0x4c534c47u,0x6474732eu,0x3035342eu,0x00000000u,0x0003000eu,0x00000000u,0x00000001u,0x0006000fu,0x00000005u,0x00000004u,0x6e69616du,0x00000000u,0x00000037u,0x00060010u,0x00000004u,0x00000011u,0x00000010u,0x00000010u,0x00000001u,0x00030003u,0x00000002u,0x000001c2u,0x00040005u,0x00000004u,0x6e69616du,0x00000000u,0x00060005u,0x0000000eu,0x63746566u,0x76285568u,0x763b3269u,0x003b3269u,0x00030005u,0x0000000cu,0x00000070u,0x00030005u,0x0000000du,0x006d6964u,0x00060005u,0x00000013u,0x63746566u,0x76284c68u,0x763b3269u,0x003b3269u,0x00030005u,0x00000011u,0x00000070u,0x00030005u,0x00000012u,0x006d6964u,0x00040005u,0x00000018u,0x6f6c4675u,0x006e4977u,0x00040005u,0x00000026u,0x6d754c75u,0x00000061u,0x00030005u,0x00000034u,0x00646967u,0x00080005u,0x00000037u,0x475f6c67u,0x61626f6cu,0x766e496cu,0x7461636fu,0x496e6f69u,0x00000044u,0x00030005u,0x0000003cu,0x006d6964u,0x00030005u,0x00000055u,0x00007464u,0x00030005u,0x00000056u,0x00000055u,0x00050006u,0x00000056u,0x00000000u,0x61726170u,0x0000736du,0x00030005u,0x00000058u,0x00000000u,0x00040005u,0x0000005cu,0x626d616cu,0x00006164u,0x00050005u,0x0000005fu,0x65676465u,0x68706c41u,0x00000061u,0x00040005u,0x00000063u,0x54737065u,0x00000056u,0x00030005u,0x00000068u,0x00004375u,0x00040005u,0x00000069u,0x61726170u,0x0000006du,0x00040005u,0x0000006bu,0x61726170u,0x0000006du,0x00030005u,0x0000006eu,0x00004c75u,0x00040005u,0x00000073u,0x61726170u,0x0000006du,0x00040005u,0x00000074u,0x61726170u,0x0000006du,0x00030005u,0x00000077u,0x00005275u,0x00040005u,0x0000007bu,0x61726170u,0x0000006du,0x00040005u,0x0000007cu,0x61726170u,0x0000006du,0x00030005u,0x0000007fu,0x00005575u,0x00040005u,0x00000083u,0x61726170u,0x0000006du,0x00040005u,0x00000084u,0x61726170u,0x0000006du,0x00030005u,0x00000087u,0x00004475u,0x00040005u,0x0000008bu,0x61726170u,0x0000006du,0x00040005u,0x0000008cu,0x61726170u,0x0000006du,0x00040005u,0x0000008fu,0x6d69646cu,0x00000000u,0x00030005u,0x00000093u,0x00004c6cu,0x00040005u,0x00000096u,0x61726170u,0x0000006du,0x00040005u,0x00000097u,0x61726170u,0x0000006du,0x00030005u,0x0000009au,0x0000526cu,0x00040005u,0x0000009du,0x61726170u,0x0000006du,0x00040005u,0x0000009eu,0x61726170u,0x0000006du,0x00030005u,0x000000a1u,0x0000556cu,0x00040005u,0x000000a4u,0x61726170u,0x0000006du,0x00040005u,0x000000a5u,0x61726170u,0x0000006du,0x00030005u,0x000000a8u,0x0000446cu,0x00040005u,0x000000abu,0x61726170u,0x0000006du,0x00040005u,0x000000acu,0x61726170u,0x0000006du,0x00040005u,0x000000afu,0x67616d67u,0x00000000u,0x00030005u,0x000000bbu,0x00000067u,0x00030005u,0x000000c4u,0x00004c64u,0x00030005u,0x000000c8u,0x00005264u,0x00030005u,0x000000ccu,0x00005564u,0x00030005u,0x000000d0u,0x00004464u,0x00030005u,0x000000d4u,0x00003265u,0x00030005u,0x000000d8u,0x00004c77u,0x00030005u,0x000000e1u,0x00005277u,0x00030005u,0x000000eau,0x00005577u,0x00030005u,0x000000f3u,0x00004477u,0x00040005u,0x000000fcu,0x576d7573u,0x00000000u,0x00040005u,0x00000104u,0x576d7573u,0x00000055u,0x00040005u,0x00000114u,0x66694475u,0x00000066u,0x00030005u,0x00000120u,0x00003066u,0x00050005u,0x00000121u,0x6f6c4675u,0x73624f77u,0x00000000u,0x00040005u,0x0000012au,0x74656874u,0x00000061u,0x00030005u,0x0000012eu,0x00000072u,0x00040005u,0x00000132u,0x77654e75u,0x00000000u,0x00050005u,0x0000013eu,0x6f6c4675u,0x74754f77u,0x00000000u,0x00040047u,0x00000018u,0x00000021u,0x00000020u,0x00040047u,0x00000018u,0x00000022u,0x00000000u,0x00040047u,0x00000026u,0x00000021u,0x00000022u,0x00040047u,0x00000026u,0x00000022u,0x00000000u,0x00040047u,0x00000037u,0x0000000bu,0x0000001cu,0x00030047u,0x00000056u,0x00000002u,0x00050048u,0x00000056u,0x00000000u,0x00000023u,0x00000000u,0x00040047u,0x00000058u,0x00000021u,0x00000000u,0x00040047u,0x00000058u,0x00000022u,0x00000000u,0x00040047u,0x00000121u,0x00000021u,0x00000021u,0x00040047u,0x00000121u,0x00000022u,0x00000000u,0x00030047u,0x0000013eu,0x00000019u,0x00040047u,0x0000013eu,0x00000021u,0x00000030u,0x00040047u,0x0000013eu,0x00000022u,0x00000000u,0x00040047u,0x00000143u,0x0000000bu,0x00000019u,0x00020013u,0x00000002u,0x00030021u,0x00000003u,0x00000002u,0x00040015u,0x00000006u,0x00000020u,0x00000001u,0x00040017u,0x00000007u,0x00000006u,0x00000002u,0x00040020u,0x00000008u,0x00000007u,0x00000007u,0x00030016u,0x00000009u,0x00000020u,0x00040017u,0x0000000au,0x00000009u,0x00000004u,0x00050021u,0x0000000bu,0x0000000au,0x00000008u,0x00000008u,0x00050021u,0x00000010u,0x00000009u,0x00000008u,0x00000008u,0x00090019u,0x00000015u,0x00000009u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000001u,0x00000000u,0x0003001bu,0x00000016u,0x00000015u,0x00040020u,0x00000017u,0x00000000u,0x00000016u,0x0004003bu,0x00000017u,0x00000018u,0x00000000u,0x0004002bu,0x00000006u,0x0000001bu,0x00000000u,0x0005002cu,0x00000007u,0x0000001cu,0x0000001bu,0x0000001bu,0x0004002bu,0x00000006u,0x0000001eu,0x00000001u,0x0004003bu,0x00000017u,0x00000026u,0x00000000u,Line truncated
|
static const uint32_t OF3_FLOWREG_SPV[] = {0x07230203u,0x00010300u,0x0008000bu,0x00000196u,0x00000000u,0x00020011u,0x00000001u,0x00020011u,0x00000032u,0x0006000bu,0x00000001u,0x4c534c47u,0x6474732eu,0x3035342eu,0x00000000u,0x0003000eu,0x00000000u,0x00000001u,0x0006000fu,0x00000005u,0x00000004u,0x6e69616du,0x00000000u,0x00000037u,0x00060010u,0x00000004u,0x00000011u,0x00000010u,0x00000010u,0x00000001u,0x00030003u,0x00000002u,0x000001c2u,0x00040005u,0x00000004u,0x6e69616du,0x00000000u,0x00040005u,0x00000018u,0x6f6c4675u,0x006e4977u,0x00040005u,0x00000026u,0x6d754c75u,0x00000061u,0x00080005u,0x00000037u,0x475f6c67u,0x61626f6cu,0x766e496cu,0x7461636fu,0x496e6f69u,0x00000044u,0x00030005u,0x00000056u,0x00000055u,0x00050006u,0x00000056u,0x00000000u,0x61726170u,0x0000736du,0x00030005u,0x00000058u,0x00000000u,0x00050005u,0x00000118u,0x6f6c4675u,0x73624f77u,0x00000000u,0x00050005u,0x00000131u,0x6f6c4675u,0x74754f77u,0x00000000u,0x00040047u,0x00000018u,0x00000021u,0x00000020u,0x00040047u,0x00000018u,0x00000022u,0x00000000u,0x00040047u,0x00000026u,0x00000021u,0x00000022u,0x00040047u,0x00000026u,0x00000022u,0x00000000u,0x00040047u,0x00000037u,0x0000000bu,0x0000001cu,0x00030047u,0x00000056u,0x00000002u,0x00050048u,0x00000056u,0x00000000u,0x00000023u,0x00000000u,0x00040047u,0x00000058u,0x00000021u,0x00000000u,0x00040047u,0x00000058u,0x00000022u,0x00000000u,0x00040047u,0x00000118u,0x00000021u,0x00000021u,0x00040047u,0x00000118u,0x00000022u,0x00000000u,0x00030047u,0x00000131u,0x00000019u,0x00040047u,0x00000131u,0x00000021u,0x00000030u,0x00040047u,0x00000131u,0x00000022u,0x00000000u,0x00040047u,0x00000136u,0x0000000bu,0x00000019u,0x00020013u,0x00000002u,0x00030021u,0x00000003u,0x00000002u,0x00040015u,0x00000006u,0x00000020u,0x00000001u,0x00040017u,0x00000007u,0x00000006u,0x00000002u,0x00030016u,0x00000009u,0x00000020u,0x00040017u,0x0000000au,0x00000009u,0x00000004u,0x00090019u,0x00000015u,0x00000009u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000001u,0x00000000u,0x0003001bu,0x00000016u,0x00000015u,0x00040020u,0x00000017u,0x00000000u,0x00000016u,0x0004003bu,0x00000017u,0x00000018u,0x00000000u,0x0004002bu,0x00000006u,0x0000001bu,0x00000000u,0x0005002cu,0x00000007u,0x0000001cu,0x0000001bu,0x0000001bu,0x0004002bu,0x00000006u,0x0000001eu,0x00000001u,0x0004003bu,0x00000017u,0x00000026u,0x00000000u,0x00040015u,0x0000002fu,0x00000020u,0x00000000u,0x0004002bu,0x0000002fu,0x00000030u,0x00000000u,0x00040017u,0x00000035u,0x0000002fu,0x00000003u,0x00040020u,0x00000036u,0x00000001u,0x00000035u,0x0004003bu,0x00000036u,0x00000037u,0x00000001u,0x00040017u,0x00000038u,0x0000002fu,0x00000002u,0x00020014u,0x00000040u,0x0004002bu,0x0000002fu,0x0000004au,0x00000001u,0x0003001eu,0x00000056u,0x0000000au,0x00040020u,0x00000057u,0x00000002u,0x00000056u,0x0004003bu,0x00000057u,0x00000058u,0x00000002u,0x00040020u,0x00000059u,0x00000002u,0x00000009u,0x0004002bu,0x0000002fu,0x00000060u,0x00000002u,0x0004002bu,0x0000002fu,0x00000064u,0x00000003u,0x0004002bu,0x00000006u,0x0000006fu,0xffffffffu,0x0005002cu,0x00000007u,0x00000070u,0x0000006fu,0x0000001bu,0x0005002cu,0x00000007u,0x00000078u,0x0000001eu,0x0000001bu,0x0005002cu,0x00000007u,0x00000080u,0x0000001bu,0x0000006fu,0x0005002cu,0x00000007u,0x00000088u,0x0000001bu,0x0000001eu,0x0004002bu,0x00000009u,0x000000abu,0x3f000000u,0x00040017u,0x000000b2u,0x00000009u,0x00000002u,0x0004002bu,0x00000009u,0x000000bcu,0x3d4ccccdu,0x0004002bu,0x00000009u,0x000000bdu,0x3f800000u,0x0004003bu,0x00000017u,0x00000118u,0x00000000u,0x00090019u,0x0000012fu,0x00000009u,0x00000001u,0x00000000u,0x00000000u,0x00000000u,0x00000002u,0x00000002u,0x00040020u,0x00000130u,0x00000000u,0x0000012fu,0x0004003bu,0x00000130u,0x00000131u,0x00000000u,0x0004002bu,0x0000002fu,0x00000135u,0x00000010u,0x0006002cu,0x00000035u,0x00000136u,0x00000135u,0x00000135u,0x0000004au,0x0005002cu,0x00000007u,0x00000195u,0x0000001eu,0x0000001eu,0x00050036u,0x00000002u,0x00000004u,0x00000000u,0x00000003u,0x000200f8u,0x00000005u,0x000300f7u,0x00000137u,0x00000000u,0x000300fbu,0x00000030u,0x00000138u,0x000200f8u,0x00000138u,0x0004003du,0x00000035u,0x00000039u,0x00000037u,0x0007004fu,0x00000038u,0x0000003au,0x00000039u,0x00000039u,0x00000000u,0x00000001u,0x0004007cu,0x00000007u,0x0000003bu,0x0000003au,0x0004003du,0x00000016u,0x0000003du,0x00000018u,0x00040064u,0x00000015u,0x0000003eu,0x0000003du,0x00050067u,0x00000007u,0x0000003fu,0x0000003eu,0x0000001bu,0x00050051u,0x00000006u,0x00000043u,0x0000003bu,0x00000000u,0x00050051u,0x00000006u,0x00000045u,0x0000003fu,0x00000000u,0x000500afu,0x00000040u,0x00000046u,0x00000043u,0x00000045u,0x000400a8u,0x00000040u,0x00000047u,0x00000046u,0x000300f7u,0x00000049u,0x00000000u,0x000400fau,0x00000047u,0x00000048u,0x00000049u,0x000200f8u,0x00000048u,0x00050051u,0x00000006u,0x0000004cu,0x0000003bu,0x00000001u,0x00050051u,0x00000006u,0x0000004eu,0x0000003fu,0x00000001u,0x000500afu,0x00000040u,0x0000004fu,0x0000004cu,0x0000004eu,0x000200f9u,0x00000049u,0x000200f8u,0x00000049u,0x000700f5u,0x00000040u,0x00000050u,0x00000046u,Line truncated
|
||||||
static const size_t OF3_FLOWREG_LEN = 1936;
|
static const size_t OF3_FLOWREG_LEN = 981;
|
||||||
static const uint32_t DDFG_SYNTH_SPV[] = {0x07230203u,0x00010300u,0x0008000bu,0x00000208u,0x00000000u,0x00020011u,0x00000001u,0x00020011u,0x00000032u,0x0006000bu,0x00000001u,0x4c534c47u,0x6474732eu,0x3035342eu,0x00000000u,0x0003000eu,0x00000000u,0x00000001u,0x0006000fu,0x00000005u,0x00000004u,0x6e69616du,0x00000000u,0x0000001cu,0x00060010u,0x00000004u,0x00000011u,0x00000010u,0x00000010u,0x00000001u,0x00030003u,0x00000002u,0x000001c2u,0x00040005u,0x00000004u,0x6e69616du,0x00000000u,0x00050005u,0x0000000bu,0x616d756cu,0x33667628u,0x0000003bu,0x00030005u,0x0000000au,0x00000063u,0x00030005u,0x00000018u,0x00646967u,0x00080005u,0x0000001cu,0x475f6c67u,0x61626f6cu,0x766e496cu,0x7461636fu,0x496e6f69u,0x00000044u,0x00030005u,0x00000021u,0x006d6964u,0x00040005u,0x00000024u,0x74754f75u,0x00000000u,0x00040005u,0x0000003eu,0x44766e69u,0x00006d69u,0x00030005u,0x00000044u,0x00007675u,0x00030005u,0x0000004du,0x00000055u,0x00060006u,0x0000004du,0x00000000u,0x776f6c66u,0x6c616353u,0x00000065u,0x00050006u,0x0000004du,0x00000001u,0x68706c61u,0x00000061u,0x00050006u,0x0000004du,0x00000002u,0x61746562u,0x00000000u,0x00050006u,0x0000004du,0x00000003u,0x626d616cu,0x00006164u,0x00050006u,0x0000004du,0x00000004u,0x69737065u,0x006e6f6cu,0x00060006u,0x0000004du,0x00000005u,0x746f6870u,0x6163536fu,0x0000656cu,0x00050006u,0x0000004du,0x00000006u,0x30646170u,0x00000000u,0x00050006u,0x0000004du,0x00000007u,0x31646170u,0x00000000u,0x00050006u,0x0000004du,0x00000008u,0x52647568u,0x00746365u,0x00030005u,0x0000004fu,0x00000000u,0x00040005u,0x0000008cu,0x72754375u,0x00000072u,0x00030005u,0x00000098u,0x00676264u,0x00030005u,0x0000009fu,0x00007366u,0x00040005u,0x000000a9u,0x64774273u,0x00000000u,0x00050005u,0x000000aau,0x6f6c4675u,0x64774277u,0x00000000u,0x00040005u,0x000000aeu,0x64774673u,0x00000000u,0x00050005u,0x000000afu,0x6f6c4675u,0x64774677u,0x00000000u,0x00030005u,0x000000b3u,0x00313046u,0x00030005u,0x000000bau,0x00303146u,0x00040005u,0x000000c1u,0x31306663u,0x00000000u,0x00040005u,0x000000c5u,0x30316663u,0x00000000u,0x00030005u,0x000000c9u,0x0031306du,0x00030005u,0x000000d5u,0x0030316du,0x00030005u,0x000000e0u,0x00004170u,0x00030005u,0x000000e8u,0x00004270u,0x00030005u,0x000000f0u,0x00003043u,0x00040005u,0x000000f1u,0x65725075u,0x00000076u,0x00030005u,0x000000f6u,0x00003143u,0x00030005u,0x000000fbu,0x00004165u,0x00040005u,0x000000fcu,0x61726170u,0x0000006du,0x00040005u,0x0000010cu,0x61726170u,0x0000006du,0x00030005u,0x00000111u,0x00004265u,0x00040005u,0x00000112u,0x61726170u,0x0000006du,0x00040005u,0x00000122u,0x61726170u,0x0000006du,0x00040005u,0x00000127u,0x76556266u,0x00000000u,0x00040005u,0x0000012bu,0x65526266u,0x00646973u,0x00040005u,0x00000138u,0x736e6f63u,0x00747369u,0x00030005u,0x00000149u,0x0000305au,0x00030005u,0x00000157u,0x0000315au,0x00040005u,0x00000163u,0x30756174u,0x00000000u,0x00040005u,0x00000167u,0x31756174u,0x00000000u,0x00040005u,0x0000016au,0x78616d7au,0x00000000u,0x00030005u,0x0000016eu,0x00003057u,0x00030005u,0x00000179u,0x00003157u,0x00040005u,0x00000183u,0x6d757357u,0x00000000u,0x00040005u,0x00000187u,0x70726177u,0x00006465u,0x00050005u,0x000001a0u,0x736f7263u,0x64616673u,0x00000065u,0x00050005u,0x000001adu,0x746f6870u,0x7272456fu,0x00000000u,0x00050005u,0x000001b1u,0x746f6870u,0x7572546fu,0x00007473u,0x00040005u,0x000001b7u,0x73757274u,0x00000074u,0x00040005u,0x000001c3u,0x76657270u,0x00000043u,0x00040005u,0x000001c8u,0x72727563u,0x00000043u,0x00050005u,0x000001cdu,0x746e6f63u,0x44746e65u,0x00666669u,0x00050005u,0x000001d2u,0x72746e75u,0x65747375u,0x00000064u,0x00040005u,0x000001d7u,0x44676962u,0x00666669u,0x00050005u,0x000001dcu,0x70616e73u,0x75436f54u,0x00007272u,0x00040005u,0x000001e5u,0x6374756fu,0x00000000u,0x00030005u,0x000001eeu,0x0067616du,0x00030005u,0x000001f2u,0x0000006eu,0x00030005u,0x000001f6u,0x00746173u,0x00040047u,0x0000001cu,0x0000000bu,0x0000001cu,0x00030047u,0x00000024u,0x00000019u,0x00040047u,0x00000024u,0x00000021u,0x00000030u,0x00040047u,0x00000024u,0x00000022u,0x00000000u,0x00030047u,0x0000004du,0x00000002u,0x00050048u,0x0000004du,0x00000000u,0x00000023u,0x00000000u,0x00050048u,0x0000004du,0x00000001u,0x00000023u,0x00000004u,0x00050048u,0x0000004du,0x00000002u,0x00000023u,0x00000008u,0x00050048u,0x0000004du,0x00000003u,0x00000023u,0x0000000cu,0x00050048u,0x0000004du,0x00000004u,0x00000023u,0x00000010u,0x00050048u,0x0000004du,0x00000005u,0x00000023u,0x00000014u,0x00050048u,0x0000004du,0x00000006u,0x00000023u,0x00000018u,0x00050048u,0x0000004du,0x00000007u,0x00000023u,0x0000001cu,0x00050048u,0x0000004du,0x00000008u,0x00000023u,0x00000020u,0x00040047u,0x0000004fu,0x00000021u,0x00000000u,0x00040047u,0x0000004fu,0x00000022u,0x00000000u,0x00040047u,0x0000008cu,0x00000021u,0x00000021u,0x00040047u,0x0000008cu,0x00000022u,0x00000000u,0x00040047u,0x000000aau,0x00000021u,0x00000023u,0x00040047u,0x000000aau,0x00000022u,0x00000000u,0x00040047u,0x000000afu,0x00000021u,0x00000022u,0x00040047u,0x000000afu,0x00000022u,0x00000000u,0x00040047u,0x000000f1u,0x00000021u,0x00000020u,0x00040047u,0x000000f1u,0Line truncated
|
static const uint32_t DDFG_SYNTH_SPV[] = {0x07230203u,0x00010300u,0x0008000bu,0x00000208u,0x00000000u,0x00020011u,0x00000001u,0x00020011u,0x00000032u,0x0006000bu,0x00000001u,0x4c534c47u,0x6474732eu,0x3035342eu,0x00000000u,0x0003000eu,0x00000000u,0x00000001u,0x0006000fu,0x00000005u,0x00000004u,0x6e69616du,0x00000000u,0x0000001cu,0x00060010u,0x00000004u,0x00000011u,0x00000010u,0x00000010u,0x00000001u,0x00030003u,0x00000002u,0x000001c2u,0x00040005u,0x00000004u,0x6e69616du,0x00000000u,0x00050005u,0x0000000bu,0x616d756cu,0x33667628u,0x0000003bu,0x00030005u,0x0000000au,0x00000063u,0x00030005u,0x00000018u,0x00646967u,0x00080005u,0x0000001cu,0x475f6c67u,0x61626f6cu,0x766e496cu,0x7461636fu,0x496e6f69u,0x00000044u,0x00030005u,0x00000021u,0x006d6964u,0x00040005u,0x00000024u,0x74754f75u,0x00000000u,0x00040005u,0x0000003eu,0x44766e69u,0x00006d69u,0x00030005u,0x00000044u,0x00007675u,0x00030005u,0x0000004du,0x00000055u,0x00060006u,0x0000004du,0x00000000u,0x776f6c66u,0x6c616353u,0x00000065u,0x00050006u,0x0000004du,0x00000001u,0x68706c61u,0x00000061u,0x00050006u,0x0000004du,0x00000002u,0x61746562u,0x00000000u,0x00050006u,0x0000004du,0x00000003u,0x626d616cu,0x00006164u,0x00050006u,0x0000004du,0x00000004u,0x69737065u,0x006e6f6cu,0x00060006u,0x0000004du,0x00000005u,0x746f6870u,0x6163536fu,0x0000656cu,0x00050006u,0x0000004du,0x00000006u,0x30646170u,0x00000000u,0x00050006u,0x0000004du,0x00000007u,0x31646170u,0x00000000u,0x00050006u,0x0000004du,0x00000008u,0x52647568u,0x00746365u,0x00030005u,0x0000004fu,0x00000000u,0x00040005u,0x0000008cu,0x72754375u,0x00000072u,0x00030005u,0x00000098u,0x00676264u,0x00030005u,0x0000009fu,0x00007366u,0x00040005u,0x000000a9u,0x64774273u,0x00000000u,0x00050005u,0x000000aau,0x6f6c4675u,0x64774277u,0x00000000u,0x00040005u,0x000000aeu,0x64774673u,0x00000000u,0x00050005u,0x000000afu,0x6f6c4675u,0x64774677u,0x00000000u,0x00030005u,0x000000b3u,0x00313046u,0x00030005u,0x000000bau,0x00303146u,0x00040005u,0x000000c1u,0x31306663u,0x00000000u,0x00040005u,0x000000c5u,0x30316663u,0x00000000u,0x00030005u,0x000000c9u,0x0031306du,0x00030005u,0x000000d5u,0x0030316du,0x00030005u,0x000000e0u,0x00004170u,0x00030005u,0x000000e8u,0x00004270u,0x00030005u,0x000000f0u,0x00003043u,0x00040005u,0x000000f1u,0x65725075u,0x00000076u,0x00030005u,0x000000f6u,0x00003143u,0x00030005u,0x000000fbu,0x00004165u,0x00040005u,0x000000fcu,0x61726170u,0x0000006du,0x00040005u,0x0000010cu,0x61726170u,0x0000006du,0x00030005u,0x00000111u,0x00004265u,0x00040005u,0x00000112u,0x61726170u,0x0000006du,0x00040005u,0x00000122u,0x61726170u,0x0000006du,0x00040005u,0x00000127u,0x76556266u,0x00000000u,0x00040005u,0x0000012bu,0x65526266u,0x00646973u,0x00040005u,0x00000138u,0x736e6f63u,0x00747369u,0x00030005u,0x00000149u,0x0000305au,0x00030005u,0x00000157u,0x0000315au,0x00040005u,0x00000163u,0x30756174u,0x00000000u,0x00040005u,0x00000167u,0x31756174u,0x00000000u,0x00040005u,0x0000016au,0x78616d7au,0x00000000u,0x00030005u,0x0000016eu,0x00003057u,0x00030005u,0x00000179u,0x00003157u,0x00040005u,0x00000183u,0x6d757357u,0x00000000u,0x00040005u,0x00000187u,0x70726177u,0x00006465u,0x00050005u,0x000001a0u,0x736f7263u,0x64616673u,0x00000065u,0x00050005u,0x000001adu,0x746f6870u,0x7272456fu,0x00000000u,0x00050005u,0x000001b1u,0x746f6870u,0x7572546fu,0x00007473u,0x00040005u,0x000001b7u,0x73757274u,0x00000074u,0x00040005u,0x000001c3u,0x76657270u,0x00000043u,0x00040005u,0x000001c8u,0x72727563u,0x00000043u,0x00050005u,0x000001cdu,0x746e6f63u,0x44746e65u,0x00666669u,0x00050005u,0x000001d2u,0x72746e75u,0x65747375u,0x00000064u,0x00040005u,0x000001d7u,0x44676962u,0x00666669u,0x00050005u,0x000001dcu,0x70616e73u,0x75436f54u,0x00007272u,0x00040005u,0x000001e5u,0x6374756fu,0x00000000u,0x00030005u,0x000001eeu,0x0067616du,0x00030005u,0x000001f2u,0x0000006eu,0x00030005u,0x000001f6u,0x00746173u,0x00040047u,0x0000001cu,0x0000000bu,0x0000001cu,0x00030047u,0x00000024u,0x00000019u,0x00040047u,0x00000024u,0x00000021u,0x00000030u,0x00040047u,0x00000024u,0x00000022u,0x00000000u,0x00030047u,0x0000004du,0x00000002u,0x00050048u,0x0000004du,0x00000000u,0x00000023u,0x00000000u,0x00050048u,0x0000004du,0x00000001u,0x00000023u,0x00000004u,0x00050048u,0x0000004du,0x00000002u,0x00000023u,0x00000008u,0x00050048u,0x0000004du,0x00000003u,0x00000023u,0x0000000cu,0x00050048u,0x0000004du,0x00000004u,0x00000023u,0x00000010u,0x00050048u,0x0000004du,0x00000005u,0x00000023u,0x00000014u,0x00050048u,0x0000004du,0x00000006u,0x00000023u,0x00000018u,0x00050048u,0x0000004du,0x00000007u,0x00000023u,0x0000001cu,0x00050048u,0x0000004du,0x00000008u,0x00000023u,0x00000020u,0x00040047u,0x0000004fu,0x00000021u,0x00000000u,0x00040047u,0x0000004fu,0x00000022u,0x00000000u,0x00040047u,0x0000008cu,0x00000021u,0x00000021u,0x00040047u,0x0000008cu,0x00000022u,0x00000000u,0x00040047u,0x000000aau,0x00000021u,0x00000023u,0x00040047u,0x000000aau,0x00000022u,0x00000000u,0x00040047u,0x000000afu,0x00000021u,0x00000022u,0x00040047u,0x000000afu,0x00000022u,0x00000000u,0x00040047u,0x000000f1u,0x00000021u,0x00000020u,0x00040047u,0x000000f1u,0Line truncated
|
||||||
static const size_t DDFG_SYNTH_LEN = 3082;
|
static const size_t DDFG_SYNTH_LEN = 3082;
|
||||||
struct Blob { const uint32_t* code; size_t words; };
|
struct Blob { const uint32_t* code; size_t words; };
|
||||||
|
|||||||
@@ -3,9 +3,35 @@
|
|||||||
#include "log.hpp"
|
#include "log.hpp"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <array>
|
||||||
|
|
||||||
namespace ddfg {
|
namespace ddfg {
|
||||||
|
|
||||||
|
struct ScratchState {
|
||||||
|
VkDevice ownerDevice = VK_NULL_HANDLE;
|
||||||
|
VkBuffer synthUbo[ddfg::FrameGen::kSynthSlots]{};
|
||||||
|
VkDeviceMemory synthUboMem[ddfg::FrameGen::kSynthSlots]{};
|
||||||
|
void* synthUboPtr[ddfg::FrameGen::kSynthSlots]{};
|
||||||
|
std::vector<VkBuffer> flowUbo; std::vector<VkDeviceMemory> flowUboMem; std::vector<void*> flowUboPtr;
|
||||||
|
VkBuffer expandUbo = VK_NULL_HANDLE; VkDeviceMemory expandUboMem = VK_NULL_HANDLE; void* expandUboPtr = nullptr;
|
||||||
|
VkBuffer flowRegUbo = VK_NULL_HANDLE; VkDeviceMemory flowRegUboMem = VK_NULL_HANDLE; void* flowRegUboPtr = nullptr;
|
||||||
|
VkBuffer gmUbo[ddfg::FrameGen::kGmSlots]{};
|
||||||
|
VkDeviceMemory gmUboMem[ddfg::FrameGen::kGmSlots]{};
|
||||||
|
void* gmUboPtr[ddfg::FrameGen::kGmSlots]{};
|
||||||
|
VkDescriptorSet sLumaCurr = VK_NULL_HANDLE, sLumaPrev = VK_NULL_HANDLE;
|
||||||
|
std::vector<VkDescriptorSet> sDownA, sDownB, sFlow;
|
||||||
|
VkDescriptorSet sExpand[ddfg::FrameGen::kGmSlots]{};
|
||||||
|
VkDescriptorSet sFlowReg0 = VK_NULL_HANDLE, sFlowRegAB = VK_NULL_HANDLE, sFlowRegBA = VK_NULL_HANDLE;
|
||||||
|
VkDescriptorSet sSynth[ddfg::FrameGen::kSynthSlots]{};
|
||||||
|
VkDescriptorSet sGmReduce[ddfg::FrameGen::kGmSlots]{};
|
||||||
|
std::vector<VkDescriptorSet> sGmPrewarp[ddfg::FrameGen::kGmSlots];
|
||||||
|
VkExtent2D builtFor{0,0};
|
||||||
|
uint64_t builtGeneration = 0;
|
||||||
|
bool built = false;
|
||||||
|
bool flowInited = false;
|
||||||
|
bool flowReady = false;
|
||||||
|
};
|
||||||
|
|
||||||
#define VKOK(x) do { if ((x) != VK_SUCCESS) { DDFG_LOGE("vk fail: %s", #x); return false; } } while (0)
|
#define VKOK(x) do { if ((x) != VK_SUCCESS) { DDFG_LOGE("vk fail: %s", #x); return false; } } while (0)
|
||||||
|
|
||||||
uint32_t FrameGen::findMemType(uint32_t bits, VkMemoryPropertyFlags props) const {
|
uint32_t FrameGen::findMemType(uint32_t bits, VkMemoryPropertyFlags props) const {
|
||||||
@@ -107,6 +133,10 @@ static bool buildSetLayout(const DeviceDispatch* dd, VkDevice dev,
|
|||||||
|
|
||||||
bool FrameGen::init(const DeviceDispatch* dd, const InstanceDispatch* id,
|
bool FrameGen::init(const DeviceDispatch* dd, const InstanceDispatch* id,
|
||||||
VkPhysicalDevice phys, VkDevice dev, uint32_t queueFamily, VkQueue queue) {
|
VkPhysicalDevice phys, VkDevice dev, uint32_t queueFamily, VkQueue queue) {
|
||||||
|
if (device_ || completionUnknown_ || deviceLost_) {
|
||||||
|
DDFG_LOGE("framegen: refusing to initialize an instance that still owns device resources");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
dd_ = dd; id_ = id; phys_ = phys; device_ = dev; queueFamily_ = queueFamily; queue_ = queue;
|
dd_ = dd; id_ = id; phys_ = phys; device_ = dev; queueFamily_ = queueFamily; queue_ = queue;
|
||||||
id_->GetPhysicalDeviceMemoryProperties(phys_, &memProps_);
|
id_->GetPhysicalDeviceMemoryProperties(phys_, &memProps_);
|
||||||
|
|
||||||
@@ -165,16 +195,37 @@ static VkExtent2D levelExtent(VkExtent2D e, int l) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool FrameGen::onResize(VkExtent2D extent, VkFormat , bool force) {
|
bool FrameGen::onResize(VkExtent2D extent, VkFormat , bool force) {
|
||||||
|
if (completionUnknown_ || deviceLost_) return false;
|
||||||
|
if (!device_) {
|
||||||
|
DDFG_LOGE("framegen: cannot resize before device initialization");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!force && ready_ && extent.width == extent_.width && extent.height == extent_.height) return true;
|
if (!force && ready_ && extent.width == extent_.width && extent.height == extent_.height) return true;
|
||||||
|
if (ready_ && !waitIdle("resize")) return false;
|
||||||
|
if (scratch_ && scratch_->ownerDevice != VK_NULL_HANDLE && !destroyScratchResources()) {
|
||||||
|
DDFG_LOGE("framegen resize: scratch cleanup failed; retaining the previous image set");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ready_ = false;
|
||||||
|
++imageGeneration_;
|
||||||
for (auto& i : pyrA_) destroyImage(i); pyrA_.clear();
|
for (auto& i : pyrA_) destroyImage(i); pyrA_.clear();
|
||||||
for (auto& i : pyrB_) destroyImage(i); pyrB_.clear();
|
for (auto& i : pyrB_) destroyImage(i); pyrB_.clear();
|
||||||
for (auto& i : pyrAs_) destroyImage(i); pyrAs_.clear();
|
for (auto& i : pyrAs_) destroyImage(i); pyrAs_.clear();
|
||||||
for (auto& i : flowLvl_) destroyImage(i); flowLvl_.clear();
|
for (auto& i : flowLvl_) destroyImage(i); flowLvl_.clear();
|
||||||
destroyImage(flowExpA_); destroyImage(flowExpB_);
|
destroyImage(flowExpA_); destroyImage(flowExpB_);
|
||||||
destroyImage(flowRegA_); destroyImage(flowRegB_);
|
destroyImage(flowRegA_); destroyImage(flowRegB_);
|
||||||
extent_ = extent; ready_ = false;
|
extent_ = extent;
|
||||||
|
|
||||||
|
for (int i = 0; i < 6; ++i) gmRun_[i] = 0.0;
|
||||||
|
for (int s = 0; s < kGmSlots; ++s) {
|
||||||
|
gmSlotValid_[s] = false;
|
||||||
|
for (int i = 0; i < 6; ++i) gmLinAt_[s][i] = 0.0;
|
||||||
|
}
|
||||||
|
gmHaveEst_ = false;
|
||||||
|
gmEngaged_ = false;
|
||||||
|
gmStableCount_ = 0;
|
||||||
|
gmLastTransPx_ = 0.0f;
|
||||||
|
|
||||||
const VkImageUsageFlags lumaUsage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT;
|
const VkImageUsageFlags lumaUsage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT;
|
||||||
const VkImageUsageFlags flowUsage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
|
const VkImageUsageFlags flowUsage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
|
||||||
@@ -211,10 +262,51 @@ void FrameGen::barrier(VkCommandBuffer cmd, VkImage img, VkImageLayout from, VkI
|
|||||||
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, 0, nullptr, 1, &b);
|
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, 0, nullptr, 1, &b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FrameGen::initializeImage(VkCommandBuffer cmd, VkImage img, VkImageLayout to) {
|
||||||
|
VkImageMemoryBarrier b{VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER};
|
||||||
|
b.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||||
|
b.newLayout = to;
|
||||||
|
b.srcAccessMask = 0;
|
||||||
|
b.dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT;
|
||||||
|
b.image = img;
|
||||||
|
b.subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1};
|
||||||
|
b.srcQueueFamilyIndex = b.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
|
||||||
|
dd_->CmdPipelineBarrier(cmd, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
|
||||||
|
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, 0, nullptr, 1, &b);
|
||||||
|
}
|
||||||
|
|
||||||
void FrameGen::destroy() {
|
|
||||||
if (!device_) return;
|
bool FrameGen::destroy() {
|
||||||
dd_->DeviceWaitIdle(device_);
|
if (!device_) return true;
|
||||||
|
if (!deviceLost_) {
|
||||||
|
// A previous wait failure leaves completion unknown, but a later
|
||||||
|
// teardown attempt may safely retry the wait before releasing resources.
|
||||||
|
if (!dd_ || !dd_->DeviceWaitIdle) {
|
||||||
|
ready_ = false;
|
||||||
|
completionUnknown_ = true;
|
||||||
|
DDFG_LOGE("framegen destroy: vkDeviceWaitIdle is unavailable; preserving GPU resources");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const VkResult idleResult = dd_->DeviceWaitIdle(device_);
|
||||||
|
if (idleResult == VK_SUCCESS) completionUnknown_ = false;
|
||||||
|
if (idleResult != VK_SUCCESS) {
|
||||||
|
ready_ = false;
|
||||||
|
if (idleResult == VK_ERROR_DEVICE_LOST) {
|
||||||
|
deviceLost_ = true;
|
||||||
|
DDFG_LOGE("framegen destroy: device lost; releasing owned resources without waiting");
|
||||||
|
} else {
|
||||||
|
completionUnknown_ = true;
|
||||||
|
DDFG_LOGE("framegen destroy: DeviceWaitIdle failed (%d); preserving resources because GPU completion is unknown",
|
||||||
|
(int)idleResult);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ready_ = false;
|
||||||
|
if (descPool_) dd_->DestroyDescriptorPool(device_, descPool_, nullptr);
|
||||||
|
descPool_ = VK_NULL_HANDLE;
|
||||||
|
releaseScratch();
|
||||||
for (auto& i : pyrA_) destroyImage(i); pyrA_.clear();
|
for (auto& i : pyrA_) destroyImage(i); pyrA_.clear();
|
||||||
for (auto& i : pyrB_) destroyImage(i); pyrB_.clear();
|
for (auto& i : pyrB_) destroyImage(i); pyrB_.clear();
|
||||||
for (auto& i : pyrAs_) destroyImage(i); pyrAs_.clear();
|
for (auto& i : pyrAs_) destroyImage(i); pyrAs_.clear();
|
||||||
@@ -226,15 +318,45 @@ void FrameGen::destroy() {
|
|||||||
destroyPipe(pGmReduce_); destroyPipe(pGmPrewarp_);
|
destroyPipe(pGmReduce_); destroyPipe(pGmPrewarp_);
|
||||||
destroyPipe(pFlowReg_);
|
destroyPipe(pFlowReg_);
|
||||||
for (int s = 0; s < kGmSlots; ++s) {
|
for (int s = 0; s < kGmSlots; ++s) {
|
||||||
if (gmSsboMem_[s]) dd_->UnmapMemory(device_, gmSsboMem_[s]);
|
if (gmSsboPtr_[s] && gmSsboMem_[s]) dd_->UnmapMemory(device_, gmSsboMem_[s]);
|
||||||
if (gmSsbo_[s]) dd_->DestroyBuffer(device_, gmSsbo_[s], nullptr);
|
if (gmSsbo_[s]) dd_->DestroyBuffer(device_, gmSsbo_[s], nullptr);
|
||||||
if (gmSsboMem_[s]) dd_->FreeMemory(device_, gmSsboMem_[s], nullptr);
|
if (gmSsboMem_[s]) dd_->FreeMemory(device_, gmSsboMem_[s], nullptr);
|
||||||
gmSsbo_[s] = VK_NULL_HANDLE; gmSsboMem_[s] = VK_NULL_HANDLE; gmSsboPtr_[s] = nullptr;
|
gmSsbo_[s] = VK_NULL_HANDLE; gmSsboMem_[s] = VK_NULL_HANDLE; gmSsboPtr_[s] = nullptr;
|
||||||
}
|
}
|
||||||
gmBuffersReady_ = false;
|
gmBuffersReady_ = false;
|
||||||
if (descPool_) dd_->DestroyDescriptorPool(device_, descPool_, nullptr);
|
|
||||||
if (linear_) dd_->DestroySampler(device_, linear_, nullptr);
|
if (linear_) dd_->DestroySampler(device_, linear_, nullptr);
|
||||||
descPool_ = VK_NULL_HANDLE; linear_ = VK_NULL_HANDLE; device_ = VK_NULL_HANDLE; ready_ = false;
|
linear_ = VK_NULL_HANDLE;
|
||||||
|
device_ = VK_NULL_HANDLE;
|
||||||
|
ready_ = false;
|
||||||
|
deviceLost_ = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FrameGen::abandon() {
|
||||||
|
device_ = VK_NULL_HANDLE;
|
||||||
|
dd_ = nullptr;
|
||||||
|
id_ = nullptr;
|
||||||
|
phys_ = VK_NULL_HANDLE;
|
||||||
|
queue_ = VK_NULL_HANDLE;
|
||||||
|
linear_ = VK_NULL_HANDLE;
|
||||||
|
descPool_ = VK_NULL_HANDLE;
|
||||||
|
scratch_.reset();
|
||||||
|
pyrA_.clear(); pyrB_.clear(); pyrAs_.clear(); flowLvl_.clear();
|
||||||
|
flowExpA_ = Img{}; flowExpB_ = Img{};
|
||||||
|
flowRegA_ = Img{}; flowRegB_ = Img{};
|
||||||
|
pLuma_ = Pipe{}; pDown_ = Pipe{}; pFlow_ = Pipe{}; pFlowM4_ = Pipe{};
|
||||||
|
pExpand_ = Pipe{}; pExpandM4_ = Pipe{}; pSynth_ = Pipe{};
|
||||||
|
pGmReduce_ = Pipe{}; pGmPrewarp_ = Pipe{}; pFlowReg_ = Pipe{};
|
||||||
|
for (int s = 0; s < kGmSlots; ++s) {
|
||||||
|
gmSsbo_[s] = VK_NULL_HANDLE;
|
||||||
|
gmSsboMem_[s] = VK_NULL_HANDLE;
|
||||||
|
gmSsboPtr_[s] = nullptr;
|
||||||
|
gmSlotValid_[s] = false;
|
||||||
|
}
|
||||||
|
gmBuffersReady_ = false;
|
||||||
|
ready_ = false;
|
||||||
|
completionUnknown_ = false;
|
||||||
|
deviceLost_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "vk_dispatch.hpp"
|
#include "vk_dispatch.hpp"
|
||||||
#include "config.hpp"
|
#include "config.hpp"
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace ddfg {
|
namespace ddfg {
|
||||||
|
|
||||||
|
struct ScratchState;
|
||||||
|
|
||||||
class FrameGen {
|
class FrameGen {
|
||||||
public:
|
public:
|
||||||
|
FrameGen();
|
||||||
|
~FrameGen();
|
||||||
|
FrameGen(const FrameGen&) = delete;
|
||||||
|
FrameGen& operator=(const FrameGen&) = delete;
|
||||||
|
|
||||||
bool init(const DeviceDispatch* dd, const InstanceDispatch* id,
|
bool init(const DeviceDispatch* dd, const InstanceDispatch* id,
|
||||||
VkPhysicalDevice phys, VkDevice dev, uint32_t queueFamily, VkQueue queue);
|
VkPhysicalDevice phys, VkDevice dev, uint32_t queueFamily, VkQueue queue);
|
||||||
void configure(const Config& c);
|
void configure(const Config& c);
|
||||||
@@ -14,7 +22,8 @@ public:
|
|||||||
void record(VkCommandBuffer cmd, VkImageView prevView, VkImageView currView,
|
void record(VkCommandBuffer cmd, VkImageView prevView, VkImageView currView,
|
||||||
VkImageView outView, float alpha, uint32_t gmSlot = 0,
|
VkImageView outView, float alpha, uint32_t gmSlot = 0,
|
||||||
uint32_t synthSlot = 0, bool reuseFlow = false);
|
uint32_t synthSlot = 0, bool reuseFlow = false);
|
||||||
void destroy();
|
bool destroy();
|
||||||
|
void abandon();
|
||||||
bool valid() const { return device_ != VK_NULL_HANDLE && ready_; }
|
bool valid() const { return device_ != VK_NULL_HANDLE && ready_; }
|
||||||
const Config& config() const { return cfg_; }
|
const Config& config() const { return cfg_; }
|
||||||
|
|
||||||
@@ -63,6 +72,10 @@ private:
|
|||||||
const std::vector<VkDescriptorType>& bindings);
|
const std::vector<VkDescriptorType>& bindings);
|
||||||
void destroyPipe(Pipe& p);
|
void destroyPipe(Pipe& p);
|
||||||
void barrier(VkCommandBuffer cmd, VkImage img, VkImageLayout from, VkImageLayout to);
|
void barrier(VkCommandBuffer cmd, VkImage img, VkImageLayout from, VkImageLayout to);
|
||||||
|
void initializeImage(VkCommandBuffer cmd, VkImage img, VkImageLayout to);
|
||||||
|
bool waitIdle(const char* operation);
|
||||||
|
bool destroyScratchResources(bool resetPool = true);
|
||||||
|
void releaseScratch();
|
||||||
|
|
||||||
const DeviceDispatch* dd_ = nullptr;
|
const DeviceDispatch* dd_ = nullptr;
|
||||||
const InstanceDispatch* id_ = nullptr;
|
const InstanceDispatch* id_ = nullptr;
|
||||||
@@ -76,8 +89,12 @@ private:
|
|||||||
|
|
||||||
Config cfg_;
|
Config cfg_;
|
||||||
VkExtent2D extent_{};
|
VkExtent2D extent_{};
|
||||||
|
uint64_t imageGeneration_ = 0;
|
||||||
bool ready_ = false;
|
bool ready_ = false;
|
||||||
|
bool completionUnknown_ = false;
|
||||||
|
bool deviceLost_ = false;
|
||||||
int flowFinest_ = kFlowFinestDefault;
|
int flowFinest_ = kFlowFinestDefault;
|
||||||
|
std::unique_ptr<ScratchState> scratch_;
|
||||||
|
|
||||||
Pipe pLuma_, pDown_, pFlow_, pFlowM4_, pExpand_, pExpandM4_, pSynth_;
|
Pipe pLuma_, pDown_, pFlow_, pFlowM4_, pExpand_, pExpandM4_, pSynth_;
|
||||||
Pipe pGmReduce_, pGmPrewarp_;
|
Pipe pGmReduce_, pGmPrewarp_;
|
||||||
|
|||||||
@@ -1,31 +1,7 @@
|
|||||||
|
|
||||||
namespace {
|
namespace ddfg {
|
||||||
struct ScratchState {
|
FrameGen::FrameGen() : scratch_(std::make_unique<ScratchState>()) {}
|
||||||
VkBuffer synthUbo[ddfg::FrameGen::kSynthSlots]{};
|
FrameGen::~FrameGen() { (void)destroy(); }
|
||||||
VkDeviceMemory synthUboMem[ddfg::FrameGen::kSynthSlots]{};
|
|
||||||
void* synthUboPtr[ddfg::FrameGen::kSynthSlots]{};
|
|
||||||
std::vector<VkBuffer> flowUbo; std::vector<VkDeviceMemory> flowUboMem; std::vector<void*> flowUboPtr;
|
|
||||||
VkBuffer expandUbo = VK_NULL_HANDLE; VkDeviceMemory expandUboMem = VK_NULL_HANDLE; void* expandUboPtr = nullptr;
|
|
||||||
VkBuffer flowRegUbo = VK_NULL_HANDLE; VkDeviceMemory flowRegUboMem = VK_NULL_HANDLE; void* flowRegUboPtr = nullptr;
|
|
||||||
VkBuffer gmUbo[ddfg::FrameGen::kGmSlots]{};
|
|
||||||
VkDeviceMemory gmUboMem[ddfg::FrameGen::kGmSlots]{};
|
|
||||||
void* gmUboPtr[ddfg::FrameGen::kGmSlots]{};
|
|
||||||
VkDescriptorSet sLumaCurr = VK_NULL_HANDLE, sLumaPrev = VK_NULL_HANDLE;
|
|
||||||
std::vector<VkDescriptorSet> sDownA, sDownB, sFlow;
|
|
||||||
VkDescriptorSet sExpand[ddfg::FrameGen::kGmSlots]{};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
VkDescriptorSet sFlowReg0 = VK_NULL_HANDLE, sFlowRegAB = VK_NULL_HANDLE, sFlowRegBA = VK_NULL_HANDLE;
|
|
||||||
VkDescriptorSet sSynth[ddfg::FrameGen::kSynthSlots]{};
|
|
||||||
VkDescriptorSet sGmReduce[ddfg::FrameGen::kGmSlots]{};
|
|
||||||
std::vector<VkDescriptorSet> sGmPrewarp[ddfg::FrameGen::kGmSlots];
|
|
||||||
VkExtent2D builtFor{0,0};
|
|
||||||
bool built = false;
|
|
||||||
bool flowInited = false;
|
|
||||||
bool flowReady = false;
|
|
||||||
};
|
|
||||||
ScratchState g_scratch;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool makeUbo(const ddfg::DeviceDispatch* dd, VkDevice dev,
|
static bool makeUbo(const ddfg::DeviceDispatch* dd, VkDevice dev,
|
||||||
@@ -58,6 +34,26 @@ static void wImg(const ddfg::DeviceDispatch* dd, VkDevice dev, VkDescriptorSet s
|
|||||||
w.dstSet = set; w.dstBinding = binding; w.descriptorCount = 1; w.descriptorType = type; w.pImageInfo = ⅈ
|
w.dstSet = set; w.dstBinding = binding; w.descriptorCount = 1; w.descriptorType = type; w.pImageInfo = ⅈ
|
||||||
dd->UpdateDescriptorSets(dev, 1, &w, 0, nullptr);
|
dd->UpdateDescriptorSets(dev, 1, &w, 0, nullptr);
|
||||||
}
|
}
|
||||||
|
static void wImgBatch(const ddfg::DeviceDispatch* dd, VkDevice dev,
|
||||||
|
const VkDescriptorSet* sets, const uint32_t* bindings,
|
||||||
|
const VkDescriptorType* types, const VkImageView* views,
|
||||||
|
const VkSampler* samplers, const VkImageLayout* layouts,
|
||||||
|
uint32_t count) {
|
||||||
|
VkDescriptorImageInfo infos[3]{};
|
||||||
|
VkWriteDescriptorSet writes[3]{};
|
||||||
|
for (uint32_t i = 0; i < count; ++i) {
|
||||||
|
infos[i].imageView = views[i];
|
||||||
|
infos[i].sampler = samplers[i];
|
||||||
|
infos[i].imageLayout = layouts[i];
|
||||||
|
writes[i] = {VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET};
|
||||||
|
writes[i].dstSet = sets[i];
|
||||||
|
writes[i].dstBinding = bindings[i];
|
||||||
|
writes[i].descriptorCount = 1;
|
||||||
|
writes[i].descriptorType = types[i];
|
||||||
|
writes[i].pImageInfo = &infos[i];
|
||||||
|
}
|
||||||
|
dd->UpdateDescriptorSets(dev, count, writes, 0, nullptr);
|
||||||
|
}
|
||||||
static void wUbo(const ddfg::DeviceDispatch* dd, VkDevice dev, VkDescriptorSet set, uint32_t binding,
|
static void wUbo(const ddfg::DeviceDispatch* dd, VkDevice dev, VkDescriptorSet set, uint32_t binding,
|
||||||
VkBuffer buf, VkDeviceSize range) {
|
VkBuffer buf, VkDeviceSize range) {
|
||||||
VkDescriptorBufferInfo bi{}; bi.buffer = buf; bi.range = range;
|
VkDescriptorBufferInfo bi{}; bi.buffer = buf; bi.range = range;
|
||||||
@@ -122,7 +118,7 @@ static void mulAff(const double A[3][3], const double B[3][3], double out[3][3])
|
|||||||
|
|
||||||
namespace ddfg {
|
namespace ddfg {
|
||||||
|
|
||||||
static bool ensureScratch(FrameGen* fg, const DeviceDispatch* dd, VkDevice dev,
|
static bool ensureScratch(ScratchState& S, FrameGen* fg, const DeviceDispatch* dd, VkDevice dev,
|
||||||
const VkPhysicalDeviceMemoryProperties& mp, VkDescriptorPool pool,
|
const VkPhysicalDeviceMemoryProperties& mp, VkDescriptorPool pool,
|
||||||
VkSampler samp, VkExtent2D ext,
|
VkSampler samp, VkExtent2D ext,
|
||||||
std::vector<FrameGen::Img>& pyrA, std::vector<FrameGen::Img>& pyrB,
|
std::vector<FrameGen::Img>& pyrA, std::vector<FrameGen::Img>& pyrB,
|
||||||
@@ -133,58 +129,123 @@ static bool ensureScratch(FrameGen* fg, const DeviceDispatch* dd, VkDevice dev,
|
|||||||
const FrameGen::Pipe& pSynth, const FrameGen::Pipe& pGmReduce,
|
const FrameGen::Pipe& pSynth, const FrameGen::Pipe& pGmReduce,
|
||||||
const FrameGen::Pipe& pGmPrewarp, const FrameGen::Pipe& pFlowReg,
|
const FrameGen::Pipe& pGmPrewarp, const FrameGen::Pipe& pFlowReg,
|
||||||
FrameGen::Img& flowRegA, FrameGen::Img& flowRegB, VkBuffer* gmSsbo,
|
FrameGen::Img& flowRegA, FrameGen::Img& flowRegB, VkBuffer* gmSsbo,
|
||||||
int kLevels, const Config& cfg);
|
int kLevels, const Config& cfg, uint64_t imageGeneration);
|
||||||
|
|
||||||
static void destroyScratch(const DeviceDispatch* dd, VkDevice dev, VkDescriptorPool pool) {
|
bool FrameGen::waitIdle(const char* operation) {
|
||||||
|
if (completionUnknown_ || deviceLost_ || !device_) return false;
|
||||||
|
if (!dd_ || !dd_->DeviceWaitIdle) {
|
||||||
|
completionUnknown_ = true;
|
||||||
|
ready_ = false;
|
||||||
|
DDFG_LOGE("framegen: %s cannot confirm GPU completion; this instance is stopped and its resources are retained",
|
||||||
|
operation);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const VkResult result = dd_->DeviceWaitIdle(device_);
|
||||||
|
if (result == VK_SUCCESS) return true;
|
||||||
|
ready_ = false;
|
||||||
|
if (result == VK_ERROR_DEVICE_LOST) {
|
||||||
|
deviceLost_ = true;
|
||||||
|
DDFG_LOGE("framegen: %s reported device loss; cleanup will skip further waits", operation);
|
||||||
|
} else {
|
||||||
|
completionUnknown_ = true;
|
||||||
|
DDFG_LOGE("framegen: %s vkDeviceWaitIdle failed (%d); this instance is stopped and its GPU resources retained",
|
||||||
|
operation, (int)result);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FrameGen::destroyScratchResources(bool resetPool) {
|
||||||
|
if (!scratch_) return true;
|
||||||
|
if (resetPool && descPool_ && !deviceLost_) {
|
||||||
|
if (!dd_ || !dd_->ResetDescriptorPool) {
|
||||||
|
ready_ = false;
|
||||||
|
DDFG_LOGE("framegen: descriptor-pool reset is unavailable; retaining scratch resources");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const VkResult result = dd_->ResetDescriptorPool(device_, descPool_, 0);
|
||||||
|
if (result != VK_SUCCESS) {
|
||||||
|
ready_ = false;
|
||||||
|
if (result == VK_ERROR_DEVICE_LOST) deviceLost_ = true;
|
||||||
|
DDFG_LOGE("framegen: descriptor-pool reset failed (%d); retaining scratch resources",
|
||||||
|
(int)result);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
releaseScratch();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FrameGen::releaseScratch() {
|
||||||
|
if (!scratch_) return;
|
||||||
|
auto& S = *scratch_;
|
||||||
auto freeUbo = [&](VkBuffer& b, VkDeviceMemory& m, void*& p) {
|
auto freeUbo = [&](VkBuffer& b, VkDeviceMemory& m, void*& p) {
|
||||||
if (m) dd->UnmapMemory(dev, m);
|
if (p && m) dd_->UnmapMemory(device_, m);
|
||||||
if (b) dd->DestroyBuffer(dev, b, nullptr);
|
if (b) dd_->DestroyBuffer(device_, b, nullptr);
|
||||||
if (m) dd->FreeMemory(dev, m, nullptr);
|
if (m) dd_->FreeMemory(device_, m, nullptr);
|
||||||
b = VK_NULL_HANDLE; m = VK_NULL_HANDLE; p = nullptr;
|
b = VK_NULL_HANDLE;
|
||||||
|
m = VK_NULL_HANDLE;
|
||||||
|
p = nullptr;
|
||||||
};
|
};
|
||||||
auto& S = g_scratch;
|
|
||||||
for (int s = 0; s < FrameGen::kSynthSlots; ++s) freeUbo(S.synthUbo[s], S.synthUboMem[s], S.synthUboPtr[s]);
|
for (int s = 0; s < FrameGen::kSynthSlots; ++s) freeUbo(S.synthUbo[s], S.synthUboMem[s], S.synthUboPtr[s]);
|
||||||
freeUbo(S.expandUbo, S.expandUboMem, S.expandUboPtr);
|
freeUbo(S.expandUbo, S.expandUboMem, S.expandUboPtr);
|
||||||
freeUbo(S.flowRegUbo, S.flowRegUboMem, S.flowRegUboPtr);
|
freeUbo(S.flowRegUbo, S.flowRegUboMem, S.flowRegUboPtr);
|
||||||
for (size_t i = 0; i < S.flowUbo.size(); ++i) freeUbo(S.flowUbo[i], S.flowUboMem[i], S.flowUboPtr[i]);
|
for (size_t i = 0; i < S.flowUbo.size(); ++i) freeUbo(S.flowUbo[i], S.flowUboMem[i], S.flowUboPtr[i]);
|
||||||
for (int s = 0; s < FrameGen::kGmSlots; ++s) freeUbo(S.gmUbo[s], S.gmUboMem[s], S.gmUboPtr[s]);
|
for (int s = 0; s < FrameGen::kGmSlots; ++s) freeUbo(S.gmUbo[s], S.gmUboMem[s], S.gmUboPtr[s]);
|
||||||
if (pool && dd->ResetDescriptorPool) dd->ResetDescriptorPool(dev, pool, 0);
|
|
||||||
S = ScratchState{};
|
S = ScratchState{};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void FrameGen::configure(const Config& c) {
|
void FrameGen::configure(const Config& c) {
|
||||||
cfg_ = c; cfg_.sanitize();
|
if (completionUnknown_ || deviceLost_) return;
|
||||||
int want = flowFinestForPreset(cfg_.perfPreset);
|
Config nextCfg = c;
|
||||||
|
nextCfg.sanitize();
|
||||||
|
int want = flowFinestForPreset(nextCfg.perfPreset);
|
||||||
const int maxFinest = kLevels - 2;
|
const int maxFinest = kLevels - 2;
|
||||||
if (want > maxFinest) {
|
if (want > maxFinest) {
|
||||||
DDFG_LOGE("perf-preset=%d wants kFlowFinest=%d but only %d pyramid levels exist "
|
DDFG_LOGE("perf-preset=%d wants kFlowFinest=%d but only %d pyramid levels exist "
|
||||||
"(need >=2 solved) - clamping to %d", cfg_.perfPreset, want, kLevels, maxFinest);
|
"(need >=2 solved) - clamping to %d", nextCfg.perfPreset, want, kLevels, maxFinest);
|
||||||
want = maxFinest;
|
want = maxFinest;
|
||||||
}
|
}
|
||||||
if (want < 1) want = 1;
|
if (want < 1) want = 1;
|
||||||
|
|
||||||
const int prevFinest = flowFinest_;
|
const int prevFinest = flowFinest_;
|
||||||
flowFinest_ = want;
|
const bool live = (want != prevFinest) && ready_;
|
||||||
const bool live = (flowFinest_ != prevFinest) && ready_;
|
|
||||||
DDFG_LOGI("perf-preset=%d -> kFlowFinest=%d (was %d) live-rebuild=%d ready=%d",
|
DDFG_LOGI("perf-preset=%d -> kFlowFinest=%d (was %d) live-rebuild=%d ready=%d",
|
||||||
cfg_.perfPreset, flowFinest_, prevFinest, live ? 1 : 0, ready_ ? 1 : 0);
|
nextCfg.perfPreset, want, prevFinest, live ? 1 : 0, ready_ ? 1 : 0);
|
||||||
|
|
||||||
if (!live) return;
|
if (!live) {
|
||||||
|
cfg_ = nextCfg;
|
||||||
|
flowFinest_ = want;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!waitIdle("live preset rebuild")) return;
|
||||||
|
if (scratch_ && scratch_->ownerDevice != VK_NULL_HANDLE && !destroyScratchResources()) {
|
||||||
|
DDFG_LOGE("perf-preset live rebuild: scratch cleanup failed; keeping the previous configuration");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dd_->DeviceWaitIdle(device_);
|
|
||||||
destroyScratch(dd_, device_, descPool_);
|
|
||||||
if (!onResize(extent_, VK_FORMAT_UNDEFINED, true))
|
|
||||||
DDFG_LOGE("perf-preset live rebuild: onResize FAILED at %ux%u - FG disabled until next resize",
|
|
||||||
extent_.width, extent_.height);
|
|
||||||
for (int i = 0; i < 6; ++i) gmRun_[i] = 0.0;
|
for (int i = 0; i < 6; ++i) gmRun_[i] = 0.0;
|
||||||
for (int s = 0; s < kGmSlots; ++s) { gmSlotValid_[s] = false; for (int i = 0; i < 6; ++i) gmLinAt_[s][i] = 0.0; }
|
for (int s = 0; s < kGmSlots; ++s) {
|
||||||
gmHaveEst_ = false; gmEngaged_ = false; gmStableCount_ = 0; gmLastTransPx_ = 0.0f;
|
gmSlotValid_[s] = false;
|
||||||
|
for (int i = 0; i < 6; ++i) gmLinAt_[s][i] = 0.0;
|
||||||
|
}
|
||||||
|
gmHaveEst_ = false;
|
||||||
|
gmEngaged_ = false;
|
||||||
|
gmStableCount_ = 0;
|
||||||
|
gmLastTransPx_ = 0.0f;
|
||||||
|
|
||||||
|
cfg_ = nextCfg;
|
||||||
|
flowFinest_ = want;
|
||||||
|
ready_ = false;
|
||||||
|
if (!onResize(extent_, VK_FORMAT_UNDEFINED, true)) {
|
||||||
|
ready_ = false;
|
||||||
|
DDFG_LOGE("perf-preset live rebuild: onResize FAILED at %ux%u - frame generation unavailable",
|
||||||
|
extent_.width, extent_.height);
|
||||||
|
return;
|
||||||
|
}
|
||||||
DDFG_LOGI("perf-preset live rebuild DONE (kFlowFinest=%d, flow predictor reset)", flowFinest_);
|
DDFG_LOGI("perf-preset live rebuild DONE (kFlowFinest=%d, flow predictor reset)", flowFinest_);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FrameGen::updateGlobalMotion(uint32_t gmSlot, VkExtent2D fullExtent) {
|
bool FrameGen::updateGlobalMotion(uint32_t gmSlot, VkExtent2D fullExtent) {
|
||||||
++gmFrames_;
|
++gmFrames_;
|
||||||
if (!gmBuffersReady_ || cfg_.gmMode == 2 ) {
|
if (!gmBuffersReady_ || cfg_.gmMode == 2 ) {
|
||||||
@@ -199,10 +260,10 @@ bool FrameGen::updateGlobalMotion(uint32_t gmSlot, VkExtent2D fullExtent) {
|
|||||||
bool good = false;
|
bool good = false;
|
||||||
if (gmSlotValid_[gmSlot]) {
|
if (gmSlotValid_[gmSlot]) {
|
||||||
const float* pt = (const float*)gmSsboPtr_[gmSlot];
|
const float* pt = (const float*)gmSsboPtr_[gmSlot];
|
||||||
double sums[32]; for (int k = 0; k < 32; ++k) sums[k] = 0.0;
|
double sums[28]{};
|
||||||
for (int t = 0; t < kGmThreads; ++t) {
|
for (int t = 0; t < kGmThreads; ++t) {
|
||||||
const float* row = pt + (size_t)t * kGmStride;
|
const float* row = pt + (size_t)t * kGmStride;
|
||||||
for (int k = 0; k < kGmStride; ++k) sums[k] += (double)row[k];
|
for (int k = 0; k < 28; ++k) sums[k] += (double)row[k];
|
||||||
}
|
}
|
||||||
double coverage = sums[27];
|
double coverage = sums[27];
|
||||||
double lvlpx = double((fullExtent.width >> kGmLevel) * (fullExtent.height >> kGmLevel));
|
double lvlpx = double((fullExtent.width >> kGmLevel) * (fullExtent.height >> kGmLevel));
|
||||||
@@ -254,23 +315,33 @@ bool FrameGen::updateGlobalMotion(uint32_t gmSlot, VkExtent2D fullExtent) {
|
|||||||
void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView currView,
|
void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView currView,
|
||||||
VkImageView outView, float alpha, uint32_t gmSlot, uint32_t synthSlot, bool reuseFlow) {
|
VkImageView outView, float alpha, uint32_t gmSlot, uint32_t synthSlot, bool reuseFlow) {
|
||||||
if (!valid()) return;
|
if (!valid()) return;
|
||||||
|
auto& S = *scratch_;
|
||||||
if (gmSlot >= (uint32_t)kGmSlots) gmSlot = 0;
|
if (gmSlot >= (uint32_t)kGmSlots) gmSlot = 0;
|
||||||
if (synthSlot >= (uint32_t)kSynthSlots) synthSlot = 0;
|
if (synthSlot >= (uint32_t)kSynthSlots) synthSlot = 0;
|
||||||
const bool m4 = (cfg_.model == 4);
|
const bool m4 = (cfg_.model == 4);
|
||||||
const Pipe& flowP = m4 ? pFlowM4_ : pFlow_;
|
const Pipe& flowP = m4 ? pFlowM4_ : pFlow_;
|
||||||
const Pipe& expandP = m4 ? pExpandM4_ : pExpand_;
|
const Pipe& expandP = m4 ? pExpandM4_ : pExpand_;
|
||||||
|
|
||||||
if (!g_scratch.built || g_scratch.builtFor.width != extent_.width || g_scratch.builtFor.height != extent_.height) {
|
if (!S.built || S.builtFor.width != extent_.width ||
|
||||||
ensureScratch(this, dd_, device_, memProps_, descPool_, linear_, extent_,
|
S.builtFor.height != extent_.height ||
|
||||||
pyrA_, pyrB_, pyrAs_, flowLvl_, flowExpA_, flowExpB_,
|
S.builtGeneration != imageGeneration_) {
|
||||||
pLuma_, pDown_, flowP, expandP, pSynth_, pGmReduce_, pGmPrewarp_,
|
if (S.built && !waitIdle("scratch rebuild")) return;
|
||||||
pFlowReg_, flowRegA_, flowRegB_, gmSsbo_, kLevels, cfg_);
|
if (S.ownerDevice != VK_NULL_HANDLE && !destroyScratchResources()) {
|
||||||
|
DDFG_LOGE("framegen record: scratch cleanup failed; skipping this frame");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!ensureScratch(S, this, dd_, device_, memProps_, descPool_, linear_, extent_,
|
||||||
|
pyrA_, pyrB_, pyrAs_, flowLvl_, flowExpA_, flowExpB_,
|
||||||
|
pLuma_, pDown_, flowP, expandP, pSynth_, pGmReduce_, pGmPrewarp_,
|
||||||
|
pFlowReg_, flowRegA_, flowRegB_, gmSsbo_, kLevels, cfg_, imageGeneration_))
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reuseFlow && !g_scratch.flowReady) return;
|
if (S.ownerDevice != device_) return;
|
||||||
|
if (reuseFlow && !S.flowReady) return;
|
||||||
if (!reuseFlow) {
|
if (!reuseFlow) {
|
||||||
bool gmEngaged = updateGlobalMotion(gmSlot, extent_);
|
bool gmEngaged = updateGlobalMotion(gmSlot, extent_);
|
||||||
if (g_scratch.gmUboPtr[gmSlot]) {
|
if (S.gmUboPtr[gmSlot]) {
|
||||||
GMUBO g{};
|
GMUBO g{};
|
||||||
g.lin[0]=(float)gmRun_[0]; g.lin[1]=(float)gmRun_[1]; g.lin[2]=(float)gmRun_[2]; g.lin[3]=(float)gmRun_[3];
|
g.lin[0]=(float)gmRun_[0]; g.lin[1]=(float)gmRun_[1]; g.lin[2]=(float)gmRun_[2]; g.lin[3]=(float)gmRun_[3];
|
||||||
g.linT[0]=(float)gmRun_[4]; g.linT[1]=(float)gmRun_[5]; g.linT[2]=gmEngaged?1.0f:0.0f; g.linT[3]=0.0f;
|
g.linT[0]=(float)gmRun_[4]; g.linT[1]=(float)gmRun_[5]; g.linT[2]=gmEngaged?1.0f:0.0f; g.linT[3]=0.0f;
|
||||||
@@ -278,7 +349,7 @@ void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView cur
|
|||||||
g.app[0]=(float)gmRun_[0]; g.app[1]=(float)gmRun_[1]; g.app[2]=(float)gmRun_[2]; g.app[3]=(float)gmRun_[3];
|
g.app[0]=(float)gmRun_[0]; g.app[1]=(float)gmRun_[1]; g.app[2]=(float)gmRun_[2]; g.app[3]=(float)gmRun_[3];
|
||||||
g.appT[0]=(float)gmRun_[4]; g.appT[1]=(float)gmRun_[5];
|
g.appT[0]=(float)gmRun_[4]; g.appT[1]=(float)gmRun_[5];
|
||||||
}
|
}
|
||||||
std::memcpy(g_scratch.gmUboPtr[gmSlot], &g, sizeof(g));
|
std::memcpy(S.gmUboPtr[gmSlot], &g, sizeof(g));
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
static int lastEng = -1;
|
static int lastEng = -1;
|
||||||
@@ -289,18 +360,37 @@ void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView cur
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wImg(dd_, device_, g_scratch.sLumaCurr, 32, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, currView, linear_, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
|
const VkDescriptorSet lumaSets[] = {S.sLumaCurr, S.sLumaPrev};
|
||||||
wImg(dd_, device_, g_scratch.sLumaPrev, 32, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, prevView, linear_, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
|
const uint32_t lumaBindings[] = {32, 32};
|
||||||
|
const VkDescriptorType lumaTypes[] = {
|
||||||
|
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER};
|
||||||
|
const VkImageView lumaViews[] = {currView, prevView};
|
||||||
|
const VkSampler lumaSamplers[] = {linear_, linear_};
|
||||||
|
const VkImageLayout lumaLayouts[] = {
|
||||||
|
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL};
|
||||||
|
wImgBatch(dd_, device_, lumaSets, lumaBindings, lumaTypes, lumaViews,
|
||||||
|
lumaSamplers, lumaLayouts, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
SynthUBO su{cfg_.flowScale, alpha, cfg_.beta, cfg_.lambda, cfg_.epsilon, cfg_.photoScale, 0, 0,
|
SynthUBO su{cfg_.flowScale, alpha, cfg_.beta, cfg_.lambda, cfg_.epsilon, cfg_.photoScale, 0, 0,
|
||||||
cfg_.hudX0, cfg_.hudY0, cfg_.hudX1, cfg_.hudY1};
|
cfg_.hudX0, cfg_.hudY0, cfg_.hudX1, cfg_.hudY1};
|
||||||
if (g_scratch.synthUboPtr[synthSlot]) std::memcpy(g_scratch.synthUboPtr[synthSlot], &su, sizeof(su));
|
if (S.synthUboPtr[synthSlot]) std::memcpy(S.synthUboPtr[synthSlot], &su, sizeof(su));
|
||||||
|
|
||||||
const VkDescriptorSet synthSet = g_scratch.sSynth[synthSlot];
|
const VkDescriptorSet synthSet = S.sSynth[synthSlot];
|
||||||
wImg(dd_, device_, synthSet, 32, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, prevView, linear_, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
|
const VkDescriptorSet synthSets[] = {synthSet, synthSet, synthSet};
|
||||||
wImg(dd_, device_, synthSet, 33, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, currView, linear_, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
|
const uint32_t synthBindings[] = {32, 33, 48};
|
||||||
wImg(dd_, device_, synthSet, 48, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, outView, VK_NULL_HANDLE, VK_IMAGE_LAYOUT_GENERAL);
|
const VkDescriptorType synthTypes[] = {
|
||||||
|
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
|
||||||
|
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
|
||||||
|
VK_DESCRIPTOR_TYPE_STORAGE_IMAGE};
|
||||||
|
const VkImageView synthViews[] = {prevView, currView, outView};
|
||||||
|
const VkSampler synthSamplers[] = {linear_, linear_, VK_NULL_HANDLE};
|
||||||
|
const VkImageLayout synthLayouts[] = {
|
||||||
|
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
|
||||||
|
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
|
||||||
|
VK_IMAGE_LAYOUT_GENERAL};
|
||||||
|
wImgBatch(dd_, device_, synthSets, synthBindings, synthTypes, synthViews,
|
||||||
|
synthSamplers, synthLayouts, 3);
|
||||||
|
|
||||||
auto disp = [&](const Pipe& p, VkDescriptorSet set, VkExtent2D e) {
|
auto disp = [&](const Pipe& p, VkDescriptorSet set, VkExtent2D e) {
|
||||||
dd_->CmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, p.pipeline);
|
dd_->CmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, p.pipeline);
|
||||||
@@ -308,43 +398,94 @@ void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView cur
|
|||||||
dd_->CmdDispatch(cmd, (e.width + 15) / 16, (e.height + 15) / 16, 1);
|
dd_->CmdDispatch(cmd, (e.width + 15) / 16, (e.height + 15) / 16, 1);
|
||||||
};
|
};
|
||||||
auto bar = [&](FrameGen::Img& i){ barrier(cmd, i.image, VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_GENERAL); };
|
auto bar = [&](FrameGen::Img& i){ barrier(cmd, i.image, VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_GENERAL); };
|
||||||
|
auto barPair = [&](FrameGen::Img& a, FrameGen::Img& b) {
|
||||||
|
VkImageMemoryBarrier barriers[2]{};
|
||||||
|
FrameGen::Img* images[] = {&a, &b};
|
||||||
|
for (uint32_t i = 0; i < 2; ++i) {
|
||||||
|
barriers[i].sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
|
||||||
|
barriers[i].srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT;
|
||||||
|
barriers[i].dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT;
|
||||||
|
barriers[i].oldLayout = VK_IMAGE_LAYOUT_GENERAL;
|
||||||
|
barriers[i].newLayout = VK_IMAGE_LAYOUT_GENERAL;
|
||||||
|
barriers[i].srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
|
||||||
|
barriers[i].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
|
||||||
|
barriers[i].image = images[i]->image;
|
||||||
|
barriers[i].subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1};
|
||||||
|
}
|
||||||
|
dd_->CmdPipelineBarrier(cmd, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
|
||||||
|
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr,
|
||||||
|
0, nullptr, 2, barriers);
|
||||||
|
};
|
||||||
|
const bool frEngaged = (cfg_.frMode != 2) && (cfg_.frIters > 0);
|
||||||
|
|
||||||
if (!reuseFlow) {
|
if (!reuseFlow) {
|
||||||
for (auto& i : pyrA_) barrier(cmd, i.image, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL);
|
// Batch fresh-image transitions that share the same stage and access masks.
|
||||||
for (auto& i : pyrB_) barrier(cmd, i.image, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL);
|
std::array<VkImageMemoryBarrier, 4 * kLevels + 1> initBarriers{};
|
||||||
for (int l = flowFinest_; l < kLevels; ++l) barrier(cmd, pyrAs_[l].image, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL);
|
size_t initBarrierCount = 0;
|
||||||
barrier(cmd, flowExpA_.image, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL);
|
auto addInitBarrier = [&](VkImage image) {
|
||||||
barrier(cmd, flowExpB_.image, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL);
|
VkImageMemoryBarrier b{VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER};
|
||||||
barrier(cmd, flowRegA_.image, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL);
|
b.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||||
barrier(cmd, flowRegB_.image, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL);
|
b.newLayout = VK_IMAGE_LAYOUT_GENERAL;
|
||||||
|
b.srcAccessMask = 0;
|
||||||
|
b.dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT;
|
||||||
|
b.image = image;
|
||||||
|
b.subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1};
|
||||||
|
b.srcQueueFamilyIndex = b.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
|
||||||
|
initBarriers[initBarrierCount++] = b;
|
||||||
|
};
|
||||||
|
for (auto& i : pyrA_) addInitBarrier(i.image);
|
||||||
|
for (auto& i : pyrB_) addInitBarrier(i.image);
|
||||||
|
for (int l = flowFinest_; l < kLevels; ++l) addInitBarrier(pyrAs_[l].image);
|
||||||
|
addInitBarrier(flowExpA_.image);
|
||||||
|
addInitBarrier(flowExpB_.image);
|
||||||
|
if (frEngaged) {
|
||||||
|
addInitBarrier(flowRegA_.image);
|
||||||
|
addInitBarrier(flowRegB_.image);
|
||||||
|
}
|
||||||
|
// The final flow level is cleared through TRANSFER_DST_OPTIMAL below;
|
||||||
|
// the other levels can use the common initialization barrier.
|
||||||
|
for (int l = flowFinest_; l < kLevels - 1; ++l) addInitBarrier(flowLvl_[l].image);
|
||||||
|
if (initBarrierCount != 0) {
|
||||||
|
dd_->CmdPipelineBarrier(cmd,
|
||||||
|
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT,
|
||||||
|
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr,
|
||||||
|
0, nullptr, static_cast<uint32_t>(initBarrierCount), initBarriers.data());
|
||||||
|
}
|
||||||
{
|
{
|
||||||
VkClearColorValue zero{};
|
VkClearColorValue zero{};
|
||||||
VkImageSubresourceRange rng{VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1};
|
VkImageSubresourceRange rng{VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1};
|
||||||
for (int l = flowFinest_; l < kLevels; ++l) {
|
VkImageMemoryBarrier b{VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER};
|
||||||
VkImageMemoryBarrier b{VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER};
|
b.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||||
b.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED; b.newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
|
b.newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
|
||||||
b.srcAccessMask = 0; b.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
|
b.srcAccessMask = 0;
|
||||||
b.image = flowLvl_[l].image; b.subresourceRange = rng;
|
b.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
|
||||||
b.srcQueueFamilyIndex = b.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
|
b.image = flowLvl_[kLevels - 1].image;
|
||||||
dd_->CmdPipelineBarrier(cmd, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, nullptr, 0, nullptr, 1, &b);
|
b.subresourceRange = rng;
|
||||||
dd_->CmdClearColorImage(cmd, flowLvl_[l].image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &zero, 1, &rng);
|
b.srcQueueFamilyIndex = b.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
|
||||||
b.oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; b.newLayout = VK_IMAGE_LAYOUT_GENERAL;
|
dd_->CmdPipelineBarrier(cmd,
|
||||||
b.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; b.dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT;
|
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT,
|
||||||
dd_->CmdPipelineBarrier(cmd, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, 0, nullptr, 1, &b);
|
VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, nullptr, 0, nullptr, 1, &b);
|
||||||
}
|
dd_->CmdClearColorImage(cmd, flowLvl_[kLevels - 1].image,
|
||||||
|
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &zero, 1, &rng);
|
||||||
|
b.oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
|
||||||
|
b.newLayout = VK_IMAGE_LAYOUT_GENERAL;
|
||||||
|
b.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
|
||||||
|
b.dstAccessMask = VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT;
|
||||||
|
dd_->CmdPipelineBarrier(cmd, VK_PIPELINE_STAGE_TRANSFER_BIT,
|
||||||
|
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, 0, nullptr, 1, &b);
|
||||||
}
|
}
|
||||||
|
|
||||||
disp(pLuma_, g_scratch.sLumaCurr, levelExtent(extent_, 0));
|
disp(pLuma_, S.sLumaCurr, levelExtent(extent_, 0));
|
||||||
disp(pLuma_, g_scratch.sLumaPrev, levelExtent(extent_, 0));
|
disp(pLuma_, S.sLumaPrev, levelExtent(extent_, 0));
|
||||||
bar(pyrA_[0]); bar(pyrB_[0]);
|
barPair(pyrA_[0], pyrB_[0]);
|
||||||
for (int l = 1; l < kLevels; ++l) {
|
for (int l = 1; l < kLevels; ++l) {
|
||||||
disp(pDown_, g_scratch.sDownA[l - 1], levelExtent(extent_, l));
|
disp(pDown_, S.sDownA[l - 1], levelExtent(extent_, l));
|
||||||
disp(pDown_, g_scratch.sDownB[l - 1], levelExtent(extent_, l));
|
disp(pDown_, S.sDownB[l - 1], levelExtent(extent_, l));
|
||||||
bar(pyrA_[l]); bar(pyrB_[l]);
|
barPair(pyrA_[l], pyrB_[l]);
|
||||||
}
|
}
|
||||||
if (gmBuffersReady_ && g_scratch.sGmReduce[gmSlot]) {
|
if (gmBuffersReady_ && S.sGmReduce[gmSlot]) {
|
||||||
dd_->CmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, pGmReduce_.pipeline);
|
dd_->CmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, pGmReduce_.pipeline);
|
||||||
dd_->CmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, pGmReduce_.layout, 0, 1, &g_scratch.sGmReduce[gmSlot], 0, nullptr);
|
dd_->CmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, pGmReduce_.layout, 0, 1, &S.sGmReduce[gmSlot], 0, nullptr);
|
||||||
dd_->CmdDispatch(cmd, (uint32_t)(kGmThreads / 64), 1, 1);
|
dd_->CmdDispatch(cmd, (uint32_t)(kGmThreads / 64), 1, 1);
|
||||||
VkMemoryBarrier mb{VK_STRUCTURE_TYPE_MEMORY_BARRIER};
|
VkMemoryBarrier mb{VK_STRUCTURE_TYPE_MEMORY_BARRIER};
|
||||||
mb.srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT; mb.dstAccessMask = VK_ACCESS_HOST_READ_BIT;
|
mb.srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT; mb.dstAccessMask = VK_ACCESS_HOST_READ_BIT;
|
||||||
@@ -352,32 +493,31 @@ void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView cur
|
|||||||
0, 1, &mb, 0, nullptr, 0, nullptr);
|
0, 1, &mb, 0, nullptr, 0, nullptr);
|
||||||
}
|
}
|
||||||
for (int l = flowFinest_; l < kLevels; ++l) {
|
for (int l = flowFinest_; l < kLevels; ++l) {
|
||||||
disp(pGmPrewarp_, g_scratch.sGmPrewarp[gmSlot][l], levelExtent(extent_, l));
|
disp(pGmPrewarp_, S.sGmPrewarp[gmSlot][l], levelExtent(extent_, l));
|
||||||
bar(pyrAs_[l]);
|
bar(pyrAs_[l]);
|
||||||
}
|
}
|
||||||
for (int l = kLevels - 1; l >= flowFinest_; --l) {
|
for (int l = kLevels - 1; l >= flowFinest_; --l) {
|
||||||
disp(flowP, g_scratch.sFlow[l], levelExtent(extent_, l));
|
disp(flowP, S.sFlow[l], levelExtent(extent_, l));
|
||||||
bar(flowLvl_[l]);
|
bar(flowLvl_[l]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool frEngaged = (cfg_.frMode != 2) && (cfg_.frIters > 0);
|
|
||||||
if (frEngaged) {
|
if (frEngaged) {
|
||||||
const int F = flowFinest_;
|
const int F = flowFinest_;
|
||||||
const VkExtent2D fe = levelExtent(extent_, F);
|
const VkExtent2D fe = levelExtent(extent_, F);
|
||||||
if (g_scratch.flowRegUboPtr) {
|
if (S.flowRegUboPtr) {
|
||||||
FlowRegUBO fu{cfg_.frDt, cfg_.frLambda, cfg_.frEdge, cfg_.frEps};
|
FlowRegUBO fu{cfg_.frDt, cfg_.frLambda, cfg_.frEdge, cfg_.frEps};
|
||||||
std::memcpy(g_scratch.flowRegUboPtr, &fu, sizeof(fu));
|
std::memcpy(S.flowRegUboPtr, &fu, sizeof(fu));
|
||||||
}
|
}
|
||||||
FrameGen::Img* last = nullptr;
|
FrameGen::Img* last = nullptr;
|
||||||
for (int it = 0; it < cfg_.frIters; ++it) {
|
for (int it = 0; it < cfg_.frIters; ++it) {
|
||||||
VkDescriptorSet set; FrameGen::Img* outImg;
|
VkDescriptorSet set; FrameGen::Img* outImg;
|
||||||
if (it == 0) { set = g_scratch.sFlowReg0; outImg = &flowRegA_; }
|
if (it == 0) { set = S.sFlowReg0; outImg = &flowRegA_; }
|
||||||
else if (it % 2 == 1) { set = g_scratch.sFlowRegAB; outImg = &flowRegB_; }
|
else if (it % 2 == 1) { set = S.sFlowRegAB; outImg = &flowRegB_; }
|
||||||
else { set = g_scratch.sFlowRegBA; outImg = &flowRegA_; }
|
else { set = S.sFlowRegBA; outImg = &flowRegA_; }
|
||||||
dd_->CmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, pFlowReg_.pipeline);
|
dd_->CmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, pFlowReg_.pipeline);
|
||||||
dd_->CmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, pFlowReg_.layout, 0, 1, &set, 0, nullptr);
|
dd_->CmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_COMPUTE, pFlowReg_.layout, 0, 1, &set, 0, nullptr);
|
||||||
dd_->CmdDispatch(cmd, (fe.width + 15) / 16, (fe.height + 15) / 16, 1);
|
dd_->CmdDispatch(cmd, (fe.width + 15) / 16, (fe.height + 15) / 16, 1);
|
||||||
bar(*outImg);
|
if (it + 1 < cfg_.frIters) bar(*outImg);
|
||||||
last = outImg;
|
last = outImg;
|
||||||
}
|
}
|
||||||
VkMemoryBarrier mb{VK_STRUCTURE_TYPE_MEMORY_BARRIER};
|
VkMemoryBarrier mb{VK_STRUCTURE_TYPE_MEMORY_BARRIER};
|
||||||
@@ -407,14 +547,14 @@ void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView cur
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
disp(expandP, g_scratch.sExpand[gmSlot], levelExtent(extent_, 0));
|
disp(expandP, S.sExpand[gmSlot], levelExtent(extent_, 0));
|
||||||
bar(flowExpA_); bar(flowExpB_);
|
barPair(flowExpA_, flowExpB_);
|
||||||
g_scratch.flowReady = true;
|
S.flowReady = true;
|
||||||
}
|
}
|
||||||
disp(pSynth_, synthSet, levelExtent(extent_, 0));
|
disp(pSynth_, synthSet, levelExtent(extent_, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ensureScratch(FrameGen* fg, const DeviceDispatch* dd, VkDevice dev,
|
static bool ensureScratch(ScratchState& S, FrameGen* fg, const DeviceDispatch* dd, VkDevice dev,
|
||||||
const VkPhysicalDeviceMemoryProperties& mp, VkDescriptorPool pool,
|
const VkPhysicalDeviceMemoryProperties& mp, VkDescriptorPool pool,
|
||||||
VkSampler samp, VkExtent2D ext,
|
VkSampler samp, VkExtent2D ext,
|
||||||
std::vector<FrameGen::Img>& pyrA, std::vector<FrameGen::Img>& pyrB,
|
std::vector<FrameGen::Img>& pyrA, std::vector<FrameGen::Img>& pyrB,
|
||||||
@@ -425,9 +565,10 @@ static bool ensureScratch(FrameGen* fg, const DeviceDispatch* dd, VkDevice dev,
|
|||||||
const FrameGen::Pipe& pSynth, const FrameGen::Pipe& pGmReduce,
|
const FrameGen::Pipe& pSynth, const FrameGen::Pipe& pGmReduce,
|
||||||
const FrameGen::Pipe& pGmPrewarp, const FrameGen::Pipe& pFlowReg,
|
const FrameGen::Pipe& pGmPrewarp, const FrameGen::Pipe& pFlowReg,
|
||||||
FrameGen::Img& flowRegA, FrameGen::Img& flowRegB, VkBuffer* gmSsbo,
|
FrameGen::Img& flowRegA, FrameGen::Img& flowRegB, VkBuffer* gmSsbo,
|
||||||
int kLevels, const Config& cfg) {
|
int kLevels, const Config& cfg, uint64_t imageGeneration) {
|
||||||
auto& S = g_scratch;
|
if (S.ownerDevice != VK_NULL_HANDLE && S.ownerDevice != dev) return false;
|
||||||
S = ScratchState{};
|
S = ScratchState{};
|
||||||
|
S.ownerDevice = dev;
|
||||||
const auto GEN = VK_IMAGE_LAYOUT_GENERAL;
|
const auto GEN = VK_IMAGE_LAYOUT_GENERAL;
|
||||||
|
|
||||||
for (int s = 0; s < FrameGen::kSynthSlots; ++s)
|
for (int s = 0; s < FrameGen::kSynthSlots; ++s)
|
||||||
@@ -528,7 +669,7 @@ static bool ensureScratch(FrameGen* fg, const DeviceDispatch* dd, VkDevice dev,
|
|||||||
wImg(dd, dev, S.sSynth[s], 35, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, expB.view, samp, GEN);
|
wImg(dd, dev, S.sSynth[s], 35, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, expB.view, samp, GEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
S.builtFor = ext; S.built = true;
|
S.builtFor = ext; S.builtGeneration = imageGeneration; S.ownerDevice = dev; S.built = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -614,10 +614,13 @@ private:
|
|||||||
XrSessionBeginInfo begin{XR_TYPE_SESSION_BEGIN_INFO};
|
XrSessionBeginInfo begin{XR_TYPE_SESSION_BEGIN_INFO};
|
||||||
begin.primaryViewConfigurationType = XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO;
|
begin.primaryViewConfigurationType = XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO;
|
||||||
check(xrBeginSession(session_, &begin), "xrBeginSession"); running_ = true;
|
check(xrBeginSession(session_, &begin), "xrBeginSession"); running_ = true;
|
||||||
|
// Meta's clock governor scales clocks by the DroidDeck process's overall load and cannot see
|
||||||
|
// SteamVR missing refreshes inside the guest; holding the top level kept it at 72 Hz.
|
||||||
if (setPerformance_) {
|
if (setPerformance_) {
|
||||||
for (auto domain : {XR_PERF_SETTINGS_DOMAIN_CPU_EXT, XR_PERF_SETTINGS_DOMAIN_GPU_EXT}) {
|
for (auto domain : {XR_PERF_SETTINGS_DOMAIN_CPU_EXT, XR_PERF_SETTINGS_DOMAIN_GPU_EXT}) {
|
||||||
XrResult request = setPerformance_(session_, domain, XR_PERF_SETTINGS_LEVEL_SUSTAINED_HIGH_EXT);
|
XrResult request = setPerformance_(session_, domain, XR_PERF_SETTINGS_LEVEL_BOOST_EXT);
|
||||||
__android_log_print(ANDROID_LOG_INFO, "DroidDeckXR", "sustained performance domain=%d result=%d", domain, request);
|
if (XR_FAILED(request)) request = setPerformance_(session_, domain, XR_PERF_SETTINGS_LEVEL_SUSTAINED_HIGH_EXT);
|
||||||
|
__android_log_print(ANDROID_LOG_INFO, "DroidDeckXR", "performance domain=%d result=%d", domain, request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (state_ == XR_SESSION_STATE_STOPPING) {
|
} else if (state_ == XR_SESSION_STATE_STOPPING) {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
// - Same push constants as cas.frag: ndc, input size, sharpness [0..1].
|
// - Same push constants as cas.frag: ndc, input size, sharpness [0..1].
|
||||||
// CasSetup's const1.x = -1 / lerp(8, 5, sharpness) is computed here.
|
// CasSetup's const1.x = -1 / lerp(8, 5, sharpness) is computed here.
|
||||||
// - The input is the effect chain's previous target at the same size, so the
|
// - The input is the effect chain's previous target at the same size, so the
|
||||||
// output pixel reads the input pixel 1:1 (texelFetch, edges clamped).
|
// output pixel reads the input pixel 1:1 (texel centres, edges clamped).
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
// DD_HALF is set for the *_half_frag.h build (gen_shaders.sh): colour and
|
// DD_HALF is set for the *_half_frag.h build (gen_shaders.sh): colour and
|
||||||
@@ -64,8 +64,8 @@ layout(location = 0) in highp vec2 fragTexCoord;
|
|||||||
layout(location = 0) out vec4 outColor;
|
layout(location = 0) out vec4 outColor;
|
||||||
|
|
||||||
vec3 CasLoad(ivec2 p) {
|
vec3 CasLoad(ivec2 p) {
|
||||||
ivec2 sz = textureSize(InputTexture, 0);
|
highp vec2 uv = (vec2(p) + 0.5) / pc.resolution;
|
||||||
return texelFetch(InputTexture, clamp(p, ivec2(0), sz - ivec2(1)), 0).rgb;
|
return textureLod(InputTexture, uv, 0.0).rgb;
|
||||||
}
|
}
|
||||||
|
|
||||||
float AMin3F1(float x, float y, float z) { return min(x, min(y, z)); }
|
float AMin3F1(float x, float y, float z) { return min(x, min(y, z)); }
|
||||||
|
|||||||
@@ -1,214 +1,213 @@
|
|||||||
// 1116.2.0
|
// 1115.1.0
|
||||||
#pragma once
|
#pragma once
|
||||||
const uint32_t cas_ffx_half_code[] = {
|
const uint32_t cas_ffx_half_code[] = {
|
||||||
0x07230203,0x00010000,0x0008000b,0x000000d7,0x00000000,0x00020011,0x00000001,0x00020011,
|
0x07230203,0x00010000,0x0008000b,0x000000d7,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||||
0x00000032,0x0006000b,0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,
|
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||||
0x00000000,0x00000001,0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000043,
|
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000047,0x000000d1,0x00030010,
|
||||||
0x000000d1,0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,
|
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d,
|
||||||
0x00000004,0x6e69616d,0x00000000,0x00060005,0x0000000d,0x4c736143,0x2864616f,0x3b326976,
|
0x00000000,0x00060005,0x0000000d,0x4c736143,0x2864616f,0x3b326976,0x00000000,0x00030005,
|
||||||
0x00000000,0x00030005,0x0000000c,0x00000070,0x00070005,0x00000014,0x6e694d41,0x28314633,
|
0x0000000c,0x00000070,0x00070005,0x00000014,0x6e694d41,0x28314633,0x663b3166,0x31663b31,
|
||||||
0x663b3166,0x31663b31,0x0000003b,0x00030005,0x00000011,0x00000078,0x00030005,0x00000012,
|
0x0000003b,0x00030005,0x00000011,0x00000078,0x00030005,0x00000012,0x00000079,0x00030005,
|
||||||
0x00000079,0x00030005,0x00000013,0x0000007a,0x00070005,0x00000019,0x78614d41,0x28314633,
|
0x00000013,0x0000007a,0x00070005,0x00000019,0x78614d41,0x28314633,0x663b3166,0x31663b31,
|
||||||
0x663b3166,0x31663b31,0x0000003b,0x00030005,0x00000016,0x00000078,0x00030005,0x00000017,
|
0x0000003b,0x00030005,0x00000016,0x00000078,0x00030005,0x00000017,0x00000079,0x00030005,
|
||||||
0x00000079,0x00030005,0x00000018,0x0000007a,0x00030005,0x0000001b,0x00007a73,0x00060005,
|
0x00000018,0x0000007a,0x00030005,0x0000001d,0x00007675,0x00030005,0x00000024,0x00004350,
|
||||||
0x0000001f,0x75706e49,0x78655474,0x65727574,0x00000000,0x00030005,0x00000040,0x00007073,
|
0x00040006,0x00000024,0x00000000,0x0063646e,0x00060006,0x00000024,0x00000001,0x6f736572,
|
||||||
0x00060005,0x00000043,0x67617266,0x43786554,0x64726f6f,0x00000000,0x00030005,0x00000045,
|
0x6974756c,0x00006e6f,0x00060006,0x00000024,0x00000002,0x72616873,0x73656e70,0x00000073,
|
||||||
0x00004350,0x00040006,0x00000045,0x00000000,0x0063646e,0x00060006,0x00000045,0x00000001,
|
0x00030005,0x00000026,0x00006370,0x00060005,0x0000002f,0x75706e49,0x78655474,0x65727574,
|
||||||
0x6f736572,0x6974756c,0x00006e6f,0x00060006,0x00000045,0x00000002,0x72616873,0x73656e70,
|
0x00000000,0x00030005,0x00000045,0x00007073,0x00060005,0x00000047,0x67617266,0x43786554,
|
||||||
0x00000073,0x00030005,0x00000047,0x00006370,0x00040005,0x0000004d,0x6b616570,0x00000000,
|
0x64726f6f,0x00000000,0x00040005,0x0000004d,0x6b616570,0x00000000,0x00030005,0x0000005a,
|
||||||
0x00030005,0x0000005b,0x00000062,0x00040005,0x00000060,0x61726170,0x0000006d,0x00030005,
|
0x00000062,0x00040005,0x00000060,0x61726170,0x0000006d,0x00030005,0x00000062,0x00000064,
|
||||||
0x00000062,0x00000064,0x00040005,0x00000066,0x61726170,0x0000006d,0x00030005,0x00000068,
|
0x00040005,0x00000066,0x61726170,0x0000006d,0x00030005,0x00000068,0x00000065,0x00040005,
|
||||||
0x00000065,0x00040005,0x00000069,0x61726170,0x0000006d,0x00030005,0x0000006c,0x00000066,
|
0x00000069,0x61726170,0x0000006d,0x00030005,0x0000006c,0x00000066,0x00040005,0x00000070,
|
||||||
0x00040005,0x00000070,0x61726170,0x0000006d,0x00030005,0x00000072,0x00000068,0x00040005,
|
0x61726170,0x0000006d,0x00030005,0x00000072,0x00000068,0x00040005,0x00000076,0x61726170,
|
||||||
0x00000076,0x61726170,0x0000006d,0x00030005,0x00000078,0x00476e6d,0x00040005,0x00000079,
|
0x0000006d,0x00030005,0x00000078,0x00476e6d,0x00040005,0x00000079,0x61726170,0x0000006d,
|
||||||
0x61726170,0x0000006d,0x00040005,0x0000007e,0x61726170,0x0000006d,0x00040005,0x00000081,
|
0x00040005,0x0000007e,0x61726170,0x0000006d,0x00040005,0x00000081,0x61726170,0x0000006d,
|
||||||
0x61726170,0x0000006d,0x00040005,0x00000085,0x61726170,0x0000006d,0x00040005,0x00000086,
|
0x00040005,0x00000085,0x61726170,0x0000006d,0x00040005,0x00000086,0x61726170,0x0000006d,
|
||||||
0x61726170,0x0000006d,0x00040005,0x00000089,0x61726170,0x0000006d,0x00030005,0x0000008d,
|
0x00040005,0x00000089,0x61726170,0x0000006d,0x00030005,0x0000008d,0x0047786d,0x00040005,
|
||||||
0x0047786d,0x00040005,0x0000008e,0x61726170,0x0000006d,0x00040005,0x00000091,0x61726170,
|
0x0000008e,0x61726170,0x0000006d,0x00040005,0x00000091,0x61726170,0x0000006d,0x00040005,
|
||||||
0x0000006d,0x00040005,0x00000094,0x61726170,0x0000006d,0x00040005,0x00000098,0x61726170,
|
0x00000094,0x61726170,0x0000006d,0x00040005,0x00000098,0x61726170,0x0000006d,0x00040005,
|
||||||
0x0000006d,0x00040005,0x00000099,0x61726170,0x0000006d,0x00040005,0x0000009c,0x61726170,
|
0x00000099,0x61726170,0x0000006d,0x00040005,0x0000009c,0x61726170,0x0000006d,0x00040005,
|
||||||
0x0000006d,0x00040005,0x000000a0,0x4d706372,0x00000047,0x00040005,0x000000a5,0x47706d61,
|
0x000000a0,0x4d706372,0x00000047,0x00040005,0x000000a5,0x47706d61,0x00000000,0x00030005,
|
||||||
0x00000000,0x00030005,0x000000af,0x00004777,0x00050005,0x000000b3,0x57706372,0x68676965,
|
0x000000af,0x00004777,0x00050005,0x000000b3,0x57706372,0x68676965,0x00000074,0x00030005,
|
||||||
0x00000074,0x00030005,0x000000b9,0x00786970,0x00050005,0x000000d1,0x4374756f,0x726f6c6f,
|
0x000000b9,0x00786970,0x00050005,0x000000d1,0x4374756f,0x726f6c6f,0x00000000,0x00030047,
|
||||||
0x00000000,0x00030047,0x0000000d,0x00000000,0x00030047,0x00000011,0x00000000,0x00030047,
|
0x0000000d,0x00000000,0x00030047,0x00000011,0x00000000,0x00030047,0x00000012,0x00000000,
|
||||||
0x00000012,0x00000000,0x00030047,0x00000013,0x00000000,0x00030047,0x00000014,0x00000000,
|
0x00030047,0x00000013,0x00000000,0x00030047,0x00000014,0x00000000,0x00030047,0x00000016,
|
||||||
0x00030047,0x00000016,0x00000000,0x00030047,0x00000017,0x00000000,0x00030047,0x00000018,
|
0x00000000,0x00030047,0x00000017,0x00000000,0x00030047,0x00000018,0x00000000,0x00030047,
|
||||||
0x00000000,0x00030047,0x00000019,0x00000000,0x00030047,0x0000001f,0x00000000,0x00040047,
|
0x00000019,0x00000000,0x00030047,0x00000024,0x00000002,0x00050048,0x00000024,0x00000000,
|
||||||
0x0000001f,0x00000021,0x00000000,0x00040047,0x0000001f,0x00000022,0x00000000,0x00030047,
|
0x00000023,0x00000000,0x00050048,0x00000024,0x00000001,0x00000023,0x00000010,0x00040048,
|
||||||
0x00000020,0x00000000,0x00030047,0x00000024,0x00000000,0x00030047,0x0000002e,0x00000000,
|
0x00000024,0x00000002,0x00000000,0x00050048,0x00000024,0x00000002,0x00000023,0x00000018,
|
||||||
0x00030047,0x0000002f,0x00000000,0x00030047,0x00000032,0x00000000,0x00030047,0x00000033,
|
0x00030047,0x0000002f,0x00000000,0x00040047,0x0000002f,0x00000021,0x00000000,0x00040047,
|
||||||
0x00000000,0x00030047,0x00000034,0x00000000,0x00030047,0x00000035,0x00000000,0x00030047,
|
0x0000002f,0x00000022,0x00000000,0x00030047,0x00000030,0x00000000,0x00030047,0x00000033,
|
||||||
0x00000036,0x00000000,0x00030047,0x00000039,0x00000000,0x00030047,0x0000003a,0x00000000,
|
0x00000000,0x00030047,0x00000034,0x00000000,0x00030047,0x00000037,0x00000000,0x00030047,
|
||||||
0x00030047,0x0000003b,0x00000000,0x00030047,0x0000003c,0x00000000,0x00030047,0x0000003d,
|
0x00000038,0x00000000,0x00030047,0x00000039,0x00000000,0x00030047,0x0000003a,0x00000000,
|
||||||
0x00000000,0x00040047,0x00000043,0x0000001e,0x00000000,0x00030047,0x00000045,0x00000002,
|
0x00030047,0x0000003b,0x00000000,0x00030047,0x0000003e,0x00000000,0x00030047,0x0000003f,
|
||||||
0x00050048,0x00000045,0x00000000,0x00000023,0x00000000,0x00050048,0x00000045,0x00000001,
|
0x00000000,0x00030047,0x00000040,0x00000000,0x00030047,0x00000041,0x00000000,0x00030047,
|
||||||
0x00000023,0x00000010,0x00040048,0x00000045,0x00000002,0x00000000,0x00050048,0x00000045,
|
0x00000042,0x00000000,0x00040047,0x00000047,0x0000001e,0x00000000,0x00030047,0x0000004d,
|
||||||
0x00000002,0x00000023,0x00000018,0x00030047,0x0000004d,0x00000000,0x00030047,0x00000054,
|
0x00000000,0x00030047,0x00000054,0x00000000,0x00030047,0x00000056,0x00000000,0x00030047,
|
||||||
0x00000000,0x00030047,0x00000057,0x00000000,0x00030047,0x00000058,0x00000000,0x00030047,
|
0x00000057,0x00000000,0x00030047,0x00000058,0x00000000,0x00030047,0x0000005a,0x00000000,
|
||||||
0x00000059,0x00000000,0x00030047,0x0000005b,0x00000000,0x00030047,0x00000061,0x00000000,
|
0x00030047,0x00000061,0x00000000,0x00030047,0x00000062,0x00000000,0x00030047,0x00000067,
|
||||||
0x00030047,0x00000062,0x00000000,0x00030047,0x00000067,0x00000000,0x00030047,0x00000068,
|
0x00000000,0x00030047,0x00000068,0x00000000,0x00030047,0x0000006b,0x00000000,0x00030047,
|
||||||
0x00000000,0x00030047,0x0000006b,0x00000000,0x00030047,0x0000006c,0x00000000,0x00030047,
|
0x0000006c,0x00000000,0x00030047,0x00000071,0x00000000,0x00030047,0x00000072,0x00000000,
|
||||||
0x00000071,0x00000000,0x00030047,0x00000072,0x00000000,0x00030047,0x00000077,0x00000000,
|
0x00030047,0x00000077,0x00000000,0x00030047,0x00000078,0x00000000,0x00030047,0x00000079,
|
||||||
0x00030047,0x00000078,0x00000000,0x00030047,0x00000079,0x00000000,0x00030047,0x0000007d,
|
0x00000000,0x00030047,0x0000007d,0x00000000,0x00030047,0x0000007e,0x00000000,0x00030047,
|
||||||
0x00000000,0x00030047,0x0000007e,0x00000000,0x00030047,0x00000080,0x00000000,0x00030047,
|
0x00000080,0x00000000,0x00030047,0x00000081,0x00000000,0x00030047,0x00000083,0x00000000,
|
||||||
0x00000081,0x00000000,0x00030047,0x00000083,0x00000000,0x00030047,0x00000084,0x00000000,
|
0x00030047,0x00000084,0x00000000,0x00030047,0x00000085,0x00000000,0x00030047,0x00000086,
|
||||||
0x00030047,0x00000085,0x00000000,0x00030047,0x00000086,0x00000000,0x00030047,0x00000088,
|
0x00000000,0x00030047,0x00000088,0x00000000,0x00030047,0x00000089,0x00000000,0x00030047,
|
||||||
0x00000000,0x00030047,0x00000089,0x00000000,0x00030047,0x0000008b,0x00000000,0x00030047,
|
0x0000008b,0x00000000,0x00030047,0x0000008c,0x00000000,0x00030047,0x0000008d,0x00000000,
|
||||||
0x0000008c,0x00000000,0x00030047,0x0000008d,0x00000000,0x00030047,0x0000008e,0x00000000,
|
0x00030047,0x0000008e,0x00000000,0x00030047,0x00000090,0x00000000,0x00030047,0x00000091,
|
||||||
0x00030047,0x00000090,0x00000000,0x00030047,0x00000091,0x00000000,0x00030047,0x00000093,
|
0x00000000,0x00030047,0x00000093,0x00000000,0x00030047,0x00000094,0x00000000,0x00030047,
|
||||||
0x00000000,0x00030047,0x00000094,0x00000000,0x00030047,0x00000096,0x00000000,0x00030047,
|
0x00000096,0x00000000,0x00030047,0x00000097,0x00000000,0x00030047,0x00000098,0x00000000,
|
||||||
0x00000097,0x00000000,0x00030047,0x00000098,0x00000000,0x00030047,0x00000099,0x00000000,
|
0x00030047,0x00000099,0x00000000,0x00030047,0x0000009b,0x00000000,0x00030047,0x0000009c,
|
||||||
0x00030047,0x0000009b,0x00000000,0x00030047,0x0000009c,0x00000000,0x00030047,0x0000009e,
|
0x00000000,0x00030047,0x0000009e,0x00000000,0x00030047,0x0000009f,0x00000000,0x00030047,
|
||||||
0x00000000,0x00030047,0x0000009f,0x00000000,0x00030047,0x000000a0,0x00000000,0x00030047,
|
0x000000a0,0x00000000,0x00030047,0x000000a1,0x00000000,0x00030047,0x000000a3,0x00000000,
|
||||||
0x000000a1,0x00000000,0x00030047,0x000000a3,0x00000000,0x00030047,0x000000a4,0x00000000,
|
0x00030047,0x000000a4,0x00000000,0x00030047,0x000000a5,0x00000000,0x00030047,0x000000a6,
|
||||||
0x00030047,0x000000a5,0x00000000,0x00030047,0x000000a6,0x00000000,0x00030047,0x000000a7,
|
0x00000000,0x00030047,0x000000a7,0x00000000,0x00030047,0x000000a8,0x00000000,0x00030047,
|
||||||
0x00000000,0x00030047,0x000000a8,0x00000000,0x00030047,0x000000a9,0x00000000,0x00030047,
|
0x000000a9,0x00000000,0x00030047,0x000000aa,0x00000000,0x00030047,0x000000ab,0x00000000,
|
||||||
0x000000aa,0x00000000,0x00030047,0x000000ab,0x00000000,0x00030047,0x000000ac,0x00000000,
|
0x00030047,0x000000ac,0x00000000,0x00030047,0x000000ad,0x00000000,0x00030047,0x000000ae,
|
||||||
0x00030047,0x000000ad,0x00000000,0x00030047,0x000000ae,0x00000000,0x00030047,0x000000af,
|
0x00000000,0x00030047,0x000000af,0x00000000,0x00030047,0x000000b0,0x00000000,0x00030047,
|
||||||
0x00000000,0x00030047,0x000000b0,0x00000000,0x00030047,0x000000b1,0x00000000,0x00030047,
|
0x000000b1,0x00000000,0x00030047,0x000000b2,0x00000000,0x00030047,0x000000b3,0x00000000,
|
||||||
0x000000b2,0x00000000,0x00030047,0x000000b3,0x00000000,0x00030047,0x000000b5,0x00000000,
|
0x00030047,0x000000b5,0x00000000,0x00030047,0x000000b6,0x00000000,0x00030047,0x000000b7,
|
||||||
0x00030047,0x000000b6,0x00000000,0x00030047,0x000000b7,0x00000000,0x00030047,0x000000b8,
|
0x00000000,0x00030047,0x000000b8,0x00000000,0x00030047,0x000000b9,0x00000000,0x00030047,
|
||||||
0x00000000,0x00030047,0x000000b9,0x00000000,0x00030047,0x000000ba,0x00000000,0x00030047,
|
0x000000ba,0x00000000,0x00030047,0x000000bb,0x00000000,0x00030047,0x000000bc,0x00000000,
|
||||||
0x000000bb,0x00000000,0x00030047,0x000000bc,0x00000000,0x00030047,0x000000bd,0x00000000,
|
0x00030047,0x000000bd,0x00000000,0x00030047,0x000000be,0x00000000,0x00030047,0x000000bf,
|
||||||
0x00030047,0x000000be,0x00000000,0x00030047,0x000000bf,0x00000000,0x00030047,0x000000c0,
|
0x00000000,0x00030047,0x000000c0,0x00000000,0x00030047,0x000000c1,0x00000000,0x00030047,
|
||||||
0x00000000,0x00030047,0x000000c1,0x00000000,0x00030047,0x000000c2,0x00000000,0x00030047,
|
0x000000c2,0x00000000,0x00030047,0x000000c3,0x00000000,0x00030047,0x000000c4,0x00000000,
|
||||||
0x000000c3,0x00000000,0x00030047,0x000000c4,0x00000000,0x00030047,0x000000c5,0x00000000,
|
0x00030047,0x000000c5,0x00000000,0x00030047,0x000000c6,0x00000000,0x00030047,0x000000c7,
|
||||||
0x00030047,0x000000c6,0x00000000,0x00030047,0x000000c7,0x00000000,0x00030047,0x000000c8,
|
0x00000000,0x00030047,0x000000c8,0x00000000,0x00030047,0x000000c9,0x00000000,0x00030047,
|
||||||
0x00000000,0x00030047,0x000000c9,0x00000000,0x00030047,0x000000ca,0x00000000,0x00030047,
|
0x000000ca,0x00000000,0x00030047,0x000000cb,0x00000000,0x00030047,0x000000cc,0x00000000,
|
||||||
0x000000cb,0x00000000,0x00030047,0x000000cc,0x00000000,0x00030047,0x000000cd,0x00000000,
|
0x00030047,0x000000cd,0x00000000,0x00030047,0x000000ce,0x00000000,0x00030047,0x000000cf,
|
||||||
0x00030047,0x000000ce,0x00000000,0x00030047,0x000000cf,0x00000000,0x00030047,0x000000d1,
|
0x00000000,0x00030047,0x000000d1,0x00000000,0x00040047,0x000000d1,0x0000001e,0x00000000,
|
||||||
0x00000000,0x00040047,0x000000d1,0x0000001e,0x00000000,0x00030047,0x000000d2,0x00000000,
|
0x00030047,0x000000d2,0x00000000,0x00030047,0x000000d3,0x00000000,0x00030047,0x000000d4,
|
||||||
0x00030047,0x000000d3,0x00000000,0x00030047,0x000000d4,0x00000000,0x00030047,0x000000d5,
|
0x00000000,0x00030047,0x000000d5,0x00000000,0x00030047,0x000000d6,0x00000000,0x00020013,
|
||||||
0x00000000,0x00030047,0x000000d6,0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,
|
0x00000002,0x00030021,0x00000003,0x00000002,0x00040015,0x00000006,0x00000020,0x00000001,
|
||||||
0x00000002,0x00040015,0x00000006,0x00000020,0x00000001,0x00040017,0x00000007,0x00000006,
|
0x00040017,0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,0x00000007,0x00000007,
|
||||||
0x00000002,0x00040020,0x00000008,0x00000007,0x00000007,0x00030016,0x00000009,0x00000020,
|
0x00030016,0x00000009,0x00000020,0x00040017,0x0000000a,0x00000009,0x00000003,0x00040021,
|
||||||
0x00040017,0x0000000a,0x00000009,0x00000003,0x00040021,0x0000000b,0x0000000a,0x00000008,
|
0x0000000b,0x0000000a,0x00000008,0x00040020,0x0000000f,0x00000007,0x00000009,0x00060021,
|
||||||
0x00040020,0x0000000f,0x00000007,0x00000009,0x00060021,0x00000010,0x00000009,0x0000000f,
|
0x00000010,0x00000009,0x0000000f,0x0000000f,0x0000000f,0x00040017,0x0000001b,0x00000009,
|
||||||
0x0000000f,0x0000000f,0x00090019,0x0000001c,0x00000009,0x00000001,0x00000000,0x00000000,
|
0x00000002,0x00040020,0x0000001c,0x00000007,0x0000001b,0x0004002b,0x00000009,0x00000020,
|
||||||
0x00000000,0x00000001,0x00000000,0x0003001b,0x0000001d,0x0000001c,0x00040020,0x0000001e,
|
0x3f000000,0x00040017,0x00000023,0x00000009,0x00000004,0x0005001e,0x00000024,0x00000023,
|
||||||
0x00000000,0x0000001d,0x0004003b,0x0000001e,0x0000001f,0x00000000,0x0004002b,0x00000006,
|
0x0000001b,0x00000009,0x00040020,0x00000025,0x00000009,0x00000024,0x0004003b,0x00000025,
|
||||||
0x00000021,0x00000000,0x0005002c,0x00000007,0x00000026,0x00000021,0x00000021,0x0004002b,
|
0x00000026,0x00000009,0x0004002b,0x00000006,0x00000027,0x00000001,0x00040020,0x00000028,
|
||||||
0x00000006,0x00000028,0x00000001,0x0005002c,0x00000007,0x00000029,0x00000028,0x00000028,
|
0x00000009,0x0000001b,0x00090019,0x0000002c,0x00000009,0x00000001,0x00000000,0x00000000,
|
||||||
0x00040017,0x0000002d,0x00000009,0x00000004,0x00040017,0x00000041,0x00000009,0x00000002,
|
0x00000000,0x00000001,0x00000000,0x0003001b,0x0000002d,0x0000002c,0x00040020,0x0000002e,
|
||||||
0x00040020,0x00000042,0x00000001,0x00000041,0x0004003b,0x00000042,0x00000043,0x00000001,
|
0x00000000,0x0000002d,0x0004003b,0x0000002e,0x0000002f,0x00000000,0x0004002b,0x00000009,
|
||||||
0x0005001e,0x00000045,0x0000002d,0x00000041,0x00000009,0x00040020,0x00000046,0x00000009,
|
0x00000032,0x00000000,0x00040020,0x00000046,0x00000001,0x0000001b,0x0004003b,0x00000046,
|
||||||
0x00000045,0x0004003b,0x00000046,0x00000047,0x00000009,0x00040020,0x00000048,0x00000009,
|
0x00000047,0x00000001,0x0004002b,0x00000009,0x0000004e,0xbf800000,0x0004002b,0x00000009,
|
||||||
0x00000041,0x0004002b,0x00000009,0x0000004e,0xbf800000,0x0004002b,0x00000009,0x0000004f,
|
0x0000004f,0x41000000,0x0004002b,0x00000009,0x00000050,0x40a00000,0x0004002b,0x00000006,
|
||||||
0x41000000,0x0004002b,0x00000009,0x00000050,0x40a00000,0x0004002b,0x00000006,0x00000051,
|
0x00000051,0x00000002,0x00040020,0x00000052,0x00000009,0x00000009,0x0004002b,0x00000009,
|
||||||
0x00000002,0x00040020,0x00000052,0x00000009,0x00000009,0x0004002b,0x00000009,0x00000055,
|
0x00000055,0x3f800000,0x00040020,0x00000059,0x00000007,0x0000000a,0x0004002b,0x00000006,
|
||||||
0x00000000,0x0004002b,0x00000009,0x00000056,0x3f800000,0x00040020,0x0000005a,0x00000007,
|
0x0000005c,0x00000000,0x0004002b,0x00000006,0x0000005d,0xffffffff,0x0005002c,0x00000007,
|
||||||
0x0000000a,0x0004002b,0x00000006,0x0000005d,0xffffffff,0x0005002c,0x00000007,0x0000005e,
|
0x0000005e,0x0000005c,0x0000005d,0x0005002c,0x00000007,0x00000064,0x0000005d,0x0000005c,
|
||||||
0x00000021,0x0000005d,0x0005002c,0x00000007,0x00000064,0x0000005d,0x00000021,0x0005002c,
|
0x0005002c,0x00000007,0x0000006e,0x00000027,0x0000005c,0x0005002c,0x00000007,0x00000074,
|
||||||
0x00000007,0x0000006e,0x00000028,0x00000021,0x0005002c,0x00000007,0x00000074,0x00000021,
|
0x0000005c,0x00000027,0x00040015,0x0000007a,0x00000020,0x00000000,0x0004002b,0x0000007a,
|
||||||
0x00000028,0x00040015,0x0000007a,0x00000020,0x00000000,0x0004002b,0x0000007a,0x0000007b,
|
0x0000007b,0x00000001,0x0004002b,0x00000009,0x000000a2,0x3a800000,0x0004002b,0x00000009,
|
||||||
0x00000001,0x0004002b,0x00000009,0x000000a2,0x3a800000,0x0004002b,0x00000009,0x000000b4,
|
0x000000b4,0x40800000,0x00040020,0x000000d0,0x00000003,0x00000023,0x0004003b,0x000000d0,
|
||||||
0x40800000,0x00040020,0x000000d0,0x00000003,0x0000002d,0x0004003b,0x000000d0,0x000000d1,
|
0x000000d1,0x00000003,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,
|
||||||
0x00000003,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,
|
0x00000005,0x0004003b,0x00000008,0x00000045,0x00000007,0x0004003b,0x0000000f,0x0000004d,
|
||||||
0x0004003b,0x00000008,0x00000040,0x00000007,0x0004003b,0x0000000f,0x0000004d,0x00000007,
|
0x00000007,0x0004003b,0x00000059,0x0000005a,0x00000007,0x0004003b,0x00000008,0x00000060,
|
||||||
0x0004003b,0x0000005a,0x0000005b,0x00000007,0x0004003b,0x00000008,0x00000060,0x00000007,
|
0x00000007,0x0004003b,0x00000059,0x00000062,0x00000007,0x0004003b,0x00000008,0x00000066,
|
||||||
0x0004003b,0x0000005a,0x00000062,0x00000007,0x0004003b,0x00000008,0x00000066,0x00000007,
|
0x00000007,0x0004003b,0x00000059,0x00000068,0x00000007,0x0004003b,0x00000008,0x00000069,
|
||||||
0x0004003b,0x0000005a,0x00000068,0x00000007,0x0004003b,0x00000008,0x00000069,0x00000007,
|
0x00000007,0x0004003b,0x00000059,0x0000006c,0x00000007,0x0004003b,0x00000008,0x00000070,
|
||||||
0x0004003b,0x0000005a,0x0000006c,0x00000007,0x0004003b,0x00000008,0x00000070,0x00000007,
|
0x00000007,0x0004003b,0x00000059,0x00000072,0x00000007,0x0004003b,0x00000008,0x00000076,
|
||||||
0x0004003b,0x0000005a,0x00000072,0x00000007,0x0004003b,0x00000008,0x00000076,0x00000007,
|
0x00000007,0x0004003b,0x0000000f,0x00000078,0x00000007,0x0004003b,0x0000000f,0x00000079,
|
||||||
0x0004003b,0x0000000f,0x00000078,0x00000007,0x0004003b,0x0000000f,0x00000079,0x00000007,
|
0x00000007,0x0004003b,0x0000000f,0x0000007e,0x00000007,0x0004003b,0x0000000f,0x00000081,
|
||||||
0x0004003b,0x0000000f,0x0000007e,0x00000007,0x0004003b,0x0000000f,0x00000081,0x00000007,
|
0x00000007,0x0004003b,0x0000000f,0x00000085,0x00000007,0x0004003b,0x0000000f,0x00000086,
|
||||||
0x0004003b,0x0000000f,0x00000085,0x00000007,0x0004003b,0x0000000f,0x00000086,0x00000007,
|
0x00000007,0x0004003b,0x0000000f,0x00000089,0x00000007,0x0004003b,0x0000000f,0x0000008d,
|
||||||
0x0004003b,0x0000000f,0x00000089,0x00000007,0x0004003b,0x0000000f,0x0000008d,0x00000007,
|
0x00000007,0x0004003b,0x0000000f,0x0000008e,0x00000007,0x0004003b,0x0000000f,0x00000091,
|
||||||
0x0004003b,0x0000000f,0x0000008e,0x00000007,0x0004003b,0x0000000f,0x00000091,0x00000007,
|
0x00000007,0x0004003b,0x0000000f,0x00000094,0x00000007,0x0004003b,0x0000000f,0x00000098,
|
||||||
0x0004003b,0x0000000f,0x00000094,0x00000007,0x0004003b,0x0000000f,0x00000098,0x00000007,
|
0x00000007,0x0004003b,0x0000000f,0x00000099,0x00000007,0x0004003b,0x0000000f,0x0000009c,
|
||||||
0x0004003b,0x0000000f,0x00000099,0x00000007,0x0004003b,0x0000000f,0x0000009c,0x00000007,
|
0x00000007,0x0004003b,0x0000000f,0x000000a0,0x00000007,0x0004003b,0x0000000f,0x000000a5,
|
||||||
0x0004003b,0x0000000f,0x000000a0,0x00000007,0x0004003b,0x0000000f,0x000000a5,0x00000007,
|
0x00000007,0x0004003b,0x0000000f,0x000000af,0x00000007,0x0004003b,0x0000000f,0x000000b3,
|
||||||
0x0004003b,0x0000000f,0x000000af,0x00000007,0x0004003b,0x0000000f,0x000000b3,0x00000007,
|
0x00000007,0x0004003b,0x00000059,0x000000b9,0x00000007,0x0004003d,0x0000001b,0x00000048,
|
||||||
0x0004003b,0x0000005a,0x000000b9,0x00000007,0x0004003d,0x00000041,0x00000044,0x00000043,
|
0x00000047,0x00050041,0x00000028,0x00000049,0x00000026,0x00000027,0x0004003d,0x0000001b,
|
||||||
0x00050041,0x00000048,0x00000049,0x00000047,0x00000028,0x0004003d,0x00000041,0x0000004a,
|
0x0000004a,0x00000049,0x00050085,0x0000001b,0x0000004b,0x00000048,0x0000004a,0x0004006e,
|
||||||
0x00000049,0x00050085,0x00000041,0x0000004b,0x00000044,0x0000004a,0x0004006e,0x00000007,
|
0x00000007,0x0000004c,0x0000004b,0x0003003e,0x00000045,0x0000004c,0x00050041,0x00000052,
|
||||||
0x0000004c,0x0000004b,0x0003003e,0x00000040,0x0000004c,0x00050041,0x00000052,0x00000053,
|
0x00000053,0x00000026,0x00000051,0x0004003d,0x00000009,0x00000054,0x00000053,0x0008000c,
|
||||||
0x00000047,0x00000051,0x0004003d,0x00000009,0x00000054,0x00000053,0x0008000c,0x00000009,
|
0x00000009,0x00000056,0x00000001,0x0000002b,0x00000054,0x00000032,0x00000055,0x0008000c,
|
||||||
0x00000057,0x00000001,0x0000002b,0x00000054,0x00000055,0x00000056,0x0008000c,0x00000009,
|
0x00000009,0x00000057,0x00000001,0x0000002e,0x0000004f,0x00000050,0x00000056,0x00050088,
|
||||||
0x00000058,0x00000001,0x0000002e,0x0000004f,0x00000050,0x00000057,0x00050088,0x00000009,
|
0x00000009,0x00000058,0x0000004e,0x00000057,0x0003003e,0x0000004d,0x00000058,0x0004003d,
|
||||||
0x00000059,0x0000004e,0x00000058,0x0003003e,0x0000004d,0x00000059,0x0004003d,0x00000007,
|
0x00000007,0x0000005b,0x00000045,0x00050080,0x00000007,0x0000005f,0x0000005b,0x0000005e,
|
||||||
0x0000005c,0x00000040,0x00050080,0x00000007,0x0000005f,0x0000005c,0x0000005e,0x0003003e,
|
0x0003003e,0x00000060,0x0000005f,0x00050039,0x0000000a,0x00000061,0x0000000d,0x00000060,
|
||||||
0x00000060,0x0000005f,0x00050039,0x0000000a,0x00000061,0x0000000d,0x00000060,0x0003003e,
|
0x0003003e,0x0000005a,0x00000061,0x0004003d,0x00000007,0x00000063,0x00000045,0x00050080,
|
||||||
0x0000005b,0x00000061,0x0004003d,0x00000007,0x00000063,0x00000040,0x00050080,0x00000007,
|
0x00000007,0x00000065,0x00000063,0x00000064,0x0003003e,0x00000066,0x00000065,0x00050039,
|
||||||
0x00000065,0x00000063,0x00000064,0x0003003e,0x00000066,0x00000065,0x00050039,0x0000000a,
|
0x0000000a,0x00000067,0x0000000d,0x00000066,0x0003003e,0x00000062,0x00000067,0x0004003d,
|
||||||
0x00000067,0x0000000d,0x00000066,0x0003003e,0x00000062,0x00000067,0x0004003d,0x00000007,
|
0x00000007,0x0000006a,0x00000045,0x0003003e,0x00000069,0x0000006a,0x00050039,0x0000000a,
|
||||||
0x0000006a,0x00000040,0x0003003e,0x00000069,0x0000006a,0x00050039,0x0000000a,0x0000006b,
|
0x0000006b,0x0000000d,0x00000069,0x0003003e,0x00000068,0x0000006b,0x0004003d,0x00000007,
|
||||||
0x0000000d,0x00000069,0x0003003e,0x00000068,0x0000006b,0x0004003d,0x00000007,0x0000006d,
|
0x0000006d,0x00000045,0x00050080,0x00000007,0x0000006f,0x0000006d,0x0000006e,0x0003003e,
|
||||||
0x00000040,0x00050080,0x00000007,0x0000006f,0x0000006d,0x0000006e,0x0003003e,0x00000070,
|
0x00000070,0x0000006f,0x00050039,0x0000000a,0x00000071,0x0000000d,0x00000070,0x0003003e,
|
||||||
0x0000006f,0x00050039,0x0000000a,0x00000071,0x0000000d,0x00000070,0x0003003e,0x0000006c,
|
0x0000006c,0x00000071,0x0004003d,0x00000007,0x00000073,0x00000045,0x00050080,0x00000007,
|
||||||
0x00000071,0x0004003d,0x00000007,0x00000073,0x00000040,0x00050080,0x00000007,0x00000075,
|
0x00000075,0x00000073,0x00000074,0x0003003e,0x00000076,0x00000075,0x00050039,0x0000000a,
|
||||||
0x00000073,0x00000074,0x0003003e,0x00000076,0x00000075,0x00050039,0x0000000a,0x00000077,
|
0x00000077,0x0000000d,0x00000076,0x0003003e,0x00000072,0x00000077,0x00050041,0x0000000f,
|
||||||
0x0000000d,0x00000076,0x0003003e,0x00000072,0x00000077,0x00050041,0x0000000f,0x0000007c,
|
0x0000007c,0x00000062,0x0000007b,0x0004003d,0x00000009,0x0000007d,0x0000007c,0x0003003e,
|
||||||
0x00000062,0x0000007b,0x0004003d,0x00000009,0x0000007d,0x0000007c,0x0003003e,0x00000079,
|
0x00000079,0x0000007d,0x00050041,0x0000000f,0x0000007f,0x00000068,0x0000007b,0x0004003d,
|
||||||
0x0000007d,0x00050041,0x0000000f,0x0000007f,0x00000068,0x0000007b,0x0004003d,0x00000009,
|
0x00000009,0x00000080,0x0000007f,0x0003003e,0x0000007e,0x00000080,0x00050041,0x0000000f,
|
||||||
0x00000080,0x0000007f,0x0003003e,0x0000007e,0x00000080,0x00050041,0x0000000f,0x00000082,
|
0x00000082,0x0000006c,0x0000007b,0x0004003d,0x00000009,0x00000083,0x00000082,0x0003003e,
|
||||||
0x0000006c,0x0000007b,0x0004003d,0x00000009,0x00000083,0x00000082,0x0003003e,0x00000081,
|
0x00000081,0x00000083,0x00070039,0x00000009,0x00000084,0x00000014,0x00000079,0x0000007e,
|
||||||
0x00000083,0x00070039,0x00000009,0x00000084,0x00000014,0x00000079,0x0000007e,0x00000081,
|
0x00000081,0x0003003e,0x00000085,0x00000084,0x00050041,0x0000000f,0x00000087,0x0000005a,
|
||||||
0x0003003e,0x00000085,0x00000084,0x00050041,0x0000000f,0x00000087,0x0000005b,0x0000007b,
|
0x0000007b,0x0004003d,0x00000009,0x00000088,0x00000087,0x0003003e,0x00000086,0x00000088,
|
||||||
0x0004003d,0x00000009,0x00000088,0x00000087,0x0003003e,0x00000086,0x00000088,0x00050041,
|
0x00050041,0x0000000f,0x0000008a,0x00000072,0x0000007b,0x0004003d,0x00000009,0x0000008b,
|
||||||
0x0000000f,0x0000008a,0x00000072,0x0000007b,0x0004003d,0x00000009,0x0000008b,0x0000008a,
|
0x0000008a,0x0003003e,0x00000089,0x0000008b,0x00070039,0x00000009,0x0000008c,0x00000014,
|
||||||
0x0003003e,0x00000089,0x0000008b,0x00070039,0x00000009,0x0000008c,0x00000014,0x00000085,
|
0x00000085,0x00000086,0x00000089,0x0003003e,0x00000078,0x0000008c,0x00050041,0x0000000f,
|
||||||
0x00000086,0x00000089,0x0003003e,0x00000078,0x0000008c,0x00050041,0x0000000f,0x0000008f,
|
0x0000008f,0x00000062,0x0000007b,0x0004003d,0x00000009,0x00000090,0x0000008f,0x0003003e,
|
||||||
0x00000062,0x0000007b,0x0004003d,0x00000009,0x00000090,0x0000008f,0x0003003e,0x0000008e,
|
0x0000008e,0x00000090,0x00050041,0x0000000f,0x00000092,0x00000068,0x0000007b,0x0004003d,
|
||||||
0x00000090,0x00050041,0x0000000f,0x00000092,0x00000068,0x0000007b,0x0004003d,0x00000009,
|
0x00000009,0x00000093,0x00000092,0x0003003e,0x00000091,0x00000093,0x00050041,0x0000000f,
|
||||||
0x00000093,0x00000092,0x0003003e,0x00000091,0x00000093,0x00050041,0x0000000f,0x00000095,
|
0x00000095,0x0000006c,0x0000007b,0x0004003d,0x00000009,0x00000096,0x00000095,0x0003003e,
|
||||||
0x0000006c,0x0000007b,0x0004003d,0x00000009,0x00000096,0x00000095,0x0003003e,0x00000094,
|
0x00000094,0x00000096,0x00070039,0x00000009,0x00000097,0x00000019,0x0000008e,0x00000091,
|
||||||
0x00000096,0x00070039,0x00000009,0x00000097,0x00000019,0x0000008e,0x00000091,0x00000094,
|
0x00000094,0x0003003e,0x00000098,0x00000097,0x00050041,0x0000000f,0x0000009a,0x0000005a,
|
||||||
0x0003003e,0x00000098,0x00000097,0x00050041,0x0000000f,0x0000009a,0x0000005b,0x0000007b,
|
0x0000007b,0x0004003d,0x00000009,0x0000009b,0x0000009a,0x0003003e,0x00000099,0x0000009b,
|
||||||
0x0004003d,0x00000009,0x0000009b,0x0000009a,0x0003003e,0x00000099,0x0000009b,0x00050041,
|
0x00050041,0x0000000f,0x0000009d,0x00000072,0x0000007b,0x0004003d,0x00000009,0x0000009e,
|
||||||
0x0000000f,0x0000009d,0x00000072,0x0000007b,0x0004003d,0x00000009,0x0000009e,0x0000009d,
|
0x0000009d,0x0003003e,0x0000009c,0x0000009e,0x00070039,0x00000009,0x0000009f,0x00000019,
|
||||||
0x0003003e,0x0000009c,0x0000009e,0x00070039,0x00000009,0x0000009f,0x00000019,0x00000098,
|
0x00000098,0x00000099,0x0000009c,0x0003003e,0x0000008d,0x0000009f,0x0004003d,0x00000009,
|
||||||
0x00000099,0x0000009c,0x0003003e,0x0000008d,0x0000009f,0x0004003d,0x00000009,0x000000a1,
|
0x000000a1,0x0000008d,0x0007000c,0x00000009,0x000000a3,0x00000001,0x00000028,0x000000a1,
|
||||||
0x0000008d,0x0007000c,0x00000009,0x000000a3,0x00000001,0x00000028,0x000000a1,0x000000a2,
|
0x000000a2,0x00050088,0x00000009,0x000000a4,0x00000055,0x000000a3,0x0003003e,0x000000a0,
|
||||||
0x00050088,0x00000009,0x000000a4,0x00000056,0x000000a3,0x0003003e,0x000000a0,0x000000a4,
|
0x000000a4,0x0004003d,0x00000009,0x000000a6,0x00000078,0x0004003d,0x00000009,0x000000a7,
|
||||||
0x0004003d,0x00000009,0x000000a6,0x00000078,0x0004003d,0x00000009,0x000000a7,0x0000008d,
|
0x0000008d,0x00050083,0x00000009,0x000000a8,0x00000055,0x000000a7,0x0007000c,0x00000009,
|
||||||
0x00050083,0x00000009,0x000000a8,0x00000056,0x000000a7,0x0007000c,0x00000009,0x000000a9,
|
0x000000a9,0x00000001,0x00000025,0x000000a6,0x000000a8,0x0004003d,0x00000009,0x000000aa,
|
||||||
0x00000001,0x00000025,0x000000a6,0x000000a8,0x0004003d,0x00000009,0x000000aa,0x000000a0,
|
0x000000a0,0x00050085,0x00000009,0x000000ab,0x000000a9,0x000000aa,0x0008000c,0x00000009,
|
||||||
0x00050085,0x00000009,0x000000ab,0x000000a9,0x000000aa,0x0008000c,0x00000009,0x000000ac,
|
0x000000ac,0x00000001,0x0000002b,0x000000ab,0x00000032,0x00000055,0x0003003e,0x000000a5,
|
||||||
0x00000001,0x0000002b,0x000000ab,0x00000055,0x00000056,0x0003003e,0x000000a5,0x000000ac,
|
0x000000ac,0x0004003d,0x00000009,0x000000ad,0x000000a5,0x0006000c,0x00000009,0x000000ae,
|
||||||
0x0004003d,0x00000009,0x000000ad,0x000000a5,0x0006000c,0x00000009,0x000000ae,0x00000001,
|
0x00000001,0x0000001f,0x000000ad,0x0003003e,0x000000a5,0x000000ae,0x0004003d,0x00000009,
|
||||||
0x0000001f,0x000000ad,0x0003003e,0x000000a5,0x000000ae,0x0004003d,0x00000009,0x000000b0,
|
0x000000b0,0x000000a5,0x0004003d,0x00000009,0x000000b1,0x0000004d,0x00050085,0x00000009,
|
||||||
0x000000a5,0x0004003d,0x00000009,0x000000b1,0x0000004d,0x00050085,0x00000009,0x000000b2,
|
0x000000b2,0x000000b0,0x000000b1,0x0003003e,0x000000af,0x000000b2,0x0004003d,0x00000009,
|
||||||
0x000000b0,0x000000b1,0x0003003e,0x000000af,0x000000b2,0x0004003d,0x00000009,0x000000b5,
|
0x000000b5,0x000000af,0x00050085,0x00000009,0x000000b6,0x000000b4,0x000000b5,0x00050081,
|
||||||
0x000000af,0x00050085,0x00000009,0x000000b6,0x000000b4,0x000000b5,0x00050081,0x00000009,
|
0x00000009,0x000000b7,0x00000055,0x000000b6,0x00050088,0x00000009,0x000000b8,0x00000055,
|
||||||
0x000000b7,0x00000056,0x000000b6,0x00050088,0x00000009,0x000000b8,0x00000056,0x000000b7,
|
0x000000b7,0x0003003e,0x000000b3,0x000000b8,0x0004003d,0x0000000a,0x000000ba,0x0000005a,
|
||||||
0x0003003e,0x000000b3,0x000000b8,0x0004003d,0x0000000a,0x000000ba,0x0000005b,0x0004003d,
|
0x0004003d,0x00000009,0x000000bb,0x000000af,0x0005008e,0x0000000a,0x000000bc,0x000000ba,
|
||||||
0x00000009,0x000000bb,0x000000af,0x0005008e,0x0000000a,0x000000bc,0x000000ba,0x000000bb,
|
0x000000bb,0x0004003d,0x0000000a,0x000000bd,0x00000062,0x0004003d,0x00000009,0x000000be,
|
||||||
0x0004003d,0x0000000a,0x000000bd,0x00000062,0x0004003d,0x00000009,0x000000be,0x000000af,
|
0x000000af,0x0005008e,0x0000000a,0x000000bf,0x000000bd,0x000000be,0x00050081,0x0000000a,
|
||||||
0x0005008e,0x0000000a,0x000000bf,0x000000bd,0x000000be,0x00050081,0x0000000a,0x000000c0,
|
0x000000c0,0x000000bc,0x000000bf,0x0004003d,0x0000000a,0x000000c1,0x0000006c,0x0004003d,
|
||||||
0x000000bc,0x000000bf,0x0004003d,0x0000000a,0x000000c1,0x0000006c,0x0004003d,0x00000009,
|
0x00000009,0x000000c2,0x000000af,0x0005008e,0x0000000a,0x000000c3,0x000000c1,0x000000c2,
|
||||||
0x000000c2,0x000000af,0x0005008e,0x0000000a,0x000000c3,0x000000c1,0x000000c2,0x00050081,
|
0x00050081,0x0000000a,0x000000c4,0x000000c0,0x000000c3,0x0004003d,0x0000000a,0x000000c5,
|
||||||
0x0000000a,0x000000c4,0x000000c0,0x000000c3,0x0004003d,0x0000000a,0x000000c5,0x00000072,
|
0x00000072,0x0004003d,0x00000009,0x000000c6,0x000000af,0x0005008e,0x0000000a,0x000000c7,
|
||||||
0x0004003d,0x00000009,0x000000c6,0x000000af,0x0005008e,0x0000000a,0x000000c7,0x000000c5,
|
0x000000c5,0x000000c6,0x00050081,0x0000000a,0x000000c8,0x000000c4,0x000000c7,0x0004003d,
|
||||||
0x000000c6,0x00050081,0x0000000a,0x000000c8,0x000000c4,0x000000c7,0x0004003d,0x0000000a,
|
0x0000000a,0x000000c9,0x00000068,0x00050081,0x0000000a,0x000000ca,0x000000c8,0x000000c9,
|
||||||
0x000000c9,0x00000068,0x00050081,0x0000000a,0x000000ca,0x000000c8,0x000000c9,0x0004003d,
|
0x0004003d,0x00000009,0x000000cb,0x000000b3,0x0005008e,0x0000000a,0x000000cc,0x000000ca,
|
||||||
0x00000009,0x000000cb,0x000000b3,0x0005008e,0x0000000a,0x000000cc,0x000000ca,0x000000cb,
|
0x000000cb,0x00060050,0x0000000a,0x000000cd,0x00000032,0x00000032,0x00000032,0x00060050,
|
||||||
0x00060050,0x0000000a,0x000000cd,0x00000055,0x00000055,0x00000055,0x00060050,0x0000000a,
|
0x0000000a,0x000000ce,0x00000055,0x00000055,0x00000055,0x0008000c,0x0000000a,0x000000cf,
|
||||||
0x000000ce,0x00000056,0x00000056,0x00000056,0x0008000c,0x0000000a,0x000000cf,0x00000001,
|
0x00000001,0x0000002b,0x000000cc,0x000000cd,0x000000ce,0x0003003e,0x000000b9,0x000000cf,
|
||||||
0x0000002b,0x000000cc,0x000000cd,0x000000ce,0x0003003e,0x000000b9,0x000000cf,0x0004003d,
|
0x0004003d,0x0000000a,0x000000d2,0x000000b9,0x00050051,0x00000009,0x000000d3,0x000000d2,
|
||||||
0x0000000a,0x000000d2,0x000000b9,0x00050051,0x00000009,0x000000d3,0x000000d2,0x00000000,
|
0x00000000,0x00050051,0x00000009,0x000000d4,0x000000d2,0x00000001,0x00050051,0x00000009,
|
||||||
0x00050051,0x00000009,0x000000d4,0x000000d2,0x00000001,0x00050051,0x00000009,0x000000d5,
|
0x000000d5,0x000000d2,0x00000002,0x00070050,0x00000023,0x000000d6,0x000000d3,0x000000d4,
|
||||||
0x000000d2,0x00000002,0x00070050,0x0000002d,0x000000d6,0x000000d3,0x000000d4,0x000000d5,
|
0x000000d5,0x00000055,0x0003003e,0x000000d1,0x000000d6,0x000100fd,0x00010038,0x00050036,
|
||||||
0x00000056,0x0003003e,0x000000d1,0x000000d6,0x000100fd,0x00010038,0x00050036,0x0000000a,
|
0x0000000a,0x0000000d,0x00000000,0x0000000b,0x00030037,0x00000008,0x0000000c,0x000200f8,
|
||||||
0x0000000d,0x00000000,0x0000000b,0x00030037,0x00000008,0x0000000c,0x000200f8,0x0000000e,
|
0x0000000e,0x0004003b,0x0000001c,0x0000001d,0x00000007,0x0004003d,0x00000007,0x0000001e,
|
||||||
0x0004003b,0x00000008,0x0000001b,0x00000007,0x0004003d,0x0000001d,0x00000020,0x0000001f,
|
0x0000000c,0x0004006f,0x0000001b,0x0000001f,0x0000001e,0x00050050,0x0000001b,0x00000021,
|
||||||
0x00040064,0x0000001c,0x00000022,0x00000020,0x00050067,0x00000007,0x00000023,0x00000022,
|
0x00000020,0x00000020,0x00050081,0x0000001b,0x00000022,0x0000001f,0x00000021,0x00050041,
|
||||||
0x00000021,0x0003003e,0x0000001b,0x00000023,0x0004003d,0x0000001d,0x00000024,0x0000001f,
|
0x00000028,0x00000029,0x00000026,0x00000027,0x0004003d,0x0000001b,0x0000002a,0x00000029,
|
||||||
0x0004003d,0x00000007,0x00000025,0x0000000c,0x0004003d,0x00000007,0x00000027,0x0000001b,
|
0x00050088,0x0000001b,0x0000002b,0x00000022,0x0000002a,0x0003003e,0x0000001d,0x0000002b,
|
||||||
0x00050082,0x00000007,0x0000002a,0x00000027,0x00000029,0x0008000c,0x00000007,0x0000002b,
|
0x0004003d,0x0000002d,0x00000030,0x0000002f,0x0004003d,0x0000001b,0x00000031,0x0000001d,
|
||||||
0x00000001,0x0000002d,0x00000025,0x00000026,0x0000002a,0x00040064,0x0000001c,0x0000002c,
|
0x00070058,0x00000023,0x00000033,0x00000030,0x00000031,0x00000002,0x00000032,0x0008004f,
|
||||||
0x00000024,0x0007005f,0x0000002d,0x0000002e,0x0000002c,0x0000002b,0x00000002,0x00000021,
|
0x0000000a,0x00000034,0x00000033,0x00000033,0x00000000,0x00000001,0x00000002,0x000200fe,
|
||||||
0x0008004f,0x0000000a,0x0000002f,0x0000002e,0x0000002e,0x00000000,0x00000001,0x00000002,
|
0x00000034,0x00010038,0x00050036,0x00000009,0x00000014,0x00000000,0x00000010,0x00030037,
|
||||||
0x000200fe,0x0000002f,0x00010038,0x00050036,0x00000009,0x00000014,0x00000000,0x00000010,
|
0x0000000f,0x00000011,0x00030037,0x0000000f,0x00000012,0x00030037,0x0000000f,0x00000013,
|
||||||
0x00030037,0x0000000f,0x00000011,0x00030037,0x0000000f,0x00000012,0x00030037,0x0000000f,
|
0x000200f8,0x00000015,0x0004003d,0x00000009,0x00000037,0x00000011,0x0004003d,0x00000009,
|
||||||
0x00000013,0x000200f8,0x00000015,0x0004003d,0x00000009,0x00000032,0x00000011,0x0004003d,
|
0x00000038,0x00000012,0x0004003d,0x00000009,0x00000039,0x00000013,0x0007000c,0x00000009,
|
||||||
0x00000009,0x00000033,0x00000012,0x0004003d,0x00000009,0x00000034,0x00000013,0x0007000c,
|
0x0000003a,0x00000001,0x00000025,0x00000038,0x00000039,0x0007000c,0x00000009,0x0000003b,
|
||||||
0x00000009,0x00000035,0x00000001,0x00000025,0x00000033,0x00000034,0x0007000c,0x00000009,
|
0x00000001,0x00000025,0x00000037,0x0000003a,0x000200fe,0x0000003b,0x00010038,0x00050036,
|
||||||
0x00000036,0x00000001,0x00000025,0x00000032,0x00000035,0x000200fe,0x00000036,0x00010038,
|
0x00000009,0x00000019,0x00000000,0x00000010,0x00030037,0x0000000f,0x00000016,0x00030037,
|
||||||
0x00050036,0x00000009,0x00000019,0x00000000,0x00000010,0x00030037,0x0000000f,0x00000016,
|
0x0000000f,0x00000017,0x00030037,0x0000000f,0x00000018,0x000200f8,0x0000001a,0x0004003d,
|
||||||
0x00030037,0x0000000f,0x00000017,0x00030037,0x0000000f,0x00000018,0x000200f8,0x0000001a,
|
0x00000009,0x0000003e,0x00000016,0x0004003d,0x00000009,0x0000003f,0x00000017,0x0004003d,
|
||||||
0x0004003d,0x00000009,0x00000039,0x00000016,0x0004003d,0x00000009,0x0000003a,0x00000017,
|
0x00000009,0x00000040,0x00000018,0x0007000c,0x00000009,0x00000041,0x00000001,0x00000028,
|
||||||
0x0004003d,0x00000009,0x0000003b,0x00000018,0x0007000c,0x00000009,0x0000003c,0x00000001,
|
0x0000003f,0x00000040,0x0007000c,0x00000009,0x00000042,0x00000001,0x00000028,0x0000003e,
|
||||||
0x00000028,0x0000003a,0x0000003b,0x0007000c,0x00000009,0x0000003d,0x00000001,0x00000028,
|
0x00000041,0x000200fe,0x00000042,0x00010038
|
||||||
0x00000039,0x0000003c,0x000200fe,0x0000003d,0x00010038
|
|
||||||
};
|
};
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
#include "droiddeck-ahb-v1-server-protocol.h"
|
#include "droiddeck-ahb-v1-server-protocol.h"
|
||||||
#include <android/hardware_buffer.h>
|
#include <android/hardware_buffer.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <linux/sync_file.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
@@ -133,10 +134,10 @@ static void handle_released(uint64_t id, int fd) {
|
|||||||
if (fd >= 0) {
|
if (fd >= 0) {
|
||||||
struct droiddeck_dma_buf_sync_file imp = {.flags = DROIDDECK_DMA_BUF_SYNC_READ, .fd = fd};
|
struct droiddeck_dma_buf_sync_file imp = {.flags = DROIDDECK_DMA_BUF_SYNC_READ, .fd = fd};
|
||||||
int dmabuf_fd = droiddeck_dmabuf_fd(ab->b);
|
int dmabuf_fd = droiddeck_dmabuf_fd(ab->b);
|
||||||
if (!ab->display && dmabuf_fd >= 0 && ioctl(dmabuf_fd, DROIDDECK_DMA_BUF_IOCTL_IMPORT_SYNC_FILE, &imp) == 0) {
|
if (dmabuf_fd >= 0 && ioctl(dmabuf_fd, DROIDDECK_DMA_BUF_IOCTL_IMPORT_SYNC_FILE, &imp) == 0) {
|
||||||
close(fd);
|
close(fd);
|
||||||
} else {
|
} else {
|
||||||
if (!ab->display && !g_import_failed_logged) {
|
if (!g_import_failed_logged) {
|
||||||
g_import_failed_logged = 1;
|
g_import_failed_logged = 1;
|
||||||
droiddeck_log("layer", "zero-copy: DMA_BUF_IOCTL_IMPORT_SYNC_FILE failed (%s): releases wait for the display's fence here instead",
|
droiddeck_log("layer", "zero-copy: DMA_BUF_IOCTL_IMPORT_SYNC_FILE failed (%s): releases wait for the display's fence here instead",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
@@ -145,6 +146,12 @@ static void handle_released(uint64_t id, int fd) {
|
|||||||
if (poll(&p, 1, 0) > 0) {
|
if (poll(&p, 1, 0) > 0) {
|
||||||
close(fd);
|
close(fd);
|
||||||
} else {
|
} else {
|
||||||
|
if (ab->fence_src) {
|
||||||
|
struct sync_merge_data m = {.name = "droiddeck-release", .fd2 = fd};
|
||||||
|
if (ioctl(ab->fence_fd, SYNC_IOC_MERGE, &m) == 0) { close(fd); fd = m.fence; }
|
||||||
|
wl_event_source_remove(ab->fence_src);
|
||||||
|
close(ab->fence_fd);
|
||||||
|
}
|
||||||
ab->fence_fd = fd;
|
ab->fence_fd = fd;
|
||||||
ab->fence_src = wl_event_loop_add_fd(g_loop, fd, WL_EVENT_READABLE, on_fence_readable, ab);
|
ab->fence_src = wl_event_loop_add_fd(g_loop, fd, WL_EVENT_READABLE, on_fence_readable, ab);
|
||||||
if (!ab->fence_src) { close(fd); ab->fence_fd = -1; }
|
if (!ab->fence_src) { close(fd); ab->fence_fd = -1; }
|
||||||
@@ -152,6 +159,7 @@ static void handle_released(uint64_t id, int fd) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ab->fence_src) return;
|
||||||
send_deferred_release(ab);
|
send_deferred_release(ab);
|
||||||
maybe_free(ab);
|
maybe_free(ab);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,6 +242,10 @@ struct surface {
|
|||||||
enum surface_role role;
|
enum surface_role role;
|
||||||
struct wl_resource *idle_buffer;
|
struct wl_resource *idle_buffer;
|
||||||
struct wl_listener idle_buffer_destroy;
|
struct wl_listener idle_buffer_destroy;
|
||||||
|
struct surface_state *waiting;
|
||||||
|
struct wl_event_source *waiting_source, *waiting_timer;
|
||||||
|
int waiting_fd;
|
||||||
|
int64_t waiting_since_ns;
|
||||||
uint32_t *idle_px;
|
uint32_t *idle_px;
|
||||||
int idle_w, idle_h;
|
int idle_w, idle_h;
|
||||||
struct wl_resource *xdg_surface, *xdg_toplevel;
|
struct wl_resource *xdg_surface, *xdg_toplevel;
|
||||||
@@ -373,6 +377,8 @@ static struct {
|
|||||||
unsigned copy_scenes;
|
unsigned copy_scenes;
|
||||||
unsigned releases, releases_held;
|
unsigned releases, releases_held;
|
||||||
int64_t release_ns, release_max_ns;
|
int64_t release_ns, release_max_ns;
|
||||||
|
unsigned commit_waits, commit_wait_limits;
|
||||||
|
int64_t commit_wait_ns, commit_wait_max_ns;
|
||||||
} g_perf;
|
} g_perf;
|
||||||
|
|
||||||
static void schedule_render(void);
|
static void schedule_render(void);
|
||||||
@@ -846,6 +852,55 @@ static void on_pending_buffer_destroyed(struct wl_listener *l, void *data) {
|
|||||||
s->pending_buffer = NULL;
|
s->pending_buffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct surface_state {
|
||||||
|
struct wl_resource *buffer;
|
||||||
|
struct wl_listener buffer_destroy;
|
||||||
|
int attach;
|
||||||
|
int src_set, dst_set, opaque_set;
|
||||||
|
float src[4];
|
||||||
|
int dst[2], opaque[4];
|
||||||
|
struct damage_list damage_buf, damage_local;
|
||||||
|
struct wl_list frames, feedback;
|
||||||
|
};
|
||||||
|
|
||||||
|
static void on_state_buffer_destroyed(struct wl_listener *l, void *data) {
|
||||||
|
struct surface_state *st = wl_container_of(l, st, buffer_destroy);
|
||||||
|
wl_list_remove(&st->buffer_destroy.link);
|
||||||
|
wl_list_init(&st->buffer_destroy.link);
|
||||||
|
st->buffer = NULL;
|
||||||
|
st->attach = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void surface_state_take(struct surface *s, struct surface_state *st) {
|
||||||
|
st->attach = s->pending_attach;
|
||||||
|
st->buffer = s->pending_buffer;
|
||||||
|
wl_list_init(&st->buffer_destroy.link);
|
||||||
|
if (st->buffer) {
|
||||||
|
wl_list_remove(&s->pending_buffer_destroy.link);
|
||||||
|
wl_list_init(&s->pending_buffer_destroy.link);
|
||||||
|
st->buffer_destroy.notify = on_state_buffer_destroyed;
|
||||||
|
wl_resource_add_destroy_listener(st->buffer, &st->buffer_destroy);
|
||||||
|
}
|
||||||
|
s->pending_buffer = NULL;
|
||||||
|
s->pending_attach = 0;
|
||||||
|
st->src_set = s->pending_src_set;
|
||||||
|
memcpy(st->src, s->pending_src, sizeof(st->src));
|
||||||
|
st->dst_set = s->pending_dst_set;
|
||||||
|
memcpy(st->dst, s->pending_dst, sizeof(st->dst));
|
||||||
|
st->opaque_set = s->pending_opaque_set;
|
||||||
|
memcpy(st->opaque, s->pending_opaque, sizeof(st->opaque));
|
||||||
|
s->pending_src_set = s->pending_dst_set = s->pending_opaque_set = 0;
|
||||||
|
st->damage_buf = s->pending_damage_buf;
|
||||||
|
st->damage_local = s->pending_damage_local;
|
||||||
|
s->pending_damage_buf.n = s->pending_damage_local.n = 0;
|
||||||
|
wl_list_init(&st->frames);
|
||||||
|
wl_list_insert_list(&st->frames, &s->pending_frames);
|
||||||
|
wl_list_init(&s->pending_frames);
|
||||||
|
wl_list_init(&st->feedback);
|
||||||
|
wl_list_insert_list(&st->feedback, &s->pending_feedback);
|
||||||
|
wl_list_init(&s->pending_feedback);
|
||||||
|
}
|
||||||
|
|
||||||
static void fire_frames(struct wl_list *frames) {
|
static void fire_frames(struct wl_list *frames) {
|
||||||
struct wl_resource *cb, *tmp;
|
struct wl_resource *cb, *tmp;
|
||||||
uint32_t t;
|
uint32_t t;
|
||||||
@@ -1363,35 +1418,23 @@ static void surface_drop_idle(struct surface *s) {
|
|||||||
if (buffer) send_buffer_release(buffer);
|
if (buffer) send_buffer_release(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void surface_commit(struct wl_client *c, struct wl_resource *r) {
|
static void surface_state_apply(struct surface *s, struct surface_state *st) {
|
||||||
struct surface *s = wl_resource_get_user_data(r);
|
|
||||||
struct surface *child;
|
struct surface *child;
|
||||||
|
|
||||||
if (s->xdg_toplevel && !s->toplevel_committed) {
|
if (st->src_set) {
|
||||||
s->toplevel_committed = 1;
|
s->src_set = st->src[2] > 0;
|
||||||
send_toplevel_configure(s);
|
memcpy(s->src, st->src, sizeof(s->src));
|
||||||
}
|
}
|
||||||
|
if (st->dst_set) {
|
||||||
|
s->dst_set = st->dst[0] > 0;
|
||||||
|
memcpy(s->dst, st->dst, sizeof(s->dst));
|
||||||
|
}
|
||||||
|
if (st->opaque_set) memcpy(s->opaque, st->opaque, sizeof(s->opaque));
|
||||||
|
|
||||||
if (s->pending_src_set) {
|
s->damage_buf = st->damage_buf;
|
||||||
s->src_set = s->pending_src[2] > 0;
|
s->damage_local = st->damage_local;
|
||||||
memcpy(s->src, s->pending_src, sizeof(s->src));
|
if (st->attach) {
|
||||||
s->pending_src_set = 0;
|
struct wl_resource *buffer = st->buffer;
|
||||||
}
|
|
||||||
if (s->pending_dst_set) {
|
|
||||||
s->dst_set = s->pending_dst[0] > 0;
|
|
||||||
memcpy(s->dst, s->pending_dst, sizeof(s->dst));
|
|
||||||
s->pending_dst_set = 0;
|
|
||||||
}
|
|
||||||
if (s->pending_opaque_set) {
|
|
||||||
memcpy(s->opaque, s->pending_opaque, sizeof(s->opaque));
|
|
||||||
s->pending_opaque_set = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
s->damage_buf = s->pending_damage_buf;
|
|
||||||
s->damage_local = s->pending_damage_local;
|
|
||||||
s->pending_damage_buf.n = s->pending_damage_local.n = 0;
|
|
||||||
if (s->pending_attach) {
|
|
||||||
struct wl_resource *buffer = s->pending_buffer;
|
|
||||||
struct dmabuf_buffer *db = get_dmabuf(buffer);
|
struct dmabuf_buffer *db = get_dmabuf(buffer);
|
||||||
struct wl_shm_buffer *shm = buffer && !db ? wl_shm_buffer_get(buffer) : NULL;
|
struct wl_shm_buffer *shm = buffer && !db ? wl_shm_buffer_get(buffer) : NULL;
|
||||||
uint8_t pixel[4];
|
uint8_t pixel[4];
|
||||||
@@ -1400,12 +1443,10 @@ static void surface_commit(struct wl_client *c, struct wl_resource *r) {
|
|||||||
if (!buffer) g_pace.null_attaches++;
|
if (!buffer) g_pace.null_attaches++;
|
||||||
else if (!db) s->last_dmabuf = NULL;
|
else if (!db) s->last_dmabuf = NULL;
|
||||||
|
|
||||||
if (buffer) {
|
wl_list_remove(&st->buffer_destroy.link);
|
||||||
wl_list_remove(&s->pending_buffer_destroy.link);
|
wl_list_init(&st->buffer_destroy.link);
|
||||||
wl_list_init(&s->pending_buffer_destroy.link);
|
st->buffer = NULL;
|
||||||
}
|
st->attach = 0;
|
||||||
s->pending_buffer = NULL;
|
|
||||||
s->pending_attach = 0;
|
|
||||||
|
|
||||||
surface_drop_idle(s);
|
surface_drop_idle(s);
|
||||||
buf_trace_attach(buffer);
|
buf_trace_attach(buffer);
|
||||||
@@ -1442,10 +1483,10 @@ static void surface_commit(struct wl_client *c, struct wl_resource *r) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wl_list_insert_list(s->frames.prev, &s->pending_frames);
|
wl_list_insert_list(s->frames.prev, &st->frames);
|
||||||
wl_list_init(&s->pending_frames);
|
wl_list_init(&st->frames);
|
||||||
wl_list_insert_list(s->feedback.prev, &s->pending_feedback);
|
wl_list_insert_list(s->feedback.prev, &st->feedback);
|
||||||
wl_list_init(&s->pending_feedback);
|
wl_list_init(&st->feedback);
|
||||||
constraints_surface_commit(s);
|
constraints_surface_commit(s);
|
||||||
droiddeck_color_commit(s->resource);
|
droiddeck_color_commit(s->resource);
|
||||||
|
|
||||||
@@ -1455,6 +1496,186 @@ static void surface_commit(struct wl_client *c, struct wl_resource *r) {
|
|||||||
}
|
}
|
||||||
schedule_render();
|
schedule_render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define COMMIT_WAIT_LIMIT_MS 1000
|
||||||
|
|
||||||
|
static struct surface *g_zero_copy_shown, *g_unwaited;
|
||||||
|
|
||||||
|
static int state_unfinished_fd(const struct surface *s, const struct surface_state *st, int *unwaited) {
|
||||||
|
struct dmabuf_buffer *db = st->attach ? get_dmabuf(st->buffer) : NULL;
|
||||||
|
int fd = -1;
|
||||||
|
*unwaited = 0;
|
||||||
|
for (int i = 0; db && fd < 0 && i < db->n_planes; i++) {
|
||||||
|
if (db->fd[i] < 0) continue;
|
||||||
|
struct pollfd p = {.fd = db->fd[i], .events = POLLIN};
|
||||||
|
int r;
|
||||||
|
do { r = poll(&p, 1, 0); } while (r < 0 && errno == EINTR);
|
||||||
|
if (r == 0) fd = db->fd[i];
|
||||||
|
}
|
||||||
|
if (fd >= 0 && s == g_zero_copy_shown && ahb_swapchain_has_ahb(db)) {
|
||||||
|
*unwaited = 1;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void settle_unwaited(void) {
|
||||||
|
struct surface *s = g_unwaited;
|
||||||
|
if (!s) return;
|
||||||
|
g_unwaited = NULL;
|
||||||
|
struct dmabuf_buffer *db = s->dmabuf_buf;
|
||||||
|
const int64_t deadline = now_ns() + 100000000LL;
|
||||||
|
for (int i = 0; db && i < db->n_planes; i++) {
|
||||||
|
if (db->fd[i] < 0) continue;
|
||||||
|
struct pollfd p = {.fd = db->fd[i], .events = POLLIN};
|
||||||
|
for (;;) {
|
||||||
|
const int64_t left = deadline - now_ns();
|
||||||
|
const int r = poll(&p, 1, left > 0 ? (int)((left + 999999) / 1000000) : 0);
|
||||||
|
if (r >= 0 || errno != EINTR || left <= 0) break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void surface_state_discard(struct surface_state *st) {
|
||||||
|
struct wl_resource *cb, *tmp;
|
||||||
|
wl_list_remove(&st->buffer_destroy.link);
|
||||||
|
wl_resource_for_each_safe(cb, tmp, &st->frames) wl_resource_destroy(cb);
|
||||||
|
feedback_discard_all(&st->feedback);
|
||||||
|
free(st);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void surface_state_merge(struct surface_state *older, struct surface_state *newer) {
|
||||||
|
if (older->attach && !newer->attach) {
|
||||||
|
newer->attach = 1;
|
||||||
|
newer->buffer = older->buffer;
|
||||||
|
wl_list_remove(&older->buffer_destroy.link);
|
||||||
|
wl_list_init(&older->buffer_destroy.link);
|
||||||
|
if (newer->buffer) {
|
||||||
|
newer->buffer_destroy.notify = on_state_buffer_destroyed;
|
||||||
|
wl_resource_add_destroy_listener(newer->buffer, &newer->buffer_destroy);
|
||||||
|
}
|
||||||
|
wl_list_insert_list(&newer->feedback, &older->feedback);
|
||||||
|
wl_list_init(&older->feedback);
|
||||||
|
} else if (older->attach) {
|
||||||
|
if (older->buffer && older->buffer != newer->buffer) send_buffer_release(older->buffer);
|
||||||
|
g_pace.replaced += feedback_discard_all(&older->feedback);
|
||||||
|
}
|
||||||
|
if (older->src_set && !newer->src_set) {
|
||||||
|
newer->src_set = 1;
|
||||||
|
memcpy(newer->src, older->src, sizeof(newer->src));
|
||||||
|
}
|
||||||
|
if (older->dst_set && !newer->dst_set) {
|
||||||
|
newer->dst_set = 1;
|
||||||
|
memcpy(newer->dst, older->dst, sizeof(newer->dst));
|
||||||
|
}
|
||||||
|
if (older->opaque_set && !newer->opaque_set) {
|
||||||
|
newer->opaque_set = 1;
|
||||||
|
memcpy(newer->opaque, older->opaque, sizeof(newer->opaque));
|
||||||
|
}
|
||||||
|
for (int i = 0; i < older->damage_buf.n; i++)
|
||||||
|
note_damage(&newer->damage_buf, older->damage_buf.r[i][0], older->damage_buf.r[i][1],
|
||||||
|
older->damage_buf.r[i][2], older->damage_buf.r[i][3]);
|
||||||
|
for (int i = 0; i < older->damage_local.n; i++)
|
||||||
|
note_damage(&newer->damage_local, older->damage_local.r[i][0], older->damage_local.r[i][1],
|
||||||
|
older->damage_local.r[i][2], older->damage_local.r[i][3]);
|
||||||
|
wl_list_insert_list(&newer->frames, &older->frames);
|
||||||
|
wl_list_init(&older->frames);
|
||||||
|
surface_state_discard(older);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void surface_wait_stop(struct surface *s) {
|
||||||
|
if (s->waiting_source) wl_event_source_remove(s->waiting_source);
|
||||||
|
if (s->waiting_timer) wl_event_source_remove(s->waiting_timer);
|
||||||
|
if (s->waiting_fd >= 0) close(s->waiting_fd);
|
||||||
|
s->waiting_source = s->waiting_timer = NULL;
|
||||||
|
s->waiting_fd = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void surface_wait_end(struct surface *s, int over_limit) {
|
||||||
|
struct surface_state *st = s->waiting;
|
||||||
|
if (!st) return;
|
||||||
|
surface_wait_stop(s);
|
||||||
|
s->waiting = NULL;
|
||||||
|
const int64_t waited = now_ns() - s->waiting_since_ns;
|
||||||
|
g_perf.commit_waits++;
|
||||||
|
g_perf.commit_wait_ns += waited;
|
||||||
|
if (waited > g_perf.commit_wait_max_ns) g_perf.commit_wait_max_ns = waited;
|
||||||
|
if (over_limit) g_perf.commit_wait_limits++;
|
||||||
|
if (st->attach && g_unwaited == s) g_unwaited = NULL;
|
||||||
|
surface_state_apply(s, st);
|
||||||
|
free(st);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int on_commit_ready(int fd, uint32_t mask, void *data) {
|
||||||
|
surface_wait_end(data, 0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int on_commit_wait_limit(void *data) {
|
||||||
|
static int said;
|
||||||
|
if (!said) {
|
||||||
|
said = 1;
|
||||||
|
droiddeck_log("compositor", "a client's GPU writes ran past %d ms; its frame is shown as it is", COMMIT_WAIT_LIMIT_MS);
|
||||||
|
}
|
||||||
|
surface_wait_end(data, 1);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int surface_wait_start(struct surface *s, int fd, int timeout_ms) {
|
||||||
|
struct wl_event_loop *loop = wl_display_get_event_loop(g_display);
|
||||||
|
s->waiting_fd = fcntl(fd, F_DUPFD_CLOEXEC, 0);
|
||||||
|
if (s->waiting_fd >= 0) {
|
||||||
|
s->waiting_source = wl_event_loop_add_fd(loop, s->waiting_fd, WL_EVENT_READABLE, on_commit_ready, s);
|
||||||
|
s->waiting_timer = wl_event_loop_add_timer(loop, on_commit_wait_limit, s);
|
||||||
|
}
|
||||||
|
if (!s->waiting_source || !s->waiting_timer ||
|
||||||
|
wl_event_source_timer_update(s->waiting_timer, timeout_ms) != 0) {
|
||||||
|
surface_wait_stop(s);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void surface_commit(struct wl_client *c, struct wl_resource *r) {
|
||||||
|
struct surface *s = wl_resource_get_user_data(r);
|
||||||
|
|
||||||
|
if (s->xdg_toplevel && !s->toplevel_committed) {
|
||||||
|
s->toplevel_committed = 1;
|
||||||
|
send_toplevel_configure(s);
|
||||||
|
}
|
||||||
|
struct surface_state *st = calloc(1, sizeof(*st));
|
||||||
|
if (!st) {
|
||||||
|
struct surface_state now;
|
||||||
|
surface_state_take(s, &now);
|
||||||
|
surface_state_apply(s, &now);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
surface_state_take(s, st);
|
||||||
|
const int was_waiting = s->waiting != NULL;
|
||||||
|
if (was_waiting) {
|
||||||
|
surface_wait_stop(s);
|
||||||
|
surface_state_merge(s->waiting, st);
|
||||||
|
s->waiting = NULL;
|
||||||
|
}
|
||||||
|
int unwaited;
|
||||||
|
const int fd = state_unfinished_fd(s, st, &unwaited);
|
||||||
|
if (!was_waiting) s->waiting_since_ns = now_ns();
|
||||||
|
const int64_t left_ms = COMMIT_WAIT_LIMIT_MS - (now_ns() - s->waiting_since_ns) / 1000000;
|
||||||
|
if (fd >= 0 && left_ms > 0 && surface_wait_start(s, fd, (int)left_ms) == 0) {
|
||||||
|
s->waiting = st;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const int attaches = st->attach;
|
||||||
|
if (was_waiting) {
|
||||||
|
s->waiting = st;
|
||||||
|
surface_wait_end(s, fd >= 0 && left_ms <= 0);
|
||||||
|
} else {
|
||||||
|
surface_state_apply(s, st);
|
||||||
|
free(st);
|
||||||
|
}
|
||||||
|
if (unwaited) g_unwaited = s;
|
||||||
|
else if (attaches && g_unwaited == s) g_unwaited = NULL;
|
||||||
|
}
|
||||||
static void surface_set_buffer_transform(struct wl_client *c, struct wl_resource *r, int32_t t) {}
|
static void surface_set_buffer_transform(struct wl_client *c, struct wl_resource *r, int32_t t) {}
|
||||||
static void surface_set_buffer_scale(struct wl_client *c, struct wl_resource *r, int32_t s) {}
|
static void surface_set_buffer_scale(struct wl_client *c, struct wl_resource *r, int32_t s) {}
|
||||||
static void surface_damage_buffer(struct wl_client *c, struct wl_resource *r,
|
static void surface_damage_buffer(struct wl_client *c, struct wl_resource *r,
|
||||||
@@ -1516,6 +1737,13 @@ static void surface_resource_destroy(struct wl_resource *r) {
|
|||||||
child->parent = NULL;
|
child->parent = NULL;
|
||||||
}
|
}
|
||||||
if (s->pending_buffer) wl_list_remove(&s->pending_buffer_destroy.link);
|
if (s->pending_buffer) wl_list_remove(&s->pending_buffer_destroy.link);
|
||||||
|
if (s->waiting) {
|
||||||
|
surface_wait_stop(s);
|
||||||
|
surface_state_discard(s->waiting);
|
||||||
|
s->waiting = NULL;
|
||||||
|
}
|
||||||
|
if (g_zero_copy_shown == s) g_zero_copy_shown = NULL;
|
||||||
|
if (g_unwaited == s) g_unwaited = NULL;
|
||||||
pending_releases_forget_surface(s);
|
pending_releases_forget_surface(s);
|
||||||
drop_dmabuf(s, 0);
|
drop_dmabuf(s, 0);
|
||||||
ahb_swapchain_surface_gone(s);
|
ahb_swapchain_surface_gone(s);
|
||||||
@@ -1579,6 +1807,7 @@ static void compositor_create_surface(struct wl_client *c, struct wl_resource *r
|
|||||||
wl_list_init(&s->child_link);
|
wl_list_init(&s->child_link);
|
||||||
wl_list_init(&s->toplevel_link);
|
wl_list_init(&s->toplevel_link);
|
||||||
wl_list_init(&s->pending_buffer_destroy.link);
|
wl_list_init(&s->pending_buffer_destroy.link);
|
||||||
|
s->waiting_fd = -1;
|
||||||
wl_list_init(&s->idle_buffer_destroy.link);
|
wl_list_init(&s->idle_buffer_destroy.link);
|
||||||
wl_list_insert(&g_surfaces, &s->link);
|
wl_list_insert(&g_surfaces, &s->link);
|
||||||
wl_resource_set_implementation(s->resource, &surface_impl, s, surface_resource_destroy);
|
wl_resource_set_implementation(s->resource, &surface_impl, s, surface_resource_destroy);
|
||||||
@@ -2502,7 +2731,13 @@ static int64_t scene_next_due(int64_t now, int64_t due, int limit) {
|
|||||||
|
|
||||||
static void render_scene(void) {
|
static void render_scene(void) {
|
||||||
g_scene_due_ns = scene_next_due(now_ns(), g_scene_due_ns, g_fps_limit);
|
g_scene_due_ns = scene_next_due(now_ns(), g_scene_due_ns, g_fps_limit);
|
||||||
if (atomic_load(&g_stream_on)) { g_dirty_since_ns = 0; render_stream(); return; }
|
if (atomic_load(&g_stream_on)) {
|
||||||
|
g_dirty_since_ns = 0;
|
||||||
|
g_zero_copy_shown = NULL;
|
||||||
|
settle_unwaited();
|
||||||
|
render_stream();
|
||||||
|
return;
|
||||||
|
}
|
||||||
struct draw_list dl = {0};
|
struct draw_list dl = {0};
|
||||||
struct surface *s;
|
struct surface *s;
|
||||||
int w, h;
|
int w, h;
|
||||||
@@ -2576,6 +2811,8 @@ static void render_scene(void) {
|
|||||||
} else {
|
} else {
|
||||||
cursor_hdr_said = 0;
|
cursor_hdr_said = 0;
|
||||||
}
|
}
|
||||||
|
g_zero_copy_shown = NULL;
|
||||||
|
if (hdr_route == 1 || hdr_route == 2) settle_unwaited();
|
||||||
if (hdr_route == 1) {
|
if (hdr_route == 1) {
|
||||||
static int fell_back;
|
static int fell_back;
|
||||||
vkp_apply_window_request();
|
vkp_apply_window_request();
|
||||||
@@ -2609,6 +2846,7 @@ static void render_scene(void) {
|
|||||||
}
|
}
|
||||||
if (hdr_route == 0 && vkp_quest_layer_presentation() && !framegen && !cardboard && !cursor_on &&
|
if (hdr_route == 0 && vkp_quest_layer_presentation() && !framegen && !cardboard && !cursor_on &&
|
||||||
!ahb_only) {
|
!ahb_only) {
|
||||||
|
settle_unwaited();
|
||||||
rendered = vkp_render(w, h, dl.d, dl.n) == 0;
|
rendered = vkp_render(w, h, dl.d, dl.n) == 0;
|
||||||
} else if (hdr_route == 0 || hdr_route == 3) {
|
} else if (hdr_route == 0 || hdr_route == 3) {
|
||||||
const int pass_on = fx_on || framegen;
|
const int pass_on = fx_on || framegen;
|
||||||
@@ -2658,6 +2896,7 @@ static void render_scene(void) {
|
|||||||
vkp_apply_window_request();
|
vkp_apply_window_request();
|
||||||
int r = -1;
|
int r = -1;
|
||||||
const int fg_pass = framegen && fx_on && li >= 0;
|
const int fg_pass = framegen && fx_on && li >= 0;
|
||||||
|
if (framegen && li >= 0) settle_unwaited();
|
||||||
const int generated = (framegen && li >= 0)
|
const int generated = (framegen && li >= 0)
|
||||||
? sc_layer_present_generated(&dl.d[li], 1, NULL, w, h, fg_pass,
|
? sc_layer_present_generated(&dl.d[li], 1, NULL, w, h, fg_pass,
|
||||||
ls ? droiddeck_surface_color(ls) : NULL) : 0;
|
ls ? droiddeck_surface_color(ls) : NULL) : 0;
|
||||||
@@ -2671,6 +2910,8 @@ static void render_scene(void) {
|
|||||||
r = generated >= 0 ? 0 : -1;
|
r = generated >= 0 ? 0 : -1;
|
||||||
else if (generated >= 0 && !(fx_on && li >= 0) && ls && ls->dmabuf_buf && ahb_swapchain_has_ahb(ls->dmabuf_buf))
|
else if (generated >= 0 && !(fx_on && li >= 0) && ls && ls->dmabuf_buf && ahb_swapchain_has_ahb(ls->dmabuf_buf))
|
||||||
r = ahb_swapchain_present(ls->dmabuf_buf, ls, w, h, ld);
|
r = ahb_swapchain_present(ls->dmabuf_buf, ls, w, h, ld);
|
||||||
|
if (r == 0 && !fg_pass) g_zero_copy_shown = ls;
|
||||||
|
else settle_unwaited();
|
||||||
if (!fg_pass && generated >= 0 && r != 0 && li >= 0)
|
if (!fg_pass && generated >= 0 && r != 0 && li >= 0)
|
||||||
r = fx_on ? sc_layer_present_pass(&dl.d[li], 1, w, h)
|
r = fx_on ? sc_layer_present_pass(&dl.d[li], 1, w, h)
|
||||||
: sc_layer_present(dl.d[li].img, w, h, ld, ls ? droiddeck_surface_color(ls) : NULL);
|
: sc_layer_present(dl.d[li].img, w, h, ld, ls ? droiddeck_surface_color(ls) : NULL);
|
||||||
@@ -2681,6 +2922,7 @@ static void render_scene(void) {
|
|||||||
ov = sc_layer_present_overlay(dl.d[li + 1].img, go, dl.d[li + 1].blend) == 0 ? 1 : -1;
|
ov = sc_layer_present_overlay(dl.d[li + 1].img, go, dl.d[li + 1].blend) == 0 ? 1 : -1;
|
||||||
if (ov <= 0) sc_layer_hide_overlay();
|
if (ov <= 0) sc_layer_hide_overlay();
|
||||||
if (ov < 0) {
|
if (ov < 0) {
|
||||||
|
settle_unwaited();
|
||||||
sc_layer_hide();
|
sc_layer_hide();
|
||||||
rendered = vkp_render(w, h, dl.d, dl.n) == 0;
|
rendered = vkp_render(w, h, dl.d, dl.n) == 0;
|
||||||
copy = 1;
|
copy = 1;
|
||||||
@@ -2690,12 +2932,14 @@ static void render_scene(void) {
|
|||||||
g_scene_queues = sc_layer_queues();
|
g_scene_queues = sc_layer_queues();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
settle_unwaited();
|
||||||
sc_layer_hide();
|
sc_layer_hide();
|
||||||
rendered = vkp_render(w, h, dl.d, dl.n) == 0;
|
rendered = vkp_render(w, h, dl.d, dl.n) == 0;
|
||||||
copy = 1;
|
copy = 1;
|
||||||
hdr_copy = "its display layer was unavailable this frame";
|
hdr_copy = "its display layer was unavailable this frame";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
settle_unwaited();
|
||||||
sc_layer_hide();
|
sc_layer_hide();
|
||||||
rendered = vkp_render(w, h, dl.d, dl.n) == 0;
|
rendered = vkp_render(w, h, dl.d, dl.n) == 0;
|
||||||
copy = 1;
|
copy = 1;
|
||||||
@@ -4344,11 +4588,12 @@ static int on_stats_timer(void *data) {
|
|||||||
unsigned aimed_next, aimed_later, aimed_even;
|
unsigned aimed_next, aimed_later, aimed_even;
|
||||||
sc_layer_aim_take(&aimed_next, &aimed_later, &aimed_even);
|
sc_layer_aim_take(&aimed_next, &aimed_later, &aimed_even);
|
||||||
#define PERF_MS(sum, n) ((n) ? (double)(sum) / 1e6 / (double)(n) : 0.0)
|
#define PERF_MS(sum, n) ((n) ? (double)(sum) / 1e6 / (double)(n) : 0.0)
|
||||||
if (g_perf.scenes || vp.presents || g_perf.releases || drops)
|
if (g_perf.scenes || vp.presents || g_perf.releases || drops || g_perf.commit_waits)
|
||||||
droiddeck_log("perf", "last 10 s: %u ticks, %u scenes, %u on screen (copy %u, zero-copy %u, layer copy %u) | "
|
droiddeck_log("perf", "last 10 s: %u ticks, %u scenes, %u on screen (copy %u, zero-copy %u, layer copy %u) | "
|
||||||
"render_scene %.2f/%.2f ms | base %u black kept, %u presented | acquire %.2f/%.2f ms | "
|
"render_scene %.2f/%.2f ms | base %u black kept, %u presented | acquire %.2f/%.2f ms | "
|
||||||
"present %.2f/%.2f ms (%u) | fence wait %.2f/%.2f ms (%u, %u GPU release waits) | "
|
"present %.2f/%.2f ms (%u) | fence wait %.2f/%.2f ms (%u, %u GPU release waits) | "
|
||||||
"release %.2f/%.2f ms (%u, %u held) | %u pool drops | layer frames timed for the next refresh %u, "
|
"release %.2f/%.2f ms (%u, %u held) | commits held for client writes %.2f/%.2f ms (%u, %u past the limit) | "
|
||||||
|
"%u pool drops | layer frames timed for the next refresh %u, "
|
||||||
"the one after %u, held to an even step %u",
|
"the one after %u, held to an even step %u",
|
||||||
g_perf.ticks, g_perf.scenes, g_stat_frames, g_perf.copy_scenes, zero_copy, layer_frames,
|
g_perf.ticks, g_perf.scenes, g_stat_frames, g_perf.copy_scenes, zero_copy, layer_frames,
|
||||||
PERF_MS(g_perf.scene_ns, g_perf.scenes), (double)g_perf.scene_max_ns / 1e6,
|
PERF_MS(g_perf.scene_ns, g_perf.scenes), (double)g_perf.scene_max_ns / 1e6,
|
||||||
@@ -4357,7 +4602,9 @@ static int on_stats_timer(void *data) {
|
|||||||
PERF_MS(vp.present_ns, vp.presents), (double)vp.present_max_ns / 1e6, vp.presents,
|
PERF_MS(vp.present_ns, vp.presents), (double)vp.present_max_ns / 1e6, vp.presents,
|
||||||
PERF_MS(vp.wait_ns, vp.waits), (double)vp.wait_max_ns / 1e6, vp.waits, vp.gpu_release_waits,
|
PERF_MS(vp.wait_ns, vp.waits), (double)vp.wait_max_ns / 1e6, vp.waits, vp.gpu_release_waits,
|
||||||
PERF_MS(g_perf.release_ns, g_perf.releases), (double)g_perf.release_max_ns / 1e6,
|
PERF_MS(g_perf.release_ns, g_perf.releases), (double)g_perf.release_max_ns / 1e6,
|
||||||
g_perf.releases, g_perf.releases_held, drops, aimed_next, aimed_later, aimed_even);
|
g_perf.releases, g_perf.releases_held,
|
||||||
|
PERF_MS(g_perf.commit_wait_ns, g_perf.commit_waits), (double)g_perf.commit_wait_max_ns / 1e6,
|
||||||
|
g_perf.commit_waits, g_perf.commit_wait_limits, drops, aimed_next, aimed_later, aimed_even);
|
||||||
#undef PERF_MS
|
#undef PERF_MS
|
||||||
memset(&g_perf, 0, sizeof(g_perf));
|
memset(&g_perf, 0, sizeof(g_perf));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "blend_pass.h"
|
#include "blend_pass.h"
|
||||||
#include "vk_loader.h"
|
#include "vk_loader.h"
|
||||||
#include "vk_present.h"
|
#include "vk_present.h"
|
||||||
|
#include "framegen_bridge.h"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -69,6 +70,7 @@ static struct fx_settings g_set = {
|
|||||||
.gamma = 1.0f, .saturation = 1.0f, .s_raw = 100.0f, .look = "Off"};
|
.gamma = 1.0f, .saturation = 1.0f, .s_raw = 100.0f, .look = "Off"};
|
||||||
static volatile int g_changed;
|
static volatile int g_changed;
|
||||||
static struct fx_settings g_cur;
|
static struct fx_settings g_cur;
|
||||||
|
static struct fx_settings g_generated_settings;
|
||||||
static int g_cur_valid;
|
static int g_cur_valid;
|
||||||
|
|
||||||
static void set_begin(void) { pthread_mutex_lock(&g_lock); }
|
static void set_begin(void) { pthread_mutex_lock(&g_lock); }
|
||||||
@@ -235,13 +237,24 @@ static VkDescriptorPool g_dpool;
|
|||||||
static VkSampler g_sampler;
|
static VkSampler g_sampler;
|
||||||
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_NIS_LUMA, 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_NIS_LUMA, P_COUNT };
|
||||||
static VkPipeline g_pipe[P_COUNT];
|
static VkPipeline g_pipe[P_COUNT];
|
||||||
static struct fx_target g_t[2], g_mid, g_smaa_edges, g_smaa_weights;
|
struct fx_context {
|
||||||
|
struct fx_target targets[2], mid, nissrc;
|
||||||
|
struct { VkImage img; VkImageView view; VkDescriptorSet ds; int w, h; } scene;
|
||||||
|
};
|
||||||
|
#define FX_CONTEXTS (VKP_FG_MAX_GENERATIONS + 2)
|
||||||
|
static struct fx_context g_contexts[FX_CONTEXTS];
|
||||||
|
static int g_context;
|
||||||
|
#define g_t (g_contexts[g_context].targets)
|
||||||
|
#define g_mid (g_contexts[g_context].mid)
|
||||||
|
#define g_nissrc (g_contexts[g_context].nissrc)
|
||||||
|
static struct fx_target g_smaa_edges, g_smaa_weights;
|
||||||
/* Half set: NIS = nis_luma prepass (scene rgb + luma in alpha, scene size) into g_nissrc, then
|
/* Half set: NIS = nis_luma prepass (scene rgb + luma in alpha, scene size) into g_nissrc, then
|
||||||
* nis3 gathers its luma from that alpha, its coefficient banks (nis_coef.h) in a uniform buffer
|
* nis3 gathers its luma from that alpha, its coefficient banks (nis_coef.h) in a uniform buffer
|
||||||
* at descriptor set 1 (g_pl_nis = {g_dsl, g_coef_dsl}, same push-constant range as g_pl).
|
* at descriptor set 1 (g_pl_nis = {g_dsl, g_coef_dsl}, same push-constant range as g_pl).
|
||||||
* Old set (or no buffer): nis.frag on the scene, P_NIS_LUMA unused. */
|
* Old set (or no buffer): nis.frag on the scene, P_NIS_LUMA unused. */
|
||||||
static struct fx_target g_nissrc;
|
|
||||||
static int g_nis_fast;
|
static int g_nis_fast;
|
||||||
|
static int g_nis_attempted;
|
||||||
|
static int g_upscale_half;
|
||||||
static VkDescriptorSetLayout g_coef_dsl;
|
static VkDescriptorSetLayout g_coef_dsl;
|
||||||
static VkPipelineLayout g_pl_nis;
|
static VkPipelineLayout g_pl_nis;
|
||||||
static VkDescriptorPool g_coef_pool;
|
static VkDescriptorPool g_coef_pool;
|
||||||
@@ -249,7 +262,7 @@ static VkDescriptorSet g_coef_ds;
|
|||||||
static VkBuffer g_coef_buf;
|
static VkBuffer g_coef_buf;
|
||||||
static VkDeviceMemory g_coef_mem;
|
static VkDeviceMemory g_coef_mem;
|
||||||
|
|
||||||
static struct { VkImage img; VkImageView view; VkDescriptorSet ds; int w, h; } g_scene;
|
#define g_scene (g_contexts[g_context].scene)
|
||||||
|
|
||||||
void vkp_effects_bind_device(VkDevice dev, VkPhysicalDevice pd,
|
void vkp_effects_bind_device(VkDevice dev, VkPhysicalDevice pd,
|
||||||
const VkPhysicalDeviceMemoryProperties *memprops) {
|
const VkPhysicalDeviceMemoryProperties *memprops) {
|
||||||
@@ -347,7 +360,15 @@ static void scene_release(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void vkp_effects_forget_image(VkImage img) {
|
void vkp_effects_forget_image(VkImage img) {
|
||||||
if (img && g_scene.img == img) scene_release();
|
int saved = g_context;
|
||||||
|
for (g_context = 0; g_context < FX_CONTEXTS; g_context++)
|
||||||
|
if (img && g_scene.img == img) scene_release();
|
||||||
|
g_context = saved;
|
||||||
|
}
|
||||||
|
|
||||||
|
void vkp_effects_release_generated_sources(void) {
|
||||||
|
for (g_context = 1; g_context < FX_CONTEXTS; g_context++) scene_release();
|
||||||
|
g_context = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int scene_ensure(VkImage img, int w, int h) {
|
static int scene_ensure(VkImage img, int w, int h) {
|
||||||
@@ -473,9 +494,14 @@ static int upscale_half_set(void) {
|
|||||||
|
|
||||||
static void objects_destroy(void) {
|
static void objects_destroy(void) {
|
||||||
if (!g_dev) return;
|
if (!g_dev) return;
|
||||||
scene_release();
|
int saved = g_context;
|
||||||
target_destroy(&g_t[0]); target_destroy(&g_t[1]); target_destroy(&g_mid);
|
for (g_context = 0; g_context < FX_CONTEXTS; g_context++) {
|
||||||
target_destroy(&g_smaa_edges); target_destroy(&g_smaa_weights); target_destroy(&g_nissrc);
|
scene_release();
|
||||||
|
target_destroy(&g_t[0]); target_destroy(&g_t[1]); target_destroy(&g_mid);
|
||||||
|
target_destroy(&g_nissrc);
|
||||||
|
}
|
||||||
|
g_context = saved;
|
||||||
|
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; }
|
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_dpool) g_vk.DestroyDescriptorPool(g_dev, g_dpool, NULL);
|
||||||
if (g_pl) g_vk.DestroyPipelineLayout(g_dev, g_pl, NULL);
|
if (g_pl) g_vk.DestroyPipelineLayout(g_dev, g_pl, NULL);
|
||||||
@@ -486,6 +512,7 @@ static void objects_destroy(void) {
|
|||||||
if (g_rp) g_vk.DestroyRenderPass(g_dev, g_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_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_sampler = VK_NULL_HANDLE; g_rp = VK_NULL_HANDLE; g_smaa_rp = VK_NULL_HANDLE;
|
||||||
|
g_nis_fast = 0; g_nis_attempted = 0; g_upscale_half = 0;
|
||||||
g_ready = 0;
|
g_ready = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -505,7 +532,9 @@ void vkp_effects_set_formats(VkFormat scene_fmt, VkFormat target_fmt, int scene_
|
|||||||
: target_fmt == VK_FORMAT_R16G16B16A16_SFLOAT ? "the HDR picture for frame generation"
|
: target_fmt == VK_FORMAT_R16G16B16A16_SFLOAT ? "the HDR picture for frame generation"
|
||||||
: "the HDR composition's picture: PQ, or tone-mapped SDR with HDR output off");
|
: "the HDR composition's picture: PQ, or tone-mapped SDR with HDR output off");
|
||||||
} else if (scene_fmt != g_scene_fmt) {
|
} else if (scene_fmt != g_scene_fmt) {
|
||||||
scene_release();
|
int saved = g_context;
|
||||||
|
for (g_context = 0; g_context < FX_CONTEXTS; g_context++) scene_release();
|
||||||
|
g_context = saved;
|
||||||
g_scene_fmt = scene_fmt;
|
g_scene_fmt = scene_fmt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -556,75 +585,17 @@ static int objects_ensure(void) {
|
|||||||
VkPipelineLayoutCreateInfo pli = {.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, .setLayoutCount = 2, .pSetLayouts = set_layouts,
|
VkPipelineLayoutCreateInfo pli = {.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, .setLayoutCount = 2, .pSetLayouts = set_layouts,
|
||||||
.pushConstantRangeCount = 1, .pPushConstantRanges = &pcr};
|
.pushConstantRangeCount = 1, .pPushConstantRanges = &pcr};
|
||||||
if (g_vk.CreatePipelineLayout(g_dev, &pli, NULL, &g_pl) != VK_SUCCESS) goto fail;
|
if (g_vk.CreatePipelineLayout(g_dev, &pli, NULL, &g_pl) != VK_SUCCESS) goto fail;
|
||||||
VkDescriptorPoolSize ps = {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 10};
|
VkDescriptorPoolSize ps = {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, FX_CONTEXTS * 5 + 2};
|
||||||
VkDescriptorPoolCreateInfo dpi = {.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
|
VkDescriptorPoolCreateInfo dpi = {.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
|
||||||
.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, .maxSets = 10,
|
.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, .maxSets = FX_CONTEXTS * 5 + 2,
|
||||||
.poolSizeCount = 1, .pPoolSizes = &ps};
|
.poolSizeCount = 1, .pPoolSizes = &ps};
|
||||||
if (g_vk.CreateDescriptorPool(g_dev, &dpi, NULL, &g_dpool) != VK_SUCCESS) goto fail;
|
if (g_vk.CreateDescriptorPool(g_dev, &dpi, NULL, &g_dpool) != VK_SUCCESS) goto fail;
|
||||||
|
|
||||||
VkShaderModule vert = shader(upscale_vert_code, sizeof(upscale_vert_code));
|
g_upscale_half = upscale_half_set();
|
||||||
if (!vert) goto fail;
|
|
||||||
#define MKL(slot, code, name, layout) do { g_pipe[slot] = post_pipeline_for_renderpass(vert, code, sizeof(code), g_rp, name, layout); if (!g_pipe[slot]) { g_vk.DestroyShaderModule(g_dev, vert, NULL); goto fail; } } while (0)
|
|
||||||
#define MK(slot, code, name) MKL(slot, code, name, g_pl)
|
|
||||||
const int half = upscale_half_set();
|
|
||||||
g_nis_fast = 0;
|
g_nis_fast = 0;
|
||||||
if (half && !fx_alpha_holds_luma(g_fx_fmt))
|
g_nis_attempted = 0;
|
||||||
droiddeck_log("effects", "NIS uses nis.frag: the chain format has no 8-bit alpha for the luma prepass");
|
|
||||||
else if (half && coef_create() != 0)
|
|
||||||
droiddeck_log("effects", "NIS coefficient buffer unavailable; NIS uses nis.frag");
|
|
||||||
else if (half)
|
|
||||||
g_nis_fast = 1;
|
|
||||||
if (half) {
|
|
||||||
MK(P_SGSR, sgsr_half_code, "sgsr_half");
|
|
||||||
MK(P_SGSR_HQ, sgsr_quality_half_code, "sgsr_quality_half");
|
|
||||||
if (g_nis_fast) {
|
|
||||||
/* optional: a driver that rejects either fast NIS pipeline gets nis.frag, not a dead chain */
|
|
||||||
g_pipe[P_NIS] = post_pipeline_for_renderpass(vert, nis3_half_code, sizeof(nis3_half_code), g_rp, "nis3_half", g_pl_nis);
|
|
||||||
g_pipe[P_NIS_LUMA] = g_pipe[P_NIS]
|
|
||||||
? post_pipeline_for_renderpass(vert, nis_luma_half_code, sizeof(nis_luma_half_code), g_rp, "nis_luma_half", g_pl)
|
|
||||||
: VK_NULL_HANDLE;
|
|
||||||
if (!g_pipe[P_NIS] || !g_pipe[P_NIS_LUMA]) {
|
|
||||||
if (g_pipe[P_NIS]) g_vk.DestroyPipeline(g_dev, g_pipe[P_NIS], NULL);
|
|
||||||
g_pipe[P_NIS] = VK_NULL_HANDLE;
|
|
||||||
coef_destroy();
|
|
||||||
g_nis_fast = 0;
|
|
||||||
droiddeck_log("effects", "fast NIS pipelines failed to build; NIS uses nis.frag");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!g_nis_fast) MK(P_NIS, nis_code, "nis");
|
|
||||||
MK(P_EASU, fsr_easu_half_code, "fsr_easu_half");
|
|
||||||
MK(P_RCAS, fsr_rcas_half_code, "fsr_rcas_half");
|
|
||||||
MK(P_CAS, cas_ffx_half_code, "cas_ffx_half");
|
|
||||||
} else {
|
|
||||||
MK(P_SGSR, sgsr_code, "sgsr");
|
|
||||||
MK(P_SGSR_HQ, sgsr_quality_code, "sgsr_quality");
|
|
||||||
MK(P_NIS, nis_code, "nis");
|
|
||||||
MK(P_EASU, fsr_easu_code, "fsr_easu");
|
|
||||||
MK(P_RCAS, fsr_rcas_code, "fsr_rcas");
|
|
||||||
MK(P_CAS, cas_code, "cas");
|
|
||||||
}
|
|
||||||
MK(P_COLOR, color_code, "color");
|
|
||||||
MK(P_FXAA, fxaa_code, "fxaa");
|
|
||||||
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", g_pl);
|
|
||||||
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", g_pl);
|
|
||||||
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");
|
|
||||||
MK(P_DEBAND, deband_code, "deband");
|
|
||||||
#undef MK
|
|
||||||
#undef MKL
|
|
||||||
g_vk.DestroyShaderModule(g_dev, vert, NULL);
|
|
||||||
g_ready = 1;
|
g_ready = 1;
|
||||||
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), %s upscalers%s, on %s",
|
droiddeck_log("effects", "shared resources ready on %s; effect pipelines are created when needed", vkp_gpu_name());
|
||||||
half ? "half-precision" : "old fp32", g_nis_fast ? " + NIS luma prepass" : "", vkp_gpu_name());
|
|
||||||
return 0;
|
return 0;
|
||||||
fail:
|
fail:
|
||||||
objects_destroy();
|
objects_destroy();
|
||||||
@@ -633,6 +604,95 @@ fail:
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int chain_failed(void) {
|
||||||
|
objects_destroy();
|
||||||
|
g_ready = -1;
|
||||||
|
droiddeck_log("error", "effects: the screen-effect chain could not be built on this driver; effects are off for this session");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int pipelines_ensure(int spatial, const struct fx_settings *s) {
|
||||||
|
VkShaderModule vert = VK_NULL_HANDLE;
|
||||||
|
#define MKL(needed, slot, code, name, render_pass, layout) do { \
|
||||||
|
if ((needed) && !g_pipe[slot]) { \
|
||||||
|
if (!vert && !(vert = shader(upscale_vert_code, sizeof(upscale_vert_code)))) goto fail; \
|
||||||
|
g_pipe[slot] = post_pipeline_for_renderpass(vert, code, sizeof(code), render_pass, name, layout); \
|
||||||
|
if (!g_pipe[slot]) goto fail; \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
#define MK(needed, slot, code, name) MKL(needed, slot, code, name, g_rp, g_pl)
|
||||||
|
if (spatial == 3) {
|
||||||
|
if (g_upscale_half) MK(1, P_SGSR, sgsr_half_code, "sgsr_half");
|
||||||
|
else MK(1, P_SGSR, sgsr_code, "sgsr");
|
||||||
|
}
|
||||||
|
if (spatial == 8) {
|
||||||
|
if (g_upscale_half) MK(1, P_SGSR_HQ, sgsr_quality_half_code, "sgsr_quality_half");
|
||||||
|
else MK(1, P_SGSR_HQ, sgsr_quality_code, "sgsr_quality");
|
||||||
|
}
|
||||||
|
if (spatial == 4 || spatial == 5) {
|
||||||
|
if (g_upscale_half) MK(1, P_EASU, fsr_easu_half_code, "fsr_easu_half");
|
||||||
|
else MK(1, P_EASU, fsr_easu_code, "fsr_easu");
|
||||||
|
if (s->sharp_pct != 0) {
|
||||||
|
if (g_upscale_half) MK(1, P_RCAS, fsr_rcas_half_code, "fsr_rcas_half");
|
||||||
|
else MK(1, P_RCAS, fsr_rcas_code, "fsr_rcas");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (spatial == 6) {
|
||||||
|
if (g_upscale_half) MK(1, P_RCAS, fsr_rcas_half_code, "fsr_rcas_half");
|
||||||
|
else MK(1, P_RCAS, fsr_rcas_code, "fsr_rcas");
|
||||||
|
}
|
||||||
|
if (spatial == 7) {
|
||||||
|
if (g_upscale_half && !g_nis_attempted) {
|
||||||
|
g_nis_attempted = 1;
|
||||||
|
if (!fx_alpha_holds_luma(g_fx_fmt))
|
||||||
|
droiddeck_log("effects", "NIS uses nis.frag: the chain format has no 8-bit alpha for the luma prepass");
|
||||||
|
else if (coef_create() != 0)
|
||||||
|
droiddeck_log("effects", "NIS coefficient buffer unavailable; NIS uses nis.frag");
|
||||||
|
else {
|
||||||
|
if (!vert && !(vert = shader(upscale_vert_code, sizeof(upscale_vert_code)))) goto fail;
|
||||||
|
g_pipe[P_NIS] = post_pipeline_for_renderpass(vert, nis3_half_code, sizeof(nis3_half_code), g_rp, "nis3_half", g_pl_nis);
|
||||||
|
if (g_pipe[P_NIS])
|
||||||
|
g_pipe[P_NIS_LUMA] = post_pipeline_for_renderpass(vert, nis_luma_half_code, sizeof(nis_luma_half_code), g_rp, "nis_luma_half", g_pl);
|
||||||
|
if (g_pipe[P_NIS] && g_pipe[P_NIS_LUMA]) g_nis_fast = 1;
|
||||||
|
else {
|
||||||
|
if (g_pipe[P_NIS]) g_vk.DestroyPipeline(g_dev, g_pipe[P_NIS], NULL);
|
||||||
|
if (g_pipe[P_NIS_LUMA]) g_vk.DestroyPipeline(g_dev, g_pipe[P_NIS_LUMA], NULL);
|
||||||
|
g_pipe[P_NIS] = VK_NULL_HANDLE;
|
||||||
|
g_pipe[P_NIS_LUMA] = VK_NULL_HANDLE;
|
||||||
|
coef_destroy();
|
||||||
|
droiddeck_log("effects", "fast NIS pipelines failed to build; NIS uses nis.frag");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!g_nis_fast) MK(1, P_NIS, nis_code, "nis");
|
||||||
|
else if (g_upscale_half) MK(1, P_SGSR, sgsr_half_code, "sgsr_half");
|
||||||
|
}
|
||||||
|
if (cas_active(s)) {
|
||||||
|
if (g_upscale_half) MK(1, P_CAS, cas_ffx_half_code, "cas_ffx_half");
|
||||||
|
else MK(1, P_CAS, cas_code, "cas");
|
||||||
|
}
|
||||||
|
if (s->color_on && !(s->toon && g_fx_fmt == FX_FORMAT)) MK(1, P_COLOR, color_code, "color");
|
||||||
|
if (s->aa_mode == 1 || s->aa_mode == 2) MK(1, P_FXAA, fxaa_code, "fxaa");
|
||||||
|
if (s->aa_mode == 2) {
|
||||||
|
MKL(1, P_SMAA_EDGE, smaa_edge_code, "smaa_edge", g_smaa_rp, g_pl);
|
||||||
|
MKL(1, P_SMAA_WEIGHTS, smaa_weights_code, "smaa_weights", g_smaa_rp, g_pl);
|
||||||
|
MK(1, P_SMAA_BLEND, smaa_blend_code, "smaa_blend");
|
||||||
|
}
|
||||||
|
if (s->toon && s->color_on && g_fx_fmt == FX_FORMAT) MK(1, P_TOON_COLOR, toon_color_code, "toon_color");
|
||||||
|
else if (s->toon) MK(1, P_TOON, toon_code, "toon");
|
||||||
|
if (s->hdr_on) MK(1, P_HDR, hdr_code, "hdr");
|
||||||
|
if (s->ntsc) MK(1, P_NTSC, ntsc_code, "ntsc");
|
||||||
|
if (s->crt) MK(1, P_CRT, crt_code, "crt");
|
||||||
|
if (deband_active(s)) MK(1, P_DEBAND, deband_code, "deband");
|
||||||
|
#undef MK
|
||||||
|
#undef MKL
|
||||||
|
if (vert) g_vk.DestroyShaderModule(g_dev, vert, NULL);
|
||||||
|
return 0;
|
||||||
|
fail:
|
||||||
|
if (vert) g_vk.DestroyShaderModule(g_dev, vert, NULL);
|
||||||
|
return chain_failed();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void barrier(VkCommandBuffer cmd, VkImage img, VkImageLayout from, VkImageLayout to,
|
static void barrier(VkCommandBuffer cmd, VkImage img, VkImageLayout from, VkImageLayout to,
|
||||||
VkPipelineStageFlags src_stage, VkAccessFlags src_access,
|
VkPipelineStageFlags src_stage, VkAccessFlags src_access,
|
||||||
@@ -681,14 +741,26 @@ static void pass_dual(VkCommandBuffer cmd, VkPipeline p, struct fx_target *dst,
|
|||||||
static const float FULL_NDC[4] = {-1.0f, -1.0f, 1.0f, 1.0f};
|
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))
|
#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,
|
struct fx_source_state {
|
||||||
int out_w, int out_h, int *res_w, int *res_h) {
|
VkImageLayout layout;
|
||||||
|
VkPipelineStageFlags stage;
|
||||||
|
VkAccessFlags access;
|
||||||
|
};
|
||||||
|
|
||||||
|
static VkImage effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int scene_h,
|
||||||
|
int out_w, int out_h, int *res_w, int *res_h,
|
||||||
|
VkImageLayout input_layout, const struct fx_settings *frozen,
|
||||||
|
struct fx_source_state *source_state) {
|
||||||
struct fx_settings snapshot;
|
struct fx_settings snapshot;
|
||||||
const struct fx_settings *s;
|
const struct fx_settings *s;
|
||||||
vkp_effects_sync();
|
if (frozen) {
|
||||||
pthread_mutex_lock(&g_lock);
|
snapshot = *frozen;
|
||||||
snapshot = g_cur;
|
} else {
|
||||||
pthread_mutex_unlock(&g_lock);
|
vkp_effects_sync();
|
||||||
|
pthread_mutex_lock(&g_lock);
|
||||||
|
snapshot = g_cur;
|
||||||
|
pthread_mutex_unlock(&g_lock);
|
||||||
|
}
|
||||||
s = &snapshot;
|
s = &snapshot;
|
||||||
*res_w = scene_w; *res_h = scene_h;
|
*res_w = scene_w; *res_h = scene_h;
|
||||||
|
|
||||||
@@ -723,7 +795,7 @@ VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int sce
|
|||||||
effect_count(s) - (fuse_toon_color ? 1 : 0) -
|
effect_count(s) - (fuse_toon_color ? 1 : 0) -
|
||||||
(fuse_fxaa_toon ? 1 : 0);
|
(fuse_fxaa_toon ? 1 : 0);
|
||||||
|
|
||||||
if ((spatial || nfx) && objects_ensure() == 0 && scene_ensure(scene, scene_w, scene_h) == 0 &&
|
if ((spatial || nfx) && objects_ensure() == 0 && pipelines_ensure(spatial, s) == 0 && scene_ensure(scene, scene_w, scene_h) == 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) &&
|
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 ||
|
(!(spatial == 4 || spatial == 5) || s->sharp_pct == 0 ||
|
||||||
target_ensure(&g_mid, cw, ch, FX_SCRATCH_USAGE, "EASU") == 0)) {
|
target_ensure(&g_mid, cw, ch, FX_SCRATCH_USAGE, "EASU") == 0)) {
|
||||||
@@ -748,8 +820,10 @@ VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int sce
|
|||||||
g_vk.CmdSetScissor(cmd, 0, 1, &chain_sc);
|
g_vk.CmdSetScissor(cmd, 0, 1, &chain_sc);
|
||||||
|
|
||||||
if (spatial) {
|
if (spatial) {
|
||||||
barrier(cmd, scene, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
|
if (source_state) *source_state = (struct fx_source_state){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};
|
||||||
|
barrier(cmd, scene, input_layout, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
|
||||||
|
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_ACCESS_MEMORY_WRITE_BIT,
|
||||||
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_SHADER_READ_BIT);
|
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_SHADER_READ_BIT);
|
||||||
struct fx_target *dst = FREE_TARGET();
|
struct fx_target *dst = FREE_TARGET();
|
||||||
if (spatial == 3 || spatial == 8 || spatial == 7) {
|
if (spatial == 3 || spatial == 8 || spatial == 7) {
|
||||||
@@ -809,8 +883,10 @@ VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int sce
|
|||||||
cur = dst; cur_ds = dst->ds;
|
cur = dst; cur_ds = dst->ds;
|
||||||
} else if (resize) {
|
} else if (resize) {
|
||||||
struct fx_target *dst = FREE_TARGET();
|
struct fx_target *dst = FREE_TARGET();
|
||||||
barrier(cmd, scene, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
|
if (source_state) *source_state = (struct fx_source_state){VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
|
||||||
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_WRITE_BIT,
|
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_READ_BIT};
|
||||||
|
barrier(cmd, scene, input_layout, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
|
||||||
|
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_ACCESS_MEMORY_WRITE_BIT,
|
||||||
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_READ_BIT);
|
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_READ_BIT);
|
||||||
barrier(cmd, dst->img, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
barrier(cmd, dst->img, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
||||||
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_WRITE_BIT);
|
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_WRITE_BIT);
|
||||||
@@ -823,8 +899,10 @@ VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int sce
|
|||||||
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_SHADER_READ_BIT);
|
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_SHADER_READ_BIT);
|
||||||
cur = dst; cur_ds = dst->ds;
|
cur = dst; cur_ds = dst->ds;
|
||||||
} else {
|
} else {
|
||||||
barrier(cmd, scene, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
|
if (source_state) *source_state = (struct fx_source_state){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};
|
||||||
|
barrier(cmd, scene, input_layout, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
|
||||||
|
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_ACCESS_MEMORY_WRITE_BIT,
|
||||||
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_SHADER_READ_BIT);
|
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_SHADER_READ_BIT);
|
||||||
cur = NULL; cur_ds = g_scene.ds;
|
cur = NULL; cur_ds = g_scene.ds;
|
||||||
}
|
}
|
||||||
@@ -907,8 +985,54 @@ VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int sce
|
|||||||
return scene;
|
return scene;
|
||||||
}
|
}
|
||||||
|
|
||||||
barrier(cmd, scene, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
|
if (source_state) *source_state = (struct fx_source_state){VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
|
||||||
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_WRITE_BIT,
|
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_READ_BIT};
|
||||||
|
barrier(cmd, scene, input_layout, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
|
||||||
|
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_ACCESS_MEMORY_WRITE_BIT,
|
||||||
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_READ_BIT);
|
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_READ_BIT);
|
||||||
return scene;
|
return scene;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
||||||
|
return effects_run(cmd, scene, scene_w, scene_h, out_w, out_h, res_w, res_h,
|
||||||
|
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
int vkp_effects_prepare_generated(void) {
|
||||||
|
vkp_effects_sync();
|
||||||
|
pthread_mutex_lock(&g_lock);
|
||||||
|
g_generated_settings = g_cur;
|
||||||
|
pthread_mutex_unlock(&g_lock);
|
||||||
|
return spatial_mode(g_generated_settings.scaling) && g_generated_settings.scaling != 6 &&
|
||||||
|
effect_count(&g_generated_settings) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
VkImage vkp_effects_run_before_generated(VkCommandBuffer cmd, VkImage scene, int w, int h,
|
||||||
|
int *res_w, int *res_h) {
|
||||||
|
struct fx_settings settings = g_generated_settings;
|
||||||
|
settings.scaling = 0;
|
||||||
|
return effects_run(cmd, scene, w, h, w, h, res_w, res_h,
|
||||||
|
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &settings, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
VkImage vkp_effects_run_generated(VkCommandBuffer cmd, VkImage scene, int scene_w, int scene_h,
|
||||||
|
int out_w, int out_h, int slot, int *res_w, int *res_h) {
|
||||||
|
if (slot < 0 || slot > VKP_FG_MAX_GENERATIONS) {
|
||||||
|
*res_w = scene_w; *res_h = scene_h;
|
||||||
|
return scene;
|
||||||
|
}
|
||||||
|
g_context = slot + 1;
|
||||||
|
struct fx_source_state source_state = {0};
|
||||||
|
VkImage result = effects_run(cmd, scene, scene_w, scene_h, out_w, out_h, res_w, res_h,
|
||||||
|
VK_IMAGE_LAYOUT_GENERAL, &g_generated_settings, &source_state);
|
||||||
|
barrier(cmd, result, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL,
|
||||||
|
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT,
|
||||||
|
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_TRANSFER_READ_BIT);
|
||||||
|
if (result != scene)
|
||||||
|
barrier(cmd, scene, source_state.layout, VK_IMAGE_LAYOUT_GENERAL,
|
||||||
|
source_state.stage, source_state.access,
|
||||||
|
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT);
|
||||||
|
g_context = 0;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
@@ -18,6 +18,12 @@ VkFilter vkp_effects_blit_filter(void);
|
|||||||
|
|
||||||
VkImage vkp_effects_run(VkCommandBuffer cmd, VkImage scene, int scene_w, int scene_h,
|
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);
|
int out_w, int out_h, int *res_w, int *res_h);
|
||||||
|
int vkp_effects_prepare_generated(void);
|
||||||
|
void vkp_effects_release_generated_sources(void);
|
||||||
|
VkImage vkp_effects_run_before_generated(VkCommandBuffer cmd, VkImage scene, int w, int h,
|
||||||
|
int *res_w, int *res_h);
|
||||||
|
VkImage vkp_effects_run_generated(VkCommandBuffer cmd, VkImage scene, int scene_w, int scene_h,
|
||||||
|
int out_w, int out_h, int slot, int *res_w, int *res_h);
|
||||||
|
|
||||||
void vkp_effects_destroy(void);
|
void vkp_effects_destroy(void);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#define _POSIX_C_SOURCE 200809L
|
#define _POSIX_C_SOURCE 200809L
|
||||||
#include "framegen_bridge.h"
|
#include "framegen_bridge.h"
|
||||||
#include "framegen_engine.h"
|
#include "framegen_engine.h"
|
||||||
|
#include "effects_chain.h"
|
||||||
#include "vk_loader.h"
|
#include "vk_loader.h"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <stdatomic.h>
|
#include <stdatomic.h>
|
||||||
@@ -226,7 +227,10 @@ static void destroy_ring(void) {
|
|||||||
if (vk.DeviceWaitIdle) vk.DeviceWaitIdle(g_dev);
|
if (vk.DeviceWaitIdle) vk.DeviceWaitIdle(g_dev);
|
||||||
for (uint32_t i = 0; i < g_ring_n; i++) {
|
for (uint32_t i = 0; i < g_ring_n; i++) {
|
||||||
if (g_ring[i].view) vk.DestroyImageView(g_dev, g_ring[i].view, NULL);
|
if (g_ring[i].view) vk.DestroyImageView(g_dev, g_ring[i].view, NULL);
|
||||||
if (g_ring[i].img) vk.DestroyImage(g_dev, g_ring[i].img, NULL);
|
if (g_ring[i].img) {
|
||||||
|
vkp_effects_forget_image(g_ring[i].img);
|
||||||
|
vk.DestroyImage(g_dev, g_ring[i].img, NULL);
|
||||||
|
}
|
||||||
if (g_ring[i].mem) vk.FreeMemory(g_dev, g_ring[i].mem, NULL);
|
if (g_ring[i].mem) vk.FreeMemory(g_dev, g_ring[i].mem, NULL);
|
||||||
memset(&g_ring[i], 0, sizeof(g_ring[i]));
|
memset(&g_ring[i], 0, sizeof(g_ring[i]));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ bool g_probed = false, g_ready = false;
|
|||||||
|
|
||||||
std::unique_ptr<lsfg::Engine> g_lsfg;
|
std::unique_ptr<lsfg::Engine> g_lsfg;
|
||||||
std::unique_ptr<ddfg::Engine> g_ddfg;
|
std::unique_ptr<ddfg::Engine> g_ddfg;
|
||||||
|
std::vector<std::unique_ptr<ddfg::Engine>> g_retained_ddfg;
|
||||||
int g_kind = -1;
|
int g_kind = -1;
|
||||||
char g_build[96] = "";
|
char g_build[96] = "";
|
||||||
|
|
||||||
@@ -128,7 +129,14 @@ void fge_device_ready(PFN_vkGetInstanceProcAddr gipa, VkInstance inst, VkPhysica
|
|||||||
|
|
||||||
void fge_device_lost(void) {
|
void fge_device_lost(void) {
|
||||||
g_lsfg.reset();
|
g_lsfg.reset();
|
||||||
g_ddfg.reset();
|
if (g_ddfg) {
|
||||||
|
if (g_ddfg->destroy()) g_ddfg.reset();
|
||||||
|
else g_retained_ddfg.push_back(std::move(g_ddfg));
|
||||||
|
}
|
||||||
|
// The device is being torn down. Unknown-completion resources must not be
|
||||||
|
// passed to Vulkan destruction calls; the VkDevice teardown reclaims them.
|
||||||
|
for (auto& engine : g_retained_ddfg) engine->abandon();
|
||||||
|
g_retained_ddfg.clear();
|
||||||
g_kind = -1;
|
g_kind = -1;
|
||||||
g_dev = VK_NULL_HANDLE;
|
g_dev = VK_NULL_HANDLE;
|
||||||
g_queue = VK_NULL_HANDLE;
|
g_queue = VK_NULL_HANDLE;
|
||||||
@@ -193,9 +201,21 @@ int fge_start(int kind, const char *cache_path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void fge_stop(void) {
|
void fge_stop(void) {
|
||||||
if ((g_lsfg || g_ddfg) && g_table.DeviceWaitIdle && g_dev) g_table.DeviceWaitIdle(g_dev);
|
if (g_lsfg) {
|
||||||
g_lsfg.reset();
|
if (g_table.DeviceWaitIdle && g_dev) g_table.DeviceWaitIdle(g_dev);
|
||||||
g_ddfg.reset();
|
g_lsfg.reset();
|
||||||
|
}
|
||||||
|
for (auto it = g_retained_ddfg.begin(); it != g_retained_ddfg.end();) {
|
||||||
|
if ((*it)->destroy()) it = g_retained_ddfg.erase(it);
|
||||||
|
else ++it;
|
||||||
|
}
|
||||||
|
if (g_ddfg) {
|
||||||
|
if (g_ddfg->destroy()) g_ddfg.reset();
|
||||||
|
else {
|
||||||
|
ELOGE("ddfg-native: retaining engine until GPU completion is known or device teardown");
|
||||||
|
g_retained_ddfg.push_back(std::move(g_ddfg));
|
||||||
|
}
|
||||||
|
}
|
||||||
g_kind = -1;
|
g_kind = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -148,6 +148,7 @@ struct slot {
|
|||||||
uint32_t fmt;
|
uint32_t fmt;
|
||||||
int release_fd;
|
int release_fd;
|
||||||
int busy;
|
int busy;
|
||||||
|
uint64_t generation;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct layer {
|
struct layer {
|
||||||
@@ -175,6 +176,7 @@ struct layer {
|
|||||||
int votes_rate;
|
int votes_rate;
|
||||||
float fps_applied;
|
float fps_applied;
|
||||||
int recreate_pending;
|
int recreate_pending;
|
||||||
|
int pending_callbacks;
|
||||||
|
|
||||||
int32_t ds_applied;
|
int32_t ds_applied;
|
||||||
|
|
||||||
@@ -222,6 +224,7 @@ struct complete_ctx {
|
|||||||
ASurfaceControl *sc;
|
ASurfaceControl *sc;
|
||||||
int layer;
|
int layer;
|
||||||
int prev_slot;
|
int prev_slot;
|
||||||
|
uint64_t prev_generation;
|
||||||
void *prev_token;
|
void *prev_token;
|
||||||
int retire;
|
int retire;
|
||||||
};
|
};
|
||||||
@@ -288,12 +291,16 @@ static void on_complete(void *context, ASurfaceTransactionStats *stats) {
|
|||||||
pthread_mutex_lock(&g_lock);
|
pthread_mutex_lock(&g_lock);
|
||||||
if (ctx->layer >= 0 && ctx->layer < SC_LAYER_COUNT && ctx->prev_slot >= 0 && ctx->prev_slot < POOL_MAX) {
|
if (ctx->layer >= 0 && ctx->layer < SC_LAYER_COUNT && ctx->prev_slot >= 0 && ctx->prev_slot < POOL_MAX) {
|
||||||
struct slot *s = &g_layers[ctx->layer].slots[ctx->prev_slot];
|
struct slot *s = &g_layers[ctx->layer].slots[ctx->prev_slot];
|
||||||
int fd = (stats && ctx->sc) ? api.prevReleaseFence(stats, ctx->sc) : -1;
|
if (s->generation == ctx->prev_generation) {
|
||||||
if (s->release_fd >= 0) close(s->release_fd);
|
int fd = (stats && ctx->sc) ? api.prevReleaseFence(stats, ctx->sc) : -1;
|
||||||
s->release_fd = fd;
|
if (s->release_fd >= 0) close(s->release_fd);
|
||||||
s->busy = 0;
|
s->release_fd = fd;
|
||||||
|
s->busy = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (g_pending_cb > 0) g_pending_cb--;
|
if (g_pending_cb > 0) g_pending_cb--;
|
||||||
|
if (ctx->layer >= 0 && ctx->layer < SC_LAYER_COUNT && g_layers[ctx->layer].pending_callbacks > 0)
|
||||||
|
g_layers[ctx->layer].pending_callbacks--;
|
||||||
pthread_mutex_unlock(&g_lock);
|
pthread_mutex_unlock(&g_lock);
|
||||||
if (ctx->prev_token) {
|
if (ctx->prev_token) {
|
||||||
int fd = (stats && ctx->sc) ? api.prevReleaseFence(stats, ctx->sc) : -1;
|
int fd = (stats && ctx->sc) ? api.prevReleaseFence(stats, ctx->sc) : -1;
|
||||||
@@ -308,9 +315,15 @@ static int add_complete_on(ASurfaceTransaction *tx, struct layer *l, ASurfaceCon
|
|||||||
struct complete_ctx *ctx = calloc(1, sizeof(*ctx));
|
struct complete_ctx *ctx = calloc(1, sizeof(*ctx));
|
||||||
if (!ctx) return -1;
|
if (!ctx) return -1;
|
||||||
ctx->sc = sc; ctx->layer = (int)(l - g_layers); ctx->prev_slot = prev_slot;
|
ctx->sc = sc; ctx->layer = (int)(l - g_layers); ctx->prev_slot = prev_slot;
|
||||||
|
if (prev_slot >= 0 && prev_slot < POOL_MAX) {
|
||||||
|
pthread_mutex_lock(&g_lock);
|
||||||
|
ctx->prev_generation = l->slots[prev_slot].generation;
|
||||||
|
pthread_mutex_unlock(&g_lock);
|
||||||
|
}
|
||||||
ctx->prev_token = prev_token; ctx->retire = retire;
|
ctx->prev_token = prev_token; ctx->retire = retire;
|
||||||
pthread_mutex_lock(&g_lock);
|
pthread_mutex_lock(&g_lock);
|
||||||
g_pending_cb++;
|
g_pending_cb++;
|
||||||
|
l->pending_callbacks++;
|
||||||
pthread_mutex_unlock(&g_lock);
|
pthread_mutex_unlock(&g_lock);
|
||||||
api.setOnComplete(tx, ctx, on_complete);
|
api.setOnComplete(tx, ctx, on_complete);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -397,12 +410,16 @@ static void retire_sc(struct layer *l) {
|
|||||||
ASurfaceTransaction *tx = api.txCreate();
|
ASurfaceTransaction *tx = api.txCreate();
|
||||||
if (tx) {
|
if (tx) {
|
||||||
retire_ops(tx, l->sc);
|
retire_ops(tx, l->sc);
|
||||||
if (add_complete(tx, l, l->cur_slot, l->cur_token, 1) != 0) api.release(l->sc);
|
if (add_complete(tx, l, l->cur_slot, l->cur_token, 1) != 0) {
|
||||||
|
api.txDelete(tx);
|
||||||
|
droiddeck_log("layer", "%s: retirement deferred because its release callback could not be allocated", l->name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
api.txApply(tx);
|
api.txApply(tx);
|
||||||
api.txDelete(tx);
|
api.txDelete(tx);
|
||||||
} else {
|
} else {
|
||||||
if (l->cur_token) ahb_swapchain_layer_released(l->cur_token, -1);
|
droiddeck_log("layer", "%s: retirement deferred because a transaction could not be allocated", l->name);
|
||||||
api.release(l->sc);
|
return;
|
||||||
}
|
}
|
||||||
droiddeck_log("layer", "%s: SurfaceControl retired (window %p)", l->name, (void *)l->win);
|
droiddeck_log("layer", "%s: SurfaceControl retired (window %p)", l->name, (void *)l->win);
|
||||||
l->sc = NULL; l->win = NULL;
|
l->sc = NULL; l->win = NULL;
|
||||||
@@ -421,20 +438,28 @@ static void drain_and_free_pools(void) {
|
|||||||
if (!pending || now_ns() > deadline) break;
|
if (!pending || now_ns() > deadline) break;
|
||||||
usleep(2000);
|
usleep(2000);
|
||||||
}
|
}
|
||||||
pthread_mutex_lock(&g_lock);
|
|
||||||
for (int i = 0; i < SC_LAYER_COUNT; i++) {
|
for (int i = 0; i < SC_LAYER_COUNT; i++) {
|
||||||
|
struct layer *l = &g_layers[i];
|
||||||
|
pthread_mutex_lock(&g_lock);
|
||||||
|
const int pending = l->pending_callbacks;
|
||||||
|
if (pending || l->sc) {
|
||||||
|
pthread_mutex_unlock(&g_lock);
|
||||||
|
droiddeck_log("layer", "pool drain deferred for %s (%s)", l->name,
|
||||||
|
pending ? "SurfaceControl callbacks are pending" : "SurfaceControl retirement is deferred");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
for (int j = 0; j < POOL_MAX; j++) {
|
for (int j = 0; j < POOL_MAX; j++) {
|
||||||
struct slot *s = &g_layers[i].slots[j];
|
struct slot *s = &l->slots[j];
|
||||||
if (s->release_fd >= 0) { struct pollfd p = {.fd = s->release_fd, .events = POLLIN}; poll(&p, 1, 100); close(s->release_fd); }
|
if (s->release_fd >= 0) { struct pollfd p = {.fd = s->release_fd, .events = POLLIN}; poll(&p, 1, 100); close(s->release_fd); }
|
||||||
if (s->img) vkp_image_destroy(s->img);
|
if (s->img) vkp_image_destroy(s->img);
|
||||||
if (s->ahb) AHardwareBuffer_release(s->ahb);
|
if (s->ahb) AHardwareBuffer_release(s->ahb);
|
||||||
memset(s, 0, sizeof(*s));
|
memset(s, 0, sizeof(*s));
|
||||||
s->release_fd = -1;
|
s->release_fd = -1;
|
||||||
}
|
}
|
||||||
g_layers[i].first_logged = 0;
|
l->first_logged = 0;
|
||||||
g_layers[i].logged_w = g_layers[i].logged_h = 0;
|
l->logged_w = l->logged_h = 0;
|
||||||
|
pthread_mutex_unlock(&g_lock);
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&g_lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sniff_modifier(const struct droiddeck_native_handle *h, uint64_t *mod) {
|
static int sniff_modifier(const struct droiddeck_native_handle *h, uint64_t *mod) {
|
||||||
@@ -612,7 +637,10 @@ static int take_free_slot(struct layer *l, int w, int h, uint32_t fmt, int *wait
|
|||||||
if (pending < 0) pending = i;
|
if (pending < 0) pending = i;
|
||||||
}
|
}
|
||||||
if (idx < 0) idx = pending;
|
if (idx < 0) idx = pending;
|
||||||
if (idx >= 0) { fd = l->slots[idx].release_fd; l->slots[idx].release_fd = -1; }
|
if (idx >= 0) {
|
||||||
|
fd = l->slots[idx].release_fd; l->slots[idx].release_fd = -1;
|
||||||
|
l->slots[idx].generation++;
|
||||||
|
}
|
||||||
pthread_mutex_unlock(&g_lock);
|
pthread_mutex_unlock(&g_lock);
|
||||||
if (idx < 0) return -1;
|
if (idx < 0) return -1;
|
||||||
if (fd >= 0 && fence_signalled(fd)) { close(fd); fd = -1; }
|
if (fd >= 0 && fence_signalled(fd)) { close(fd); fd = -1; }
|
||||||
@@ -620,7 +648,8 @@ static int take_free_slot(struct layer *l, int w, int h, uint32_t fmt, int *wait
|
|||||||
if (s->ahb && (s->w != w || s->h != h || s->fmt != fmt)) {
|
if (s->ahb && (s->w != w || s->h != h || s->fmt != fmt)) {
|
||||||
if (fd >= 0) { close(fd); fd = -1; }
|
if (fd >= 0) { close(fd); fd = -1; }
|
||||||
vkp_image_destroy(s->img); AHardwareBuffer_release(s->ahb);
|
vkp_image_destroy(s->img); AHardwareBuffer_release(s->ahb);
|
||||||
memset(s, 0, sizeof(*s)); s->release_fd = -1;
|
const uint64_t generation = s->generation;
|
||||||
|
memset(s, 0, sizeof(*s)); s->release_fd = -1; s->generation = generation;
|
||||||
}
|
}
|
||||||
if (fd >= 0 && !vkp_can_wait_sync_fd()) {
|
if (fd >= 0 && !vkp_can_wait_sync_fd()) {
|
||||||
if (fence_wait(fd, 100) == 0) { slot_keep_fence(s, fd); return -1; }
|
if (fence_wait(fd, 100) == 0) { slot_keep_fence(s, fd); return -1; }
|
||||||
@@ -659,7 +688,13 @@ static int ensure_sc(struct layer *l) {
|
|||||||
if (load_api() != 0) return -1;
|
if (load_api() != 0) return -1;
|
||||||
ANativeWindow *win = vkp_window();
|
ANativeWindow *win = vkp_window();
|
||||||
if (!win) return -1;
|
if (!win) return -1;
|
||||||
if (l->sc && l->win != win) retire_sc(l);
|
if (l->sc && l->win != win) {
|
||||||
|
retire_sc(l);
|
||||||
|
if (l->sc) {
|
||||||
|
droiddeck_log("layer", "%s: keeping the old SurfaceControl until retirement completes", l->name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!l->sc) {
|
if (!l->sc) {
|
||||||
l->sc = api.createFromWindow(win, l->name);
|
l->sc = api.createFromWindow(win, l->name);
|
||||||
if (!l->sc) { droiddeck_log("error", "layer: ASurfaceControl_createFromWindow(%s) failed", l->name); return -1; }
|
if (!l->sc) { droiddeck_log("error", "layer: ASurfaceControl_createFromWindow(%s) failed", l->name); return -1; }
|
||||||
@@ -818,6 +853,7 @@ static ASurfaceControl *swap_sc_begin(struct layer *l) {
|
|||||||
if (!win || win != l->win) return NULL;
|
if (!win || win != l->win) return NULL;
|
||||||
ASurfaceControl *fresh = api.createFromWindow(win, l->name);
|
ASurfaceControl *fresh = api.createFromWindow(win, l->name);
|
||||||
if (!fresh) {
|
if (!fresh) {
|
||||||
|
l->recreate_pending = 1;
|
||||||
droiddeck_log("error", "layer: %s: composition recovery could not create a new SurfaceControl", l->name);
|
droiddeck_log("error", "layer: %s: composition recovery could not create a new SurfaceControl", l->name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -832,24 +868,45 @@ static ASurfaceControl *swap_sc_begin(struct layer *l) {
|
|||||||
return old;
|
return old;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rollback_swap_sc(struct layer *l, ASurfaceControl *old, int was_shown,
|
||||||
|
int32_t ds_applied, uint32_t md_applied, float hr_applied) {
|
||||||
|
if (!old) return;
|
||||||
|
ASurfaceControl *fresh = l->sc;
|
||||||
|
l->sc = old;
|
||||||
|
l->shown = was_shown;
|
||||||
|
l->recreate_pending = 1;
|
||||||
|
l->geo_valid = 0;
|
||||||
|
l->fps_applied = -1.0f;
|
||||||
|
l->ds_applied = ds_applied; l->md_applied = md_applied; l->hr_applied = hr_applied;
|
||||||
|
if (fresh) api.release(fresh);
|
||||||
|
}
|
||||||
|
|
||||||
static int present_slot(struct layer *l, int idx, const int r[8], const struct droiddeck_color *color,
|
static int present_slot(struct layer *l, int idx, const int r[8], const struct droiddeck_color *color,
|
||||||
int translucent) {
|
int translucent) {
|
||||||
struct slot *s = &l->slots[idx];
|
struct slot *s = &l->slots[idx];
|
||||||
ASurfaceTransaction *tx = api.txCreate();
|
ASurfaceTransaction *tx = api.txCreate();
|
||||||
if (!tx) return -1;
|
if (!tx) return -1;
|
||||||
|
const int was_shown = l->shown;
|
||||||
|
const int32_t ds_applied = l->ds_applied;
|
||||||
|
const uint32_t md_applied = l->md_applied;
|
||||||
|
const float hr_applied = l->hr_applied;
|
||||||
ASurfaceControl *old = swap_sc_begin(l);
|
ASurfaceControl *old = swap_sc_begin(l);
|
||||||
if (old) api.setZOrder(tx, l->sc, l->z);
|
if (old) api.setZOrder(tx, l->sc, l->z);
|
||||||
api.setBuffer(tx, l->sc, s->ahb, -1);
|
api.setBuffer(tx, l->sc, s->ahb, -1);
|
||||||
if (api.setEnableBackPressure) api.setEnableBackPressure(tx, l->sc, true);
|
if (api.setEnableBackPressure) api.setEnableBackPressure(tx, l->sc, true);
|
||||||
api.setBufferTransparency(tx, l->sc,
|
api.setBufferTransparency(tx, l->sc,
|
||||||
translucent ? ASC_TRANSPARENCY_TRANSLUCENT : ASC_TRANSPARENCY_OPAQUE);
|
translucent ? ASC_TRANSPARENCY_TRANSLUCENT : ASC_TRANSPARENCY_OPAQUE);
|
||||||
|
if (!l->shown) api.setVisibility(tx, l->sc, ASC_VISIBILITY_SHOW);
|
||||||
|
if (old) retire_ops(tx, old);
|
||||||
|
if (add_complete_on(tx, l, old ? old : l->sc, l->cur_slot, l->cur_token, old ? 1 : 0) != 0) {
|
||||||
|
api.txDelete(tx);
|
||||||
|
rollback_swap_sc(l, old, was_shown, ds_applied, md_applied, hr_applied);
|
||||||
|
droiddeck_log("layer", "%s: frame transition skipped because its release callback could not be allocated", l->name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
apply_geometry(tx, l, r);
|
apply_geometry(tx, l, r);
|
||||||
apply_frame_rate(tx, l);
|
apply_frame_rate(tx, l);
|
||||||
apply_colour(tx, l, color);
|
apply_colour(tx, l, color);
|
||||||
if (!l->shown) api.setVisibility(tx, l->sc, ASC_VISIBILITY_SHOW);
|
|
||||||
if (old) retire_ops(tx, old);
|
|
||||||
if (add_complete_on(tx, l, old ? old : l->sc, l->cur_slot, l->cur_token, old ? 1 : 0) != 0 && old)
|
|
||||||
api.release(old);
|
|
||||||
pthread_mutex_lock(&g_lock);
|
pthread_mutex_lock(&g_lock);
|
||||||
s->busy = 1;
|
s->busy = 1;
|
||||||
pthread_mutex_unlock(&g_lock);
|
pthread_mutex_unlock(&g_lock);
|
||||||
@@ -904,23 +961,27 @@ int sc_layer_present_ahb(AHardwareBuffer *ahb, int w, int h, int acquire_fd, voi
|
|||||||
}
|
}
|
||||||
ASurfaceTransaction *tx = api.txCreate();
|
ASurfaceTransaction *tx = api.txCreate();
|
||||||
if (!tx) goto unavailable;
|
if (!tx) goto unavailable;
|
||||||
|
const int was_shown = l->shown;
|
||||||
|
const int32_t ds_applied = l->ds_applied;
|
||||||
|
const uint32_t md_applied = l->md_applied;
|
||||||
|
const float hr_applied = l->hr_applied;
|
||||||
ASurfaceControl *old = swap_sc_begin(l);
|
ASurfaceControl *old = swap_sc_begin(l);
|
||||||
if (old) api.setZOrder(tx, l->sc, l->z);
|
if (old) api.setZOrder(tx, l->sc, l->z);
|
||||||
api.setBuffer(tx, l->sc, ahb, acquire_fd);
|
api.setBuffer(tx, l->sc, ahb, acquire_fd);
|
||||||
if (api.setEnableBackPressure) api.setEnableBackPressure(tx, l->sc, true);
|
if (api.setEnableBackPressure) api.setEnableBackPressure(tx, l->sc, true);
|
||||||
api.setBufferTransparency(tx, l->sc, ASC_TRANSPARENCY_OPAQUE);
|
api.setBufferTransparency(tx, l->sc, ASC_TRANSPARENCY_OPAQUE);
|
||||||
apply_geometry(tx, l, r);
|
|
||||||
apply_frame_rate(tx, l);
|
|
||||||
apply_colour(tx, l, color);
|
|
||||||
if (!l->shown) api.setVisibility(tx, l->sc, ASC_VISIBILITY_SHOW);
|
if (!l->shown) api.setVisibility(tx, l->sc, ASC_VISIBILITY_SHOW);
|
||||||
if (old) retire_ops(tx, old);
|
if (old) retire_ops(tx, old);
|
||||||
if (add_complete_on(tx, l, old ? old : l->sc, l->cur_slot,
|
if (add_complete_on(tx, l, old ? old : l->sc, l->cur_slot,
|
||||||
l->cur_token == token ? NULL : l->cur_token, old ? 1 : 0) != 0) {
|
l->cur_token == token ? NULL : l->cur_token, old ? 1 : 0) != 0) {
|
||||||
api.txDelete(tx);
|
api.txDelete(tx);
|
||||||
if (old) api.release(old);
|
rollback_swap_sc(l, old, was_shown, ds_applied, md_applied, hr_applied);
|
||||||
l->ds_applied = -1; l->md_applied = 0; l->hr_applied = -1.0f;
|
droiddeck_log("layer", "zero-copy: frame transition skipped because its release callback could not be allocated");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
apply_geometry(tx, l, r);
|
||||||
|
apply_frame_rate(tx, l);
|
||||||
|
apply_colour(tx, l, color);
|
||||||
apply_present_time(tx, 1);
|
apply_present_time(tx, 1);
|
||||||
api.txApply(tx);
|
api.txApply(tx);
|
||||||
api.txDelete(tx);
|
api.txDelete(tx);
|
||||||
@@ -1167,15 +1228,26 @@ int sc_layer_present_overlay(struct vkp_image *src, const int geo[8], int transl
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hide_layer(struct layer *l) {
|
static int hide_layer(struct layer *l) {
|
||||||
if (!l->sc || !l->shown || api.state != 1) return;
|
if (!l->sc || !l->shown || api.state != 1) return 0;
|
||||||
ASurfaceTransaction *tx = api.txCreate();
|
ASurfaceTransaction *tx = api.txCreate();
|
||||||
if (!tx) return;
|
if (!tx) return -1;
|
||||||
replace_with_blank(tx, l);
|
|
||||||
api.setVisibility(tx, l->sc, ASC_VISIBILITY_HIDE);
|
api.setVisibility(tx, l->sc, ASC_VISIBILITY_HIDE);
|
||||||
add_complete(tx, l, l->cur_slot, l->cur_token, 0);
|
if (add_complete(tx, l, l->cur_slot, l->cur_token, 0) != 0) {
|
||||||
|
/*
|
||||||
|
* Keep the current buffer attached when its release callback cannot
|
||||||
|
* be allocated. The hide can still apply without releasing the slot.
|
||||||
|
*/
|
||||||
|
api.txApply(tx);
|
||||||
|
api.txDelete(tx);
|
||||||
|
l->shown = 0;
|
||||||
|
droiddeck_log("layer", "%s: hidden; buffer release deferred because its callback could not be allocated", l->name);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
replace_with_blank(tx, l);
|
||||||
api.txApply(tx); api.txDelete(tx);
|
api.txApply(tx); api.txDelete(tx);
|
||||||
l->shown = 0; l->cur_slot = -1; l->cur_token = NULL;
|
l->shown = 0; l->cur_slot = -1; l->cur_token = NULL;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sc_layer_hide(void) {
|
void sc_layer_hide(void) {
|
||||||
@@ -1183,17 +1255,20 @@ void sc_layer_hide(void) {
|
|||||||
int said = g_layers[SC_LAYER_GAME].shown || g_layers[SC_LAYER_OVERLAY].sc;
|
int said = g_layers[SC_LAYER_GAME].shown || g_layers[SC_LAYER_OVERLAY].sc;
|
||||||
if (g_layers[SC_LAYER_OVERLAY].sc) sc_layer_hide_overlay();
|
if (g_layers[SC_LAYER_OVERLAY].sc) sc_layer_hide_overlay();
|
||||||
if (g_layers[SC_LAYER_GAME].shown) hide_layer(&g_layers[SC_LAYER_GAME]);
|
if (g_layers[SC_LAYER_GAME].shown) hide_layer(&g_layers[SC_LAYER_GAME]);
|
||||||
if (said) droiddeck_log("layer", "layers hidden (scene is not a single fullscreen window)");
|
if (said && !g_layers[SC_LAYER_GAME].shown && !g_layers[SC_LAYER_OVERLAY].shown)
|
||||||
|
droiddeck_log("layer", "layers hidden (scene is not a single fullscreen window)");
|
||||||
}
|
}
|
||||||
|
|
||||||
void sc_layer_hide_overlay(void) {
|
void sc_layer_hide_overlay(void) {
|
||||||
layers_init();
|
layers_init();
|
||||||
struct layer *l = &g_layers[SC_LAYER_OVERLAY];
|
struct layer *l = &g_layers[SC_LAYER_OVERLAY];
|
||||||
if (!l->sc) return;
|
if (!l->sc) return;
|
||||||
if (l->shown) hide_layer(l);
|
if (l->shown && hide_layer(l) != 0) return;
|
||||||
retire_sc(l);
|
retire_sc(l);
|
||||||
droiddeck_log("layer", "%s: gone (nothing is above the game any more)", l->name);
|
if (!l->sc) {
|
||||||
if (g_layers[SC_LAYER_GAME].sc) g_layers[SC_LAYER_GAME].recreate_pending = 1;
|
droiddeck_log("layer", "%s: gone (nothing is above the game any more)", l->name);
|
||||||
|
if (g_layers[SC_LAYER_GAME].sc) g_layers[SC_LAYER_GAME].recreate_pending = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sc_layer_window_gone(void) {
|
void sc_layer_window_gone(void) {
|
||||||
|
|||||||
@@ -161,7 +161,9 @@ static uint32_t g_qfam;
|
|||||||
static VkCommandPool g_pool;
|
static VkCommandPool g_pool;
|
||||||
#define MAX_PRESENTS (1 + VKP_FG_MAX_GENERATIONS)
|
#define MAX_PRESENTS (1 + VKP_FG_MAX_GENERATIONS)
|
||||||
static VkCommandBuffer g_cmds[MAX_PRESENTS];
|
static VkCommandBuffer g_cmds[MAX_PRESENTS];
|
||||||
static VkSemaphore g_acqs[MAX_PRESENTS], g_rnds[MAX_PRESENTS];
|
static VkSemaphore g_acqs[MAX_PRESENTS];
|
||||||
|
static VkSemaphore *g_rnds;
|
||||||
|
static uint32_t g_rnd_count;
|
||||||
static VkFence g_fence;
|
static VkFence g_fence;
|
||||||
static int g_swap_extra;
|
static int g_swap_extra;
|
||||||
#define SCENE_FMT VK_FORMAT_R8G8B8A8_UNORM
|
#define SCENE_FMT VK_FORMAT_R8G8B8A8_UNORM
|
||||||
@@ -230,6 +232,16 @@ static VkResult timed_wait(VkFence fence, uint64_t timeout) {
|
|||||||
return g_dev_state == -2 ? VK_ERROR_DEVICE_LOST : VK_ERROR_UNKNOWN;
|
return g_dev_state == -2 ? VK_ERROR_DEVICE_LOST : VK_ERROR_UNKNOWN;
|
||||||
int64_t t0 = perf_now();
|
int64_t t0 = perf_now();
|
||||||
VkResult r = g_vk.WaitForFences(g_dev, 1, &fence, VK_TRUE, timeout);
|
VkResult r = g_vk.WaitForFences(g_dev, 1, &fence, VK_TRUE, timeout);
|
||||||
|
if (r == VK_TIMEOUT) {
|
||||||
|
droiddeck_log("gpu", "GPU fence delayed: retaining frame resources until completion");
|
||||||
|
/* A scheduling delay does not invalidate the device. Keep this submission's
|
||||||
|
* resources and call stack alive, as the main render path already does. */
|
||||||
|
do {
|
||||||
|
r = g_vk.WaitForFences(g_dev, 1, &fence, VK_TRUE, UINT64_MAX);
|
||||||
|
} while (r == VK_TIMEOUT);
|
||||||
|
if (r == VK_SUCCESS)
|
||||||
|
droiddeck_log("gpu", "GPU fence completed: continuing presentation");
|
||||||
|
}
|
||||||
perf_add(&g_perf.wait_ns, &g_perf.wait_max_ns, &g_perf.waits, perf_now() - t0);
|
perf_add(&g_perf.wait_ns, &g_perf.wait_max_ns, &g_perf.waits, perf_now() - t0);
|
||||||
if (r != VK_SUCCESS && r != VK_ERROR_DEVICE_LOST)
|
if (r != VK_SUCCESS && r != VK_ERROR_DEVICE_LOST)
|
||||||
quarantine_pending_work(r, "fence wait");
|
quarantine_pending_work(r, "fence wait");
|
||||||
@@ -323,12 +335,44 @@ static void reset_sync(void) {
|
|||||||
VkSemaphoreCreateInfo semci = {.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO};
|
VkSemaphoreCreateInfo semci = {.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO};
|
||||||
for (int k = 0; k < MAX_PRESENTS; k++) {
|
for (int k = 0; k < MAX_PRESENTS; k++) {
|
||||||
if (g_acqs[k]) g_vk.DestroySemaphore(g_dev, g_acqs[k], NULL);
|
if (g_acqs[k]) g_vk.DestroySemaphore(g_dev, g_acqs[k], NULL);
|
||||||
if (g_rnds[k]) g_vk.DestroySemaphore(g_dev, g_rnds[k], NULL);
|
g_acqs[k] = VK_NULL_HANDLE;
|
||||||
g_vk.CreateSemaphore(g_dev, &semci, NULL, &g_acqs[k]);
|
if (g_vk.CreateSemaphore(g_dev, &semci, NULL, &g_acqs[k]) != VK_SUCCESS)
|
||||||
g_vk.CreateSemaphore(g_dev, &semci, NULL, &g_rnds[k]);
|
droiddeck_log("error", "present: failed to recreate acquire semaphore %d", k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void destroy_present_semaphores(void) {
|
||||||
|
if (g_dev && g_vk.DestroySemaphore) {
|
||||||
|
for (uint32_t i = 0; i < g_rnd_count; i++)
|
||||||
|
if (g_rnds[i]) g_vk.DestroySemaphore(g_dev, g_rnds[i], NULL);
|
||||||
|
}
|
||||||
|
free(g_rnds);
|
||||||
|
g_rnds = NULL;
|
||||||
|
g_rnd_count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int create_present_semaphores(void) {
|
||||||
|
if (!g_nimg) return -1;
|
||||||
|
VkSemaphore *sems = calloc(g_nimg, sizeof(*sems));
|
||||||
|
if (!sems) return -1;
|
||||||
|
VkSemaphoreCreateInfo semci = {.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO};
|
||||||
|
for (uint32_t i = 0; i < g_nimg; i++) {
|
||||||
|
VkResult r = g_vk.CreateSemaphore(g_dev, &semci, NULL, &sems[i]);
|
||||||
|
if (r != VK_SUCCESS) {
|
||||||
|
droiddeck_log("error", "present: failed to create image semaphore %u (%s)",
|
||||||
|
i, vk_result_name(r));
|
||||||
|
for (uint32_t j = 0; j < i; j++)
|
||||||
|
if (sems[j]) g_vk.DestroySemaphore(g_dev, sems[j], NULL);
|
||||||
|
free(sems);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
destroy_present_semaphores();
|
||||||
|
g_rnds = sems;
|
||||||
|
g_rnd_count = g_nimg;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void destroy_swapchain(void) {
|
static void destroy_swapchain(void) {
|
||||||
g_base_black = 0;
|
g_base_black = 0;
|
||||||
if (g_dev_state != 1) return;
|
if (g_dev_state != 1) return;
|
||||||
@@ -338,10 +382,11 @@ static void destroy_swapchain(void) {
|
|||||||
else quarantine_pending_work(idle, "swapchain idle");
|
else quarantine_pending_work(idle, "swapchain idle");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
reset_sync();
|
|
||||||
for (uint32_t i = 0; i < g_nimg; i++) blendp_forget_image(g_images[i]);
|
for (uint32_t i = 0; i < g_nimg; i++) blendp_forget_image(g_images[i]);
|
||||||
if (g_swapchain) g_vk.DestroySwapchainKHR(g_dev, g_swapchain, NULL);
|
if (g_swapchain) g_vk.DestroySwapchainKHR(g_dev, g_swapchain, NULL);
|
||||||
g_swapchain = VK_NULL_HANDLE;
|
g_swapchain = VK_NULL_HANDLE;
|
||||||
|
destroy_present_semaphores();
|
||||||
|
reset_sync();
|
||||||
g_swap_md_identity = 0;
|
g_swap_md_identity = 0;
|
||||||
if (g_surface) g_vk.DestroySurfaceKHR(g_inst, g_surface, NULL);
|
if (g_surface) g_vk.DestroySurfaceKHR(g_inst, g_surface, NULL);
|
||||||
g_surface = VK_NULL_HANDLE;
|
g_surface = VK_NULL_HANDLE;
|
||||||
@@ -1365,12 +1410,35 @@ static int swap_init_locked(void) {
|
|||||||
SWLOGE("present: vkCreateSwapchainKHR failed (%d)", (int)cr);
|
SWLOGE("present: vkCreateSwapchainKHR failed (%d)", (int)cr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
g_vk.GetSwapchainImagesKHR(g_dev, g_swapchain, &g_nimg, NULL);
|
cr = g_vk.GetSwapchainImagesKHR(g_dev, g_swapchain, &g_nimg, NULL);
|
||||||
|
if (cr != VK_SUCCESS || !g_nimg) {
|
||||||
|
SWLOGE("present: vkGetSwapchainImagesKHR count failed (%s)", vk_result_name(cr));
|
||||||
|
g_nimg = 0;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
g_images = calloc(g_nimg, sizeof(VkImage));
|
g_images = calloc(g_nimg, sizeof(VkImage));
|
||||||
g_vk.GetSwapchainImagesKHR(g_dev, g_swapchain, &g_nimg, g_images);
|
if (!g_images) {
|
||||||
|
SWLOGE("present: failed to allocate swapchain image list");
|
||||||
|
g_nimg = 0;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
cr = g_vk.GetSwapchainImagesKHR(g_dev, g_swapchain, &g_nimg, g_images);
|
||||||
|
if (cr != VK_SUCCESS) {
|
||||||
|
SWLOGE("present: vkGetSwapchainImagesKHR failed (%s)", vk_result_name(cr));
|
||||||
|
free(g_images);
|
||||||
|
g_images = NULL;
|
||||||
|
g_nimg = 0;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (create_present_semaphores() != 0) {
|
||||||
|
SWLOGE("present: failed to initialize per-image present semaphores");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
droiddeck_log("gpu", "screen output %ux%u, %u buffers, vsync%s", g_extent.width, g_extent.height, g_nimg,
|
droiddeck_log("gpu", "screen output %ux%u, %u buffers, vsync%s", g_extent.width, g_extent.height, g_nimg,
|
||||||
g_swap_extra ? " (frame generation: several presents per frame)" : "");
|
g_swap_extra ? " (frame generation: several presents per frame)" : "");
|
||||||
|
droiddeck_log("gpu", "present synchronization: %u render-finished semaphores, one per swapchain image",
|
||||||
|
g_rnd_count);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2691,6 +2759,21 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
|
|||||||
pass_n = 1;
|
pass_n = 1;
|
||||||
overlay_start = source_end;
|
overlay_start = source_end;
|
||||||
}
|
}
|
||||||
|
const int upscale_w = (int)(scene_w * g_map.kx + 0.5f);
|
||||||
|
const int upscale_h = (int)(scene_h * g_map.ky + 0.5f);
|
||||||
|
const int post_upscale = fx && fg && !hf && !cb && vkp_effects_upscaling() &&
|
||||||
|
vkp_effects_prepare_generated() &&
|
||||||
|
(upscale_w > input_w || upscale_h > input_h);
|
||||||
|
if (post_upscale) {
|
||||||
|
static int last_input_w, last_input_h, last_output_w, last_output_h;
|
||||||
|
if (input_w != last_input_w || input_h != last_input_h ||
|
||||||
|
upscale_w != last_output_w || upscale_h != last_output_h) {
|
||||||
|
droiddeck_log("framegen", "post-upscale: interpolate %dx%d, spatial filter each present to %dx%d",
|
||||||
|
input_w, input_h, upscale_w, upscale_h);
|
||||||
|
last_input_w = input_w; last_input_h = input_h;
|
||||||
|
last_output_w = upscale_w; last_output_h = upscale_h;
|
||||||
|
}
|
||||||
|
}
|
||||||
const int deep = hf && n > 0 && fg && g_swap_is_hdr && !hf->tonemap && vkp_framegen_format_ok(FG_HDR_FMT) &&
|
const int deep = hf && n > 0 && fg && g_swap_is_hdr && !hf->tonemap && vkp_framegen_format_ok(FG_HDR_FMT) &&
|
||||||
ensure_img(&g_fgscene, scene_w, scene_h, FG_HDR_FMT,
|
ensure_img(&g_fgscene, scene_w, scene_h, FG_HDR_FMT,
|
||||||
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT |
|
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT |
|
||||||
@@ -2826,8 +2909,11 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
|
|||||||
if (fx) {
|
if (fx) {
|
||||||
int mapped_w = (int)(scene_w * g_map.kx + 0.5f), mapped_h = (int)(scene_h * g_map.ky + 0.5f);
|
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; }
|
if (fg && !vkp_effects_sharpening()) { mapped_w = scene_w; mapped_h = scene_h; }
|
||||||
|
if (post_upscale) { mapped_w = input_w; mapped_h = input_h; }
|
||||||
vkp_effects_set_formats(scene_fmt, scene_fmt, hdr_how == 1 || hdr_unconverted);
|
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);
|
result = post_upscale
|
||||||
|
? vkp_effects_run_before_generated(cmd, scene_img, input_w, input_h, &rw, &rh)
|
||||||
|
: 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,
|
effects_overlay_draws(cmd, result, rw, rh, scene_w, scene_h,
|
||||||
draws ? draws + overlay_start : NULL, n - overlay_start);
|
draws ? draws + overlay_start : NULL, n - overlay_start);
|
||||||
release_external_client_draws(cmd, draws, n);
|
release_external_client_draws(cmd, draws, n);
|
||||||
@@ -2850,7 +2936,12 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
|
|||||||
if (ngen > VKP_FG_MAX_GENERATIONS) ngen = VKP_FG_MAX_GENERATIONS;
|
if (ngen > VKP_FG_MAX_GENERATIONS) ngen = VKP_FG_MAX_GENERATIONS;
|
||||||
}
|
}
|
||||||
|
|
||||||
record_screen_blit(cmd, ngen ? gens[0] : result, rw, rh, scene_w, scene_h, img, blit_filter, cb);
|
VkImage screen = ngen ? gens[0] : result;
|
||||||
|
int screen_w = rw, screen_h = rh;
|
||||||
|
if (post_upscale)
|
||||||
|
screen = vkp_effects_run_generated(cmd, screen, rw, rh, upscale_w, upscale_h,
|
||||||
|
0, &screen_w, &screen_h);
|
||||||
|
record_screen_blit(cmd, screen, screen_w, screen_h, scene_w, scene_h, img, blit_filter, cb);
|
||||||
}
|
}
|
||||||
g_vk.EndCommandBuffer(cmd);
|
g_vk.EndCommandBuffer(cmd);
|
||||||
|
|
||||||
@@ -2874,14 +2965,27 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
|
|||||||
VkCommandBuffer ck = g_cmds[k];
|
VkCommandBuffer ck = g_cmds[k];
|
||||||
g_vk.ResetCommandBuffer(ck, 0);
|
g_vk.ResetCommandBuffer(ck, 0);
|
||||||
g_vk.BeginCommandBuffer(ck, &bi);
|
g_vk.BeginCommandBuffer(ck, &bi);
|
||||||
record_screen_blit(ck, k < ngen ? gens[k] : result, rw, rh, scene_w, scene_h, img, blit_filter, cb);
|
VkImage screen = k < ngen ? gens[k] : result;
|
||||||
|
int screen_w = rw, screen_h = rh;
|
||||||
|
if (post_upscale)
|
||||||
|
screen = vkp_effects_run_generated(ck, screen, rw, rh, upscale_w, upscale_h,
|
||||||
|
k, &screen_w, &screen_h);
|
||||||
|
record_screen_blit(ck, screen, screen_w, screen_h, scene_w, scene_h, img, blit_filter, cb);
|
||||||
g_vk.EndCommandBuffer(ck);
|
g_vk.EndCommandBuffer(ck);
|
||||||
}
|
}
|
||||||
const int last = (k + 1 == presents);
|
const int last = (k + 1 == presents);
|
||||||
VkPipelineStageFlags wait = VK_PIPELINE_STAGE_TRANSFER_BIT;
|
VkPipelineStageFlags wait = VK_PIPELINE_STAGE_TRANSFER_BIT;
|
||||||
|
/* A present-wait semaphore is reused only after this exact swapchain image
|
||||||
|
* has been acquired again; a frame-slot fence cannot prove present completion. */
|
||||||
|
if (img >= g_rnd_count || !g_rnds[img]) {
|
||||||
|
droiddeck_log("error", "present: image index %u exceeds semaphore count %u",
|
||||||
|
img, g_rnd_count);
|
||||||
|
destroy_swapchain();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
VkSubmitInfo si = {.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, .waitSemaphoreCount = 1,
|
VkSubmitInfo si = {.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, .waitSemaphoreCount = 1,
|
||||||
.pWaitSemaphores = &g_acqs[k], .pWaitDstStageMask = &wait, .commandBufferCount = 1,
|
.pWaitSemaphores = &g_acqs[k], .pWaitDstStageMask = &wait, .commandBufferCount = 1,
|
||||||
.pCommandBuffers = &g_cmds[k], .signalSemaphoreCount = 1, .pSignalSemaphores = &g_rnds[k]};
|
.pCommandBuffers = &g_cmds[k], .signalSemaphoreCount = 1, .pSignalSemaphores = &g_rnds[img]};
|
||||||
VkResult qr = g_vk.QueueSubmit(g_queue, 1, &si, last ? g_fence : VK_NULL_HANDLE);
|
VkResult qr = g_vk.QueueSubmit(g_queue, 1, &si, last ? g_fence : VK_NULL_HANDLE);
|
||||||
if (qr != VK_SUCCESS) {
|
if (qr != VK_SUCCESS) {
|
||||||
if (qr == VK_ERROR_DEVICE_LOST) device_lost("submit");
|
if (qr == VK_ERROR_DEVICE_LOST) device_lost("submit");
|
||||||
@@ -2891,7 +2995,7 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
|
|||||||
}
|
}
|
||||||
fence_submitted = last;
|
fence_submitted = last;
|
||||||
VkPresentInfoKHR pi = {.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR, .waitSemaphoreCount = 1,
|
VkPresentInfoKHR pi = {.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR, .waitSemaphoreCount = 1,
|
||||||
.pWaitSemaphores = &g_rnds[k], .swapchainCount = 1,
|
.pWaitSemaphores = &g_rnds[img], .swapchainCount = 1,
|
||||||
.pSwapchains = &g_swapchain, .pImageIndices = &img};
|
.pSwapchains = &g_swapchain, .pImageIndices = &img};
|
||||||
const int64_t t_pres = perf_now();
|
const int64_t t_pres = perf_now();
|
||||||
pr = g_vk.QueuePresentKHR(g_queue, &pi);
|
pr = g_vk.QueuePresentKHR(g_queue, &pi);
|
||||||
@@ -2912,6 +3016,7 @@ static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, i
|
|||||||
VkResult fr = timed_wait(g_fence, UINT64_MAX);
|
VkResult fr = timed_wait(g_fence, UINT64_MAX);
|
||||||
if (fr == VK_ERROR_DEVICE_LOST || pr == VK_ERROR_DEVICE_LOST) { device_lost("present"); return -1; }
|
if (fr == VK_ERROR_DEVICE_LOST || pr == VK_ERROR_DEVICE_LOST) { device_lost("present"); return -1; }
|
||||||
if (fr != VK_SUCCESS) return -1;
|
if (fr != VK_SUCCESS) return -1;
|
||||||
|
vkp_effects_release_generated_sources();
|
||||||
if (fg) vkp_framegen_presented(presented_gen);
|
if (fg) vkp_framegen_presented(presented_gen);
|
||||||
if (pr == VK_ERROR_OUT_OF_DATE_KHR || pr == VK_ERROR_SURFACE_LOST_KHR) {
|
if (pr == VK_ERROR_OUT_OF_DATE_KHR || pr == VK_ERROR_SURFACE_LOST_KHR) {
|
||||||
droiddeck_log("gpu", "screen surface %s on present: rebuilding the swapchain", vk_result_name(pr));
|
droiddeck_log("gpu", "screen surface %s on present: rebuilding the swapchain", vk_result_name(pr));
|
||||||
|
|||||||
@@ -430,21 +430,28 @@ internal class DriverMenus(private val activity: Activity, private val ui: Handl
|
|||||||
*/
|
*/
|
||||||
private fun useMaliFallback(missing: String?): String {
|
private fun useMaliFallback(missing: String?): String {
|
||||||
val oldVulkan = com.droiddeck.launcher.session.VenusComponent.hostVulkanTooOld(activity)
|
val oldVulkan = com.droiddeck.launcher.session.VenusComponent.hostVulkanTooOld(activity)
|
||||||
val venus = oldVulkan == null && com.droiddeck.launcher.session.VenusComponent.available(activity)
|
val venusByUser = venusExplicit()
|
||||||
|
val venus = MaliAutoRoute.venusStandsIn(
|
||||||
|
com.droiddeck.launcher.session.VenusComponent.available(activity), oldVulkan == null,
|
||||||
|
SessionPrefs.venus(activity), venusByUser, gpu.name,
|
||||||
|
)
|
||||||
if (oldVulkan != null) Log.i(TAG, "auto: Mali driver reports Vulkan $oldVulkan; Venus needs 1.2, the bridge stands in")
|
if (oldVulkan != null) Log.i(TAG, "auto: Mali driver reports Vulkan $oldVulkan; Venus needs 1.2, the bridge stands in")
|
||||||
val ownership = MaliAutoRoute.fallbackOwnership(
|
val ownership = MaliAutoRoute.fallbackOwnership(
|
||||||
venus,
|
venus,
|
||||||
SessionPrefs.vkBridge(activity), bridgeExplicit(),
|
SessionPrefs.vkBridge(activity), bridgeExplicit(),
|
||||||
SessionPrefs.venus(activity), venusExplicit(),
|
SessionPrefs.venus(activity), venusByUser,
|
||||||
)
|
)
|
||||||
if (venus && !SessionPrefs.venus(activity)) {
|
if (venus && !SessionPrefs.venus(activity)) {
|
||||||
SessionPrefs.setVenus(activity, true)
|
SessionPrefs.setVenus(activity, true)
|
||||||
if (SessionPrefs.vkBridge(activity) && !bridgeExplicit())
|
if (SessionPrefs.vkBridge(activity) && !bridgeExplicit())
|
||||||
SessionPrefs.setVkBridge(activity, false)
|
SessionPrefs.setVkBridge(activity, false)
|
||||||
SessionPrefs.setMaliFallbackByAuto(activity, ownership)
|
SessionPrefs.setMaliFallbackByAuto(activity, ownership)
|
||||||
} else if (!venus && !SessionPrefs.vkBridge(activity)) {
|
} else if (!venus) {
|
||||||
SessionPrefs.setVkBridge(activity, true)
|
val venusOff = SessionPrefs.venus(activity) && !venusByUser
|
||||||
SessionPrefs.setMaliFallbackByAuto(activity, ownership)
|
val bridgeOn = !SessionPrefs.vkBridge(activity)
|
||||||
|
if (venusOff) SessionPrefs.clearVenus(activity)
|
||||||
|
if (bridgeOn) SessionPrefs.setVkBridge(activity, true)
|
||||||
|
if (venusOff || bridgeOn || ownership != MaliAutoRoute.NONE) SessionPrefs.setMaliFallbackByAuto(activity, ownership)
|
||||||
} else if (ownership != MaliAutoRoute.NONE) {
|
} else if (ownership != MaliAutoRoute.NONE) {
|
||||||
SessionPrefs.setMaliFallbackByAuto(activity, ownership)
|
SessionPrefs.setMaliFallbackByAuto(activity, ownership)
|
||||||
}
|
}
|
||||||
@@ -467,7 +474,7 @@ internal class DriverMenus(private val activity: Activity, private val ui: Handl
|
|||||||
/** A pair is installed for this Mali: the route Auto switched on in its place goes off again. */
|
/** A pair is installed for this Mali: the route Auto switched on in its place goes off again. */
|
||||||
private fun endMaliFallback() {
|
private fun endMaliFallback() {
|
||||||
when (SessionPrefs.maliFallbackByAuto(activity)) {
|
when (SessionPrefs.maliFallbackByAuto(activity)) {
|
||||||
"venus" -> SessionPrefs.setVenus(activity, false)
|
"venus" -> SessionPrefs.clearVenus(activity)
|
||||||
"bridge" -> SessionPrefs.setVkBridge(activity, false)
|
"bridge" -> SessionPrefs.setVkBridge(activity, false)
|
||||||
else -> return
|
else -> return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1038,6 +1038,28 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
|||||||
onHandled()
|
onHandled()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// A Linux recomp starts as the Linux app it is, whether or not Steam would launch it.
|
||||||
|
if (game.source == com.droiddeck.launcher.runtime.RecompShortcuts.SOURCE) {
|
||||||
|
launchCoordinator.releaseHandling(request)
|
||||||
|
onHandled()
|
||||||
|
val key = game.storeId
|
||||||
|
Thread({
|
||||||
|
val app = com.droiddeck.launcher.store.UserAppsState.items.firstOrNull { it.key == key }
|
||||||
|
?: runCatching { com.droiddeck.launcher.runtime.UserApps.list(this).firstOrNull { it.key == key } }.getOrNull()
|
||||||
|
ui.post {
|
||||||
|
if (app == null) android.widget.Toast.makeText(this, R.string.recomps_launch_missing, android.widget.Toast.LENGTH_SHORT).show()
|
||||||
|
else {
|
||||||
|
Library.recordPlayed(this, game)
|
||||||
|
startActivity(Intent(this, SessionActivity::class.java)
|
||||||
|
.putExtra(SessionService.EXTRA_MODE, SessionService.MODE_RUN)
|
||||||
|
.putExtra(SessionService.EXTRA_PROGRAM, app.program)
|
||||||
|
.putExtra(SessionService.EXTRA_PROGRAM_ARGS, app.args.toTypedArray()))
|
||||||
|
onSettled()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, "recomp-launch").start()
|
||||||
|
return
|
||||||
|
}
|
||||||
val files = game.gameFiles
|
val files = game.gameFiles
|
||||||
if (game.source != com.droiddeck.launcher.stores.Store.XBOX.id || files == null) {
|
if (game.source != com.droiddeck.launcher.stores.Store.XBOX.id || files == null) {
|
||||||
if (startGame(game, returnHome, onHandled, request)) onSettled()
|
if (startGame(game, returnHome, onHandled, request)) onSettled()
|
||||||
@@ -1993,11 +2015,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val askAllFiles = Build.VERSION.SDK_INT >= 30 && com.droiddeck.launcher.files.AllFilesAccess.missing() &&
|
if (savedInstanceState == null) ui.post { startSteamAtStartupIfEnabled(cold = true) }
|
||||||
!SessionPrefs.allFilesAsked(this)
|
|
||||||
if (savedInstanceState == null) {
|
|
||||||
if (!askAllFiles) ui.post { startSteamAtStartupIfEnabled(cold = true) }
|
|
||||||
}
|
|
||||||
saved?.let { state ->
|
saved?.let { state ->
|
||||||
restoreCompatLaunch(state)
|
restoreCompatLaunch(state)
|
||||||
pendingSwitch = savedIntent(state, KEY_PENDING_SWITCH)
|
pendingSwitch = savedIntent(state, KEY_PENDING_SWITCH)
|
||||||
@@ -2005,13 +2023,8 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
|||||||
}
|
}
|
||||||
|
|
||||||
val wanted = ArrayList<String>()
|
val wanted = ArrayList<String>()
|
||||||
if (Build.VERSION.SDK_INT >= 30) {
|
// From Android 11, shared storage outside the app's own folders is all-files access, which the file picker asks for when a shared drive is opened.
|
||||||
// From targetSdk 30, shared storage outside the app's own folders is all-files access or nothing.
|
if (Build.VERSION.SDK_INT < 30 && checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||||
if (askAllFiles) {
|
|
||||||
SessionPrefs.setAllFilesAsked(this)
|
|
||||||
com.droiddeck.launcher.files.AllFilesAccess.open(this)
|
|
||||||
}
|
|
||||||
} else if (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
|
||||||
wanted.add(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
wanted.add(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||||
}
|
}
|
||||||
if (SessionPrefs.micEnabled(this) && !SessionPrefs.micAsked(this)
|
if (SessionPrefs.micEnabled(this) && !SessionPrefs.micAsked(this)
|
||||||
@@ -2020,6 +2033,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
|||||||
SessionPrefs.setMicAsked(this)
|
SessionPrefs.setMicAsked(this)
|
||||||
}
|
}
|
||||||
if (wanted.isNotEmpty()) requestPermissions(wanted.toTypedArray(), 1)
|
if (wanted.isNotEmpty()) requestPermissions(wanted.toTypedArray(), 1)
|
||||||
|
com.droiddeck.launcher.session.Onboarding.onFirstRunReady = firstRunReady
|
||||||
Thread({ com.droiddeck.launcher.stores.StoreAccounts.encryptAll(this) }, "store-credentials").start()
|
Thread({ com.droiddeck.launcher.stores.StoreAccounts.encryptAll(this) }, "store-credentials").start()
|
||||||
if (!SessionState.running) Thread({
|
if (!SessionState.running) Thread({
|
||||||
com.droiddeck.launcher.session.LogMigration.run(this)
|
com.droiddeck.launcher.session.LogMigration.run(this)
|
||||||
@@ -2111,7 +2125,10 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
|||||||
|
|
||||||
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
||||||
super.onWindowFocusChanged(hasFocus)
|
super.onWindowFocusChanged(hasFocus)
|
||||||
if (!hasFocus) triggerKeys.cancel()
|
if (!hasFocus) {
|
||||||
|
triggerKeys.cancel()
|
||||||
|
stopRightStickScroll()
|
||||||
|
}
|
||||||
if (hasFocus) {
|
if (hasFocus) {
|
||||||
com.droiddeck.launcher.ui.DualScreenPanel.yieldTo(taskId, false)
|
com.droiddeck.launcher.ui.DualScreenPanel.yieldTo(taskId, false)
|
||||||
applyLauncherFullscreen()
|
applyLauncherFullscreen()
|
||||||
@@ -2208,15 +2225,114 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
|||||||
}
|
}
|
||||||
|
|
||||||
private val triggerKeys = com.droiddeck.launcher.input.TriggerKeys { dispatchKeyEvent(it) }
|
private val triggerKeys = com.droiddeck.launcher.input.TriggerKeys { dispatchKeyEvent(it) }
|
||||||
|
private val rightStickLayouts = HashMap<Int, Boolean>()
|
||||||
|
private val rightStickScrollHandler = android.os.Handler(android.os.Looper.getMainLooper())
|
||||||
|
private var rightStickScrollDeviceId = -1
|
||||||
|
private var rightStickScrollDeflection = 0f
|
||||||
|
private var rightStickScrollScheduled = false
|
||||||
|
private var rightStickNextDispatchAt = 0L
|
||||||
|
private val rightStickScrollTick = object : Runnable {
|
||||||
|
override fun run() {
|
||||||
|
val deviceId = rightStickScrollDeviceId
|
||||||
|
if (!hasWindowFocus() || (compatLaunch != null && !compatLaunch!!.loading.ended) ||
|
||||||
|
deviceId == -1 ||
|
||||||
|
android.view.InputDevice.getDevice(deviceId) == null ||
|
||||||
|
kotlin.math.abs(rightStickScrollDeflection) < 0.55f) {
|
||||||
|
stopRightStickScroll()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
rightStickScrollScheduled = false
|
||||||
|
dispatchRightStickScroll(rightStickScrollDeflection, deviceId)
|
||||||
|
rightStickNextDispatchAt = android.os.SystemClock.uptimeMillis() + 130L
|
||||||
|
rightStickScrollHandler.postDelayed(this, 130L)
|
||||||
|
rightStickScrollScheduled = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun stopRightStickScroll() {
|
||||||
|
rightStickScrollHandler.removeCallbacks(rightStickScrollTick)
|
||||||
|
rightStickScrollDeviceId = -1
|
||||||
|
rightStickScrollDeflection = 0f
|
||||||
|
rightStickScrollScheduled = false
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun dispatchRightStickScroll(value: Float, deviceId: Int) {
|
||||||
|
val now = android.os.SystemClock.uptimeMillis()
|
||||||
|
val root = window.decorView
|
||||||
|
if (root.width <= 0 || root.height <= 0) return
|
||||||
|
val properties = android.view.MotionEvent.PointerProperties().apply {
|
||||||
|
id = 0
|
||||||
|
toolType = android.view.MotionEvent.TOOL_TYPE_MOUSE
|
||||||
|
}
|
||||||
|
val coordinates = android.view.MotionEvent.PointerCoords().apply {
|
||||||
|
x = root.width * 0.65f
|
||||||
|
y = root.height * 0.5f
|
||||||
|
setAxisValue(android.view.MotionEvent.AXIS_VSCROLL, -value * 3f)
|
||||||
|
}
|
||||||
|
val scroll = android.view.MotionEvent.obtain(
|
||||||
|
now, now, android.view.MotionEvent.ACTION_SCROLL, 1,
|
||||||
|
arrayOf(properties), arrayOf(coordinates), 0, 0, 1f, 1f,
|
||||||
|
deviceId, 0, android.view.InputDevice.SOURCE_MOUSE, 0,
|
||||||
|
)
|
||||||
|
try {
|
||||||
|
super.dispatchGenericMotionEvent(scroll)
|
||||||
|
} finally {
|
||||||
|
scroll.recycle()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun scrollPageWithRightStick(event: android.view.MotionEvent) {
|
||||||
|
if (event.actionMasked != android.view.MotionEvent.ACTION_MOVE ||
|
||||||
|
!com.droiddeck.launcher.input.PadBridge.isControllerMotionEvent(event)) return
|
||||||
|
val device = event.device ?: return
|
||||||
|
val rxRy = com.droiddeck.launcher.input.PadBridge.rightStickUsesRxRy(event, device, rightStickLayouts)
|
||||||
|
?: run {
|
||||||
|
if (rightStickScrollDeviceId == event.deviceId) stopRightStickScroll()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val axis = if (rxRy) android.view.MotionEvent.AXIS_RY else android.view.MotionEvent.AXIS_RZ
|
||||||
|
val value = event.getAxisValue(axis)
|
||||||
|
if (kotlin.math.abs(value) < 0.55f) {
|
||||||
|
if (rightStickScrollDeviceId == event.deviceId) stopRightStickScroll()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
rightStickScrollDeviceId = event.deviceId
|
||||||
|
rightStickScrollDeflection = value
|
||||||
|
if (!rightStickScrollScheduled) {
|
||||||
|
val delay = (rightStickNextDispatchAt - android.os.SystemClock.uptimeMillis()).coerceAtLeast(0L)
|
||||||
|
rightStickScrollHandler.postDelayed(rightStickScrollTick, delay)
|
||||||
|
rightStickScrollScheduled = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun dispatchGenericMotionEvent(event: android.view.MotionEvent): Boolean {
|
override fun dispatchGenericMotionEvent(event: android.view.MotionEvent): Boolean {
|
||||||
if (compatLaunch != null && !compatLaunch!!.loading.ended &&
|
if (compatLaunch != null && !compatLaunch!!.loading.ended &&
|
||||||
com.droiddeck.launcher.input.PadBridge.isControllerMotionEvent(event)) return true
|
com.droiddeck.launcher.input.PadBridge.isControllerMotionEvent(event)) {
|
||||||
|
stopRightStickScroll()
|
||||||
|
return true
|
||||||
|
}
|
||||||
triggerKeys.onMotion(event)
|
triggerKeys.onMotion(event)
|
||||||
|
scrollPageWithRightStick(event)
|
||||||
return super.dispatchGenericMotionEvent(event)
|
return super.dispatchGenericMotionEvent(event)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Volatile private var inFront = false
|
||||||
|
private var autoSteamPending = false
|
||||||
|
|
||||||
|
/** Runs on the worker thread that finishes setup, so the foreground state is read as setup completes, not when the UI thread gets to it. */
|
||||||
|
private val firstRunReady: () -> Unit = {
|
||||||
|
val front = inFront
|
||||||
|
runOnUiThread { if (front) autoStartSteam() }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun autoStartSteam() {
|
||||||
|
if (isFinishing || isDestroyed || SessionState.running || !inFront) return
|
||||||
|
if (busy) autoSteamPending = true else playSteam()
|
||||||
|
}
|
||||||
|
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
|
inFront = false
|
||||||
|
stopRightStickScroll()
|
||||||
compatLaunchVisible = false
|
compatLaunchVisible = false
|
||||||
if (android.os.Build.VERSION.SDK_INT >= 29) com.droiddeck.launcher.ui.DualScreenPanel.ownerPaused(taskId, true)
|
if (android.os.Build.VERSION.SDK_INT >= 29) com.droiddeck.launcher.ui.DualScreenPanel.ownerPaused(taskId, true)
|
||||||
super.onPause()
|
super.onPause()
|
||||||
@@ -2224,6 +2340,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
|||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
inFront = true
|
||||||
if (!homeChoiceOpen) {
|
if (!homeChoiceOpen) {
|
||||||
HomeApp.releaseUnusedHomeEntry(this)
|
HomeApp.releaseUnusedHomeEntry(this)
|
||||||
refreshHomeAppState()
|
refreshHomeAppState()
|
||||||
@@ -2359,6 +2476,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
|||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
// The queued launch was saved before this; a restored activity keeps its copy, and this one must not start it too.
|
// The queued launch was saved before this; a restored activity keeps its copy, and this one must not start it too.
|
||||||
|
if (com.droiddeck.launcher.session.Onboarding.onFirstRunReady === firstRunReady) com.droiddeck.launcher.session.Onboarding.onFirstRunReady = null
|
||||||
queuedLaunchRunner.destroy()
|
queuedLaunchRunner.destroy()
|
||||||
triggerKeys.cancel()
|
triggerKeys.cancel()
|
||||||
launchCoordinator.cancelAll()
|
launchCoordinator.cancelAll()
|
||||||
@@ -3658,6 +3776,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
|||||||
refresh()
|
refresh()
|
||||||
com.droiddeck.launcher.agent.AgentHost.refresh(this)
|
com.droiddeck.launcher.agent.AgentHost.refresh(this)
|
||||||
if (ok == true && LinuxRuntime.isInstalled(this)) { protons.checkUpdates(); protons.ensureSteamClient() }
|
if (ok == true && LinuxRuntime.isInstalled(this)) { protons.checkUpdates(); protons.ensureSteamClient() }
|
||||||
|
if (autoSteamPending) { autoSteamPending = false; autoStartSteam() }
|
||||||
}
|
}
|
||||||
}, "runtime-operation").start()
|
}, "runtime-operation").start()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ internal object MaliAutoRoute {
|
|||||||
|
|
||||||
fun userChoice(keyStored: Boolean, owner: String, route: String): Boolean = keyStored && owner != route
|
fun userChoice(keyStored: Boolean, owner: String, route: String): Boolean = keyStored && owner != route
|
||||||
|
|
||||||
|
fun venusStandsIn(available: Boolean, hostVulkanOk: Boolean, venusOn: Boolean, venusExplicit: Boolean, gpuName: String): Boolean =
|
||||||
|
available && hostVulkanOk && if (venusExplicit) venusOn else !venusStallsOn(gpuName)
|
||||||
|
|
||||||
|
// Steam's web helper dies on its first window through Venus on these (#2879), so the bridge stands in.
|
||||||
|
fun venusStallsOn(gpuName: String): Boolean = gpuName.contains("G2-Ultra", ignoreCase = true)
|
||||||
|
|
||||||
fun shouldEnd(ownsRoute: String, mali: Boolean, installedPair: Boolean): Boolean =
|
fun shouldEnd(ownsRoute: String, mali: Boolean, installedPair: Boolean): Boolean =
|
||||||
mali && installedPair && ownsRoute != NONE
|
mali && installedPair && ownsRoute != NONE
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.droiddeck.launcher
|
||||||
|
|
||||||
|
import com.droiddeck.launcher.gpu.SteamVr
|
||||||
|
|
||||||
|
internal class QuestSteamVrWatch(start: Long) {
|
||||||
|
private var startupDeadline = start + STARTUP_MS
|
||||||
|
private var lastRunning: Long? = null
|
||||||
|
private var graceUntil = start
|
||||||
|
private var wasPaused = false
|
||||||
|
|
||||||
|
// A frozen guest cannot answer the status call, so a status read during a freeze, or one that
|
||||||
|
// started before it, says nothing about SteamVR.
|
||||||
|
fun stopped(now: Long, status: SteamVr.Status, paused: Boolean): Boolean {
|
||||||
|
if (paused) {
|
||||||
|
wasPaused = true
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (wasPaused) {
|
||||||
|
wasPaused = false
|
||||||
|
graceUntil = now + RESUME_GRACE_MS
|
||||||
|
}
|
||||||
|
if (status == SteamVr.Status.RUNNING) {
|
||||||
|
lastRunning = now
|
||||||
|
graceUntil = now
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
val deadline = lastRunning?.plus(RUNNING_GRACE_MS) ?: startupDeadline
|
||||||
|
return now >= maxOf(deadline, graceUntil)
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val STARTUP_MS = 30_000L
|
||||||
|
const val RUNNING_GRACE_MS = 5_000L
|
||||||
|
const val RESUME_GRACE_MS = 15_000L
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -52,18 +52,17 @@ class QuestXrActivity : NativeActivity() {
|
|||||||
if (!closing) leaveXr("SteamVR start failed", sessionAlive())
|
if (!closing) leaveXr("SteamVR start failed", sessionAlive())
|
||||||
return@Thread
|
return@Thread
|
||||||
}
|
}
|
||||||
val startupDeadline = SystemClock.elapsedRealtime() + 30_000
|
val watch = QuestSteamVrWatch(SystemClock.elapsedRealtime())
|
||||||
var lastRunning: Long? = null
|
|
||||||
while (!closing) {
|
while (!closing) {
|
||||||
if (!sessionAlive()) {
|
if (!sessionAlive()) {
|
||||||
leaveXr("Steam session ended", false)
|
leaveXr("Steam session ended", false)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
steamVrStatus = SteamVr.status(this)
|
val pausedBefore = guestPaused()
|
||||||
val now = SystemClock.elapsedRealtime()
|
val status = SteamVr.status(this)
|
||||||
if (steamVrStatus == SteamVr.Status.RUNNING) lastRunning = now
|
val paused = pausedBefore || guestPaused()
|
||||||
val deadline = lastRunning?.plus(5_000) ?: startupDeadline
|
if (!paused) steamVrStatus = status
|
||||||
if (steamVrStatus != SteamVr.Status.RUNNING && now >= deadline) {
|
if (watch.stopped(SystemClock.elapsedRealtime(), status, paused)) {
|
||||||
leaveXr("SteamVR stopped or did not finish starting", true)
|
leaveXr("SteamVR stopped or did not finish starting", true)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -81,6 +80,8 @@ class QuestXrActivity : NativeActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun guestPaused() = SessionState.suspending || SessionState.suspended || SessionState.resuming
|
||||||
|
|
||||||
private fun sessionAlive() = SessionState.running && !SessionState.stopRequested &&
|
private fun sessionAlive() = SessionState.running && !SessionState.stopRequested &&
|
||||||
sessionId != null && SessionState.sessionId == sessionId
|
sessionId != null && SessionState.sessionId == sessionId
|
||||||
|
|
||||||
|
|||||||
@@ -2916,6 +2916,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
|||||||
val runtimeDir = File(filesDir, ".wayland-rt").apply { mkdirs() }
|
val runtimeDir = File(filesDir, ".wayland-rt").apply { mkdirs() }
|
||||||
FileUtils.copyAsset(this, "wayland/keymap.xkb", File(runtimeDir, "keymap.xkb"))
|
FileUtils.copyAsset(this, "wayland/keymap.xkb", File(runtimeDir, "keymap.xkb"))
|
||||||
com.droiddeck.launcher.input.VrControllers.publish(this)
|
com.droiddeck.launcher.input.VrControllers.publish(this)
|
||||||
|
com.droiddeck.launcher.session.QuestSteamVrLaunch.publish(this)
|
||||||
|
|
||||||
val turnip = TurnipDriver(this)
|
val turnip = TurnipDriver(this)
|
||||||
com.droiddeck.launcher.gpu.DriverSetupLog.write(this, "surface.driver-setup")
|
com.droiddeck.launcher.gpu.DriverSetupLog.write(this, "surface.driver-setup")
|
||||||
@@ -6371,6 +6372,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
|||||||
}
|
}
|
||||||
if (CompositorHost.isStarted) applyFrameGen(force = true)
|
if (CompositorHost.isStarted) applyFrameGen(force = true)
|
||||||
applyFollowOrientation(resources.configuration)
|
applyFollowOrientation(resources.configuration)
|
||||||
|
uiHandler.removeCallbacks(questSteamVrRequest)
|
||||||
|
if (com.droiddeck.launcher.session.QuestExperimental.isSupported()) uiHandler.post(questSteamVrRequest)
|
||||||
if (runtimeRemovalBlocked) return
|
if (runtimeRemovalBlocked) return
|
||||||
if (!SessionState.suspended) pausedFrame = null
|
if (!SessionState.suspended) pausedFrame = null
|
||||||
com.droiddeck.launcher.ui.Motion.refresh(this)
|
com.droiddeck.launcher.ui.Motion.refresh(this)
|
||||||
@@ -6430,10 +6433,19 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
|
uiHandler.removeCallbacks(questSteamVrRequest)
|
||||||
departureCleanup()
|
departureCleanup()
|
||||||
super.onPause()
|
super.onPause()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val questSteamVrRequest = object : Runnable {
|
||||||
|
override fun run() {
|
||||||
|
if (com.droiddeck.launcher.session.QuestSteamVrLaunch.takeRequest(this@SessionActivity) &&
|
||||||
|
SessionState.running && SessionState.mode == SessionService.MODE_STEAM) steamVrAction("start")
|
||||||
|
uiHandler.postDelayed(this, 1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun departureCleanup() {
|
private fun departureCleanup() {
|
||||||
com.droiddeck.launcher.input.SystemKeyCapture.detach(this)
|
com.droiddeck.launcher.input.SystemKeyCapture.detach(this)
|
||||||
com.droiddeck.launcher.input.HomeButtonShortcuts.detach(this)
|
com.droiddeck.launcher.input.HomeButtonShortcuts.detach(this)
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.droiddeck.launcher.agent
|
package com.droiddeck.launcher.agent
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Environment
|
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
import android.os.SystemClock
|
import android.os.SystemClock
|
||||||
@@ -564,7 +563,7 @@ object AgentHost {
|
|||||||
(if (connectAdb) "adb start-server >/dev/null 2>&1; adb connect \"\$ADB_SERIAL\" >/dev/null 2>&1; " else "") +
|
(if (connectAdb) "adb start-server >/dev/null 2>&1; adb connect \"\$ADB_SERIAL\" >/dev/null 2>&1; " else "") +
|
||||||
"cd \"$1\" 2>/dev/null; shift; exec \"$@\"", "sh", workdir,
|
"cd \"$1\" 2>/dev/null; shift; exec \"$@\"", "sh", workdir,
|
||||||
)
|
)
|
||||||
val proot = LinuxRuntime.command(app, null, null, Environment.getExternalStorageDirectory(), null, env + shell + command, fakeRoot)
|
val proot = LinuxRuntime.command(app, null, null, LinuxRuntime.sharedStorage(app), null, env + shell + command, fakeRoot)
|
||||||
return ProcessBuilder(proot).redirectErrorStream(true).apply {
|
return ProcessBuilder(proot).redirectErrorStream(true).apply {
|
||||||
environment().apply {
|
environment().apply {
|
||||||
remove("LD_PRELOAD"); remove("LD_AUDIT"); remove("LD_LIBRARY_PATH")
|
remove("LD_PRELOAD"); remove("LD_AUDIT"); remove("LD_LIBRARY_PATH")
|
||||||
|
|||||||
@@ -8,8 +8,11 @@ import androidx.compose.runtime.mutableStateListOf
|
|||||||
import androidx.compose.runtime.mutableStateMapOf
|
import androidx.compose.runtime.mutableStateMapOf
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
|
import com.droiddeck.launcher.R
|
||||||
|
import com.droiddeck.launcher.core.WirelessAdbFix
|
||||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||||
import com.droiddeck.launcher.session.OrphanReaper
|
import com.droiddeck.launcher.session.OrphanReaper
|
||||||
|
import com.droiddeck.launcher.session.QuestExperimental
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
@@ -88,6 +91,8 @@ object AgentSetup {
|
|||||||
private fun completedKey(harness: AgentHarness) = "setup_completed_${harness.id}"
|
private fun completedKey(harness: AgentHarness) = "setup_completed_${harness.id}"
|
||||||
|
|
||||||
private val main = Handler(Looper.getMainLooper())
|
private val main = Handler(Looper.getMainLooper())
|
||||||
|
/** Advanced by every Allow, so a connection check started before it cannot overwrite what it found. */
|
||||||
|
private var connectionGeneration = 0
|
||||||
private const val REPO = "https://github.com/Droid-Deck/DroidDeck.git"
|
private const val REPO = "https://github.com/Droid-Deck/DroidDeck.git"
|
||||||
private const val CHECKOUT = "/root/DroidDeck"
|
private const val CHECKOUT = "/root/DroidDeck"
|
||||||
private val HELPERS = listOf("android-open", "dd-gh-login", "droiddeckctl", "droiddeck-scenario")
|
private val HELPERS = listOf("android-open", "dd-gh-login", "droiddeckctl", "droiddeck-scenario")
|
||||||
@@ -104,6 +109,7 @@ object AgentSetup {
|
|||||||
val harness = AgentHost.harness
|
val harness = AgentHost.harness
|
||||||
keys = harness.keys(LinuxRuntime.rootDir(app))
|
keys = harness.keys(LinuxRuntime.rootDir(app))
|
||||||
val probes = mutableListOf<Pair<Step, List<String>>>()
|
val probes = mutableListOf<Pair<Step, List<String>>>()
|
||||||
|
val generation = connectionGeneration
|
||||||
for (step in Step.entries) if (status[step] != Status.WORKING) {
|
for (step in Step.entries) if (status[step] != Status.WORKING) {
|
||||||
when (step) {
|
when (step) {
|
||||||
Step.INSTALL -> set(step, if (harness.files.all { AgentHost.guestFileExists(app, it) }) Status.DONE else Status.TODO)
|
Step.INSTALL -> set(step, if (harness.files.all { AgentHost.guestFileExists(app, it) }) Status.DONE else Status.TODO)
|
||||||
@@ -114,7 +120,9 @@ object AgentSetup {
|
|||||||
detail.remove(step)
|
detail.remove(step)
|
||||||
Thread({
|
Thread({
|
||||||
val live = com.droiddeck.launcher.core.WirelessAdbFix.liveConnectAddress(app) != null
|
val live = com.droiddeck.launcher.core.WirelessAdbFix.liveConnectAddress(app) != null
|
||||||
set(step, if (live) Status.DONE else Status.TODO)
|
main.post {
|
||||||
|
if (generation == connectionGeneration && status[step] != Status.WORKING) status[step] = if (live) Status.DONE else Status.TODO
|
||||||
|
}
|
||||||
}, "agent-connection").start()
|
}, "agent-connection").start()
|
||||||
} else probes += step to listOf("sh", "-c",
|
} else probes += step to listOf("sh", "-c",
|
||||||
"for i in 1 2 3; do adb connect \"\$ADB_SERIAL\" >/dev/null 2>&1; " +
|
"for i in 1 2 3; do adb connect \"\$ADB_SERIAL\" >/dev/null 2>&1; " +
|
||||||
@@ -123,7 +131,7 @@ object AgentSetup {
|
|||||||
Step.GITHUB -> probes += step to listOf("gh", "auth", "status")
|
Step.GITHUB -> probes += step to listOf("gh", "auth", "status")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Thread({ for ((step, command) in probes) probe(app, harness, step, command) }, "agent-checks").start()
|
Thread({ for ((step, command) in probes) probe(app, harness, step, command, generation) }, "agent-checks").start()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The last failed refresh ends the script: the installs after it would run from stale indexes and could report success. */
|
/** The last failed refresh ends the script: the installs after it would run from stale indexes and could report success. */
|
||||||
@@ -141,6 +149,22 @@ object AgentSetup {
|
|||||||
/** Runs [step]'s action. [CONNECTION] is the app's own pairing flow, so the caller opens it. */
|
/** Runs [step]'s action. [CONNECTION] is the app's own pairing flow, so the caller opens it. */
|
||||||
fun run(context: Context, step: Step) = run(context, step, null)
|
fun run(context: Context, step: Step) = run(context, step, null)
|
||||||
|
|
||||||
|
/** The [Step.CONNECTION] action on a Quest, which has no pairing screen; see [WirelessAdbFix.trustOnDevice]. */
|
||||||
|
fun trustOnDevice(context: Context) {
|
||||||
|
val app = context.applicationContext
|
||||||
|
connectionGeneration++
|
||||||
|
status[Step.CONNECTION] = Status.WORKING
|
||||||
|
detail[Step.CONNECTION] = app.getString(R.string.agent_connection_quest_waiting)
|
||||||
|
Thread({
|
||||||
|
val ok = runCatching { WirelessAdbFix.trustOnDevice(app) }.isSuccess
|
||||||
|
main.post {
|
||||||
|
status[Step.CONNECTION] = if (ok) Status.DONE else Status.FAILED
|
||||||
|
if (ok) detail.remove(Step.CONNECTION) else detail[Step.CONNECTION] = app.getString(R.string.agent_connection_quest_failed)
|
||||||
|
if (ok) check(app)
|
||||||
|
}
|
||||||
|
}, "agent-quest-trust").start()
|
||||||
|
}
|
||||||
|
|
||||||
/** Opens the page where a provider's key is made, as the sign-in of a harness that takes pasted keys. */
|
/** Opens the page where a provider's key is made, as the sign-in of a harness that takes pasted keys. */
|
||||||
fun openKeyPage(context: Context, page: String) = run(context, Step.SIGN_IN, listOf("/root/.local/bin/android-open", page))
|
fun openKeyPage(context: Context, page: String) = run(context, Step.SIGN_IN, listOf("/root/.local/bin/android-open", page))
|
||||||
|
|
||||||
@@ -216,7 +240,7 @@ object AgentSetup {
|
|||||||
detail.clear()
|
detail.clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun probe(app: Context, harness: AgentHarness, step: Step, command: List<String>) {
|
private fun probe(app: Context, harness: AgentHarness, step: Step, command: List<String>, generation: Int) {
|
||||||
var output = ""
|
var output = ""
|
||||||
val ok = runCatching {
|
val ok = runCatching {
|
||||||
val child = AgentHost.guest(app, command, connectAdb = step == Step.CONNECTION).start()
|
val child = AgentHost.guest(app, command, connectAdb = step == Step.CONNECTION).start()
|
||||||
@@ -232,11 +256,14 @@ object AgentSetup {
|
|||||||
}.onFailure { output = it.message.orEmpty() }.getOrDefault(false)
|
}.onFailure { output = it.message.orEmpty() }.getOrDefault(false)
|
||||||
main.post {
|
main.post {
|
||||||
if (AgentHost.harness != harness) return@post
|
if (AgentHost.harness != harness) return@post
|
||||||
|
// A running or newer Allow owns the row, including the instructions it shows while it waits.
|
||||||
|
if (step == Step.CONNECTION && (generation != connectionGeneration || status[step] == Status.WORKING)) return@post
|
||||||
if (status[step] != Status.WORKING) status[step] = if (ok) Status.DONE else Status.TODO
|
if (status[step] != Status.WORKING) status[step] = if (ok) Status.DONE else Status.TODO
|
||||||
val last = output.lines().lastOrNull { it.isNotBlank() && !noise(it.trim()) }?.trim()?.take(160)
|
val last = output.lines().lastOrNull { it.isNotBlank() && !noise(it.trim()) }?.trim()?.take(160)
|
||||||
when {
|
when {
|
||||||
ok -> detail.remove(step)
|
ok -> detail.remove(step)
|
||||||
step == Step.CONNECTION -> detail[step] = app.getString(com.droiddeck.launcher.R.string.agent_connection_off)
|
step == Step.CONNECTION -> detail[step] = app.getString(
|
||||||
|
if (QuestExperimental.isSupported()) R.string.agent_connection_quest_off else R.string.agent_connection_off)
|
||||||
step.required && last != null -> detail[step] = last
|
step.required && last != null -> detail[step] = last
|
||||||
}
|
}
|
||||||
if (ready) AgentHost.prefs(app).edit().putBoolean(completedKey(harness), true).apply()
|
if (ready) AgentHost.prefs(app).edit().putBoolean(completedKey(harness), true).apply()
|
||||||
|
|||||||
@@ -61,7 +61,19 @@ object GameEnvironment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun effective(config: Config, preset: String, scope: String, forceSsbs: Boolean = false): Map<String, String?> =
|
fun effective(config: Config, preset: String, scope: String, forceSsbs: Boolean = false): Map<String, String?> =
|
||||||
defaults(preset, forceSsbs) + config.shared + if (scope.isEmpty()) emptyMap() else config.games[scope].orEmpty()
|
defaults(preset, forceSsbs) + config.shared + if (scope.isEmpty()) emptyMap() else knownGames[scope].orEmpty() + config.games[scope].orEmpty()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* What some Steam games need here whatever the shared settings say; the game's own settings still win.
|
||||||
|
* GTA III dies at 0042A703 when a new game starts with FEX's reduced x87 precision, as the Rockstar store copy does.
|
||||||
|
*/
|
||||||
|
val knownGames: Map<String, Map<String, String?>> = mapOf(
|
||||||
|
"12100" to mapOf("FEX_X87REDUCEDPRECISION" to "0"),
|
||||||
|
)
|
||||||
|
|
||||||
|
/** [config] with [knownGames] folded under each game's own settings, for the guest to read. */
|
||||||
|
fun withKnownGames(config: Config): Config =
|
||||||
|
config.copy(games = config.games + knownGames.mapValues { (scope, known) -> known + config.games[scope].orEmpty() })
|
||||||
|
|
||||||
fun hasOverride(config: Config, scope: String, name: String): Boolean =
|
fun hasOverride(config: Config, scope: String, name: String): Boolean =
|
||||||
scope.isNotEmpty() && config.entries(scope).containsKey(name)
|
scope.isNotEmpty() && config.entries(scope).containsKey(name)
|
||||||
@@ -78,7 +90,7 @@ object GameEnvironment {
|
|||||||
val entries = config.games[scope].orEmpty()
|
val entries = config.games[scope].orEmpty()
|
||||||
if (FexPreset.environmentKeys.none(entries::containsKey)) return null
|
if (FexPreset.environmentKeys.none(entries::containsKey)) return null
|
||||||
return FexPreset.all.firstOrNull { preset ->
|
return FexPreset.all.firstOrNull { preset ->
|
||||||
val expected = FexPreset.environment(preset.id)
|
val expected = presetFor(scope, preset.id)
|
||||||
FexPreset.environmentKeys.all { key -> entries.containsKey(key) && entries[key] == expected[key] }
|
FexPreset.environmentKeys.all { key -> entries.containsKey(key) && entries[key] == expected[key] }
|
||||||
}?.id ?: CUSTOM_FEX_PRESET
|
}?.id ?: CUSTOM_FEX_PRESET
|
||||||
}
|
}
|
||||||
@@ -88,12 +100,16 @@ object GameEnvironment {
|
|||||||
require(preset == null || FexPreset.all.any { it.id == preset })
|
require(preset == null || FexPreset.all.any { it.id == preset })
|
||||||
val entries = config.entries(scope).filterKeys { it !in FexPreset.environmentKeys }.toMutableMap()
|
val entries = config.entries(scope).filterKeys { it !in FexPreset.environmentKeys }.toMutableMap()
|
||||||
if (preset != null) {
|
if (preset != null) {
|
||||||
val values = FexPreset.environment(preset)
|
val values = presetFor(scope, preset)
|
||||||
FexPreset.environmentKeys.forEach { key -> entries[key] = values[key] }
|
FexPreset.environmentKeys.forEach { key -> entries[key] = values[key] }
|
||||||
}
|
}
|
||||||
return config.withEntries(scope, entries)
|
return config.withEntries(scope, entries)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** A FEX preset as a game gets it: picking one never undoes a fix the game is known to need. */
|
||||||
|
private fun presetFor(scope: String, preset: String): Map<String, String?> =
|
||||||
|
FexPreset.environment(preset) + knownGames[scope].orEmpty().filterKeys { it in FexPreset.environmentKeys }
|
||||||
|
|
||||||
const val CUSTOM_FEX_PRESET = "__custom__"
|
const val CUSTOM_FEX_PRESET = "__custom__"
|
||||||
|
|
||||||
val syncBackends = listOf(SessionPrefs.SYNC_NTSYNC, SessionPrefs.SYNC_FSYNC, SessionPrefs.SYNC_ESYNC, SessionPrefs.SYNC_WINESERVER)
|
val syncBackends = listOf(SessionPrefs.SYNC_NTSYNC, SessionPrefs.SYNC_FSYNC, SessionPrefs.SYNC_ESYNC, SessionPrefs.SYNC_WINESERVER)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.droiddeck.launcher.core
|
package com.droiddeck.launcher.core
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.pm.PackageManager
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
|
|
||||||
@@ -19,4 +20,14 @@ object GlobalSettings {
|
|||||||
fun developerOptionsOn(context: Context): Boolean = isOn(context, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED)
|
fun developerOptionsOn(context: Context): Boolean = isOn(context, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED)
|
||||||
|
|
||||||
fun wirelessDebuggingOn(context: Context): Boolean = isOn(context, "adb_wifi_enabled")
|
fun wirelessDebuggingOn(context: Context): Boolean = isOn(context, "adb_wifi_enabled")
|
||||||
|
|
||||||
|
/**
|
||||||
|
* True when it was off and is now on. Quest only, where Settings has no switch for it; it needs
|
||||||
|
* WRITE_SECURE_SETTINGS granted over adb.
|
||||||
|
*/
|
||||||
|
fun turnOnWirelessDebugging(context: Context): Boolean {
|
||||||
|
if (!com.droiddeck.launcher.session.QuestExperimental.isSupported() || wirelessDebuggingOn(context)) return false
|
||||||
|
if (context.checkSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) return false
|
||||||
|
return runCatching { Settings.Global.putInt(context.contentResolver, "adb_wifi_enabled", 1) }.getOrDefault(false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -22,6 +22,9 @@ object WirelessAdbFix {
|
|||||||
private const val HOST_FILE = "wireless-adb-host.txt"
|
private const val HOST_FILE = "wireless-adb-host.txt"
|
||||||
private const val CONNECTION_FILE = "wireless-adb-connection.txt"
|
private const val CONNECTION_FILE = "wireless-adb-connection.txt"
|
||||||
const val LOOPBACK = "127.0.0.1"
|
const val LOOPBACK = "127.0.0.1"
|
||||||
|
private const val TCP_PORT = 5555
|
||||||
|
private const val WIRELESS_START_MS = 2_000L
|
||||||
|
private const val NETWORK_PROMPT_MS = 30_000L
|
||||||
|
|
||||||
private data class SavedConnection(val host: String, val port: Int?)
|
private data class SavedConnection(val host: String, val port: Int?)
|
||||||
|
|
||||||
@@ -55,6 +58,23 @@ object WirelessAdbFix {
|
|||||||
writeAtomically(context, File(context.noBackupFilesDir, CONNECTION_FILE), ByteArray(0))
|
writeAtomically(context, File(context.noBackupFilesDir, CONNECTION_FILE), ByteArray(0))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Quest has no pairing screen. adbd in TCP mode (`adb tcpip 5555`) asks "Allow debugging?" for an
|
||||||
|
* unknown key, and Wireless debugging accepts a key allowed there, so this stands in for pairing.
|
||||||
|
* Blocks until the prompt is answered or times out.
|
||||||
|
*/
|
||||||
|
fun trustOnDevice(context: Context) {
|
||||||
|
val app = context.applicationContext
|
||||||
|
// Already trusted, as after a reboot: Wireless debugging takes the key, and port 5555 is closed by then.
|
||||||
|
val live = if (savedConnection(app) != null) liveConnectAddress(app) else null
|
||||||
|
if (live != null && acceptsKey(app, live.substringBeforeLast(':').trim('[', ']'), live.substringAfterLast(':').toInt())) return
|
||||||
|
GlobalSettings.turnOnWirelessDebugging(app)
|
||||||
|
loadOrCreateIdentity(app)
|
||||||
|
Kadb.create(LOOPBACK, TCP_PORT, 2_000, 120_000).use { check(it.shell("true").exitCode == 0) }
|
||||||
|
writeAtomically(app, File(app.noBackupFilesDir, HOST_FILE), LOOPBACK.toByteArray())
|
||||||
|
writeAtomically(app, File(app.noBackupFilesDir, CONNECTION_FILE), ByteArray(0))
|
||||||
|
}
|
||||||
|
|
||||||
private fun savedConnection(context: Context): SavedConnection? {
|
private fun savedConnection(context: Context): SavedConnection? {
|
||||||
val directory = context.applicationContext.noBackupFilesDir
|
val directory = context.applicationContext.noBackupFilesDir
|
||||||
if (!File(directory, CERT_FILE).isFile || !File(directory, KEY_FILE).isFile) return null
|
if (!File(directory, CERT_FILE).isFile || !File(directory, KEY_FILE).isFile) return null
|
||||||
@@ -78,10 +98,17 @@ object WirelessAdbFix {
|
|||||||
fun liveConnectAddress(context: Context): String? {
|
fun liveConnectAddress(context: Context): String? {
|
||||||
val app = context.applicationContext
|
val app = context.applicationContext
|
||||||
val saved = savedConnection(app) ?: return null
|
val saved = savedConnection(app) ?: return null
|
||||||
|
val turnedOn = GlobalSettings.turnOnWirelessDebugging(app)
|
||||||
val host = if (':' in saved.host) "[${saved.host}]" else saved.host
|
val host = if (':' in saved.host) "[${saved.host}]" else saved.host
|
||||||
saved.port?.takeIf { answers(saved.host, it) }?.let { return "$host:$it" }
|
if (!turnedOn) saved.port?.takeIf { answers(saved.host, it) }?.let { return "$host:$it" }
|
||||||
val loopback = runCatching { InetAddress.getByName(saved.host).isLoopbackAddress }.getOrDefault(false)
|
val loopback = runCatching { InetAddress.getByName(saved.host).isLoopbackAddress }.getOrDefault(false)
|
||||||
val port = if (loopback) loopbackAdbPort(app) else findConnectPort(app, saved.host, accept = { answers(saved.host, it) })
|
// Turning it on can first ask "Allow wireless debugging on this network?", so keep looking while that is answered.
|
||||||
|
val deadline = android.os.SystemClock.elapsedRealtime() + if (turnedOn) NETWORK_PROMPT_MS else 0L
|
||||||
|
var port: Int?
|
||||||
|
do {
|
||||||
|
if (turnedOn) Thread.sleep(WIRELESS_START_MS)
|
||||||
|
port = if (loopback) loopbackAdbPort(app) else findConnectPort(app, saved.host, accept = { answers(saved.host, it) })
|
||||||
|
} while (port == null && android.os.SystemClock.elapsedRealtime() < deadline)
|
||||||
port ?: return null
|
port ?: return null
|
||||||
saveConnection(app, saved.host, port)
|
saveConnection(app, saved.host, port)
|
||||||
return "$host:$port"
|
return "$host:$port"
|
||||||
@@ -105,10 +132,12 @@ object WirelessAdbFix {
|
|||||||
}
|
}
|
||||||
}.apply { start() }
|
}.apply { start() }
|
||||||
}.forEach { it.join() }
|
}.forEach { it.join() }
|
||||||
|
return open.sorted().firstOrNull { port -> acceptsKey(app, LOOPBACK, port) }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun acceptsKey(app: Context, host: String, port: Int): Boolean {
|
||||||
loadOrCreateIdentity(app)
|
loadOrCreateIdentity(app)
|
||||||
return open.sorted().firstOrNull { port ->
|
return runCatching { Kadb.create(host, port, 1_000, 3_000).use { it.shell("true").exitCode == 0 } }.getOrDefault(false)
|
||||||
runCatching { Kadb.create(LOOPBACK, port, 1_000, 3_000).use { it.shell("true").exitCode == 0 } }.getOrDefault(false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private val EPHEMERAL_PORTS = 32768..60999
|
private val EPHEMERAL_PORTS = 32768..60999
|
||||||
|
|||||||
@@ -8,9 +8,18 @@ import android.os.Environment
|
|||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
|
|
||||||
object AllFilesAccess {
|
object AllFilesAccess {
|
||||||
|
private val VOLUME = Regex("^(/storage/emulated/\\d+|/storage/[^/]+|/sdcard)(/.*)?$")
|
||||||
|
private val APP_FOLDERS = listOf("/Android/data", "/Android/obb")
|
||||||
|
|
||||||
fun missing(sdk: Int = Build.VERSION.SDK_INT, granted: () -> Boolean = { Environment.isExternalStorageManager() }): Boolean =
|
fun missing(sdk: Int = Build.VERSION.SDK_INT, granted: () -> Boolean = { Environment.isExternalStorageManager() }): Boolean =
|
||||||
sdk >= Build.VERSION_CODES.R && !granted()
|
sdk >= Build.VERSION_CODES.R && !granted()
|
||||||
|
|
||||||
|
/** Whether reading [path] takes all-files access: shared storage, outside the per-app folders directly under a volume's root, which Android always lets the app use. */
|
||||||
|
fun covers(path: String): Boolean {
|
||||||
|
val inside = VOLUME.matchEntire(path)?.groupValues?.get(2) ?: return false
|
||||||
|
return APP_FOLDERS.none { inside == it || inside.startsWith("$it/") }
|
||||||
|
}
|
||||||
|
|
||||||
fun open(context: Context) {
|
fun open(context: Context) {
|
||||||
val app = Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, Uri.parse("package:" + context.packageName))
|
val app = Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, Uri.parse("package:" + context.packageName))
|
||||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
|
|||||||
@@ -504,13 +504,15 @@ fun FileManagerScreen(
|
|||||||
}
|
}
|
||||||
val drives = remember(storageTick) { StorageRoots.list(context) }
|
val drives = remember(storageTick) { StorageRoots.list(context) }
|
||||||
var accessDrive by remember { mutableStateOf<String?>(null) }
|
var accessDrive by remember { mutableStateOf<String?>(null) }
|
||||||
|
var accessWasMissing by remember { mutableStateOf(AllFilesAccess.missing()) }
|
||||||
|
var accessDeclined by remember { mutableStateOf(false) }
|
||||||
fun unreadable(drive: StorageRoot) {
|
fun unreadable(drive: StorageRoot) {
|
||||||
if (AllFilesAccess.missing()) accessDrive = drive.label
|
if (AllFilesAccess.missing()) accessDrive = drive.label
|
||||||
else Toast.makeText(context, context.getString(R.string.fm_drive_not_readable, drive.label), Toast.LENGTH_SHORT).show()
|
else Toast.makeText(context, context.getString(R.string.fm_drive_not_readable, drive.label), Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
accessDrive?.let { label ->
|
accessDrive?.let { label ->
|
||||||
OutlinedAlertDialog(
|
OutlinedAlertDialog(
|
||||||
onDismissRequest = { accessDrive = null },
|
onDismissRequest = { accessDrive = null; accessDeclined = true },
|
||||||
title = { Text(stringResource(R.string.fm_drive_access_title, label)) },
|
title = { Text(stringResource(R.string.fm_drive_access_title, label)) },
|
||||||
text = { Text(stringResource(R.string.fm_drive_access_text)) },
|
text = { Text(stringResource(R.string.fm_drive_access_text)) },
|
||||||
confirmButton = {
|
confirmButton = {
|
||||||
@@ -519,9 +521,17 @@ fun FileManagerScreen(
|
|||||||
AllFilesAccess.open(context)
|
AllFilesAccess.open(context)
|
||||||
}, modifier = Modifier.focusGlide(CircleShape)) { Text(stringResource(R.string.upd_open_settings)) }
|
}, modifier = Modifier.focusGlide(CircleShape)) { Text(stringResource(R.string.upd_open_settings)) }
|
||||||
},
|
},
|
||||||
dismissButton = { TextButton(onClick = { accessDrive = null }, modifier = Modifier.focusGlide(CircleShape)) { Text(stringResource(R.string.common_cancel)) } },
|
dismissButton = { TextButton(onClick = { accessDrive = null; accessDeclined = true }, modifier = Modifier.focusGlide(CircleShape)) { Text(stringResource(R.string.common_cancel)) } },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
LaunchedEffect(currentDir, storageTick) {
|
||||||
|
if (!AllFilesAccess.missing()) {
|
||||||
|
if (accessWasMissing) { accessWasMissing = false; loadDirectory(currentDir, resetScroll = false, record = false) }
|
||||||
|
} else {
|
||||||
|
accessWasMissing = true
|
||||||
|
if (!accessDeclined && accessDrive == null && AllFilesAccess.covers(currentDir.path)) accessDrive = drives.firstOrNull { currentDir.path.startsWith(it.dir.path) }?.label ?: context.getString(R.string.fm_drive_internal)
|
||||||
|
}
|
||||||
|
}
|
||||||
val linuxRoot = remember(storageTick) {
|
val linuxRoot = remember(storageTick) {
|
||||||
com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(context).takeIf { File(it, "usr").isDirectory }
|
com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(context).takeIf { File(it, "usr").isDirectory }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -499,6 +499,7 @@ object AddedGames {
|
|||||||
launchOptions = when {
|
launchOptions = when {
|
||||||
sidecar == null -> SessionPrefs.addedGameLaunch(context, folder.path)
|
sidecar == null -> SessionPrefs.addedGameLaunch(context, folder.path)
|
||||||
sidecar.store == Store.UBISOFT -> com.droiddeck.launcher.stores.ubisoft.UbisoftConnect.launchOptions(context)
|
sidecar.store == Store.UBISOFT -> com.droiddeck.launcher.stores.ubisoft.UbisoftConnect.launchOptions(context)
|
||||||
|
sidecar.store == Store.EA -> SessionPrefs.addedGameLaunch(context, folder.path)
|
||||||
else -> ""
|
else -> ""
|
||||||
},
|
},
|
||||||
single = single != null, steamProgram = steamProgram))
|
single = single != null, steamProgram = steamProgram))
|
||||||
@@ -585,7 +586,8 @@ object AddedGames {
|
|||||||
}.getOrNull()
|
}.getOrNull()
|
||||||
|
|
||||||
fun writeListing(context: Context, games: List<Game>,
|
fun writeListing(context: Context, games: List<Game>,
|
||||||
extra: List<JSONObject> = listOfNotNull(com.droiddeck.launcher.stores.epic.EpicClient.steamListing(context))): File {
|
extra: List<JSONObject> = listOfNotNull(com.droiddeck.launcher.stores.epic.EpicClient.steamListing(context)) +
|
||||||
|
com.droiddeck.launcher.runtime.RecompShortcuts.listing(context)): File {
|
||||||
val file = listingFile(context).apply { parentFile?.mkdirs() }
|
val file = listingFile(context).apply { parentFile?.mkdirs() }
|
||||||
val json = StringBuilder("[")
|
val json = StringBuilder("[")
|
||||||
games.forEachIndexed { i, g ->
|
games.forEachIndexed { i, g ->
|
||||||
|
|||||||
@@ -248,11 +248,14 @@ object Library {
|
|||||||
AddedGames.guestPath(context, g.folder).let { it == null || it !in claimed })
|
AddedGames.guestPath(context, g.folder).let { it == null || it !in claimed })
|
||||||
}
|
}
|
||||||
val played = shortcutsLastPlayed(SessionPrefs.steamRoot(context, arch))
|
val played = shortcutsLastPlayed(SessionPrefs.steamRoot(context, arch))
|
||||||
return (steam + own.map { g -> addedGame(context, g, roots, played[g.appId] ?: 0L) }).distinctBy { it.gameId }
|
val recomps = com.droiddeck.launcher.runtime.RecompShortcuts.library(context) { appId, gameId ->
|
||||||
|
maxOf(played[appId] ?: 0L, recordedPlay(context, gameId))
|
||||||
|
}
|
||||||
|
return (steam + own.map { g -> addedGame(context, g, roots, played[g.appId] ?: 0L) } + recomps).distinctBy { it.gameId }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun recordPlayed(context: Context, game: SteamGame) {
|
fun recordPlayed(context: Context, game: SteamGame) {
|
||||||
if (game.library == ADDED) recordPlayed(context, game.gameIdString)
|
if (game.library == ADDED || game.library == com.droiddeck.launcher.runtime.RecompShortcuts.SOURCE) recordPlayed(context, game.gameIdString)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun recordPlayed(context: Context, gameId: String) {
|
fun recordPlayed(context: Context, gameId: String) {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public final class PadBridge {
|
|||||||
private final PadState[] playerStates = new PadState[SLOTS];
|
private final PadState[] playerStates = new PadState[SLOTS];
|
||||||
private final float[][] rawSticks = new float[SLOTS][4];
|
private final float[][] rawSticks = new float[SLOTS][4];
|
||||||
private final Map<Integer, Boolean> rightStickLayouts = new HashMap<>();
|
private final Map<Integer, Boolean> rightStickLayouts = new HashMap<>();
|
||||||
private final boolean[][] keyTriggers = new boolean[SLOTS][2];
|
private final TriggerKey[][] keyTriggers = TriggerKey.slots(SLOTS);
|
||||||
private final int[] retainedSticks = new int[SLOTS];
|
private final int[] retainedSticks = new int[SLOTS];
|
||||||
private final PadState effectiveState = new PadState();
|
private final PadState effectiveState = new PadState();
|
||||||
private final PadState homeGuideReport = new PadState();
|
private final PadState homeGuideReport = new PadState();
|
||||||
@@ -484,7 +484,7 @@ public final class PadBridge {
|
|||||||
stateFor(slot).clear();
|
stateFor(slot).clear();
|
||||||
retainedSticks[slot] = 0;
|
retainedSticks[slot] = 0;
|
||||||
Arrays.fill(rawSticks[slot], 0f);
|
Arrays.fill(rawSticks[slot], 0f);
|
||||||
Arrays.fill(keyTriggers[slot], false);
|
for (TriggerKey key : keyTriggers[slot]) key.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void mutateState(java.util.function.Consumer<PadState> mutation) {
|
private void mutateState(java.util.function.Consumer<PadState> mutation) {
|
||||||
@@ -530,7 +530,7 @@ public final class PadBridge {
|
|||||||
float lx = event.getAxisValue(MotionEvent.AXIS_X);
|
float lx = event.getAxisValue(MotionEvent.AXIS_X);
|
||||||
float ly = event.getAxisValue(MotionEvent.AXIS_Y);
|
float ly = event.getAxisValue(MotionEvent.AXIS_Y);
|
||||||
boolean wired = wiredXboxLayout(device, event.getSource());
|
boolean wired = wiredXboxLayout(device, event.getSource());
|
||||||
boolean rxRyStick = rightStickUsesRxRy(event, device, rightStickLayouts);
|
boolean rxRyStick = Boolean.TRUE.equals(rightStickUsesRxRy(event, device, rightStickLayouts));
|
||||||
float rx = event.getAxisValue(rxRyStick ? MotionEvent.AXIS_RX : MotionEvent.AXIS_Z);
|
float rx = event.getAxisValue(rxRyStick ? MotionEvent.AXIS_RX : MotionEvent.AXIS_Z);
|
||||||
float ry = event.getAxisValue(rxRyStick ? MotionEvent.AXIS_RY : MotionEvent.AXIS_RZ);
|
float ry = event.getAxisValue(rxRyStick ? MotionEvent.AXIS_RY : MotionEvent.AXIS_RZ);
|
||||||
retainStick(slot, JoyCon.LEFT, lx, ly);
|
retainStick(slot, JoyCon.LEFT, lx, ly);
|
||||||
@@ -570,26 +570,76 @@ public final class PadBridge {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static float keyTrigger(float current, boolean pressed, int repeatCount, boolean analog, boolean[] held, int side) {
|
static final class TriggerKey {
|
||||||
|
static final float RELEASE_FROM_PEAK = 0.05f;
|
||||||
|
boolean held;
|
||||||
|
boolean handoff;
|
||||||
|
boolean axisLive;
|
||||||
|
boolean axisMovedWhilePressed;
|
||||||
|
float peak;
|
||||||
|
float axis;
|
||||||
|
|
||||||
|
static TriggerKey[][] slots(int count) {
|
||||||
|
TriggerKey[][] keys = new TriggerKey[count][2];
|
||||||
|
for (TriggerKey[] pair : keys) {
|
||||||
|
pair[0] = new TriggerKey();
|
||||||
|
pair[1] = new TriggerKey();
|
||||||
|
}
|
||||||
|
return keys;
|
||||||
|
}
|
||||||
|
|
||||||
|
void reset() {
|
||||||
|
held = false;
|
||||||
|
handoff = false;
|
||||||
|
axisLive = false;
|
||||||
|
axisMovedWhilePressed = false;
|
||||||
|
peak = 0f;
|
||||||
|
axis = 0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static float keyTrigger(float current, boolean pressed, int repeatCount, boolean analog, TriggerKey[] keys, int side) {
|
||||||
|
TriggerKey key = keys[side];
|
||||||
if (repeatCount > 0) return current;
|
if (repeatCount > 0) return current;
|
||||||
if (!analog) {
|
if (!analog) {
|
||||||
held[side] = pressed;
|
key.held = pressed;
|
||||||
return pressed ? 1f : 0f;
|
return pressed ? 1f : 0f;
|
||||||
}
|
}
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
if (current != 0f) return current;
|
key.axisMovedWhilePressed = false;
|
||||||
held[side] = true;
|
if (key.axisLive || current != 0f) return current;
|
||||||
|
key.held = true;
|
||||||
return 1f;
|
return 1f;
|
||||||
}
|
}
|
||||||
if (!held[side]) return current;
|
if (!key.axisMovedWhilePressed) key.axisLive = false;
|
||||||
held[side] = false;
|
if (key.handoff) {
|
||||||
|
key.handoff = false;
|
||||||
|
return key.axis;
|
||||||
|
}
|
||||||
|
if (!key.held) return current;
|
||||||
|
key.held = false;
|
||||||
return 0f;
|
return 0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
static float axisTrigger(float value, boolean[] held, int side) {
|
static float axisTrigger(float value, TriggerKey[] keys, int side) {
|
||||||
if (!held[side]) return value;
|
TriggerKey key = keys[side];
|
||||||
if (value == 0f) return 1f;
|
key.axis = value;
|
||||||
held[side] = false;
|
if (value != 0f) {
|
||||||
|
key.axisLive = true;
|
||||||
|
key.axisMovedWhilePressed = true;
|
||||||
|
}
|
||||||
|
if (key.held) {
|
||||||
|
if (value == 0f) return 1f;
|
||||||
|
key.held = false;
|
||||||
|
key.handoff = true;
|
||||||
|
key.peak = value;
|
||||||
|
return 1f;
|
||||||
|
}
|
||||||
|
if (key.handoff) {
|
||||||
|
key.peak = Math.max(key.peak, value);
|
||||||
|
if (value > key.peak - TriggerKey.RELEASE_FROM_PEAK) return 1f;
|
||||||
|
key.handoff = false;
|
||||||
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -604,14 +654,14 @@ public final class PadBridge {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean rightStickUsesRxRy(MotionEvent event, InputDevice device, Map<Integer, Boolean> layouts) {
|
public static Boolean rightStickUsesRxRy(MotionEvent event, InputDevice device, Map<Integer, Boolean> layouts) {
|
||||||
int source = event.getSource();
|
int source = event.getSource();
|
||||||
if (wiredXboxLayout(device, source)) return true;
|
if (wiredXboxLayout(device, source)) return true;
|
||||||
boolean hasRxRy = hasAxis(device, source, MotionEvent.AXIS_RX)
|
boolean hasRxRy = hasAxis(device, source, MotionEvent.AXIS_RX)
|
||||||
&& hasAxis(device, source, MotionEvent.AXIS_RY);
|
&& hasAxis(device, source, MotionEvent.AXIS_RY);
|
||||||
boolean hasZRz = hasAxis(device, source, MotionEvent.AXIS_Z)
|
boolean hasZRz = hasAxis(device, source, MotionEvent.AXIS_Z)
|
||||||
&& hasAxis(device, source, MotionEvent.AXIS_RZ);
|
&& hasAxis(device, source, MotionEvent.AXIS_RZ);
|
||||||
if (!hasRxRy) return false;
|
if (!hasRxRy) return hasZRz ? false : null;
|
||||||
if (!hasZRz) return true;
|
if (!hasZRz) return true;
|
||||||
Boolean cached = layouts.get(event.getDeviceId());
|
Boolean cached = layouts.get(event.getDeviceId());
|
||||||
if (cached != null) return cached;
|
if (cached != null) return cached;
|
||||||
@@ -619,7 +669,7 @@ public final class PadBridge {
|
|||||||
&& nearCentre(device, source, event, MotionEvent.AXIS_RX, MotionEvent.AXIS_RY);
|
&& nearCentre(device, source, event, MotionEvent.AXIS_RX, MotionEvent.AXIS_RY);
|
||||||
boolean zRzEvidence = atMinimum(device, source, event, MotionEvent.AXIS_RX, MotionEvent.AXIS_RY)
|
boolean zRzEvidence = atMinimum(device, source, event, MotionEvent.AXIS_RX, MotionEvent.AXIS_RY)
|
||||||
&& nearCentre(device, source, event, MotionEvent.AXIS_Z, MotionEvent.AXIS_RZ);
|
&& nearCentre(device, source, event, MotionEvent.AXIS_Z, MotionEvent.AXIS_RZ);
|
||||||
if (rxRyEvidence == zRzEvidence) return false;
|
if (rxRyEvidence == zRzEvidence) return null;
|
||||||
boolean useRxRy = rxRyEvidence;
|
boolean useRxRy = rxRyEvidence;
|
||||||
layouts.put(event.getDeviceId(), useRxRy);
|
layouts.put(event.getDeviceId(), useRxRy);
|
||||||
return useRxRy;
|
return useRxRy;
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class PadMouse(private val listener: Listener, private val clock: () -> Long = S
|
|||||||
val sticks = physical.getOrPut(event.deviceId) { Sticks() }
|
val sticks = physical.getOrPut(event.deviceId) { Sticks() }
|
||||||
val device = event.device
|
val device = event.device
|
||||||
val wired = wiredLayout.getOrPut(event.deviceId) { PadBridge.wiredXboxLayout(device, event.source) }
|
val wired = wiredLayout.getOrPut(event.deviceId) { PadBridge.wiredXboxLayout(device, event.source) }
|
||||||
val rxRyStick = PadBridge.rightStickUsesRxRy(event, device, rightStickLayouts)
|
val rxRyStick = PadBridge.rightStickUsesRxRy(event, device, rightStickLayouts) ?: false
|
||||||
sticks.leftX = event.getAxisValue(MotionEvent.AXIS_X)
|
sticks.leftX = event.getAxisValue(MotionEvent.AXIS_X)
|
||||||
sticks.leftY = event.getAxisValue(MotionEvent.AXIS_Y)
|
sticks.leftY = event.getAxisValue(MotionEvent.AXIS_Y)
|
||||||
sticks.rightX = scrollAxis(event, if (rxRyStick) MotionEvent.AXIS_RX else MotionEvent.AXIS_Z)
|
sticks.rightX = scrollAxis(event, if (rxRyStick) MotionEvent.AXIS_RX else MotionEvent.AXIS_Z)
|
||||||
|
|||||||
@@ -0,0 +1,146 @@
|
|||||||
|
package com.droiddeck.launcher.runtime
|
||||||
|
|
||||||
|
import android.util.JsonReader
|
||||||
|
import android.util.JsonToken
|
||||||
|
import java.io.File
|
||||||
|
import java.io.Reader
|
||||||
|
|
||||||
|
// Decomp Buddy's plans.json (about 16 MB) holds, per repo and platform, the release file to download, the
|
||||||
|
// program in it and the game files it needs. It is read as a stream, keeping only those fields.
|
||||||
|
object DecompBuddyPlans {
|
||||||
|
class GameFile(
|
||||||
|
val label: String, val filename: String?, val how: String?, val kind: String?,
|
||||||
|
val hashes: List<Pair<String, String>> = emptyList(), val size: Long = 0,
|
||||||
|
)
|
||||||
|
|
||||||
|
class Target(
|
||||||
|
val gameTitle: String?, val method: String?, val asset: String?, val tag: String?, val executable: String?,
|
||||||
|
val sha256: String?, val pkg: String?, val files: List<GameFile>,
|
||||||
|
)
|
||||||
|
|
||||||
|
class Plan(val tag: String?, val targets: Map<String, Target>)
|
||||||
|
|
||||||
|
private val WANTED = setOf("windows", "linux", "linux-arm64", "android")
|
||||||
|
|
||||||
|
fun read(file: File): Map<String, Plan> = file.bufferedReader().use { read(it) }
|
||||||
|
|
||||||
|
fun read(source: Reader): Map<String, Plan> {
|
||||||
|
val out = HashMap<String, Plan>()
|
||||||
|
JsonReader(source).use { r ->
|
||||||
|
r.beginObject()
|
||||||
|
while (r.hasNext()) {
|
||||||
|
if (r.nextName() != "plans" || r.peek() != JsonToken.BEGIN_OBJECT) { r.skipValue(); continue }
|
||||||
|
r.beginObject()
|
||||||
|
while (r.hasNext()) {
|
||||||
|
val key = r.nextName()
|
||||||
|
plan(r)?.let { out[key.lowercase()] = it }
|
||||||
|
}
|
||||||
|
r.endObject()
|
||||||
|
}
|
||||||
|
r.endObject()
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun JsonReader.str(): String? = if (peek() == JsonToken.STRING) nextString() else { skipValue(); null }
|
||||||
|
|
||||||
|
private fun plan(r: JsonReader): Plan? {
|
||||||
|
if (r.peek() != JsonToken.BEGIN_OBJECT) { r.skipValue(); return null }
|
||||||
|
var tag: String? = null
|
||||||
|
val targets = HashMap<String, Target>()
|
||||||
|
r.beginObject()
|
||||||
|
while (r.hasNext()) when (r.nextName()) {
|
||||||
|
"tag" -> tag = r.str()
|
||||||
|
"targets" -> if (r.peek() != JsonToken.BEGIN_OBJECT) r.skipValue() else {
|
||||||
|
r.beginObject()
|
||||||
|
while (r.hasNext()) {
|
||||||
|
val id = r.nextName()
|
||||||
|
if (id in WANTED) target(r)?.let { targets[id] = it } else r.skipValue()
|
||||||
|
}
|
||||||
|
r.endObject()
|
||||||
|
}
|
||||||
|
else -> r.skipValue()
|
||||||
|
}
|
||||||
|
r.endObject()
|
||||||
|
return if (targets.isEmpty()) null else Plan(tag, targets)
|
||||||
|
}
|
||||||
|
|
||||||
|
// A repo with several games under one target (a collection) is set up from its first.
|
||||||
|
private fun target(r: JsonReader): Target? {
|
||||||
|
if (r.peek() != JsonToken.BEGIN_OBJECT) { r.skipValue(); return null }
|
||||||
|
var first: Target? = null
|
||||||
|
r.beginObject()
|
||||||
|
while (r.hasNext()) {
|
||||||
|
if (r.nextName() != "games" || r.peek() != JsonToken.BEGIN_ARRAY) { r.skipValue(); continue }
|
||||||
|
r.beginArray()
|
||||||
|
while (r.hasNext()) { val g = game(r); if (first == null) first = g }
|
||||||
|
r.endArray()
|
||||||
|
}
|
||||||
|
r.endObject()
|
||||||
|
return first
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun game(r: JsonReader): Target? {
|
||||||
|
if (r.peek() != JsonToken.BEGIN_OBJECT) { r.skipValue(); return null }
|
||||||
|
var title: String? = null
|
||||||
|
var method: String? = null; var asset: String? = null; var tag: String? = null
|
||||||
|
var exe: String? = null; var sha: String? = null; var pkg: String? = null
|
||||||
|
val files = mutableListOf<GameFile>()
|
||||||
|
r.beginObject()
|
||||||
|
while (r.hasNext()) when (r.nextName()) {
|
||||||
|
"game_title" -> title = r.str()
|
||||||
|
"build" -> if (r.peek() != JsonToken.BEGIN_OBJECT) r.skipValue() else {
|
||||||
|
r.beginObject()
|
||||||
|
while (r.hasNext()) when (r.nextName()) {
|
||||||
|
"method" -> method = r.str()
|
||||||
|
"release_asset" -> asset = r.str()
|
||||||
|
"release_tag" -> tag = r.str()
|
||||||
|
"executable" -> exe = r.str()
|
||||||
|
"package_id" -> pkg = r.str()
|
||||||
|
"scanned" -> if (r.peek() != JsonToken.BEGIN_OBJECT) r.skipValue() else {
|
||||||
|
r.beginObject()
|
||||||
|
while (r.hasNext()) if (r.nextName() == "sha256") sha = r.str() else r.skipValue()
|
||||||
|
r.endObject()
|
||||||
|
}
|
||||||
|
else -> r.skipValue()
|
||||||
|
}
|
||||||
|
r.endObject()
|
||||||
|
}
|
||||||
|
"game_files" -> if (r.peek() != JsonToken.BEGIN_ARRAY) r.skipValue() else {
|
||||||
|
r.beginArray()
|
||||||
|
while (r.hasNext()) {
|
||||||
|
if (r.peek() != JsonToken.BEGIN_OBJECT) { r.skipValue(); continue }
|
||||||
|
var label = ""; var name: String? = null; var how: String? = null; var kind: String? = null
|
||||||
|
val hashes = mutableListOf<Pair<String, String>>(); var size = 0L
|
||||||
|
r.beginObject()
|
||||||
|
while (r.hasNext()) when (r.nextName()) {
|
||||||
|
"label" -> label = r.str().orEmpty()
|
||||||
|
"expected_filename" -> name = r.str()
|
||||||
|
"how_provided" -> how = r.str()
|
||||||
|
"kind" -> kind = r.str()
|
||||||
|
"expected_size" -> size = if (r.peek() == JsonToken.NUMBER) r.nextLong() else { r.skipValue(); 0L }
|
||||||
|
"expected_hashes" -> if (r.peek() != JsonToken.BEGIN_ARRAY) r.skipValue() else {
|
||||||
|
r.beginArray()
|
||||||
|
while (r.hasNext()) {
|
||||||
|
if (r.peek() != JsonToken.BEGIN_OBJECT) { r.skipValue(); continue }
|
||||||
|
var algo: String? = null; var value: String? = null
|
||||||
|
r.beginObject()
|
||||||
|
while (r.hasNext()) when (r.nextName()) { "algo" -> algo = r.str(); "value" -> value = r.str(); else -> r.skipValue() }
|
||||||
|
r.endObject()
|
||||||
|
if (algo != null && value != null) hashes += algo to value
|
||||||
|
}
|
||||||
|
r.endArray()
|
||||||
|
}
|
||||||
|
else -> r.skipValue()
|
||||||
|
}
|
||||||
|
r.endObject()
|
||||||
|
files += GameFile(label, name, how, kind, hashes, size)
|
||||||
|
}
|
||||||
|
r.endArray()
|
||||||
|
}
|
||||||
|
else -> r.skipValue()
|
||||||
|
}
|
||||||
|
r.endObject()
|
||||||
|
return Target(title, method, asset, tag, exe, sha, pkg, files)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.droiddeck.launcher.runtime
|
package com.droiddeck.launcher.runtime
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Environment
|
|
||||||
import com.droiddeck.launcher.core.DownloadSource
|
import com.droiddeck.launcher.core.DownloadSource
|
||||||
import com.droiddeck.launcher.core.HostProcess
|
import com.droiddeck.launcher.core.HostProcess
|
||||||
import com.droiddeck.launcher.session.OrphanReaper
|
import com.droiddeck.launcher.session.OrphanReaper
|
||||||
@@ -37,7 +36,7 @@ object GuestCommand {
|
|||||||
SessionFiles.stage(context, root)
|
SessionFiles.stage(context, root)
|
||||||
LinuxNetworkLinkComponent(context, root).publish()
|
LinuxNetworkLinkComponent(context, root).publish()
|
||||||
val runtimeDir = File(context.filesDir, ".flatpak-rt").apply { mkdirs() }
|
val runtimeDir = File(context.filesDir, ".flatpak-rt").apply { mkdirs() }
|
||||||
val binds = LinuxRuntime.binds(context, null, runtimeDir, Environment.getExternalStorageDirectory(), extraBinds)
|
val binds = LinuxRuntime.binds(context, null, runtimeDir, LinuxRuntime.sharedStorage(context), extraBinds)
|
||||||
val native = NativeGuest.forSession(context)
|
val native = NativeGuest.forSession(context)
|
||||||
val fastPathKey = if (!native && fastPath && !fakeRoot && linkDir == null && ProotFastPath.enabled(context)) ProotFastPath.key(root, binds) else null
|
val fastPathKey = if (!native && fastPath && !fakeRoot && linkDir == null && ProotFastPath.enabled(context)) ProotFastPath.key(root, binds) else null
|
||||||
val guest = mutableListOf(
|
val guest = mutableListOf(
|
||||||
|
|||||||
@@ -302,9 +302,9 @@ class LinuxNetworkLinkComponent(
|
|||||||
val etc = File(rootDir, "etc")
|
val etc = File(rootDir, "etc")
|
||||||
replace(File(etc, "resolv.conf"), text)
|
replace(File(etc, "resolv.conf"), text)
|
||||||
val hosts = File(etc, "hosts")
|
val hosts = File(etc, "hosts")
|
||||||
if (!hosts.isFile || !hosts.readText().contains("localhost")) {
|
val existing = if (hosts.isFile) hosts.readText() else null
|
||||||
hosts.writeText("127.0.0.1 localhost\n::1 localhost\n")
|
val wanted = hostsText(existing)
|
||||||
}
|
if (wanted != existing) replace(hosts, wanted)
|
||||||
Log.i(TAG, "resolver: " + servers.joinToString(" "))
|
Log.i(TAG, "resolver: " + servers.joinToString(" "))
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
Log.w(TAG, "Could not write the resolver", e)
|
Log.w(TAG, "Could not write the resolver", e)
|
||||||
@@ -338,6 +338,42 @@ class LinuxNetworkLinkComponent(
|
|||||||
companion object {
|
companion object {
|
||||||
private val WRITES = Any()
|
private val WRITES = Any()
|
||||||
|
|
||||||
|
private const val HOSTS_BLOCK_START = "# DroidDeck: Unity telemetry is refused (start)"
|
||||||
|
private const val HOSTS_BLOCK_END = "# DroidDeck: Unity telemetry is refused (end)"
|
||||||
|
|
||||||
|
// Unity 5's player seeds its bundled OpenSSL before its first HTTPS request, and that code jumps
|
||||||
|
// to a bad address under FEX (Windlands, 428370). Refusing these telemetry hosts makes the request
|
||||||
|
// fail before TLS starts; the games run without them.
|
||||||
|
internal val UNITY_TELEMETRY_HOSTS = listOf(
|
||||||
|
"config.uca.cloud.unity3d.com", "api.uca.cloud.unity3d.com", "cdp.cloud.unity3d.com",
|
||||||
|
"stats.unity3d.com", "perf-events.cloud.unity3d.com",
|
||||||
|
)
|
||||||
|
|
||||||
|
internal fun hostsText(existing: String?): String {
|
||||||
|
val kept = mutableListOf<String>()
|
||||||
|
var block: MutableList<String>? = null
|
||||||
|
for (line in existing.orEmpty().lines()) {
|
||||||
|
when {
|
||||||
|
line == HOSTS_BLOCK_START -> {
|
||||||
|
block?.let(kept::addAll)
|
||||||
|
block = mutableListOf()
|
||||||
|
}
|
||||||
|
line == HOSTS_BLOCK_END -> block = null
|
||||||
|
block != null -> block!!.add(line)
|
||||||
|
else -> kept.add(line)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
block?.let(kept::addAll)
|
||||||
|
kept.removeAll { it.isBlank() }
|
||||||
|
return buildString {
|
||||||
|
if (kept.none { it.substringBefore('#').contains("localhost") }) append("127.0.0.1 localhost\n::1 localhost\n")
|
||||||
|
kept.forEach { append(it).append('\n') }
|
||||||
|
append(HOSTS_BLOCK_START).append('\n')
|
||||||
|
append("0.0.0.0 ").append(UNITY_TELEMETRY_HOSTS.joinToString(" ")).append('\n')
|
||||||
|
append(HOSTS_BLOCK_END).append('\n')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal fun gateways(properties: LinkProperties?, capabilities: NetworkCapabilities?): List<InetAddress> =
|
internal fun gateways(properties: LinkProperties?, capabilities: NetworkCapabilities?): List<InetAddress> =
|
||||||
listOf(Inet4Address::class.java, Inet6Address::class.java).mapNotNull { family ->
|
listOf(Inet4Address::class.java, Inet6Address::class.java).mapNotNull { family ->
|
||||||
properties?.routes.orEmpty()
|
properties?.routes.orEmpty()
|
||||||
|
|||||||
@@ -185,7 +185,12 @@ public final class LinuxRuntime {
|
|||||||
public static List<String> lastBinds(Context context) {
|
public static List<String> lastBinds(Context context) {
|
||||||
List<String> binds = lastBinds;
|
List<String> binds = lastBinds;
|
||||||
if (binds != null) return binds;
|
if (binds != null) return binds;
|
||||||
return binds(context, null, null, android.os.Environment.getExternalStorageDirectory(), null);
|
return binds(context, null, null, sharedStorage(context), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The phone's shared storage, or null when it should stay out of the container. */
|
||||||
|
public static File sharedStorage(Context context) {
|
||||||
|
return SessionPrefs.mountSharedStorage(context) ? android.os.Environment.getExternalStorageDirectory() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<String> prootPrefix(Context context, File root, String cwd) {
|
public static List<String> prootPrefix(Context context, File root, String cwd) {
|
||||||
|
|||||||
@@ -112,8 +112,9 @@ object NativeGuest {
|
|||||||
File(BwrapSpawner.hostPath(binds.map { BwrapSpawner.Bind.parse(it) }, root.path, cwd)).takeIf { it.isDirectory } ?: root
|
File(BwrapSpawner.hostPath(binds.map { BwrapSpawner.Bind.parse(it) }, root.path, cwd)).takeIf { it.isDirectory } ?: root
|
||||||
|
|
||||||
/** A process for [guest] (argv) started as proot would with [binds], in guest directory [cwd]. */
|
/** A process for [guest] (argv) started as proot would with [binds], in guest directory [cwd]. */
|
||||||
fun processBuilder(context: Context, root: File, binds: List<String>, guest: List<String>, cwd: String = "/root"): ProcessBuilder =
|
fun processBuilder(context: Context, root: File, binds: List<String>, guest: List<String>, cwd: String = "/root"): ProcessBuilder {
|
||||||
ProcessBuilder(command(root, guest.first(), guest.drop(1)))
|
if (sessionMode == null) prepare(context, root)
|
||||||
|
return ProcessBuilder(command(root, guest.first(), guest.drop(1)))
|
||||||
.directory(workingDirectory(root, binds, cwd))
|
.directory(workingDirectory(root, binds, cwd))
|
||||||
.also { builder ->
|
.also { builder ->
|
||||||
builder.environment().apply {
|
builder.environment().apply {
|
||||||
@@ -121,6 +122,7 @@ object NativeGuest {
|
|||||||
putAll(sessionEnvironment(root, binds, guest.first(), SessionPrefs.guestHostname(context)))
|
putAll(sessionEnvironment(root, binds, guest.first(), SessionPrefs.guestHostname(context)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private const val RUNPATH_CONF = "etc/ld.so.conf.d/zz-droiddeck-native.conf"
|
private const val RUNPATH_CONF = "etc/ld.so.conf.d/zz-droiddeck-native.conf"
|
||||||
private val SCAN_DIRS = listOf("usr/lib", "usr/local/lib", "opt")
|
private val SCAN_DIRS = listOf("usr/lib", "usr/local/lib", "opt")
|
||||||
@@ -149,6 +151,7 @@ object NativeGuest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** What a rootfs needs before anything runs in it natively; cheap once done. */
|
/** What a rootfs needs before anything runs in it natively; cheap once done. */
|
||||||
|
@Synchronized
|
||||||
fun prepare(context: Context, root: File) {
|
fun prepare(context: Context, root: File) {
|
||||||
val relinked = relinkAbsoluteSymlinks(context, root)
|
val relinked = relinkAbsoluteSymlinks(context, root)
|
||||||
if (relinked > 0) android.util.Log.i(TAG, "native userland: $relinked absolute symlinks made relative")
|
if (relinked > 0) android.util.Log.i(TAG, "native userland: $relinked absolute symlinks made relative")
|
||||||
|
|||||||
@@ -0,0 +1,145 @@
|
|||||||
|
package com.droiddeck.launcher.runtime
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.IntentFilter
|
||||||
|
import android.content.pm.PackageInstaller
|
||||||
|
import android.content.pm.PackageManager
|
||||||
|
import android.net.Uri
|
||||||
|
import android.os.Build
|
||||||
|
import android.widget.Toast
|
||||||
|
import com.droiddeck.launcher.R
|
||||||
|
import com.droiddeck.launcher.core.FileUtils
|
||||||
|
import com.droiddeck.launcher.update.SelfInstaller
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
object RecompAndroid {
|
||||||
|
const val ACTION_STATUS = "com.droiddeck.launcher.recomps.INSTALL_STATUS"
|
||||||
|
private const val RECORDS = "recomps-android"
|
||||||
|
|
||||||
|
private const val INCOMPATIBLE = "incompatible"
|
||||||
|
|
||||||
|
@Volatile private var registered = false
|
||||||
|
@Volatile var onChanged: () -> Unit = {}
|
||||||
|
// Why the last install of each package failed, in words for the player.
|
||||||
|
@Volatile var onFailed: (pkg: String, message: String) -> Unit = { _, _ -> }
|
||||||
|
private val sessions = java.util.concurrent.ConcurrentHashMap<Int, Pair<String, String>>()
|
||||||
|
|
||||||
|
private fun incompatibleFile(context: Context) = File(File(context.filesDir, RECORDS).apply { mkdirs() }, INCOMPATIBLE)
|
||||||
|
|
||||||
|
// Packages whose APK has no code for this device's CPUs, found when one was downloaded or refused.
|
||||||
|
fun incompatible(context: Context): Set<String> =
|
||||||
|
FileUtils.readString(incompatibleFile(context))?.lines()?.map { it.trim() }?.filter { it.isNotEmpty() }?.toSet().orEmpty()
|
||||||
|
|
||||||
|
private fun markIncompatible(context: Context, pkg: String) {
|
||||||
|
val now = incompatible(context) + pkg
|
||||||
|
FileUtils.writeString(incompatibleFile(context), now.joinToString("\n"))
|
||||||
|
}
|
||||||
|
|
||||||
|
// The CPUs an APK has native code for, from its lib/<abi>/ folders; empty when it has none (Java only).
|
||||||
|
internal fun apkAbis(apk: File): Set<String> = runCatching {
|
||||||
|
java.util.zip.ZipFile(apk).use { zip ->
|
||||||
|
zip.entries().asSequence().map { it.name }.filter { it.startsWith("lib/") }.mapNotNull { it.split('/').getOrNull(1)?.takeIf { a -> a.isNotEmpty() } }.toSet()
|
||||||
|
}
|
||||||
|
}.getOrDefault(emptySet())
|
||||||
|
|
||||||
|
internal fun fits(abis: Set<String>, device: List<String>): Boolean = abis.isEmpty() || abis.any { it in device }
|
||||||
|
|
||||||
|
private fun record(context: Context, pkg: String) = File(File(context.filesDir, RECORDS), pkg)
|
||||||
|
|
||||||
|
fun installed(context: Context, entries: List<RecompCatalog.Entry>): Map<String, RecompInstaller.Installed> {
|
||||||
|
val pm = context.packageManager
|
||||||
|
return entries.mapNotNull { e ->
|
||||||
|
val pkg = e.android?.pkg ?: return@mapNotNull null
|
||||||
|
runCatching { pm.getPackageInfo(pkg, 0) }.getOrNull() ?: return@mapNotNull null
|
||||||
|
val lines = FileUtils.readString(record(context, pkg))?.lines().orEmpty()
|
||||||
|
e.id to RecompInstaller.Installed(e.id, "android:$pkg", lines.getOrNull(0)?.takeIf { it.isNotEmpty() },
|
||||||
|
lines.getOrNull(1), RecompCatalog.Platform.ANDROID.key, record(context, pkg))
|
||||||
|
}.toMap()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Runs on a worker thread. The APK must carry the package name and signing certificate the catalog
|
||||||
|
// names, so a replaced release asset cannot install as, or over, a different app.
|
||||||
|
fun install(context: Context, entry: RecompCatalog.Entry, build: RecompCatalog.Build, release: RecompInstaller.Release, apk: File): String? {
|
||||||
|
val pkg = build.pkg ?: return context.getString(R.string.recomps_apk_mismatch)
|
||||||
|
val abis = apkAbis(apk)
|
||||||
|
val device = Build.SUPPORTED_ABIS.toList()
|
||||||
|
if (!fits(abis, device)) {
|
||||||
|
markIncompatible(context, pkg)
|
||||||
|
return context.getString(R.string.recomps_apk_wrong_cpu, abis.sorted().joinToString(", "), device.joinToString(", "))
|
||||||
|
}
|
||||||
|
if (!SelfInstaller.canInstall(context)) {
|
||||||
|
context.startActivity(SelfInstaller.permissionIntent(context).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
|
||||||
|
return context.getString(R.string.recomps_allow_installs)
|
||||||
|
}
|
||||||
|
val flags = if (Build.VERSION.SDK_INT >= 28) PackageManager.GET_SIGNING_CERTIFICATES else @Suppress("DEPRECATION") PackageManager.GET_SIGNATURES
|
||||||
|
val info = context.packageManager.getPackageArchiveInfo(apk.path, flags) ?: return context.getString(R.string.recomps_apk_mismatch)
|
||||||
|
if (info.packageName != pkg) return context.getString(R.string.recomps_apk_mismatch)
|
||||||
|
if (build.signer != null && build.signer !in SelfInstaller.archiveSignerDigests(info)) return context.getString(R.string.recomps_apk_mismatch)
|
||||||
|
listen(context)
|
||||||
|
FileUtils.writeString(record(context, pkg).apply { parentFile?.mkdirs() }, "${release.tag}\n${release.published}\n")
|
||||||
|
SelfInstaller.install(context, apk, pkg, ACTION_STATUS) { id -> sessions[id] = pkg to entry.name }
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
fun launch(context: Context, pkg: String): Boolean {
|
||||||
|
val intent = context.packageManager.getLaunchIntentForPackage(pkg) ?: return false
|
||||||
|
return runCatching { context.startActivity(intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)) }.isSuccess
|
||||||
|
}
|
||||||
|
|
||||||
|
fun uninstall(context: Context, pkg: String) {
|
||||||
|
record(context, pkg).delete()
|
||||||
|
runCatching {
|
||||||
|
context.startActivity(Intent(Intent.ACTION_DELETE, Uri.parse("package:$pkg")).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun listen(context: Context) {
|
||||||
|
if (registered) return
|
||||||
|
registered = true
|
||||||
|
val app = context.applicationContext
|
||||||
|
val receiver = object : BroadcastReceiver() {
|
||||||
|
override fun onReceive(c: Context, intent: Intent) {
|
||||||
|
val session = intent.getIntExtra(PackageInstaller.EXTRA_SESSION_ID, -1)
|
||||||
|
val status = intent.getIntExtra(PackageInstaller.EXTRA_STATUS, PackageInstaller.STATUS_FAILURE)
|
||||||
|
val (pkg, name) = (if (status == PackageInstaller.STATUS_PENDING_USER_ACTION) sessions[session] else sessions.remove(session))
|
||||||
|
?: (intent.getStringExtra(PackageInstaller.EXTRA_PACKAGE_NAME).orEmpty() to "")
|
||||||
|
when (status) {
|
||||||
|
PackageInstaller.STATUS_PENDING_USER_ACTION -> {
|
||||||
|
val confirm = if (Build.VERSION.SDK_INT >= 33) intent.getParcelableExtra(Intent.EXTRA_INTENT, Intent::class.java)
|
||||||
|
else @Suppress("DEPRECATION") intent.getParcelableExtra(Intent.EXTRA_INTENT)
|
||||||
|
confirm?.let { SelfInstaller.safeConfirmIntent(app, it) }?.let { runCatching { app.startActivity(it) } }
|
||||||
|
}
|
||||||
|
PackageInstaller.STATUS_SUCCESS -> onChanged()
|
||||||
|
else -> {
|
||||||
|
val raw = intent.getStringExtra(PackageInstaller.EXTRA_STATUS_MESSAGE)
|
||||||
|
if (raw?.contains("NO_MATCHING_ABIS") == true && pkg.isNotEmpty()) markIncompatible(app, pkg)
|
||||||
|
val message = failure(app, status, raw)
|
||||||
|
Toast.makeText(app, if (name.isNotEmpty()) app.getString(R.string.recomps_apk_failed_named, name, message) else message,
|
||||||
|
Toast.LENGTH_LONG).show()
|
||||||
|
if (pkg.isNotEmpty()) onFailed(pkg, message)
|
||||||
|
onChanged()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val filter = IntentFilter(ACTION_STATUS)
|
||||||
|
if (Build.VERSION.SDK_INT >= 33) app.registerReceiver(receiver, filter, Context.RECEIVER_NOT_EXPORTED)
|
||||||
|
else app.registerReceiver(receiver, filter)
|
||||||
|
}
|
||||||
|
|
||||||
|
// What went wrong, in words: Android's own status message names the cause but not what to do about it.
|
||||||
|
internal fun failure(context: Context, status: Int, message: String?): String = when {
|
||||||
|
message?.contains("NO_MATCHING_ABIS") == true || status == PackageInstaller.STATUS_FAILURE_INCOMPATIBLE ->
|
||||||
|
context.getString(R.string.recomps_apk_fail_cpu, Build.SUPPORTED_ABIS.joinToString(", "))
|
||||||
|
message?.contains("UPDATE_INCOMPATIBLE") == true || status == PackageInstaller.STATUS_FAILURE_CONFLICT ->
|
||||||
|
context.getString(R.string.recomps_apk_fail_conflict)
|
||||||
|
message?.contains("VERSION_DOWNGRADE") == true -> context.getString(R.string.recomps_apk_fail_downgrade)
|
||||||
|
status == PackageInstaller.STATUS_FAILURE_STORAGE -> context.getString(R.string.recomps_apk_fail_storage)
|
||||||
|
status == PackageInstaller.STATUS_FAILURE_ABORTED -> context.getString(R.string.recomps_apk_fail_cancelled)
|
||||||
|
status == PackageInstaller.STATUS_FAILURE_BLOCKED -> context.getString(R.string.recomps_apk_fail_blocked)
|
||||||
|
status == PackageInstaller.STATUS_FAILURE_INVALID -> context.getString(R.string.recomps_apk_fail_invalid)
|
||||||
|
else -> context.getString(R.string.recomps_apk_fail_other, message ?: status.toString())
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,369 @@
|
|||||||
|
package com.droiddeck.launcher.runtime
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.Log
|
||||||
|
import com.droiddeck.launcher.core.FileUtils
|
||||||
|
import org.json.JSONObject
|
||||||
|
import java.io.File
|
||||||
|
import java.net.HttpURLConnection
|
||||||
|
import java.net.URL
|
||||||
|
|
||||||
|
// The list is Decomp Buddy's, Recomp Launcher's and Recompa's own catalogs, read as their apps publish them.
|
||||||
|
// DroidDeck keeps no catalog of its own: it caches each feed, revalidates it with its ETag, and merges them by
|
||||||
|
// GitHub repo, in that order of precedence.
|
||||||
|
object RecompCatalog {
|
||||||
|
private const val TAG = "RecompCatalog"
|
||||||
|
private const val MAX_AGE_MS = 6L * 60 * 60 * 1000
|
||||||
|
|
||||||
|
class Feed(val id: String, val name: String, val url: String)
|
||||||
|
|
||||||
|
val DECOMP_BUDDY = Feed("decomp-buddy", "Decomp Buddy", "https://tanookistudios.com/decomp-buddy/catalog.json")
|
||||||
|
val DECOMP_BUDDY_PLANS = Feed("decomp-buddy-plans", "Decomp Buddy", "https://tanookistudios.com/decomp-buddy/plans.json")
|
||||||
|
val RECOMP_LAUNCHER = Feed("recomp-launcher", "Recomp Launcher", "https://recomplauncher.com/pc-catalog.json")
|
||||||
|
val RECOMPA = Feed("recompa", "Recompa", "https://recompa.app/index.json")
|
||||||
|
|
||||||
|
const val DECOMP_BUDDY_ENABLED = true
|
||||||
|
|
||||||
|
// Decomp Buddy also keeps copies of projects taken down by a legal notice; using them is off until that is decided.
|
||||||
|
const val DECOMP_BUDDY_MIRROR = false
|
||||||
|
|
||||||
|
val FEEDS = listOfNotNull(DECOMP_BUDDY.takeIf { DECOMP_BUDDY_ENABLED }, RECOMP_LAUNCHER, RECOMPA)
|
||||||
|
private val DOWNLOADS = listOfNotNull(
|
||||||
|
DECOMP_BUDDY.takeIf { DECOMP_BUDDY_ENABLED }, DECOMP_BUDDY_PLANS.takeIf { DECOMP_BUDDY_ENABLED }, RECOMP_LAUNCHER, RECOMPA,
|
||||||
|
)
|
||||||
|
|
||||||
|
// Decomp Buddy keeps a malware-scanned copy of each release file it plans, named by sha256. It is
|
||||||
|
// donation-funded, so the copy is used only when the project's own download is gone.
|
||||||
|
fun mirrorUrl(sha256: String, name: String) = "https://files.decompbuddy.com/$sha256/${android.net.Uri.encode(name)}"
|
||||||
|
|
||||||
|
val mirrorEnabled get() = DECOMP_BUDDY_ENABLED && DECOMP_BUDDY_MIRROR
|
||||||
|
|
||||||
|
enum class Platform(val key: String) {
|
||||||
|
LINUX_ARM64("linux-arm64"), LINUX_X64("linux-x64"), WINDOWS_X64("windows-x64"), ANDROID("android");
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun of(key: String) = entries.firstOrNull { it.key == key }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Native arm64 Linux first, then an Android APK, then x86-64 Linux through FEX, then Windows through Proton.
|
||||||
|
val PREFERENCE = listOf(Platform.LINUX_ARM64, Platform.ANDROID, Platform.LINUX_X64, Platform.WINDOWS_X64)
|
||||||
|
|
||||||
|
class Build(
|
||||||
|
val platform: Platform, val asset: Regex, val entry: String = "",
|
||||||
|
val file: String? = null, val sha256: String? = null, val url: String? = null,
|
||||||
|
val pkg: String? = null, val signer: String? = null, val tag: String? = null, val published: String = "",
|
||||||
|
val mirrored: Boolean = false,
|
||||||
|
)
|
||||||
|
|
||||||
|
enum class DataKind { ROM, DUMP, NONE }
|
||||||
|
|
||||||
|
class Hash(val algo: String, val value: String)
|
||||||
|
|
||||||
|
// [file] is a file the port needs inside the game's folder (a relative path), which finds that folder in a
|
||||||
|
// store install; [hashes] and [size], when a catalog gives them, tell the right version of it from another.
|
||||||
|
class Data(
|
||||||
|
val kind: DataKind, val label: String, val sha1: List<String> = emptyList(), val note: String = "", val file: String? = null,
|
||||||
|
val hashes: List<Hash> = emptyList(), val size: Long = 0,
|
||||||
|
)
|
||||||
|
|
||||||
|
class Entry(
|
||||||
|
val id: String, val name: String, val game: String, val origin: String, val type: String,
|
||||||
|
val repo: String, val license: String, val homepage: String, val art: String?,
|
||||||
|
val builds: List<Build>, val data: Data,
|
||||||
|
val sources: List<String>, val popularity: Long = 0, val setup: String? = null, val igdb: String? = null,
|
||||||
|
val cover: String? = null, val updated: String = "", val listed: String = "",
|
||||||
|
) {
|
||||||
|
fun build(platform: Platform) = builds.firstOrNull { it.platform == platform }
|
||||||
|
|
||||||
|
fun preferred(): Build? = PREFERENCE.firstNotNullOfOrNull { build(it) }
|
||||||
|
|
||||||
|
// The preferred build, passing over an Android one whose package cannot install on this device.
|
||||||
|
fun preferred(incompatible: Set<String>): Build? =
|
||||||
|
PREFERENCE.firstNotNullOfOrNull { p -> build(p)?.takeIf { it.pkg == null || it.pkg !in incompatible } }
|
||||||
|
|
||||||
|
val android get() = build(Platform.ANDROID)
|
||||||
|
|
||||||
|
val pc get() = origin in PC_ORIGINS
|
||||||
|
}
|
||||||
|
|
||||||
|
@Volatile private var cached: List<Entry>? = null
|
||||||
|
|
||||||
|
fun load(context: Context, refresh: Boolean = false): List<Entry> {
|
||||||
|
if (!refresh) cached?.let { return it }
|
||||||
|
val dir = File(context.filesDir, "recomps").apply { mkdirs() }
|
||||||
|
val files = DOWNLOADS.associateWith { feed -> runCatching { fetch(feed, dir, refresh) }.onFailure { Log.w(TAG, "${feed.id}: $it") }.getOrNull() }
|
||||||
|
fun <T> read(feed: Feed, parse: (File) -> List<T>): List<T> =
|
||||||
|
files[feed]?.let { f -> runCatching { parse(f) }.onFailure { Log.w(TAG, "${feed.id}: $it") }.getOrNull() }.orEmpty()
|
||||||
|
val plans = files[DECOMP_BUDDY_PLANS]?.let { f -> runCatching { DecompBuddyPlans.read(f) }.onFailure { Log.w(TAG, "plans: $it") }.getOrNull() }.orEmpty()
|
||||||
|
val list = shareIgdb(merge(
|
||||||
|
read(DECOMP_BUDDY) { fromDecompBuddy(JSONObject(it.readText()), plans) },
|
||||||
|
read(RECOMP_LAUNCHER) { fromRecompLauncher(JSONObject(it.readText())) },
|
||||||
|
read(RECOMPA) { fromRecompa(JSONObject(it.readText())) },
|
||||||
|
))
|
||||||
|
if (list.isNotEmpty()) cached = list
|
||||||
|
return list
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun fetch(feed: Feed, dir: File, force: Boolean): File? {
|
||||||
|
val file = File(dir, "${feed.id}.json")
|
||||||
|
val etag = File(dir, "${feed.id}.etag")
|
||||||
|
if (!force && file.isFile && System.currentTimeMillis() - file.lastModified() < MAX_AGE_MS) return file
|
||||||
|
val conn = (URL(feed.url).openConnection() as HttpURLConnection).apply {
|
||||||
|
connectTimeout = 15_000; readTimeout = 60_000
|
||||||
|
setRequestProperty("User-Agent", "DroidDeck")
|
||||||
|
if (file.isFile) FileUtils.readString(etag)?.trim()?.takeIf { it.isNotEmpty() }?.let { setRequestProperty("If-None-Match", it) }
|
||||||
|
}
|
||||||
|
return try {
|
||||||
|
when (conn.responseCode) {
|
||||||
|
HttpURLConnection.HTTP_NOT_MODIFIED -> { file.setLastModified(System.currentTimeMillis()); file }
|
||||||
|
HttpURLConnection.HTTP_OK -> {
|
||||||
|
val tmp = File(dir, "${feed.id}.json.part")
|
||||||
|
conn.inputStream.use { input -> tmp.outputStream().use { input.copyTo(it) } }
|
||||||
|
tmp.renameTo(file)
|
||||||
|
conn.getHeaderField("ETag")?.let { FileUtils.writeString(etag, it) }
|
||||||
|
file
|
||||||
|
}
|
||||||
|
else -> file.takeIf { it.isFile }
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "${feed.id}: $e")
|
||||||
|
file.takeIf { it.isFile }
|
||||||
|
} finally {
|
||||||
|
conn.disconnect()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private val ORIGINS = mapOf(
|
||||||
|
"pc" to "PC", "n64" to "N64", "x360" to "Xbox 360", "xbox360" to "Xbox 360", "xbox" to "Xbox", "ps1" to "PS1", "ps2" to "PS2",
|
||||||
|
"ps3" to "PS3", "ps4" to "PS4", "switch" to "Switch", "switch2" to "Switch 2", "snes" to "SNES", "nes" to "NES", "gc" to "GameCube",
|
||||||
|
"wii" to "Wii", "gba" to "GBA", "nds" to "DS", "ds" to "DS", "3ds" to "3DS", "arcade" to "Arcade", "dreamcast" to "Dreamcast",
|
||||||
|
"saturn" to "Saturn", "genesis" to "Genesis", "psp" to "PSP", "vita" to "Vita", "gb" to "Game Boy", "gbc" to "Game Boy Color",
|
||||||
|
)
|
||||||
|
private val ARCHIVE = Regex("\\.(zip|7z|tar|tgz|tar\\.(gz|xz|bz2|zst)|appimage|exe)$", RegexOption.IGNORE_CASE)
|
||||||
|
private val REPO = Regex("[\\w.-]+/[\\w.-]+")
|
||||||
|
private val SHA256 = Regex("[0-9a-f]{64}")
|
||||||
|
private val SHA1 = Regex("[0-9a-f]{40}")
|
||||||
|
private val PACKAGE = Regex("[A-Za-z][\\w]*(\\.[A-Za-z][\\w]*)+")
|
||||||
|
private val GITHUB = Regex("^https?://github\\.com/([\\w.-]+/[\\w.-]+?)(?:\\.git)?/?$")
|
||||||
|
private val HUBS = setOf("io.github.kalasyan.recompa")
|
||||||
|
|
||||||
|
private fun origin(code: String) = code.lowercase().let { ORIGINS[it] ?: if (it == "other") "" else it.uppercase() }
|
||||||
|
|
||||||
|
private fun safeName(s: String?) = s?.takeIf { it.isNotEmpty() && '/' !in it && it != "." && it != ".." }
|
||||||
|
|
||||||
|
// A file path inside the game's folder: relative, forward slashes, no parent steps.
|
||||||
|
internal fun safePath(s: String?): String? = s?.replace('\\', '/')?.trim('/')
|
||||||
|
?.takeIf { p -> p.isNotEmpty() && p.split('/').none { it.isEmpty() || it == "." || it == ".." } && ':' !in p }
|
||||||
|
|
||||||
|
private val HASH_ALGOS = mapOf("sha1" to 40, "sha256" to 64, "md5" to 32, "crc32" to 8)
|
||||||
|
|
||||||
|
internal fun hash(algo: String?, value: String?): Hash? {
|
||||||
|
val a = algo?.lowercase() ?: return null
|
||||||
|
val v = value?.lowercase()?.takeIf { HASH_ALGOS[a] == it.length && it.all { c -> c in "0123456789abcdef" } } ?: return null
|
||||||
|
return Hash(a, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
private val IGDB_URL = Regex("^https?://(?:www\\.)?igdb\\.com/games/([a-z0-9-]+)/?$")
|
||||||
|
|
||||||
|
private fun sha256(s: String?) = s?.lowercase()?.takeIf { SHA256.matches(it) }
|
||||||
|
|
||||||
|
internal fun globRegex(glob: String) =
|
||||||
|
Regex("^" + glob.split('*').joinToString(".*") { Regex.escape(it) } + "$", RegexOption.IGNORE_CASE)
|
||||||
|
|
||||||
|
private fun JSONObject.str(key: String) = optString(key).takeIf { it.isNotEmpty() && it != "null" }
|
||||||
|
|
||||||
|
private val PC_ORIGINS = setOf("PC", "DOS")
|
||||||
|
|
||||||
|
private val CONSOLES = mapOf(
|
||||||
|
"PC (Windows)" to "PC", "IBM PC (MS-DOS)" to "DOS", "PlayStation" to "PS1", "PlayStation 2" to "PS2", "PlayStation 3" to "PS3",
|
||||||
|
"PlayStation 4" to "PS4", "PlayStation Portable" to "PSP", "PlayStation Vita" to "Vita", "Nintendo 64" to "N64",
|
||||||
|
"Nintendo Switch" to "Switch", "Nintendo Switch 2" to "Switch 2", "Game Boy Advance" to "GBA", "Game Boy" to "Game Boy",
|
||||||
|
"Game Boy Color" to "Game Boy Color", "Nintendo DS" to "DS", "Nintendo 3DS" to "3DS", "Others" to "",
|
||||||
|
)
|
||||||
|
|
||||||
|
// Decomp Buddy's games with a published plan: the plan names the exact release file, its program and the
|
||||||
|
// game files it needs. Linux plans name the x86-64 file; its arm64 twin is looked for at install.
|
||||||
|
internal fun fromDecompBuddy(json: JSONObject, plans: Map<String, DecompBuddyPlans.Plan>): List<Entry> {
|
||||||
|
val games = json.optJSONArray("games") ?: return emptyList()
|
||||||
|
return (0 until games.length()).mapNotNull { i -> runCatching { decompBuddyGame(games.getJSONObject(i), plans) }.getOrNull() }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun decompBuddyGame(g: JSONObject, plans: Map<String, DecompBuddyPlans.Plan>): Entry? {
|
||||||
|
if (g.str("host") != "github") return null
|
||||||
|
val repo = g.str("repo")?.takeIf { REPO.matches(it) } ?: return null
|
||||||
|
val plan = plans[g.str("id")?.lowercase() ?: return null] ?: return null
|
||||||
|
fun build(platform: Platform, t: DecompBuddyPlans.Target?): Build? {
|
||||||
|
t ?: return null
|
||||||
|
if (t.method != "release") return null
|
||||||
|
val file = safeName(t.asset) ?: return null
|
||||||
|
if (platform == Platform.ANDROID && !file.endsWith(".apk", ignoreCase = true)) return null
|
||||||
|
if (platform == Platform.WINDOWS_X64 && Regex("arm64|aarch64|win32|x86(?![_-]64)|i[36]86", RegexOption.IGNORE_CASE).containsMatchIn(file)) return null
|
||||||
|
val exe = t.executable?.substringAfterLast('/')?.substringAfterLast('\\')
|
||||||
|
return Build(platform, Regex("^" + Regex.escape(file) + "$", RegexOption.IGNORE_CASE), safeName(exe).orEmpty(), file,
|
||||||
|
sha256(t.sha256), pkg = t.pkg?.takeIf { platform == Platform.ANDROID && PACKAGE.matches(it) },
|
||||||
|
tag = t.tag ?: plan.tag, published = g.str("updatedAt").orEmpty(), mirrored = sha256(t.sha256) != null)
|
||||||
|
}
|
||||||
|
val targets = plan.targets
|
||||||
|
val builds = listOfNotNull(
|
||||||
|
build(Platform.LINUX_ARM64, targets["linux-arm64"]),
|
||||||
|
build(Platform.LINUX_X64, targets["linux"])?.takeIf { b -> !Regex("arm64|aarch64", RegexOption.IGNORE_CASE).containsMatchIn(b.file!!) },
|
||||||
|
build(Platform.WINDOWS_X64, targets["windows"]),
|
||||||
|
build(Platform.ANDROID, targets["android"])?.takeIf { it.pkg != null },
|
||||||
|
)
|
||||||
|
if (builds.isEmpty()) return null
|
||||||
|
val first = targets["linux"] ?: targets["windows"] ?: targets.values.first()
|
||||||
|
val needs = first.files.firstOrNull { it.kind == null || it.kind == "game" }
|
||||||
|
val origin = g.str("console").orEmpty().let { CONSOLES[it] ?: it }
|
||||||
|
val data = when {
|
||||||
|
needs == null -> Data(DataKind.NONE, "")
|
||||||
|
else -> Data(if (origin in PC_ORIGINS) DataKind.DUMP else DataKind.ROM, needs.label, note = g.str("description").orEmpty(),
|
||||||
|
file = needs.filename?.takeIf { needs.how == "folder" || needs.how == "command_line" }?.let { safePath(it) },
|
||||||
|
hashes = needs.hashes.mapNotNull { (a, v) -> hash(a, v) }, size = needs.size)
|
||||||
|
}
|
||||||
|
val id = g.str("slug") ?: return null
|
||||||
|
return Entry(
|
||||||
|
id, g.str("title") ?: id, first.gameTitle ?: g.str("title") ?: id, origin,
|
||||||
|
if ("recomp" in repo.lowercase()) "recomp" else "port", repo, "", g.str("repoUrl") ?: "https://github.com/$repo",
|
||||||
|
g.str("iconUrl") ?: g.str("boxartUrl"), builds, data, listOf(DECOMP_BUDDY.id), g.optLong("downloads"),
|
||||||
|
cover = g.str("boxartUrl"), updated = g.str("updatedAt").orEmpty(), listed = g.str("listedAt").orEmpty(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun fromRecompLauncher(json: JSONObject): List<Entry> {
|
||||||
|
val apps = json.optJSONArray("apps") ?: return emptyList()
|
||||||
|
return (0 until apps.length()).mapNotNull { i -> runCatching { recompLauncherApp(apps.getJSONObject(i)) }.getOrNull() }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun recompLauncherApp(a: JSONObject): Entry? {
|
||||||
|
if (a.optBoolean("archived") || a.optBoolean("soon")) return null
|
||||||
|
if ((a.str("host") ?: "github") != "github") return null
|
||||||
|
val repo = a.str("repo")?.takeIf { REPO.matches(it) } ?: return null
|
||||||
|
val boot = a.optJSONObject("boot") ?: JSONObject()
|
||||||
|
if (boot.str("kind") in setOf("installer", "not-a-game", "source")) return null
|
||||||
|
val assets = a.optJSONObject("assets") ?: return null
|
||||||
|
val files = a.optJSONObject("files") ?: JSONObject()
|
||||||
|
val tag = a.str("tag")
|
||||||
|
val published = a.str("released_at").orEmpty()
|
||||||
|
val builds = listOf("linux", "windows").mapNotNull { os ->
|
||||||
|
val glob = assets.str(os) ?: return@mapNotNull null
|
||||||
|
if (glob.contains("flatpak", ignoreCase = true) || !ARCHIVE.containsMatchIn(glob)) return@mapNotNull null
|
||||||
|
val platform = when {
|
||||||
|
os == "linux" && Regex("aarch64|arm64", RegexOption.IGNORE_CASE).containsMatchIn(glob) -> Platform.LINUX_ARM64
|
||||||
|
os == "linux" -> Platform.LINUX_X64
|
||||||
|
Regex("arm64|aarch64|win32|x86(?![_-]64)", RegexOption.IGNORE_CASE).containsMatchIn(glob) -> return@mapNotNull null
|
||||||
|
else -> Platform.WINDOWS_X64
|
||||||
|
}
|
||||||
|
val start = if (os == "linux") boot.str("start_linux") else boot.str("start")?.takeIf { it.endsWith(".exe", ignoreCase = true) }
|
||||||
|
val pin = files.optJSONObject(os)
|
||||||
|
val file = safeName(pin?.str("name")) ?: safeName(glob.takeIf { '*' !in it && tag != null })
|
||||||
|
Build(platform, globRegex(glob), safeName(start).orEmpty(), file, sha256(pin?.str("sha256")), tag = tag, published = published)
|
||||||
|
}
|
||||||
|
if (builds.isEmpty()) return null
|
||||||
|
val what = boot.optJSONObject("files")?.str("what") ?: a.str("needs")
|
||||||
|
val inputs = a.optJSONObject("launcher")?.optJSONArray("inputs")
|
||||||
|
val game = (0 until (inputs?.length() ?: 0)).mapNotNull { inputs!!.optJSONObject(it) }
|
||||||
|
.firstOrNull { (it.str("role") ?: "game") == "game" || it.str("id") == "game" }
|
||||||
|
val check = game?.optJSONObject("check")?.str("file")?.let { safePath(it) }
|
||||||
|
val igdb = a.optJSONObject("about")?.str("url")?.let { IGDB_URL.find(it)?.groupValues?.get(1) }
|
||||||
|
val steps = a.optJSONArray("setup_steps")
|
||||||
|
val id = a.str("id") ?: return null
|
||||||
|
val setup = if (!a.optBoolean("setup_required")) null
|
||||||
|
else (0 until (steps?.length() ?: 0)).take(2).joinToString(" ") { steps!!.getString(it) }.ifEmpty { "" }
|
||||||
|
return Entry(
|
||||||
|
id, a.str("name") ?: id, a.str("game") ?: a.str("name") ?: id, origin(a.str("origin").orEmpty()),
|
||||||
|
if ("recomp" in (id + repo).lowercase()) "recomp" else "port", repo, a.str("license").orEmpty(),
|
||||||
|
"https://github.com/$repo", a.str("icon") ?: a.str("cover"), builds,
|
||||||
|
if (what != null) Data(DataKind.DUMP, what, note = a.str("blurb").orEmpty(), file = check) else Data(DataKind.NONE, ""),
|
||||||
|
listOf(RECOMP_LAUNCHER.id), a.optLong("downloads"), setup, igdb,
|
||||||
|
cover = a.str("cover"), updated = published, listed = a.str("added").orEmpty(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun fromRecompa(json: JSONObject): List<Entry> {
|
||||||
|
val ports = json.optJSONArray("ports") ?: return emptyList()
|
||||||
|
return (0 until ports.length()).mapNotNull { i -> runCatching { recompaPort(ports.getJSONObject(i)) }.getOrNull() }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun recompaPort(p: JSONObject): Entry? {
|
||||||
|
val req = p.optJSONObject("requirements") ?: JSONObject()
|
||||||
|
val abi = req.optJSONArray("abi")
|
||||||
|
if (abi != null && abi.length() > 0 && (0 until abi.length()).none { abi.getString(it) == "arm64-v8a" }) return null
|
||||||
|
if (req.optInt("min_sdk", 0) > android.os.Build.VERSION.SDK_INT) return null
|
||||||
|
val forks = p.optJSONArray("forks") ?: return null
|
||||||
|
val fork = (0 until forks.length()).map { forks.getJSONObject(it) }.filter { f ->
|
||||||
|
val asset = f.optJSONObject("release")?.optJSONObject("asset")
|
||||||
|
sha256(asset?.str("sha256")) != null && sha256(f.str("signer_sha256")) != null &&
|
||||||
|
f.str("package")?.let { PACKAGE.matches(it) } == true && asset?.str("url")?.startsWith("https://") == true
|
||||||
|
}.maxByOrNull { it.optLong("downloads") } ?: return null
|
||||||
|
if (fork.getString("package") in HUBS) return null
|
||||||
|
val release = fork.getJSONObject("release")
|
||||||
|
val asset = release.getJSONObject("asset")
|
||||||
|
val android = Build(
|
||||||
|
Platform.ANDROID, Regex("^" + Regex.escape(asset.getString("name")) + "$"), "", safeName(asset.str("name")),
|
||||||
|
sha256(asset.str("sha256")), asset.getString("url"), fork.getString("package"), sha256(fork.str("signer_sha256")),
|
||||||
|
release.str("tag"), release.str("published_at").orEmpty(),
|
||||||
|
)
|
||||||
|
val platform = p.str("original_platform").orEmpty()
|
||||||
|
val needs = p.optJSONArray("assets")?.optJSONObject(0)
|
||||||
|
val data = if (needs == null) Data(DataKind.NONE, "") else {
|
||||||
|
val accepted = needs.optJSONArray("accepted")
|
||||||
|
Data(
|
||||||
|
if (platform == "pc" || platform == "other") DataKind.DUMP else DataKind.ROM, needs.str("label").orEmpty(),
|
||||||
|
(0 until (accepted?.length() ?: 0)).mapNotNull { accepted!!.optJSONObject(it)?.str("sha1")?.lowercase()?.takeIf { s -> SHA1.matches(s) } },
|
||||||
|
needs.str("instructions_md")?.replace(Regex("[`*_#>\\[\\]]"), "")?.trim()?.lineSequence()?.firstOrNull().orEmpty(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
val repo = p.str("upstream")?.let { GITHUB.find(it)?.groupValues?.get(1) } ?: fork.str("repo")?.takeIf { REPO.matches(it) } ?: return null
|
||||||
|
val id = p.str("id") ?: return null
|
||||||
|
return Entry(
|
||||||
|
id, fork.str("name") ?: p.str("name") ?: id, p.str("game") ?: p.str("name") ?: id, origin(platform), p.str("type") ?: "port",
|
||||||
|
repo, "", "https://github.com/$repo", p.optJSONObject("art")?.str("icon") ?: p.optJSONObject("art")?.str("cover"), listOf(android), data,
|
||||||
|
listOf(RECOMPA.id), fork.optLong("downloads"),
|
||||||
|
cover = p.optJSONObject("art")?.str("cover"), updated = release.str("published_at").orEmpty(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// An IGDB slug names the game, not the port, so other ports of a PC game take it from the one that has it,
|
||||||
|
// when the game's title leads to a single slug.
|
||||||
|
internal fun shareIgdb(list: List<Entry>): List<Entry> {
|
||||||
|
val slugs = list.filter { it.pc && it.igdb != null }.groupBy { RecompData.norm(it.game) }
|
||||||
|
.mapValues { (_, v) -> v.mapNotNull { it.igdb }.distinct().singleOrNull() }
|
||||||
|
return list.map { e ->
|
||||||
|
if (!e.pc || e.igdb != null) e
|
||||||
|
else slugs[RecompData.norm(e.game)]?.let { slug ->
|
||||||
|
Entry(e.id, e.name, e.game, e.origin, e.type, e.repo, e.license, e.homepage, e.art, e.builds, e.data, e.sources,
|
||||||
|
e.popularity, e.setup, slug, e.cover, e.updated, e.listed)
|
||||||
|
} ?: e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// An earlier catalog wins every field it sets; a later one with the same repo (or id) adds builds it lacks.
|
||||||
|
internal fun merge(vararg catalogs: List<Entry>): List<Entry> {
|
||||||
|
val out = LinkedHashMap<String, Entry>()
|
||||||
|
val byRepo = HashMap<String, String>()
|
||||||
|
for (e in catalogs.flatMap { it }) {
|
||||||
|
val base = (byRepo[e.repo.lowercase()] ?: e.id.takeIf { it in out })?.let { out[it] }
|
||||||
|
if (base == null) {
|
||||||
|
out[e.id] = e
|
||||||
|
byRepo.putIfAbsent(e.repo.lowercase(), e.id)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
val builds = base.builds.map { b ->
|
||||||
|
e.build(b.platform)?.takeIf { b.platform == Platform.ANDROID && b.signer == null && it.signer != null && it.pkg == b.pkg } ?: b
|
||||||
|
} + e.builds.filter { b -> base.builds.none { it.platform == b.platform } }
|
||||||
|
val b = base.data
|
||||||
|
val data = if (b.kind == DataKind.NONE) e.data else Data(
|
||||||
|
b.kind, b.label, b.sha1.ifEmpty { e.data.sha1 }, b.note,
|
||||||
|
b.file ?: e.data.file, if (b.file != null) b.hashes else e.data.hashes, if (b.file != null) b.size else e.data.size,
|
||||||
|
)
|
||||||
|
out[base.id] = Entry(
|
||||||
|
base.id, base.name, base.game, base.origin.ifEmpty { e.origin }, base.type, base.repo, base.license.ifEmpty { e.license },
|
||||||
|
base.homepage, base.art ?: e.art, builds, data,
|
||||||
|
(base.sources + e.sources).distinct(), maxOf(base.popularity, e.popularity), base.setup ?: e.setup, base.igdb ?: e.igdb,
|
||||||
|
base.cover ?: e.cover, maxOf(base.updated, e.updated), listOf(base.listed, e.listed).filter { it.isNotEmpty() }.minOrNull().orEmpty(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return out.values.toList()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,196 @@
|
|||||||
|
package com.droiddeck.launcher.runtime
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import com.droiddeck.launcher.core.FileUtils
|
||||||
|
import com.droiddeck.launcher.stores.CatalogItem
|
||||||
|
import com.droiddeck.launcher.stores.Store
|
||||||
|
import com.droiddeck.launcher.stores.StoreInstallRoot
|
||||||
|
import com.droiddeck.launcher.stores.StoresState
|
||||||
|
import com.droiddeck.launcher.stores.steam.SteamClient
|
||||||
|
import com.droiddeck.launcher.stores.steam.SteamLibraryFolders
|
||||||
|
import org.json.JSONObject
|
||||||
|
import java.io.File
|
||||||
|
import java.security.MessageDigest
|
||||||
|
import java.util.zip.CRC32
|
||||||
|
|
||||||
|
// Whether the player already has the PC game a port needs. A store whose release IDs are known for the game
|
||||||
|
// (RecompStoreIds) is matched by ID only; any other store by title. A match counts once the file the catalog
|
||||||
|
// names is in the install, and is the right version when a catalog gives its hash or size.
|
||||||
|
object RecompData {
|
||||||
|
sealed class State {
|
||||||
|
object NotNeeded : State()
|
||||||
|
class BringYourOwn(val data: RecompCatalog.Data) : State()
|
||||||
|
class Found(val store: Store, val host: File, val guest: String, val exact: Boolean, val checked: Boolean) : State()
|
||||||
|
class Incomplete(val store: Store, val host: File, val file: String, val wrongVersion: Boolean) : State()
|
||||||
|
class Owned(val store: Store, val item: CatalogItem?, val exact: Boolean) : State()
|
||||||
|
}
|
||||||
|
|
||||||
|
class Install(val store: Store, val id: String?, val title: String, val host: File, val guest: String)
|
||||||
|
|
||||||
|
class Owner(val store: Store, val id: String?, val title: String, val item: CatalogItem?)
|
||||||
|
|
||||||
|
class Inputs(
|
||||||
|
val installs: List<Install>, val owned: List<Owner>,
|
||||||
|
val ids: Map<String, RecompStoreIds.Ids> = emptyMap(), val gogSlugs: Map<String, String> = emptyMap(),
|
||||||
|
val hasher: (File, String) -> String? = ::hashOf, val done: () -> Unit = {}, val cachedOnly: Boolean = false,
|
||||||
|
)
|
||||||
|
|
||||||
|
// Decomp Buddy's rules (src/stores.js): "Fallout 2: A Post Nuclear Role Playing Game" is Fallout 2, "Fallout 2" is
|
||||||
|
// not Fallout, a possessive in front ("Sid Meier's Civilization II") is dropped, and only store editions such as
|
||||||
|
// GOTY or Gold may follow the title.
|
||||||
|
private val EDITION = Regex("^ (?:goty|game of the year|gold|complete|deluxe|definitive|anniversary|steam)(?: edition)?$")
|
||||||
|
|
||||||
|
internal fun norm(title: String): String = title.lowercase().replace(Regex("[™®©]"), "").replace("&", " and ")
|
||||||
|
.replace(Regex("\\([^)]*\\)"), " ").replace(Regex("^[\\w.]+(?: [\\w.]+)?'s "), "")
|
||||||
|
.replace(Regex("[^a-z0-9:–-]+"), " ").replace(Regex("\\s+"), " ").trim()
|
||||||
|
|
||||||
|
internal fun sameGame(wanted: String, store: String): Boolean {
|
||||||
|
val t = norm(wanted).takeIf { it.isNotEmpty() } ?: return false
|
||||||
|
val n = norm(store)
|
||||||
|
return n == t || listOf(":", " -", " –", " :").any { n.startsWith(t + it) } || (n.startsWith("$t ") && EDITION.matches(n.substring(t.length)))
|
||||||
|
}
|
||||||
|
|
||||||
|
enum class Match { EXACT, TITLE }
|
||||||
|
|
||||||
|
internal fun match(entry: RecompCatalog.Entry, inputs: Inputs, store: Store, id: String?, title: String): Match? {
|
||||||
|
val known = entry.igdb?.let { inputs.ids[it] }?.of(store).orEmpty()
|
||||||
|
if (known.isEmpty()) return if (sameGame(entry.game, title)) Match.TITLE else null
|
||||||
|
val key = when (store) {
|
||||||
|
Store.STEAM -> id
|
||||||
|
Store.GOG -> id?.let { inputs.gogSlugs[it] }
|
||||||
|
else -> null
|
||||||
|
} ?: return if (store == Store.EPIC && sameGame(entry.game, title)) Match.TITLE else null
|
||||||
|
return if (key.lowercase() in known) Match.EXACT else null
|
||||||
|
}
|
||||||
|
|
||||||
|
// The file a catalog names, as a relative path matched without case, up to 4 folders below [dir].
|
||||||
|
internal fun locate(dir: File, path: String): File? {
|
||||||
|
val parts = path.split('/').filter { it.isNotEmpty() }
|
||||||
|
if (parts.isEmpty()) return null
|
||||||
|
var level = listOf(dir)
|
||||||
|
repeat(5) {
|
||||||
|
for (d in level) resolve(d, parts)?.let { return it }
|
||||||
|
level = level.flatMap { d -> d.listFiles()?.filter { it.isDirectory }?.sortedBy { it.name }.orEmpty() }
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun resolve(base: File, parts: List<String>): File? {
|
||||||
|
var cur = base
|
||||||
|
for ((i, part) in parts.withIndex()) {
|
||||||
|
val next = File(cur, part).takeIf { it.exists() } ?: cur.listFiles()?.firstOrNull { it.name.equals(part, ignoreCase = true) } ?: return null
|
||||||
|
if (i < parts.lastIndex && !next.isDirectory) return null
|
||||||
|
cur = next
|
||||||
|
}
|
||||||
|
return cur.takeIf { it.isFile }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun folderOf(found: File, path: String): File {
|
||||||
|
var dir = found.parentFile!!
|
||||||
|
repeat(path.split('/').filter { it.isNotEmpty() }.size - 1) { dir = dir.parentFile ?: dir }
|
||||||
|
return dir
|
||||||
|
}
|
||||||
|
|
||||||
|
// null: a hash is needed but not known yet (the bulk pass reads only hashes already cached).
|
||||||
|
private fun rightVersion(data: RecompCatalog.Data, file: File, inputs: Inputs): Boolean? {
|
||||||
|
if (data.size > 0 && file.length() != data.size) return false
|
||||||
|
if (data.hashes.isEmpty()) return true
|
||||||
|
var unknown = false
|
||||||
|
for (h in data.hashes) {
|
||||||
|
val got = inputs.hasher(file, h.algo)
|
||||||
|
if (got == null) unknown = true else if (got.equals(h.value, ignoreCase = true)) return true
|
||||||
|
}
|
||||||
|
return if (unknown && inputs.cachedOnly) null else false
|
||||||
|
}
|
||||||
|
|
||||||
|
fun resolve(entry: RecompCatalog.Entry, inputs: Inputs): State {
|
||||||
|
if (entry.pc) {
|
||||||
|
val file = entry.data.file
|
||||||
|
var incomplete: State.Incomplete? = null
|
||||||
|
val installs = inputs.installs.mapNotNull { i -> match(entry, inputs, i.store, i.id, i.title)?.let { i to it } }
|
||||||
|
.sortedBy { it.second.ordinal }
|
||||||
|
for ((install, how) in installs) {
|
||||||
|
if (file == null) return State.Found(install.store, install.host, install.guest, how == Match.EXACT, checked = false)
|
||||||
|
val found = locate(install.host, file)
|
||||||
|
if (found == null) {
|
||||||
|
incomplete = incomplete ?: State.Incomplete(install.store, install.host, file, wrongVersion = false)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
val right = rightVersion(entry.data, found, inputs)
|
||||||
|
if (right == false) {
|
||||||
|
incomplete = State.Incomplete(install.store, install.host, file, wrongVersion = true)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
val dir = folderOf(found, file)
|
||||||
|
val rel = dir.relativeTo(install.host).invariantSeparatorsPath.trim('/')
|
||||||
|
return State.Found(install.store, dir, if (rel.isEmpty() || rel == ".") install.guest else "${install.guest.trimEnd('/')}/$rel",
|
||||||
|
how == Match.EXACT, checked = right == true)
|
||||||
|
}
|
||||||
|
incomplete?.let { return it }
|
||||||
|
inputs.owned.mapNotNull { o -> match(entry, inputs, o.store, o.id, o.title)?.let { o to it } }.minByOrNull { it.second.ordinal }
|
||||||
|
?.let { (o, how) -> return State.Owned(o.store, o.item, how == Match.EXACT) }
|
||||||
|
}
|
||||||
|
return if (entry.data.kind == RecompCatalog.DataKind.NONE) State.NotNeeded else State.BringYourOwn(entry.data)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun inputs(
|
||||||
|
context: Context, steamOwned: Collection<Pair<Int, String>>, entries: List<RecompCatalog.Entry>, offline: Boolean = false,
|
||||||
|
cachedOnly: Boolean = false,
|
||||||
|
): Inputs {
|
||||||
|
val root = LinuxRuntime.rootDir(context)
|
||||||
|
val installs = mutableListOf<Install>()
|
||||||
|
StoresState.installed.forEach { game ->
|
||||||
|
installs += Install(game.sidecar.store, game.sidecar.id, game.sidecar.title, game.folder, guestPath(context, root, game.folder))
|
||||||
|
}
|
||||||
|
runCatching {
|
||||||
|
SteamLibraryFolders.installed(SteamClient.libraries(context)).forEach { (appId, app) ->
|
||||||
|
val dir = app.installDir ?: return@forEach
|
||||||
|
installs += Install(Store.STEAM, appId.toString(), app.name, File(app.library.host, "steamapps/common/$dir"),
|
||||||
|
"${app.library.guest.trimEnd('/')}/steamapps/common/$dir")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val owned = StoresState.library.flatMap { (store, list) -> list.filter { it.accessible }.map { Owner(store, it.id, it.title, it) } } +
|
||||||
|
steamOwned.map { (appId, name) -> Owner(Store.STEAM, appId.toString(), name, null) }
|
||||||
|
val ids = runCatching { RecompStoreIds.forGames(context, entries.filter { it.pc }.mapNotNull { it.igdb }, offline) }.getOrDefault(emptyMap())
|
||||||
|
val gogIds = installs.filter { it.store == Store.GOG }.mapNotNull { it.id } + owned.filter { it.store == Store.GOG }.mapNotNull { it.id }
|
||||||
|
val gogSlugs = if (ids.values.any { it.gog.isNotEmpty() }) runCatching { RecompStoreIds.gogSlugs(context, gogIds, offline) }.getOrDefault(emptyMap()) else emptyMap()
|
||||||
|
val hashes = HashCache(File(File(context.filesDir, "recomps"), "hashes.json"))
|
||||||
|
return Inputs(installs, owned, ids, gogSlugs, { f, algo -> if (cachedOnly) hashes.cached(f, algo) else hashes.get(f, algo) }, hashes::save, cachedOnly)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun guestPath(context: Context, root: File, host: File): String {
|
||||||
|
val r = root.absolutePath.trimEnd('/')
|
||||||
|
val h = host.absolutePath
|
||||||
|
return if (h.startsWith("$r/")) h.removePrefix(r) else StoreInstallRoot.guestPath(context, host)
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun hashOf(file: File, algo: String): String? = runCatching {
|
||||||
|
if (algo == "crc32") {
|
||||||
|
val crc = CRC32()
|
||||||
|
file.inputStream().buffered(1 shl 16).use { input -> val buf = ByteArray(1 shl 16); while (true) { val n = input.read(buf); if (n < 0) break; crc.update(buf, 0, n) } }
|
||||||
|
"%08x".format(crc.value)
|
||||||
|
} else {
|
||||||
|
val md = MessageDigest.getInstance(when (algo) { "sha1" -> "SHA-1"; "sha256" -> "SHA-256"; "md5" -> "MD5"; else -> return@runCatching null })
|
||||||
|
file.inputStream().buffered(1 shl 16).use { input -> val buf = ByteArray(1 shl 16); while (true) { val n = input.read(buf); if (n < 0) break; md.update(buf, 0, n) } }
|
||||||
|
md.digest().joinToString("") { "%02x".format(it) }
|
||||||
|
}
|
||||||
|
}.getOrNull()
|
||||||
|
|
||||||
|
// Hashing a large game file is slow, so each answer is kept until the file's size or modified time changes.
|
||||||
|
private class HashCache(private val file: File) {
|
||||||
|
private val json = runCatching { JSONObject(file.readText()) }.getOrDefault(JSONObject())
|
||||||
|
private var dirty = false
|
||||||
|
|
||||||
|
fun cached(f: File, algo: String): String? = json.optString("${f.absolutePath}|${f.length()}|${f.lastModified()}|$algo").takeIf { it.isNotEmpty() }
|
||||||
|
|
||||||
|
fun get(f: File, algo: String): String? {
|
||||||
|
val key = "${f.absolutePath}|${f.length()}|${f.lastModified()}|$algo"
|
||||||
|
json.optString(key).takeIf { it.isNotEmpty() }?.let { return it }
|
||||||
|
return hashOf(f, algo)?.also { json.put(key, it); dirty = true }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun save() {
|
||||||
|
if (dirty) runCatching { file.parentFile?.mkdirs(); FileUtils.writeString(file, json.toString()) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,307 @@
|
|||||||
|
package com.droiddeck.launcher.runtime
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.system.Os
|
||||||
|
import com.droiddeck.launcher.R
|
||||||
|
import com.droiddeck.launcher.core.Downloader
|
||||||
|
import com.droiddeck.launcher.core.FileUtils
|
||||||
|
import com.droiddeck.launcher.core.Hashes
|
||||||
|
import com.droiddeck.launcher.frontend.AddedGames
|
||||||
|
import com.droiddeck.launcher.frontend.GameExePicker
|
||||||
|
import com.droiddeck.launcher.stores.StoreInstallRoot
|
||||||
|
import org.json.JSONArray
|
||||||
|
import java.io.File
|
||||||
|
import java.io.RandomAccessFile
|
||||||
|
|
||||||
|
object RecompInstaller {
|
||||||
|
const val META_ID = "recomp-id"
|
||||||
|
const val META_TAG = "recomp-tag"
|
||||||
|
const val META_PUBLISHED = "recomp-published"
|
||||||
|
const val META_PLATFORM = "recomp-platform"
|
||||||
|
const val META_REPO = "recomp-repo"
|
||||||
|
const val WRAPPER = "droiddeck-recomp"
|
||||||
|
private const val WINDOWS_DIR = "Recomps"
|
||||||
|
private const val NESTED_LIMIT = 3
|
||||||
|
private val ARCHIVE = Regex("\\.(zip|7z|tar|tgz|deb|tar\\.(gz|xz|bz2|zst))$", RegexOption.IGNORE_CASE)
|
||||||
|
|
||||||
|
class Release(val tag: String, val published: String, val asset: String, val url: String, val sha256: String?)
|
||||||
|
|
||||||
|
class Installed(val id: String, val appKey: String, val tag: String?, val published: String?, val platform: String?, val dir: File, val repo: String? = null)
|
||||||
|
|
||||||
|
fun installed(context: Context): Map<String, Installed> {
|
||||||
|
val out = HashMap<String, Installed>()
|
||||||
|
fun scan(root: File, prefix: String) = root.listFiles()?.forEach { dir ->
|
||||||
|
val id = FileUtils.readString(File(dir, META_ID))?.trim()?.takeIf { it.isNotEmpty() } ?: return@forEach
|
||||||
|
out[id] = Installed(id, "$prefix:${dir.name}", read(dir, META_TAG), read(dir, META_PUBLISHED), read(dir, META_PLATFORM), dir, read(dir, META_REPO))
|
||||||
|
}
|
||||||
|
scan(UserApps.root(context), "script")
|
||||||
|
AppImageManager.dir(context, "x").parentFile?.let { scan(it, "appimage") }
|
||||||
|
windowsRoots(context).forEach { scan(it, "added") }
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun windowsRoots(context: Context): List<File> =
|
||||||
|
(AddedGames.roots(context).map { it.host } + StoreInstallRoot.installRoot(context)).map { File(it, WINDOWS_DIR) }.distinct()
|
||||||
|
|
||||||
|
private fun windowsTarget(context: Context, entry: RecompCatalog.Entry): File =
|
||||||
|
File(AddedGames.roots(context).firstOrNull()?.host?.takeIf { it.canWrite() } ?: StoreInstallRoot.installRoot(context), "$WINDOWS_DIR/${entry.id}")
|
||||||
|
|
||||||
|
fun remove(context: Context, installed: Installed) {
|
||||||
|
AddedGames.remove(context, installed.dir)
|
||||||
|
FileUtils.delete(installed.dir)
|
||||||
|
}
|
||||||
|
|
||||||
|
// The build being replaced by another one. An Android app is left for the player to remove, since its
|
||||||
|
// uninstall needs their confirmation.
|
||||||
|
private fun uninstall(context: Context, inst: Installed) {
|
||||||
|
when {
|
||||||
|
inst.appKey.startsWith("added:") -> remove(context, inst)
|
||||||
|
inst.appKey.startsWith("android:") -> {}
|
||||||
|
else -> UserApps.list(context).firstOrNull { it.key == inst.appKey }?.let { UserApps.remove(context, it) { _, _ -> } }
|
||||||
|
?: FileUtils.delete(inst.dir)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun read(dir: File, name: String) = FileUtils.readString(File(dir, name))?.trim()?.takeIf { it.isNotEmpty() }
|
||||||
|
|
||||||
|
// A feed that names the release file lets the install skip the releases API, which allows 60
|
||||||
|
// unauthenticated calls an hour per address, shared by every device on it.
|
||||||
|
fun pinned(entry: RecompCatalog.Entry, build: RecompCatalog.Build): Release? {
|
||||||
|
val tag = build.tag ?: return null
|
||||||
|
val file = build.file ?: return null
|
||||||
|
val url = build.url ?: "https://github.com/${entry.repo}/releases/download/${android.net.Uri.encode(tag)}/${android.net.Uri.encode(file)}"
|
||||||
|
return Release(tag, build.published, file, url, build.sha256)
|
||||||
|
}
|
||||||
|
|
||||||
|
// The arm64 file released beside an x86-64 Linux one under the same name with the other CPU (Decomp Buddy's
|
||||||
|
// armSibling rule), found with a plain request to the release download, which is not rate-limited.
|
||||||
|
internal fun armNames(name: String): List<String> =
|
||||||
|
listOf(Regex("x86[-_]64", RegexOption.IGNORE_CASE), Regex("amd64", RegexOption.IGNORE_CASE), Regex("\\bx64\\b", RegexOption.IGNORE_CASE))
|
||||||
|
.filter { it.containsMatchIn(name) }.flatMap { re -> listOf("aarch64", "arm64", "ARM64").map { name.replace(re, it) } }.distinct()
|
||||||
|
|
||||||
|
private fun armTwin(entry: RecompCatalog.Entry, release: Release): Release? {
|
||||||
|
if (!release.url.startsWith("https://github.com/")) return null
|
||||||
|
val base = release.url.substringBeforeLast('/')
|
||||||
|
for (name in armNames(release.asset)) {
|
||||||
|
val url = "$base/${android.net.Uri.encode(name)}"
|
||||||
|
val found = runCatching {
|
||||||
|
val c = (java.net.URL(url).openConnection() as java.net.HttpURLConnection).apply {
|
||||||
|
requestMethod = "HEAD"; connectTimeout = 10_000; readTimeout = 10_000; instanceFollowRedirects = true
|
||||||
|
}
|
||||||
|
try { c.responseCode == 200 } finally { c.disconnect() }
|
||||||
|
}.getOrDefault(false)
|
||||||
|
if (found) return Release(release.tag, release.published, name, url, null)
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
fun latest(entry: RecompCatalog.Entry, build: RecompCatalog.Build): Release? {
|
||||||
|
val body = Downloader.downloadString("https://api.github.com/repos/${entry.repo}/releases?per_page=15") ?: return null
|
||||||
|
return pickRelease(body, build.asset, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun pickRelease(body: String, asset: Regex, prerelease: Boolean): Release? {
|
||||||
|
val releases = runCatching { JSONArray(body) }.getOrNull() ?: return null
|
||||||
|
val candidates = (0 until releases.length()).mapNotNull { i ->
|
||||||
|
val r = releases.getJSONObject(i)
|
||||||
|
if (r.optBoolean("draft")) return@mapNotNull null
|
||||||
|
val assets = r.optJSONArray("assets") ?: return@mapNotNull null
|
||||||
|
val a = (0 until assets.length()).map { assets.getJSONObject(it) }.firstOrNull { asset.containsMatchIn(it.getString("name")) }
|
||||||
|
?: return@mapNotNull null
|
||||||
|
r.optBoolean("prerelease") to Release(r.optString("tag_name"), r.optString("published_at"), a.getString("name"),
|
||||||
|
a.getString("browser_download_url"), Hashes.githubSha256(a.optString("digest")))
|
||||||
|
}
|
||||||
|
return (candidates.firstOrNull { prerelease || !it.first } ?: candidates.firstOrNull())?.second
|
||||||
|
}
|
||||||
|
|
||||||
|
fun isNewer(release: Release, installed: Installed): Boolean =
|
||||||
|
installed.tag != null && release.tag != installed.tag && isAfter(release, installed)
|
||||||
|
|
||||||
|
private fun isAfter(release: Release, installed: Installed): Boolean =
|
||||||
|
if (!installed.published.isNullOrEmpty() && release.published.isNotEmpty()) release.published > installed.published
|
||||||
|
else release.tag != installed.tag
|
||||||
|
|
||||||
|
fun install(
|
||||||
|
context: Context, entry: RecompCatalog.Entry, build: RecompCatalog.Build, wanted: Release?, onProgress: (String, Int) -> Unit,
|
||||||
|
allowTwin: Boolean = true,
|
||||||
|
): String? {
|
||||||
|
val android = build.platform == RecompCatalog.Platform.ANDROID
|
||||||
|
if (!android && !LinuxRuntime.isInstalled(context)) return context.getString(R.string.user_apps_runtime_required)
|
||||||
|
val release = wanted ?: pinned(entry, build) ?: run {
|
||||||
|
onProgress(context.getString(R.string.user_apps_github_checking, entry.repo), -1)
|
||||||
|
val body = Downloader.downloadString("https://api.github.com/repos/${entry.repo}/releases?per_page=15")
|
||||||
|
?: return context.getString(R.string.user_apps_github_unreachable, entry.repo)
|
||||||
|
pickRelease(body, build.asset, false) ?: return context.getString(R.string.recomps_no_build, entry.repo)
|
||||||
|
}
|
||||||
|
val twin = if (allowTwin && build.platform == RecompCatalog.Platform.LINUX_X64) armTwin(entry, release) else null
|
||||||
|
val platform = if (twin != null) RecompCatalog.Platform.LINUX_ARM64 else build.platform
|
||||||
|
return fetchAndInstall(context, entry, build, platform, twin ?: release, onProgress)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun fetchAndInstall(
|
||||||
|
context: Context, entry: RecompCatalog.Entry, build: RecompCatalog.Build, platform: RecompCatalog.Platform, release: Release,
|
||||||
|
onProgress: (String, Int) -> Unit,
|
||||||
|
): String? {
|
||||||
|
val android = platform == RecompCatalog.Platform.ANDROID
|
||||||
|
val work = File(context.cacheDir, "recomps").apply { mkdirs() }
|
||||||
|
val download = File(work, release.asset)
|
||||||
|
val stage = File(work, "stage-${entry.id}")
|
||||||
|
try {
|
||||||
|
val label = context.getString(R.string.user_apps_downloading, release.asset)
|
||||||
|
val progress = java.util.function.Consumer<Float> { f -> onProgress(label, if (f < 0) -1 else Math.round(f * 100f)) }
|
||||||
|
val mirror = release.sha256?.takeIf { RecompCatalog.mirrorEnabled && build.mirrored && release.asset == build.file }
|
||||||
|
?.let { RecompCatalog.mirrorUrl(it, release.asset) }
|
||||||
|
val ok = Downloader.downloadFile(release.url, download, true, release.sha256, progress) ||
|
||||||
|
mirror != null && Downloader.downloadFile(mirror, download.also { it.delete() }, false, release.sha256, progress)
|
||||||
|
if (!ok) return context.getString(R.string.user_apps_download_failed)
|
||||||
|
val meta = mapOf(META_ID to entry.id, META_TAG to release.tag, META_PUBLISHED to release.published, META_PLATFORM to platform.key, META_REPO to entry.repo)
|
||||||
|
if (android) return RecompAndroid.install(context, entry, build, release, download)
|
||||||
|
val previous = installed(context)[entry.id]
|
||||||
|
val problem = if (platform == RecompCatalog.Platform.WINDOWS_X64) {
|
||||||
|
installWindows(context, entry, build, download, meta, previous, onProgress)
|
||||||
|
} else if (download.name.endsWith(".appimage", ignoreCase = true)) {
|
||||||
|
AppImageManager.import(context, download, entry.name, null, meta) { onProgress(it, -1) }
|
||||||
|
} else {
|
||||||
|
FileUtils.delete(stage)
|
||||||
|
stage.mkdirs()
|
||||||
|
onProgress(context.getString(R.string.recomps_unpacking, release.asset), -1)
|
||||||
|
unpack(context, download, stage)
|
||||||
|
val found = (if (build.entry.isEmpty()) guessEntry(stage, entry) else findEntry(stage, build.entry))
|
||||||
|
?: return context.getString(R.string.recomps_entry_missing, build.entry.ifEmpty { entry.name })
|
||||||
|
if (found.name.endsWith(".appimage", ignoreCase = true)) {
|
||||||
|
AppImageManager.import(context, found, entry.name, null, meta) { onProgress(it, -1) }
|
||||||
|
} else {
|
||||||
|
UserApps.addPrepared(context, entry.name, null, meta) { dir ->
|
||||||
|
val files = File(dir, "files")
|
||||||
|
if (!stage.renameTo(files)) throw IllegalStateException(context.getString(R.string.user_apps_failed))
|
||||||
|
markExecutables(files)
|
||||||
|
val rel = found.relativeTo(stage).invariantSeparatorsPath
|
||||||
|
FileUtils.writeString(File(files, WRAPPER), wrapper(rel))
|
||||||
|
File(files, WRAPPER).setExecutable(true, false)
|
||||||
|
WRAPPER
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (problem == null && previous != null) {
|
||||||
|
if (previous.platform != platform.key) uninstall(context, previous)
|
||||||
|
else if (previous.dir != windowsTarget(context, entry)) FileUtils.delete(previous.dir)
|
||||||
|
}
|
||||||
|
if (problem == null && platform != RecompCatalog.Platform.WINDOWS_X64) {
|
||||||
|
installed(context)[entry.id]?.let { runCatching { RecompShortcuts.prepare(entry, it) } }
|
||||||
|
}
|
||||||
|
return problem
|
||||||
|
} catch (e: Exception) {
|
||||||
|
return e.message ?: context.getString(R.string.user_apps_failed)
|
||||||
|
} finally {
|
||||||
|
download.delete()
|
||||||
|
FileUtils.delete(stage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun installWindows(
|
||||||
|
context: Context, entry: RecompCatalog.Entry, build: RecompCatalog.Build, download: File, meta: Map<String, String>,
|
||||||
|
previous: Installed?, onProgress: (String, Int) -> Unit,
|
||||||
|
): String? {
|
||||||
|
val target = windowsTarget(context, entry)
|
||||||
|
if (previous?.dir == target) AddedGames.remove(context, target)
|
||||||
|
FileUtils.delete(target)
|
||||||
|
target.mkdirs()
|
||||||
|
onProgress(context.getString(R.string.recomps_unpacking, download.name), -1)
|
||||||
|
if (download.name.endsWith(".exe", ignoreCase = true)) download.copyTo(File(target, download.name), true)
|
||||||
|
else unpack(context, download, target)
|
||||||
|
val exe = (if (build.entry.isNotEmpty()) findEntry(target, build.entry) else GameExePicker.rank(target).exes.firstOrNull())
|
||||||
|
?: return context.getString(R.string.recomps_entry_missing, build.entry.ifEmpty { entry.name })
|
||||||
|
meta.forEach { (k, v) -> FileUtils.writeString(File(target, k), v) }
|
||||||
|
return when (AddedGames.addExe(context, exe)) {
|
||||||
|
is AddedGames.AddResult.Added, is AddedGames.AddResult.Existing, is AddedGames.AddResult.Switched -> null
|
||||||
|
else -> context.getString(R.string.recomps_add_failed)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun unpack(context: Context, archive: File, into: File) {
|
||||||
|
var file = archive
|
||||||
|
val binds = if (listOf(context.filesDir, context.cacheDir).any { into.absolutePath.startsWith(it.absolutePath + "/") }) null
|
||||||
|
else listOf(into.absolutePath)
|
||||||
|
repeat(NESTED_LIMIT) { depth ->
|
||||||
|
val tail = ArrayDeque<String>()
|
||||||
|
val code = GuestCommand.run(context, listOf("/usr/bin/bsdtar", "-xf", file.absolutePath, "-C", into.absolutePath),
|
||||||
|
logName = "recomps", extraBinds = binds, fastPath = true) { line ->
|
||||||
|
if (!line.startsWith("proot ")) { if (tail.size == 4) tail.removeFirst(); tail.addLast(line) }
|
||||||
|
}
|
||||||
|
if (code != 0) throw IllegalStateException(context.getString(R.string.recomps_unpack_failed, code) + tail.joinToString(" | ", ": "))
|
||||||
|
if (depth > 0) file.delete()
|
||||||
|
// A .deb unpacks to debian-binary, control.tar.* and data.tar.*; the program is in data.tar.
|
||||||
|
val debData = into.listFiles()?.takeIf { files -> files.any { it.name == "debian-binary" } }?.firstOrNull { it.name.startsWith("data.tar") }
|
||||||
|
if (debData != null) {
|
||||||
|
into.listFiles()?.filter { it.name == "debian-binary" || it.name.startsWith("control.tar") }?.forEach { it.delete() }
|
||||||
|
file = debData
|
||||||
|
return@repeat
|
||||||
|
}
|
||||||
|
val only = into.listFiles()?.singleOrNull()?.takeIf { it.isFile && ARCHIVE.containsMatchIn(it.name) } ?: return
|
||||||
|
file = only
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Catalogs that do not name the program: an AppImage if there is one, else the executable ELF (not a
|
||||||
|
// shared library) whose name is closest to the project's, nearest the top, then the largest.
|
||||||
|
internal fun guessEntry(root: File, entry: RecompCatalog.Entry): File? {
|
||||||
|
val files = root.walkTopDown().maxDepth(4).filter { it.isFile && !java.nio.file.Files.isSymbolicLink(it.toPath()) }.toList()
|
||||||
|
files.filter { it.name.endsWith(".appimage", ignoreCase = true) }.minByOrNull { it.path.length }?.let { return it }
|
||||||
|
val words = listOf(entry.id, entry.name, entry.repo.substringAfter('/')).map { key(it) }.filter { it.isNotEmpty() }
|
||||||
|
return files.filter { !Regex("\\.so(\\.|$)").containsMatchIn(it.name) && isElf(it) && elfType(it) != SHARED_OBJECT_ONLY }
|
||||||
|
.sortedWith(compareByDescending<File> { f -> val n = key(f.name); words.count { w -> n.isNotEmpty() && (w.contains(n) || n.contains(w)) } }
|
||||||
|
.thenBy { it.relativeTo(root).path.count { c -> c == '/' } }
|
||||||
|
.thenByDescending { it.length() })
|
||||||
|
.firstOrNull()
|
||||||
|
}
|
||||||
|
|
||||||
|
private const val SHARED_OBJECT_ONLY = -1
|
||||||
|
|
||||||
|
private fun key(s: String) = s.lowercase().filter { it.isLetterOrDigit() }
|
||||||
|
|
||||||
|
// ET_DYN libraries without a program interpreter are shared objects, not programs.
|
||||||
|
private fun elfType(f: File): Int = runCatching {
|
||||||
|
RandomAccessFile(f, "r").use { raf ->
|
||||||
|
val head = ByteArray(64)
|
||||||
|
if (raf.read(head) < 64) return@use 0
|
||||||
|
val little = head[5].toInt() == 1
|
||||||
|
fun u16(o: Int) = if (little) (head[o].toInt() and 0xff) or ((head[o + 1].toInt() and 0xff) shl 8) else ((head[o].toInt() and 0xff) shl 8) or (head[o + 1].toInt() and 0xff)
|
||||||
|
val type = u16(16)
|
||||||
|
if (type != 3) return@use type
|
||||||
|
val bytes = raf.length().coerceAtMost(1L shl 16).toInt()
|
||||||
|
raf.seek(0)
|
||||||
|
val buf = ByteArray(bytes)
|
||||||
|
raf.readFully(buf)
|
||||||
|
if (String(buf, Charsets.ISO_8859_1).contains("/ld-linux")) type else SHARED_OBJECT_ONLY
|
||||||
|
}
|
||||||
|
}.getOrDefault(0)
|
||||||
|
|
||||||
|
internal fun findEntry(root: File, name: String): File? {
|
||||||
|
if (name.isEmpty()) return null
|
||||||
|
var level = listOf(root)
|
||||||
|
repeat(4) {
|
||||||
|
level.forEach { dir -> dir.listFiles()?.firstOrNull { it.isFile && it.name == name }?.let { return it } }
|
||||||
|
level.forEach { dir -> dir.listFiles()?.firstOrNull { it.isFile && it.name.equals(name, ignoreCase = true) }?.let { return it } }
|
||||||
|
level = level.flatMap { dir -> dir.listFiles()?.filter { it.isDirectory }?.sortedBy { it.name }.orEmpty() }
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun markExecutables(root: File) {
|
||||||
|
root.walkTopDown().maxDepth(6).filter { it.isFile && !java.nio.file.Files.isSymbolicLink(it.toPath()) && isElf(it) }
|
||||||
|
.forEach { runCatching { Os.chmod(it.path, 0b111_101_101) } }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun isElf(f: File): Boolean = runCatching {
|
||||||
|
RandomAccessFile(f, "r").use { val b = ByteArray(4); it.read(b) == 4 && b[0] == 0x7f.toByte() && b[1] == 'E'.code.toByte() && b[2] == 'L'.code.toByte() && b[3] == 'F'.code.toByte() }
|
||||||
|
}.getOrDefault(false)
|
||||||
|
|
||||||
|
private fun quote(s: String) = "'" + s.replace("'", "'\\''") + "'"
|
||||||
|
|
||||||
|
// The program starts from its own folder, as it would after unpacking the release by hand.
|
||||||
|
internal fun wrapper(entry: String): String {
|
||||||
|
val dir = entry.substringBeforeLast('/', "")
|
||||||
|
val enter = if (dir.isEmpty()) "" else "cd ${quote(dir)} || exit 127\n"
|
||||||
|
return "#!/bin/sh\n$enter" + "exec ./${quote(entry.substringAfterLast('/'))} \"\$@\"\n"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
package com.droiddeck.launcher.runtime
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.system.Os
|
||||||
|
import android.util.Log
|
||||||
|
import com.droiddeck.launcher.core.Downloader
|
||||||
|
import com.droiddeck.launcher.core.FileUtils
|
||||||
|
import com.droiddeck.launcher.frontend.Library
|
||||||
|
import com.droiddeck.launcher.stores.SteamLiveShortcuts
|
||||||
|
import org.json.JSONObject
|
||||||
|
import java.io.File
|
||||||
|
import java.util.zip.CRC32
|
||||||
|
|
||||||
|
// Each Linux recomp (a script app or an AppImage) is also a non-Steam game: a native shortcut, without a
|
||||||
|
// compatibility tool, to a small `play` script beside the install. Windows recomps are added games, so Steam
|
||||||
|
// already has them; Android apps cannot be Steam shortcuts.
|
||||||
|
object RecompShortcuts {
|
||||||
|
private const val TAG = "RecompShortcuts"
|
||||||
|
const val SOURCE = "recomp"
|
||||||
|
private const val PLAY = "play"
|
||||||
|
private const val COVER = "cover"
|
||||||
|
private const val ICON = "icon.png"
|
||||||
|
|
||||||
|
class Shortcut(
|
||||||
|
val id: String, val name: String, val appKey: String, val exe: String, val dir: String, val appId: Long,
|
||||||
|
val cover: File?, val icon: File?, val host: File,
|
||||||
|
) {
|
||||||
|
val gameId: Long get() = (appId shl 32) or 0x02000000L
|
||||||
|
}
|
||||||
|
|
||||||
|
// Steam's own ID for a non-Steam shortcut: a CRC32 of the quoted program and the name, with the top bit set.
|
||||||
|
fun appId(exe: String, name: String): Long = CRC32().apply { update("\"$exe\"$name".toByteArray()) }.value or 0x80000000L
|
||||||
|
|
||||||
|
private fun guestDir(inst: RecompInstaller.Installed): String? = when {
|
||||||
|
inst.appKey.startsWith("script:") -> "${UserApps.GUEST_DIR}/${inst.dir.name}"
|
||||||
|
inst.appKey.startsWith("appimage:") -> "${AppImageManager.GUEST_DIR}/${inst.dir.name}"
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun playScript(inst: RecompInstaller.Installed, guest: String): String {
|
||||||
|
val launcher = if (inst.appKey.startsWith("appimage:")) AppImageManager.LAUNCHER else UserApps.SCRIPT_LAUNCHER
|
||||||
|
return "#!/bin/sh\nexec $launcher '$guest' \"\$@\"\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun writePlay(inst: RecompInstaller.Installed, guest: String): File? = runCatching {
|
||||||
|
File(inst.dir, PLAY).also { f ->
|
||||||
|
val text = playScript(inst, guest)
|
||||||
|
if (FileUtils.readString(f) != text) FileUtils.writeString(f, text)
|
||||||
|
runCatching { Os.chmod(f.path, 0b111_101_101) }
|
||||||
|
f.setExecutable(true, false)
|
||||||
|
}
|
||||||
|
}.onFailure { Log.w(TAG, "play ${inst.dir}: $it") }.getOrNull()
|
||||||
|
|
||||||
|
// Writes the play script and saves the catalog's art beside the install, for Steam's library and the Library tab.
|
||||||
|
fun prepare(entry: RecompCatalog.Entry, inst: RecompInstaller.Installed) {
|
||||||
|
val guest = guestDir(inst) ?: return
|
||||||
|
writePlay(inst, guest)
|
||||||
|
fun save(url: String?, name: String) {
|
||||||
|
if (url.isNullOrEmpty() || File(inst.dir, name).isFile) return
|
||||||
|
val tmp = File(inst.dir, "$name.part")
|
||||||
|
if (runCatching { Downloader.downloadFile(url, tmp, false) { } }.getOrDefault(false)) tmp.renameTo(File(inst.dir, name)) else tmp.delete()
|
||||||
|
}
|
||||||
|
save(entry.cover, COVER + "." + (entry.cover?.substringAfterLast('.')?.substringBefore('?')?.lowercase()?.takeIf { it in setOf("png", "jpg", "jpeg", "webp") } ?: "jpg"))
|
||||||
|
if (!File(inst.dir, ICON).isFile) save(entry.art, ICON)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun all(context: Context): List<Shortcut> = RecompInstaller.installed(context).values.mapNotNull { inst ->
|
||||||
|
val guest = guestDir(inst) ?: return@mapNotNull null
|
||||||
|
val play = File(inst.dir, PLAY).takeIf { it.isFile } ?: writePlay(inst, guest) ?: return@mapNotNull null
|
||||||
|
val name = FileUtils.readString(File(inst.dir, "name"))?.trim()?.takeIf { it.isNotEmpty() } ?: inst.id
|
||||||
|
val exe = "$guest/${play.name}"
|
||||||
|
Shortcut(inst.id, name, inst.appKey, exe, guest, appId(exe, name),
|
||||||
|
inst.dir.listFiles()?.firstOrNull { it.name.startsWith("$COVER.") && it.isFile }, File(inst.dir, ICON).takeIf { it.isFile }, inst.dir)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Entries for the session's shortcut listing (droiddeck-steam-shortcuts): native, so no compatibility tool.
|
||||||
|
fun listing(context: Context): List<JSONObject> = runCatching { all(context) }.getOrDefault(emptyList()).map { s ->
|
||||||
|
JSONObject().put("name", s.name).put("exe", s.exe).put("folder", s.dir).put("dir", s.dir).put("appid", s.appId)
|
||||||
|
.put("seen", 0).put("native", true).also { o ->
|
||||||
|
val art = JSONObject()
|
||||||
|
s.cover?.let { art.put("p", it.absolutePath) }
|
||||||
|
s.icon?.let { art.put("icon", it.absolutePath) }
|
||||||
|
if (art.length() > 0) o.put("art", art)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun library(context: Context, lastPlayed: (appId: Long, gameId: Long) -> Long = { _, _ -> 0L }): List<Library.SteamGame> =
|
||||||
|
runCatching { all(context) }.getOrDefault(emptyList()).map { s ->
|
||||||
|
Library.SteamGame(
|
||||||
|
s.appId.toInt(), s.name, s.cover ?: s.icon, SOURCE, s.gameId, lastPlayed = lastPlayed(s.appId, s.gameId), icon = s.icon,
|
||||||
|
source = SOURCE, storeId = s.appKey, installedAt = s.host.lastModified(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Adds the shortcut to a running Steam client now; the listing covers the next session either way.
|
||||||
|
fun addLive(context: Context, id: String) {
|
||||||
|
all(context).firstOrNull { it.id == id }?.let { s -> SteamLiveShortcuts.ensure(context, s.name, s.exe, s.dir, compat = false, appId = s.appId) }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun removeLive(context: Context, appId: Long) = runCatching { SteamLiveShortcuts.remove(context, appId) }
|
||||||
|
}
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
package com.droiddeck.launcher.runtime
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.Log
|
||||||
|
import com.droiddeck.launcher.core.FileUtils
|
||||||
|
import com.droiddeck.launcher.stores.Store
|
||||||
|
import org.json.JSONArray
|
||||||
|
import org.json.JSONObject
|
||||||
|
import java.io.File
|
||||||
|
import java.net.HttpURLConnection
|
||||||
|
import java.net.URL
|
||||||
|
import java.net.URLEncoder
|
||||||
|
|
||||||
|
// None of the recomp catalogs names the store release a PC port needs, but Recomp Launcher's gives each game's
|
||||||
|
// IGDB slug. Wikidata links IGDB slugs (P5794) to Steam app IDs (P1733), GOG slugs (P2725) and Epic store slugs
|
||||||
|
// (P6278), and GOG's public products API gives the slug of each GOG product the player owns. Both answers are
|
||||||
|
// cached, so a game is looked up again only after [MAX_AGE_MS].
|
||||||
|
object RecompStoreIds {
|
||||||
|
private const val TAG = "RecompStoreIds"
|
||||||
|
private const val MAX_AGE_MS = 14L * 24 * 60 * 60 * 1000
|
||||||
|
private const val BATCH = 150
|
||||||
|
private const val GOG_BATCH = 50
|
||||||
|
private const val WIKIDATA = "https://query.wikidata.org/sparql"
|
||||||
|
|
||||||
|
class Ids(val steam: Set<String>, val gog: Set<String>, val epic: Set<String>) {
|
||||||
|
fun of(store: Store): Set<String> = when (store) {
|
||||||
|
Store.STEAM -> steam
|
||||||
|
Store.GOG -> gog
|
||||||
|
Store.EPIC -> epic
|
||||||
|
else -> emptySet()
|
||||||
|
}
|
||||||
|
|
||||||
|
val empty get() = steam.isEmpty() && gog.isEmpty() && epic.isEmpty()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun file(context: Context, name: String) = File(File(context.filesDir, "recomps").apply { mkdirs() }, name)
|
||||||
|
|
||||||
|
// IGDB slug -> the store IDs Wikidata has for that game; a slug Wikidata does not know maps to empty IDs.
|
||||||
|
fun forGames(context: Context, slugs: Collection<String>, offline: Boolean = false): Map<String, Ids> {
|
||||||
|
val cacheFile = file(context, "store-ids.json")
|
||||||
|
val cache = runCatching { JSONObject(cacheFile.readText()) }.getOrDefault(JSONObject())
|
||||||
|
val now = System.currentTimeMillis()
|
||||||
|
val stale = slugs.distinct().filter { now - (cache.optJSONObject(it)?.optLong("at") ?: 0L) > MAX_AGE_MS }
|
||||||
|
if (!offline && stale.isNotEmpty()) {
|
||||||
|
var changed = false
|
||||||
|
for (chunk in stale.chunked(BATCH)) {
|
||||||
|
val found = runCatching { query(chunk) }.onFailure { Log.w(TAG, "wikidata: $it") }.getOrNull() ?: break
|
||||||
|
for (slug in chunk) {
|
||||||
|
val ids = found[slug] ?: Ids(emptySet(), emptySet(), emptySet())
|
||||||
|
cache.put(slug, JSONObject().put("at", now).put("steam", JSONArray(ids.steam.toList()))
|
||||||
|
.put("gog", JSONArray(ids.gog.toList())).put("epic", JSONArray(ids.epic.toList())))
|
||||||
|
}
|
||||||
|
changed = true
|
||||||
|
}
|
||||||
|
if (changed) FileUtils.writeString(cacheFile, cache.toString())
|
||||||
|
}
|
||||||
|
return slugs.mapNotNull { slug -> cache.optJSONObject(slug)?.let { slug to idsOf(it) } }.toMap()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun idsOf(o: JSONObject): Ids {
|
||||||
|
fun set(key: String) = o.optJSONArray(key)?.let { a -> (0 until a.length()).map { a.getString(it) }.toSet() }.orEmpty()
|
||||||
|
return Ids(set("steam"), set("gog"), set("epic"))
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun sparql(slugs: List<String>): String {
|
||||||
|
val values = slugs.filter { Regex("[a-z0-9-]+").matches(it) }.joinToString(" ") { "\"$it\"" }
|
||||||
|
return "SELECT ?igdb ?steam ?gog ?epic WHERE { VALUES ?igdb { $values } ?item wdt:P5794 ?igdb . " +
|
||||||
|
"OPTIONAL { ?item wdt:P1733 ?steam } OPTIONAL { ?item wdt:P2725 ?gog } OPTIONAL { ?item wdt:P6278 ?epic } }"
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun query(slugs: List<String>): Map<String, Ids> {
|
||||||
|
val body = "query=" + URLEncoder.encode(sparql(slugs), "UTF-8") + "&format=json"
|
||||||
|
val conn = (URL(WIKIDATA).openConnection() as HttpURLConnection).apply {
|
||||||
|
requestMethod = "POST"; doOutput = true; connectTimeout = 15_000; readTimeout = 60_000
|
||||||
|
setRequestProperty("User-Agent", "DroidDeck (https://github.com/Droid-Deck/DroidDeck)")
|
||||||
|
setRequestProperty("Accept", "application/sparql-results+json")
|
||||||
|
setRequestProperty("Content-Type", "application/x-www-form-urlencoded")
|
||||||
|
}
|
||||||
|
return try {
|
||||||
|
conn.outputStream.use { it.write(body.toByteArray()) }
|
||||||
|
if (conn.responseCode != 200) throw IllegalStateException("HTTP ${conn.responseCode}")
|
||||||
|
parseSparql(conn.inputStream.bufferedReader().use { it.readText() })
|
||||||
|
} finally {
|
||||||
|
conn.disconnect()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun parseSparql(json: String): Map<String, Ids> {
|
||||||
|
val rows = JSONObject(json).getJSONObject("results").getJSONArray("bindings")
|
||||||
|
val out = HashMap<String, Triple<MutableSet<String>, MutableSet<String>, MutableSet<String>>>()
|
||||||
|
for (i in 0 until rows.length()) {
|
||||||
|
val row = rows.getJSONObject(i)
|
||||||
|
val slug = row.optJSONObject("igdb")?.optString("value") ?: continue
|
||||||
|
val (steam, gog, epic) = out.getOrPut(slug) { Triple(HashSet(), HashSet(), HashSet()) }
|
||||||
|
row.optJSONObject("steam")?.optString("value")?.takeIf { Regex("[0-9]+").matches(it) }?.let { steam += it }
|
||||||
|
row.optJSONObject("gog")?.optString("value")?.let { gogSlug(it) }?.let { gog += it }
|
||||||
|
row.optJSONObject("epic")?.optString("value")?.takeIf { it.isNotBlank() }?.let { epic += it.lowercase() }
|
||||||
|
}
|
||||||
|
return out.mapValues { (_, v) -> Ids(v.first, v.second, v.third) }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wikidata writes GOG IDs as "game/<slug>" (or "movie/<slug>"); GOG's API gives the bare slug.
|
||||||
|
internal fun gogSlug(value: String): String? = value.substringAfterLast('/').lowercase().takeIf { Regex("[a-z0-9_]+").matches(it) }
|
||||||
|
|
||||||
|
// GOG product ID -> slug, for the GOG products the player owns. Slugs do not change, so answers are kept.
|
||||||
|
fun gogSlugs(context: Context, ids: Collection<String>, offline: Boolean = false): Map<String, String> {
|
||||||
|
val cacheFile = file(context, "gog-slugs.json")
|
||||||
|
val cache = runCatching { JSONObject(cacheFile.readText()) }.getOrDefault(JSONObject())
|
||||||
|
val missing = ids.filter { Regex("[0-9]+").matches(it) && !cache.has(it) }.distinct()
|
||||||
|
if (!offline && missing.isNotEmpty()) {
|
||||||
|
var changed = false
|
||||||
|
for (chunk in missing.chunked(GOG_BATCH)) {
|
||||||
|
val body = runCatching { get("https://api.gog.com/products?ids=${chunk.joinToString(",")}&locale=en-US") }
|
||||||
|
.onFailure { Log.w(TAG, "gog: $it") }.getOrNull() ?: break
|
||||||
|
val found = parseGogProducts(body)
|
||||||
|
for (id in chunk) cache.put(id, found[id] ?: "")
|
||||||
|
changed = true
|
||||||
|
}
|
||||||
|
if (changed) FileUtils.writeString(cacheFile, cache.toString())
|
||||||
|
}
|
||||||
|
return ids.mapNotNull { id -> cache.optString(id).takeIf { it.isNotEmpty() }?.let { id to it } }.toMap()
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun parseGogProducts(json: String): Map<String, String> {
|
||||||
|
val arr = runCatching { JSONArray(json) }.getOrNull() ?: return emptyMap()
|
||||||
|
return (0 until arr.length()).mapNotNull { i ->
|
||||||
|
val o = arr.optJSONObject(i) ?: return@mapNotNull null
|
||||||
|
val id = o.opt("id")?.toString() ?: return@mapNotNull null
|
||||||
|
o.optString("slug").lowercase().takeIf { it.isNotEmpty() }?.let { id to it }
|
||||||
|
}.toMap()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun get(url: String): String {
|
||||||
|
val conn = (URL(url).openConnection() as HttpURLConnection).apply {
|
||||||
|
connectTimeout = 15_000; readTimeout = 30_000
|
||||||
|
setRequestProperty("User-Agent", "DroidDeck")
|
||||||
|
}
|
||||||
|
return try {
|
||||||
|
if (conn.responseCode != 200) throw IllegalStateException("HTTP ${conn.responseCode}")
|
||||||
|
conn.inputStream.bufferedReader().use { it.readText() }
|
||||||
|
} finally {
|
||||||
|
conn.disconnect()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,6 +14,7 @@ import com.droiddeck.launcher.R
|
|||||||
import com.droiddeck.launcher.core.Downloader
|
import com.droiddeck.launcher.core.Downloader
|
||||||
import com.droiddeck.launcher.core.FileUtils
|
import com.droiddeck.launcher.core.FileUtils
|
||||||
import com.droiddeck.launcher.core.Hashes
|
import com.droiddeck.launcher.core.Hashes
|
||||||
|
import com.droiddeck.launcher.session.SessionPrefs
|
||||||
import com.droiddeck.launcher.store.FlathubApi
|
import com.droiddeck.launcher.store.FlathubApi
|
||||||
import org.json.JSONArray
|
import org.json.JSONArray
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
@@ -73,7 +74,7 @@ object UserApps {
|
|||||||
|
|
||||||
class ScriptPlan(val folder: File, val copy: Boolean, val bytes: Long)
|
class ScriptPlan(val folder: File, val copy: Boolean, val bytes: Long)
|
||||||
|
|
||||||
private fun root(context: Context) = File(LinuxRuntime.rootDir(context), GUEST_DIR.substring(1))
|
internal fun root(context: Context) = File(LinuxRuntime.rootDir(context), GUEST_DIR.substring(1))
|
||||||
|
|
||||||
private fun overrides(context: Context, flatpakId: String) = File(root(context), "$FLATPAK_OVERRIDES/$flatpakId")
|
private fun overrides(context: Context, flatpakId: String) = File(root(context), "$FLATPAK_OVERRIDES/$flatpakId")
|
||||||
|
|
||||||
@@ -184,9 +185,10 @@ object UserApps {
|
|||||||
|
|
||||||
fun binds(context: Context): List<String> {
|
fun binds(context: Context): List<String> {
|
||||||
val internal = Environment.getExternalStorageDirectory().canonicalPath
|
val internal = Environment.getExternalStorageDirectory().canonicalPath
|
||||||
|
val mounted = SessionPrefs.mountSharedStorage(context)
|
||||||
return root(context).listFiles().orEmpty().mapNotNull { dir ->
|
return root(context).listFiles().orEmpty().mapNotNull { dir ->
|
||||||
val target = runCatching { Os.readlink(File(dir, "files").path) }.getOrNull() ?: return@mapNotNull null
|
val target = runCatching { Os.readlink(File(dir, "files").path) }.getOrNull() ?: return@mapNotNull null
|
||||||
target.takeIf { !it.startsWith("$internal/") && File(it).isDirectory }
|
target.takeIf { !(mounted && it.startsWith("$internal/")) && File(it).isDirectory }
|
||||||
}.distinct()
|
}.distinct()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,6 +247,27 @@ object UserApps {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [prepare] fills the new app folder's `files` and returns the entry's name there, or throws.
|
||||||
|
internal fun addPrepared(context: Context, name: String, icon: File?, meta: Map<String, String>, prepare: (File) -> String): String? {
|
||||||
|
if (!LinuxRuntime.isInstalled(context)) return context.getString(R.string.user_apps_runtime_required)
|
||||||
|
val base = root(context).apply { mkdirs() }
|
||||||
|
val dir = File(base, AppImageManager.idFor(name, base.list()?.toSet() ?: emptySet()))
|
||||||
|
return try {
|
||||||
|
dir.mkdirs()
|
||||||
|
val entry = prepare(dir)
|
||||||
|
FileUtils.writeString(File(dir, "entry"), entry)
|
||||||
|
FileUtils.writeString(File(dir, "name"), name)
|
||||||
|
if (icon != null && !saveIcon(icon, File(dir, "icon.png"))) Log.w(TAG, "icon ${icon.path} could not be read")
|
||||||
|
meta.forEach { (k, v) -> FileUtils.writeString(File(dir, k), v) }
|
||||||
|
writeScriptEntry(context, dir)
|
||||||
|
null
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "prepared $name", e)
|
||||||
|
FileUtils.delete(dir)
|
||||||
|
e.message ?: context.getString(R.string.user_apps_failed)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun writeScriptEntry(context: Context, dir: File) {
|
private fun writeScriptEntry(context: Context, dir: File) {
|
||||||
val id = dir.name
|
val id = dir.name
|
||||||
val icon = if (File(dir, "icon.png").isFile) "$GUEST_DIR/$id/icon.png" else "utilities-terminal"
|
val icon = if (File(dir, "icon.png").isFile) "$GUEST_DIR/$id/icon.png" else "utilities-terminal"
|
||||||
@@ -475,7 +498,8 @@ object UserApps {
|
|||||||
if (!file.isFile) return context.getString(R.string.user_apps_file_gone)
|
if (!file.isFile) return context.getString(R.string.user_apps_file_gone)
|
||||||
if (!FlatpakManager.ready(context)) FlatpakManager.setup(context, onProgress)?.let { return it }
|
if (!FlatpakManager.ready(context)) FlatpakManager.setup(context, onProgress)?.let { return it }
|
||||||
val shared = Environment.getExternalStorageDirectory().canonicalPath
|
val shared = Environment.getExternalStorageDirectory().canonicalPath
|
||||||
val copy = File(LinuxRuntime.rootDir(context), "tmp/droiddeck-bundle.flatpak").takeIf { !file.canonicalPath.startsWith("$shared/") }
|
val copy = File(LinuxRuntime.rootDir(context), "tmp/droiddeck-bundle.flatpak")
|
||||||
|
.takeIf { !SessionPrefs.mountSharedStorage(context) || !file.canonicalPath.startsWith("$shared/") }
|
||||||
try {
|
try {
|
||||||
if (copy != null) {
|
if (copy != null) {
|
||||||
onProgress(context.getString(R.string.user_apps_copying, file.name), -1)
|
onProgress(context.getString(R.string.user_apps_copying, file.name), -1)
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ object BottomDesktop {
|
|||||||
val generation: Int,
|
val generation: Int,
|
||||||
val installed: Boolean,
|
val installed: Boolean,
|
||||||
val nativeUserland: Boolean,
|
val nativeUserland: Boolean,
|
||||||
|
val sharedStorage: File?,
|
||||||
)
|
)
|
||||||
|
|
||||||
@Volatile private var launch: Launch? = null
|
@Volatile private var launch: Launch? = null
|
||||||
@@ -91,10 +92,11 @@ object BottomDesktop {
|
|||||||
sessionDir: File,
|
sessionDir: File,
|
||||||
generation: Int,
|
generation: Int,
|
||||||
nativeUserland: Boolean,
|
nativeUserland: Boolean,
|
||||||
|
sharedStorage: File?,
|
||||||
stillCurrent: () -> Boolean,
|
stillCurrent: () -> Boolean,
|
||||||
) {
|
) {
|
||||||
val prepared = Launch(ArrayList(guest), ArrayList(binds), sessionRoot, hostEnvironment.copyOf(), root, sessionDir, generation,
|
val prepared = Launch(ArrayList(guest), ArrayList(binds), sessionRoot, hostEnvironment.copyOf(), root, sessionDir, generation,
|
||||||
DesktopCatalog.desktopInstalled(root), nativeUserland)
|
DesktopCatalog.desktopInstalled(root), nativeUserland, sharedStorage)
|
||||||
synchronized(launchLock) { if (stillCurrent()) launch = prepared }
|
synchronized(launchLock) { if (stillCurrent()) launch = prepared }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,7 +315,7 @@ object BottomDesktop {
|
|||||||
val runtime = runtimeDir(context).apply { mkdirs() }
|
val runtime = runtimeDir(context).apply { mkdirs() }
|
||||||
val imeDir = File(current.sessionRoot, "bottom-desktop-ime")
|
val imeDir = File(current.sessionRoot, "bottom-desktop-ime")
|
||||||
main.post { if (generation == guestGeneration) watchIme(imeDir) }
|
main.post { if (generation == guestGeneration) watchIme(imeDir) }
|
||||||
val binds = LinuxRuntime.binds(context, current.sessionRoot, runtime, Environment.getExternalStorageDirectory(), current.binds)
|
val binds = LinuxRuntime.binds(context, current.sessionRoot, runtime, current.sharedStorage, current.binds)
|
||||||
val guest = ArrayList(current.guest).apply {
|
val guest = ArrayList(current.guest).apply {
|
||||||
add("DD_WIDTH=$width")
|
add("DD_WIDTH=$width")
|
||||||
add("DD_HEIGHT=$height")
|
add("DD_HEIGHT=$height")
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ object GameEnvironmentStore {
|
|||||||
) {
|
) {
|
||||||
publishGameCores(context)
|
publishGameCores(context)
|
||||||
val stored = config ?: read(context)
|
val stored = config ?: read(context)
|
||||||
val resolved = stored.copy(shared = GameEnvironment.defaults(SessionPrefs.fexPreset(context), SessionPrefs.forceSsbs(context)) + stored.shared)
|
val resolved = GameEnvironment.withKnownGames(stored).copy(shared = GameEnvironment.defaults(SessionPrefs.fexPreset(context), SessionPrefs.forceSsbs(context)) + stored.shared)
|
||||||
val json = encode(resolved)
|
val json = encode(resolved)
|
||||||
val dxvk = TextureFiltering.dxvkOptions(
|
val dxvk = TextureFiltering.dxvkOptions(
|
||||||
SessionPrefs.textureAnisotropy(context), SessionPrefs.textureLodBias(context),
|
SessionPrefs.textureAnisotropy(context), SessionPrefs.textureLodBias(context),
|
||||||
|
|||||||
@@ -59,13 +59,18 @@ object GameStorage {
|
|||||||
return when {
|
return when {
|
||||||
pref == SessionPrefs.GAME_STORAGE_OFF -> null
|
pref == SessionPrefs.GAME_STORAGE_OFF -> null
|
||||||
pref.isEmpty() -> options(context).firstOrNull()?.let { Option(it.name, it.path) }
|
pref.isEmpty() -> options(context).firstOrNull()?.let { Option(it.name, it.path) }
|
||||||
else -> Option(SessionPrefs.gameStorageLabel(context), pref).takeIf { attached(File(pref)) }
|
else -> reachable(pref).let { path -> Option(SessionPrefs.gameStorageLabel(context), path).takeIf { attached(File(path)) } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun disconnected(context: Context): Boolean {
|
fun disconnected(context: Context): Boolean {
|
||||||
val pref = SessionPrefs.gameStorage(context)
|
val pref = SessionPrefs.gameStorage(context)
|
||||||
return pref.isNotEmpty() && pref != SessionPrefs.GAME_STORAGE_OFF && !attached(File(pref))
|
return pref.isNotEmpty() && pref != SessionPrefs.GAME_STORAGE_OFF && !attached(File(reachable(pref)))
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun reachable(path: String, usable: (File) -> Boolean = { it.isDirectory && it.canWrite() }): String {
|
||||||
|
val alias = UsbLink.storagePath(path)
|
||||||
|
return if (alias != path && !usable(File(path)) && usable(File(alias))) alias else path
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun attached(
|
internal fun attached(
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ object Onboarding {
|
|||||||
/** The setup screens belong to the first run; later runtime, Proton and Steam client updates keep the usual Play button. */
|
/** The setup screens belong to the first run; later runtime, Proton and Steam client updates keep the usual Play button. */
|
||||||
val firstRun = MutableStateFlow(true)
|
val firstRun = MutableStateFlow(true)
|
||||||
|
|
||||||
|
/** Called once, when this process finishes the first-run downloads itself; not when everything was already in place. */
|
||||||
|
@Volatile var onFirstRunReady: (() -> Unit)? = null
|
||||||
|
@Volatile private var worked = false
|
||||||
|
|
||||||
fun attach(context: Context) {
|
fun attach(context: Context) {
|
||||||
appContext = context.applicationContext
|
appContext = context.applicationContext
|
||||||
val prefs = context.applicationContext.getSharedPreferences(PREFS, Context.MODE_PRIVATE)
|
val prefs = context.applicationContext.getSharedPreferences(PREFS, Context.MODE_PRIVATE)
|
||||||
@@ -52,8 +56,10 @@ object Onboarding {
|
|||||||
|
|
||||||
private fun markFirstRunDone() {
|
private fun markFirstRunDone() {
|
||||||
val context = appContext ?: return
|
val context = appContext ?: return
|
||||||
|
val live = firstRun.value && worked
|
||||||
context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit().putBoolean(KEY_FIRST_RUN_DONE, true).apply()
|
context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit().putBoolean(KEY_FIRST_RUN_DONE, true).apply()
|
||||||
firstRun.value = false
|
firstRun.value = false
|
||||||
|
if (live) onFirstRunReady?.invoke()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Keeps the process in the foreground, with one notification, while a step downloads and the runtime installer is not already doing so. */
|
/** Keeps the process in the foreground, with one notification, while a step downloads and the runtime installer is not already doing so. */
|
||||||
@@ -90,6 +96,7 @@ object Onboarding {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun report(step: Step, label: String, percent: Int) {
|
fun report(step: Step, label: String, percent: Int) {
|
||||||
|
worked = true
|
||||||
failed.value = failed.value - step
|
failed.value = failed.value - step
|
||||||
active.value = active.value + (step to Progress(label, percent))
|
active.value = active.value + (step to Progress(label, percent))
|
||||||
keepAlive()
|
keepAlive()
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.droiddeck.launcher.session
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On a Quest, SteamVR has to run inside the immersive activity. A launch from Steam's library happens in the
|
||||||
|
* guest, so the guest's SteamVR helper leaves a request in the shared runtime directory for the session to act on.
|
||||||
|
*/
|
||||||
|
object QuestSteamVrLaunch {
|
||||||
|
private const val DIR = ".wayland-rt/droiddeck-steamvr"
|
||||||
|
private const val MARKER = "quest-immersive"
|
||||||
|
private const val REQUEST = "xr-request"
|
||||||
|
|
||||||
|
fun publish(context: Context) {
|
||||||
|
val dir = File(context.filesDir, DIR)
|
||||||
|
val marker = File(dir, MARKER)
|
||||||
|
if (!QuestExperimental.isSupported()) {
|
||||||
|
marker.delete()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
runCatching {
|
||||||
|
dir.mkdirs()
|
||||||
|
marker.writeText("")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** A request left by an earlier session must not open the immersive view in this one. */
|
||||||
|
fun clearRequest(context: Context) {
|
||||||
|
File(context.filesDir, "$DIR/$REQUEST").delete()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun takeRequest(context: Context): Boolean =
|
||||||
|
QuestExperimental.isSupported() && File(context.filesDir, "$DIR/$REQUEST").delete()
|
||||||
|
}
|
||||||
@@ -46,7 +46,16 @@ object SecondaryLibrary {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun privateRoot(files: File, library: File): File {
|
fun privateRoot(files: File, library: File): File {
|
||||||
val digest = MessageDigest.getInstance("SHA-256").digest(library.canonicalPath.toByteArray())
|
val own = privateDir(files, library.canonicalPath)
|
||||||
|
if (own.exists()) return own
|
||||||
|
val raw = UsbLink.rawPath(library.absolutePath)
|
||||||
|
val alias = if (raw != library.absolutePath) raw else UsbLink.storagePath(library.absolutePath)
|
||||||
|
if (alias == library.absolutePath) return own
|
||||||
|
return privateDir(files, runCatching { File(alias).canonicalPath }.getOrDefault(alias)).takeIf { it.exists() } ?: own
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun privateDir(files: File, path: String): File {
|
||||||
|
val digest = MessageDigest.getInstance("SHA-256").digest(path.toByteArray())
|
||||||
.joinToString("") { "%02x".format(it.toInt() and 255) }
|
.joinToString("") { "%02x".format(it.toInt() and 255) }
|
||||||
return File(files, "steam-libraries/$digest")
|
return File(files, "steam-libraries/$digest")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ object SessionFiles {
|
|||||||
"usr/local/bin/kwin_wayland_wrapper" to "usr/local/bin/kwin_wayland_wrapper",
|
"usr/local/bin/kwin_wayland_wrapper" to "usr/local/bin/kwin_wayland_wrapper",
|
||||||
"usr/lib/firefox/defaults/pref/droiddeck.js" to "usr/lib/firefox/defaults/pref/droiddeck.js",
|
"usr/lib/firefox/defaults/pref/droiddeck.js" to "usr/lib/firefox/defaults/pref/droiddeck.js",
|
||||||
"etc/xdg/autostart/droiddeck-clipboard.desktop" to "etc/xdg/autostart/droiddeck-clipboard.desktop",
|
"etc/xdg/autostart/droiddeck-clipboard.desktop" to "etc/xdg/autostart/droiddeck-clipboard.desktop",
|
||||||
|
"usr/share/applications/droiddeck-return-gaming.desktop" to "usr/share/applications/droiddeck-return-gaming.desktop",
|
||||||
"etc/xdg/fastfetch/config.jsonc" to "etc/xdg/fastfetch/config.jsonc",
|
"etc/xdg/fastfetch/config.jsonc" to "etc/xdg/fastfetch/config.jsonc",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -960,12 +960,6 @@ object SessionPrefs {
|
|||||||
|
|
||||||
fun micAsked(context: Context): Boolean = prefs(context).getBoolean("micAsked", false)
|
fun micAsked(context: Context): Boolean = prefs(context).getBoolean("micAsked", false)
|
||||||
|
|
||||||
fun allFilesAsked(context: Context): Boolean = prefs(context).getBoolean("allFilesAsked", false)
|
|
||||||
|
|
||||||
fun setAllFilesAsked(context: Context) {
|
|
||||||
prefs(context).edit().putBoolean("allFilesAsked", true).apply()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun bluetoothAsked(context: Context): Boolean = prefs(context).getBoolean("bluetoothAsked", false)
|
fun bluetoothAsked(context: Context): Boolean = prefs(context).getBoolean("bluetoothAsked", false)
|
||||||
|
|
||||||
fun setBluetoothAsked(context: Context) {
|
fun setBluetoothAsked(context: Context) {
|
||||||
@@ -1090,6 +1084,14 @@ object SessionPrefs {
|
|||||||
|
|
||||||
fun gameThreadHints(context: Context): Boolean = prefs(context).getBoolean("gameThreadHints", true)
|
fun gameThreadHints(context: Context): Boolean = prefs(context).getBoolean("gameThreadHints", true)
|
||||||
|
|
||||||
|
/** Whether the phone's shared storage (/sdcard) is mounted into the Linux container. */
|
||||||
|
@JvmStatic
|
||||||
|
fun mountSharedStorage(context: Context): Boolean = prefs(context).getBoolean("mountSharedStorage", true)
|
||||||
|
|
||||||
|
fun setMountSharedStorage(context: Context, on: Boolean) {
|
||||||
|
prefs(context).edit().putBoolean("mountSharedStorage", on).apply()
|
||||||
|
}
|
||||||
|
|
||||||
fun prootNoSeccomp(context: Context): Boolean = prefs(context).getBoolean("prootNoSeccomp", false)
|
fun prootNoSeccomp(context: Context): Boolean = prefs(context).getBoolean("prootNoSeccomp", false)
|
||||||
|
|
||||||
fun setProotNoSeccomp(context: Context, on: Boolean) {
|
fun setProotNoSeccomp(context: Context, on: Boolean) {
|
||||||
@@ -1227,6 +1229,11 @@ object SessionPrefs {
|
|||||||
prefs(context).edit().putBoolean("venus", on).apply()
|
prefs(context).edit().putBoolean("venus", on).apply()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Venus off with no choice stored, so that Auto turning it off does not read as the user's own choice. */
|
||||||
|
fun clearVenus(context: Context) {
|
||||||
|
prefs(context).edit().remove("venus").apply()
|
||||||
|
}
|
||||||
|
|
||||||
fun setVkBridge(context: Context, on: Boolean) {
|
fun setVkBridge(context: Context, on: Boolean) {
|
||||||
prefs(context).edit().putBoolean("vkBridge", on).putBoolean("bridgeFellBack", false).apply()
|
prefs(context).edit().putBoolean("vkBridge", on).putBoolean("bridgeFellBack", false).apply()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -417,6 +417,7 @@ class SessionService : Service() {
|
|||||||
SessionPrefs.screenEffectsProfileId(SessionState.mode, resolvedGameId, SessionState.program),
|
SessionPrefs.screenEffectsProfileId(SessionState.mode, resolvedGameId, SessionState.program),
|
||||||
)
|
)
|
||||||
com.droiddeck.launcher.stores.battlenet.BattleNetClient.clearRequests(LinuxRuntime.sessionRoot(this))
|
com.droiddeck.launcher.stores.battlenet.BattleNetClient.clearRequests(LinuxRuntime.sessionRoot(this))
|
||||||
|
QuestSteamVrLaunch.clearRequest(this)
|
||||||
val gen = synchronized(SessionState.startLock) {
|
val gen = synchronized(SessionState.startLock) {
|
||||||
synchronized(stopLock) {
|
synchronized(stopLock) {
|
||||||
SessionState.steamClientArch = null
|
SessionState.steamClientArch = null
|
||||||
@@ -742,14 +743,15 @@ class SessionService : Service() {
|
|||||||
|
|
||||||
SessionEvents.step("shm-clear") { FileUtils.clear(File(LinuxRuntime.liveDir(this), "shm")) }
|
SessionEvents.step("shm-clear") { FileUtils.clear(File(LinuxRuntime.liveDir(this), "shm")) }
|
||||||
|
|
||||||
val binds = sessionBinds(controllersOn, fakeInputDir, sessionDir, guest, sessionRoot, runtimeDir)
|
val sharedStorage = LinuxRuntime.sharedStorage(this)
|
||||||
|
val binds = sessionBinds(controllersOn, fakeInputDir, sessionDir, guest, sessionRoot, runtimeDir, sharedStorage)
|
||||||
val nativeUserland = com.droiddeck.launcher.runtime.NativeGuest.enabled(this)
|
val nativeUserland = com.droiddeck.launcher.runtime.NativeGuest.enabled(this)
|
||||||
synchronized(stopLock) {
|
synchronized(stopLock) {
|
||||||
if (gen == sessionGen && SessionState.running) com.droiddeck.launcher.runtime.NativeGuest.sessionMode = nativeUserland
|
if (gen == sessionGen && SessionState.running) com.droiddeck.launcher.runtime.NativeGuest.sessionMode = nativeUserland
|
||||||
}
|
}
|
||||||
val fastPathKey = if (ProotFastPath.enabled(this)) {
|
val fastPathKey = if (ProotFastPath.enabled(this)) {
|
||||||
val prootBinds = LinuxRuntime.binds(
|
val prootBinds = LinuxRuntime.binds(
|
||||||
this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds,
|
this, sessionRoot, runtimeDir, sharedStorage, binds,
|
||||||
)
|
)
|
||||||
val root = LinuxRuntime.rootDir(this)
|
val root = LinuxRuntime.rootDir(this)
|
||||||
ProotFastPath.key(root, prootBinds)?.also { key ->
|
ProotFastPath.key(root, prootBinds)?.also { key ->
|
||||||
@@ -763,12 +765,12 @@ class SessionService : Service() {
|
|||||||
}
|
}
|
||||||
} else null
|
} else null
|
||||||
|
|
||||||
val sessionBindSpecs = LinuxRuntime.binds(this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds)
|
val sessionBindSpecs = LinuxRuntime.binds(this, sessionRoot, runtimeDir, sharedStorage, binds)
|
||||||
val command = if (nativeUserland) {
|
val command = if (nativeUserland) {
|
||||||
LinuxRuntime.rememberSessionBinds(sessionBindSpecs)
|
LinuxRuntime.rememberSessionBinds(sessionBindSpecs)
|
||||||
com.droiddeck.launcher.runtime.NativeGuest.command(root, guest.first(), guest.drop(1))
|
com.droiddeck.launcher.runtime.NativeGuest.command(root, guest.first(), guest.drop(1))
|
||||||
} else {
|
} else {
|
||||||
LinuxRuntime.command(this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds, guest)
|
LinuxRuntime.command(this, sessionRoot, runtimeDir, sharedStorage, binds, guest)
|
||||||
}
|
}
|
||||||
|
|
||||||
val prootEnv = HostEnvironment()
|
val prootEnv = HostEnvironment()
|
||||||
@@ -797,7 +799,7 @@ class SessionService : Service() {
|
|||||||
val terminalCommand = if (nativeUserland) {
|
val terminalCommand = if (nativeUserland) {
|
||||||
com.droiddeck.launcher.runtime.NativeGuest.command(root, shellGuest.first(), shellGuest.drop(1))
|
com.droiddeck.launcher.runtime.NativeGuest.command(root, shellGuest.first(), shellGuest.drop(1))
|
||||||
} else {
|
} else {
|
||||||
LinuxRuntime.command(this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds, shellGuest)
|
LinuxRuntime.command(this, sessionRoot, runtimeDir, sharedStorage, binds, shellGuest)
|
||||||
}
|
}
|
||||||
val terminalHostEnvironment = LinkedHashMap(System.getenv())
|
val terminalHostEnvironment = LinkedHashMap(System.getenv())
|
||||||
hostEnv.asArray().forEach { entry ->
|
hostEnv.asArray().forEach { entry ->
|
||||||
@@ -808,7 +810,7 @@ class SessionService : Service() {
|
|||||||
SessionTerminal.prepare(terminalCommand, terminalHostEnvironment.map { (key, value) -> "$key=$value" }.toTypedArray(), root, gen)
|
SessionTerminal.prepare(terminalCommand, terminalHostEnvironment.map { (key, value) -> "$key=$value" }.toTypedArray(), root, gen)
|
||||||
val (fastPathName, _) = ProotFastPath.hostEnv("")
|
val (fastPathName, _) = ProotFastPath.hostEnv("")
|
||||||
BottomDesktop.prepare(desktopGuest, binds, sessionRoot,
|
BottomDesktop.prepare(desktopGuest, binds, sessionRoot,
|
||||||
prootEnv.asArray().filterNot { it.startsWith("$fastPathName=") }.toTypedArray(), root, sessionDir, gen, nativeUserland,
|
prootEnv.asArray().filterNot { it.startsWith("$fastPathName=") }.toTypedArray(), root, sessionDir, gen, nativeUserland, sharedStorage,
|
||||||
) { gen == sessionGen && SessionState.running }
|
) { gen == sessionGen && SessionState.running }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1256,6 +1258,7 @@ class SessionService : Service() {
|
|||||||
guest: MutableList<String>,
|
guest: MutableList<String>,
|
||||||
sessionRoot: File,
|
sessionRoot: File,
|
||||||
runtimeDir: File,
|
runtimeDir: File,
|
||||||
|
sharedStorage: File?,
|
||||||
): ArrayList<String> {
|
): ArrayList<String> {
|
||||||
val binds = ArrayList<String>()
|
val binds = ArrayList<String>()
|
||||||
if (controllersOn) binds.add(fakeInputDir.path + ":/dev/input")
|
if (controllersOn) binds.add(fakeInputDir.path + ":/dev/input")
|
||||||
@@ -1299,7 +1302,17 @@ class SessionService : Service() {
|
|||||||
if (controllersOn) components.add(RumbleComponent().also { it.attach(this) })
|
if (controllersOn) components.add(RumbleComponent().also { it.attach(this) })
|
||||||
val home = File(LinuxRuntime.rootDir(this), "root")
|
val home = File(LinuxRuntime.rootDir(this), "root")
|
||||||
File(home, "Storage").mkdirs()
|
File(home, "Storage").mkdirs()
|
||||||
binds.add(Environment.getExternalStorageDirectory().path + ":/root/Storage")
|
if (sharedStorage != null) {
|
||||||
|
binds.add(sharedStorage.path + ":/root/Storage")
|
||||||
|
} else {
|
||||||
|
for (folder in com.droiddeck.launcher.frontend.AddedExes.list(this).map { File(it.folder) }.distinctBy { it.path }) {
|
||||||
|
val guest = com.droiddeck.launcher.frontend.AddedGames.guestPath(this, folder) ?: continue
|
||||||
|
if (!guest.startsWith("/root/Storage/") || !folder.isDirectory) continue
|
||||||
|
File(LinuxRuntime.rootDir(this), guest.removePrefix("/")).mkdirs()
|
||||||
|
binds.add(folder.path + ":" + guest)
|
||||||
|
Log.i(TAG, "added game: $folder -> $guest (shared storage not mounted)")
|
||||||
|
}
|
||||||
|
}
|
||||||
val library = GameStorage.effective(this)
|
val library = GameStorage.effective(this)
|
||||||
steamLibraryMounts = emptyMap()
|
steamLibraryMounts = emptyMap()
|
||||||
var storageDiagnosticLibrary: File? = null
|
var storageDiagnosticLibrary: File? = null
|
||||||
@@ -1373,7 +1386,7 @@ class SessionService : Service() {
|
|||||||
val gamesLibraries = GameStorage.gamesFolderLibraries(this)
|
val gamesLibraries = GameStorage.gamesFolderLibraries(this)
|
||||||
if (gamesLibraries.isNotEmpty()) {
|
if (gamesLibraries.isNotEmpty()) {
|
||||||
var room = if (ProotFastPath.enabled(this)) {
|
var room = if (ProotFastPath.enabled(this)) {
|
||||||
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds).size
|
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, sharedStorage, binds).size
|
||||||
} else Int.MAX_VALUE
|
} else Int.MAX_VALUE
|
||||||
for (games in gamesLibraries) {
|
for (games in gamesLibraries) {
|
||||||
if (games.host.path + ":" + games.guest !in binds) continue
|
if (games.host.path + ":" + games.guest !in binds) continue
|
||||||
@@ -1415,7 +1428,7 @@ class SessionService : Service() {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
val room = if (ProotFastPath.enabled(this)) {
|
val room = if (ProotFastPath.enabled(this)) {
|
||||||
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds).size
|
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, sharedStorage, binds).size
|
||||||
} else Int.MAX_VALUE
|
} else Int.MAX_VALUE
|
||||||
val content = SecondaryLibrary.contentPath(entry.host)
|
val content = SecondaryLibrary.contentPath(entry.host)
|
||||||
val extra = SecondaryLibrary.binds(filesDir, entry.host, listOf(entry.guest), content = content)
|
val extra = SecondaryLibrary.binds(filesDir, entry.host, listOf(entry.guest), content = content)
|
||||||
@@ -1444,7 +1457,7 @@ class SessionService : Service() {
|
|||||||
Log.w(TAG, "x86-64 steam library: $problem")
|
Log.w(TAG, "x86-64 steam library: $problem")
|
||||||
} else try {
|
} else try {
|
||||||
val room = if (ProotFastPath.enabled(this)) {
|
val room = if (ProotFastPath.enabled(this)) {
|
||||||
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds).size
|
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, sharedStorage, binds).size
|
||||||
} else Int.MAX_VALUE
|
} else Int.MAX_VALUE
|
||||||
val extra = SecondaryLibrary.binds(filesDir, x64, listOf(GameStorage.X64_CARD_GUEST)).drop(1)
|
val extra = SecondaryLibrary.binds(filesDir, x64, listOf(GameStorage.X64_CARD_GUEST)).drop(1)
|
||||||
if (extra.size > room) {
|
if (extra.size > room) {
|
||||||
@@ -1466,7 +1479,7 @@ class SessionService : Service() {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
val room = if (ProotFastPath.enabled(this)) {
|
val room = if (ProotFastPath.enabled(this)) {
|
||||||
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds).size
|
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, sharedStorage, binds).size
|
||||||
} else Int.MAX_VALUE
|
} else Int.MAX_VALUE
|
||||||
val extra = SecondaryLibrary.binds(filesDir, entry.x64Host, listOf(entry.x64Guest)).drop(1)
|
val extra = SecondaryLibrary.binds(filesDir, entry.x64Host, listOf(entry.x64Guest)).drop(1)
|
||||||
if (extra.size > room) {
|
if (extra.size > room) {
|
||||||
@@ -1502,7 +1515,7 @@ class SessionService : Service() {
|
|||||||
val listing = File(filesDir, "session/desktop-volumes.json").apply { parentFile?.mkdirs() }
|
val listing = File(filesDir, "session/desktop-volumes.json").apply { parentFile?.mkdirs() }
|
||||||
val volumes = org.json.JSONArray()
|
val volumes = org.json.JSONArray()
|
||||||
var room = if (ProotFastPath.enabled(this)) {
|
var room = if (ProotFastPath.enabled(this)) {
|
||||||
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, Environment.getExternalStorageDirectory(), binds).size
|
ProotFastPath.MAX_BINDS - LinuxRuntime.binds(this, sessionRoot, runtimeDir, sharedStorage, binds).size
|
||||||
} else Int.MAX_VALUE
|
} else Int.MAX_VALUE
|
||||||
for (root in com.droiddeck.launcher.files.StorageRoots.list(this)) {
|
for (root in com.droiddeck.launcher.files.StorageRoots.list(this)) {
|
||||||
if (!root.removable || !root.readable) continue
|
if (!root.removable || !root.readable) continue
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ object SettingsReset {
|
|||||||
"gpuDriverMode", "androidDriver", "linuxDriver", "linuxDriver.steam", "linuxDriver.desktop",
|
"gpuDriverMode", "androidDriver", "linuxDriver", "linuxDriver.steam", "linuxDriver.desktop",
|
||||||
"tuSysmem", "glThread", "noGlError", "zinkLazy", "mangoapp", "gpuClockPin", "gamescopeRealtime", "paceCores",
|
"tuSysmem", "glThread", "noGlError", "zinkLazy", "mangoapp", "gpuClockPin", "gamescopeRealtime", "paceCores",
|
||||||
"directAudio", "mic", "wifiDiscovery", "clientCpusOverride", "clientCpus", "gameCpus",
|
"directAudio", "mic", "wifiDiscovery", "clientCpusOverride", "clientCpus", "gameCpus",
|
||||||
"noXalia", "fastSync", "fsyncFirst", "syncFallback", "prootNoSeccomp", "prootFastPath", "nativeUserland", "cursorComposite",
|
"noXalia", "fastSync", "fsyncFirst", "syncFallback", "prootNoSeccomp", "prootFastPath", "nativeUserland", "cursorComposite", "mountSharedStorage",
|
||||||
"guestHostname", "fexPreset", "forceSsbs", "logs", "gameDebugLogsEnabled", "enhancedDiagnosticsNext", "storageDiagnostics", "buildWatermark",
|
"guestHostname", "fexPreset", "forceSsbs", "logs", "gameDebugLogsEnabled", "enhancedDiagnosticsNext", "storageDiagnostics", "buildWatermark",
|
||||||
"upscaler", "upscaleSharpness", "screenEffects", "blackFrameInsertion", "textureAnisotropy", "textureLodBias",
|
"upscaler", "upscaleSharpness", "screenEffects", "blackFrameInsertion", "textureAnisotropy", "textureLodBias",
|
||||||
"steamDownloadsInBackground", "steam_offline", "steam_offline_auto", "steam_offline_by_network", "bootMovie", "bootMovieSound", "bootMovieVolume", "bootMovieSeconds", "skipBootMovie",
|
"steamDownloadsInBackground", "steam_offline", "steam_offline_auto", "steam_offline_by_network", "bootMovie", "bootMovieSound", "bootMovieVolume", "bootMovieSeconds", "skipBootMovie",
|
||||||
|
|||||||
@@ -10,9 +10,23 @@ import java.io.File
|
|||||||
// browser view placed outside the Big Picture window, composition capped at "notification" so gamescope keeps the game
|
// browser view placed outside the Big Picture window, composition capped at "notification" so gamescope keeps the game
|
||||||
// focused, and gamepad focus on the main UI. The hold is a lease the app renews, so Steam recovers if the app goes away.
|
// focused, and gamepad focus on the main UI. The hold is a lease the app renews, so Steam recovers if the app goes away.
|
||||||
object SteamQam {
|
object SteamQam {
|
||||||
data class Target(val port: Int, val path: String)
|
/** [mainPath] is Steam's main menu page, shown beside the quick access menu in the split layout. */
|
||||||
|
data class Target(val port: Int, val path: String, val mainPath: String? = null)
|
||||||
|
|
||||||
|
const val MAIN_MENU = 1
|
||||||
const val QUICK_ACCESS = 2
|
const val QUICK_ACCESS = 2
|
||||||
|
|
||||||
|
/** Height in CSS pixels both menus are laid out at in the split layout, so they show at one scale. */
|
||||||
|
const val SPLIT_CSS_HEIGHT = 480
|
||||||
|
|
||||||
|
/** Steam's own width for the main menu; quick access takes the rest of the panel. */
|
||||||
|
const val MAIN_CSS_WIDTH = 240
|
||||||
|
|
||||||
|
/** Holds the parked main menu in place and spreads its item rows (not dividers) over the full height, at most 80 px each. */
|
||||||
|
private const val MAIN_PARKED_CSS =
|
||||||
|
".BasicUI > .Panel { transform: none !important; width: 100% !important; height: 100% !important; margin: 0 !important; } " +
|
||||||
|
".BasicUI > .Panel > :has(> .Focusable) { flex: 1 1 0 !important; height: auto !important; max-height: 80px; } " +
|
||||||
|
".BasicUI > .Panel > :has(> .Focusable) > .Panel { height: 100% !important; }"
|
||||||
const val LEASE_MS = 5_000
|
const val LEASE_MS = 5_000
|
||||||
private const val TAG = "SteamQam"
|
private const val TAG = "SteamQam"
|
||||||
private const val EVAL_MS = 6_000L
|
private const val EVAL_MS = 6_000L
|
||||||
@@ -26,21 +40,54 @@ object SteamQam {
|
|||||||
* Takes or renews the lease for [owner], or releases it. A live lease held by a newer panel is never taken back by an
|
* Takes or renews the lease for [owner], or releases it. A live lease held by a newer panel is never taken back by an
|
||||||
* older one, so a late request from a panel being torn down cannot end its replacement's lease or change its layout.
|
* older one, so a late request from a panel being torn down cannot end its replacement's lease or change its layout.
|
||||||
*/
|
*/
|
||||||
internal fun leaseScript(on: Boolean, owner: Long, aspect: Float = 0f): String =
|
internal fun leaseScript(on: Boolean, owner: Long, aspect: Float = 0f, split: Boolean = false): String =
|
||||||
if (on) "if (!(g.__ddQamUntil > Date.now()) || !(g.__ddQamOwner > $owner)) { g.__ddQamOwner = $owner; g.__ddQamUntil = Date.now() + $LEASE_MS;" +
|
if (on) "if (!(g.__ddQamUntil > Date.now()) || !(g.__ddQamOwner > $owner)) { g.__ddQamOwner = $owner; g.__ddQamUntil = Date.now() + $LEASE_MS;" +
|
||||||
(if (aspect > 0f) " g.__ddQamAspect = $aspect;" else "") + " }"
|
(if (aspect > 0f) " g.__ddQamAspect = $aspect;" else "") + " g.__ddQamSplit = $split; }"
|
||||||
else "if (g.__ddQamOwner === $owner) g.__ddQamUntil = 0;"
|
else "if (g.__ddQamOwner === $owner) g.__ddQamUntil = 0;"
|
||||||
|
|
||||||
/** [aspect] is the panel's width over height: the menu is laid out at that shape so every tab shows at one scale. */
|
/**
|
||||||
internal fun script(on: Boolean, aspect: Float = 0f, owner: Long = 0): String = """(() => {
|
* [aspect] is the panel's width over height: the menu is laid out at that shape so every tab shows at one scale. With
|
||||||
const g = globalThis, QAM = 2;
|
* [split], Steam's main menu is kept rendered at its own width beside the quick access menu, which gets the rest.
|
||||||
|
*/
|
||||||
|
internal fun script(on: Boolean, aspect: Float = 0f, owner: Long = 0, split: Boolean = false): String = """(() => {
|
||||||
|
const g = globalThis, QAM = 2, MAIN = 1;
|
||||||
const W = SteamUIStore.WindowStore.SteamUIWindows[0];
|
const W = SteamUIStore.WindowStore.SteamUIWindows[0];
|
||||||
const m = W.MenuStore, c = W.m_CompositionStateStore;
|
const m = W.MenuStore, c = W.m_CompositionStateStore;
|
||||||
const nav = W.m_FocusNavContext;
|
const nav = W.m_FocusNavContext;
|
||||||
const popup = g_PopupManager.GetExistingPopup("SP BPM_uid0");
|
const popup = g_PopupManager.GetExistingPopup("SP BPM_uid0");
|
||||||
const held = () => g.__ddQamUntil > Date.now();
|
const held = () => g.__ddQamUntil > Date.now();
|
||||||
const ours = () => held() && m.m_eOpenSideMenu === QAM && !g.__ddQamTop;
|
const split = () => held() && g.__ddQamSplit === true;
|
||||||
|
// Steam's views carry no names: the main menu's is the one Steam focuses while the main menu is open. Until Steam
|
||||||
|
// has shown it, the main menu is opened once with its view parked like the quick access menu's.
|
||||||
|
const probing = () => g.__ddMainProbe > Date.now();
|
||||||
|
const ours = () => held() && !g.__ddQamTop && (m.m_eOpenSideMenu === QAM || (probing() && m.m_eOpenSideMenu === MAIN));
|
||||||
const width = (h) => g.__ddQamAspect > 0 ? Math.round(h * g.__ddQamAspect) : 0;
|
const width = (h) => g.__ddQamAspect > 0 ? Math.round(h * g.__ddQamAspect) : 0;
|
||||||
|
const parkX = () => popup.m_popup.innerWidth + 64;
|
||||||
|
const mainSize = () => [$MAIN_CSS_WIDTH, $SPLIT_CSS_HEIGHT];
|
||||||
|
const qamSplitSize = () => [Math.max(Math.round($SPLIT_CSS_HEIGHT * (g.__ddQamAspect > 0 ? g.__ddQamAspect : 1)) - $MAIN_CSS_WIDTH, 320), $SPLIT_CSS_HEIGHT];
|
||||||
|
const size = (w, h) => split() ? qamSplitSize() : [width(h) || w, h];
|
||||||
|
const mainView = () => views().find(v => v.__ddMain);
|
||||||
|
// Only the quick access view is parked: the one Steam focuses while quick access is open. Before Steam has
|
||||||
|
// focused it, any view but the main menu's and the header's web page (Store and other pages) may be it.
|
||||||
|
const headerView = () => W.m_HeaderStore?.m_currentBrowserAndBackstack?.m_browserView;
|
||||||
|
const isQam = (v) => !v.__ddMain && v !== headerView() &&
|
||||||
|
(!!v.__ddQamView || !views().some(o => o.__ddQamView) || (probing() && m.m_eOpenSideMenu === MAIN));
|
||||||
|
const mainParked = () => split() && (m.m_eOpenSideMenu !== MAIN || probing());
|
||||||
|
const mainDoc = () => {
|
||||||
|
for (const s of SteamUIStore.m_GamepadNavigationManager?.m_rgGamepadInputSources || []) {
|
||||||
|
try { const d = s.m_targetWindow?.document; if (d?.title?.startsWith("MainMenu")) return d; } catch (e) {}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
// Steam slides the main menu out whenever it is not the open side menu; parked, it stays in place and fills its view.
|
||||||
|
const mainStyle = (on) => {
|
||||||
|
const d = mainDoc();
|
||||||
|
let s = d?.getElementById("dd-main-split");
|
||||||
|
if (!on) { s?.remove(); return; }
|
||||||
|
if (!d?.head) return;
|
||||||
|
if (!s) { s = d.createElement("style"); s.id = "dd-main-split"; d.head.appendChild(s); }
|
||||||
|
if (s.textContent !== "$MAIN_PARKED_CSS") s.textContent = "$MAIN_PARKED_CSS";
|
||||||
|
};
|
||||||
if (!c.__ddQam) {
|
if (!c.__ddQam) {
|
||||||
c.__ddQam = c.ComputeOverallMinimumRequestedComposition;
|
c.__ddQam = c.ComputeOverallMinimumRequestedComposition;
|
||||||
m.__ddQam = m.OnMenuDeactivated;
|
m.__ddQam = m.OnMenuDeactivated;
|
||||||
@@ -59,6 +106,18 @@ object SteamQam {
|
|||||||
return without >= 2 ? v : 1;
|
return without >= 2 ? v : 1;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
// Steam frosts its Store page while a side menu is open; a parked menu is not over it.
|
||||||
|
const inst = m.m_Instance;
|
||||||
|
if (inst?.SetStoreBrowserGlass && !inst.__ddQamGlass) {
|
||||||
|
inst.__ddQamGlass = inst.SetStoreBrowserGlass;
|
||||||
|
inst.SetStoreBrowserGlass = function (e) { return inst.__ddQamGlass.call(this, ours() ? 0 : e); };
|
||||||
|
}
|
||||||
|
const glass = () => {
|
||||||
|
const on = !ours() && m.m_eOpenSideMenu !== 0;
|
||||||
|
if (g.__ddQamGlassOn === on) return;
|
||||||
|
g.__ddQamGlassOn = on;
|
||||||
|
inst?.SetStoreBrowserGlass?.(m.m_eOpenSideMenu);
|
||||||
|
};
|
||||||
const views = () => popup?.m_rgChildBrowserViews || [];
|
const views = () => popup?.m_rgChildBrowserViews || [];
|
||||||
const backdrop = (hide) => {
|
const backdrop = (hide) => {
|
||||||
const doc = popup?.m_popup?.document;
|
const doc = popup?.m_popup?.document;
|
||||||
@@ -75,16 +134,61 @@ object SteamQam {
|
|||||||
};
|
};
|
||||||
const keep = () => {
|
const keep = () => {
|
||||||
for (const v of views()) {
|
for (const v of views()) {
|
||||||
if (v.__ddQam) continue;
|
if (!v.__ddQam) v.__ddQam = v.SetBounds;
|
||||||
v.__ddQam = v.SetBounds;
|
if (v.__ddQamW === 4) continue;
|
||||||
|
v.__ddQamW = 4;
|
||||||
|
v.__ddQamVis = v.__ddQamVis || v.SetVisible;
|
||||||
|
v.__ddQamFocus = v.__ddQamFocus || v.SetFocus;
|
||||||
v.SetBounds = function (x, y, w, h, ...r) {
|
v.SetBounds = function (x, y, w, h, ...r) {
|
||||||
|
if (v.__ddMain && mainParked()) {
|
||||||
|
if (w > 0) v.__ddMainAsked = [x, y, w, h];
|
||||||
|
[w, h] = mainSize();
|
||||||
|
v.__ddMainOn = true; v.__ddMainW = w; v.__ddMainH = h;
|
||||||
|
return v.__ddQam.call(this, parkX(), 0, w, h, ...r);
|
||||||
|
}
|
||||||
|
if (v.__ddMain && w > 0) mainStyle(false);
|
||||||
v.__ddAsked = [x, y, w, h];
|
v.__ddAsked = [x, y, w, h];
|
||||||
if (w > 0 && ours()) { x = popup.m_popup.innerWidth + 64; w = width(h) || w; }
|
if (w > 0 && ours() && isQam(v)) { x = parkX(); [w, h] = size(w, h); }
|
||||||
v.__ddAt = x;
|
v.__ddAt = x;
|
||||||
v.__ddW = w;
|
v.__ddW = w;
|
||||||
|
v.__ddH = h;
|
||||||
return v.__ddQam.call(this, x, y, w, h, ...r);
|
return v.__ddQam.call(this, x, y, w, h, ...r);
|
||||||
};
|
};
|
||||||
|
v.SetVisible = function (on, ...r) {
|
||||||
|
return v.__ddQamVis.call(this, on || (!!v.__ddMain && mainParked()), ...r);
|
||||||
|
};
|
||||||
|
v.SetFocus = function (on, ...r) {
|
||||||
|
if (on && m.m_eOpenSideMenu === MAIN && v !== headerView()) {
|
||||||
|
for (const o of views()) if (o !== v) delete o.__ddMain;
|
||||||
|
v.__ddMain = true;
|
||||||
|
delete v.__ddQamView;
|
||||||
|
}
|
||||||
|
if (on && m.m_eOpenSideMenu === QAM && !v.__ddMain && v !== headerView()) {
|
||||||
|
for (const o of views()) if (o !== v) delete o.__ddQamView;
|
||||||
|
v.__ddQamView = true;
|
||||||
|
}
|
||||||
|
return v.__ddQamFocus.call(this, on, ...r);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
if (g.__ddMainProbe && !probing()) { g.__ddMainProbe = 0; g.__ddMainProbed = true; }
|
||||||
|
if (probing() && mainView()) { g.__ddMainProbe = 0; g.__ddMainProbed = true; }
|
||||||
|
const mv = mainView();
|
||||||
|
if (mv && !probing()) {
|
||||||
|
if (mainParked()) {
|
||||||
|
const [w, h] = mainSize();
|
||||||
|
if (!mv.__ddMainOn || mv.__ddMainW !== w || mv.__ddMainH !== h) {
|
||||||
|
mv.__ddQam.call(mv, parkX(), 0, w, h);
|
||||||
|
mv.__ddQamVis.call(mv, true);
|
||||||
|
mv.__ddMainOn = true; mv.__ddMainW = w; mv.__ddMainH = h;
|
||||||
|
}
|
||||||
|
} else if (mv.__ddMainOn) {
|
||||||
|
mv.__ddMainOn = false;
|
||||||
|
if (m.m_eOpenSideMenu !== MAIN) { mv.__ddQamVis.call(mv, false); mv.__ddQam.call(mv, 0, 0, 0, 0); }
|
||||||
|
else if (mv.__ddMainAsked) mv.__ddQam.call(mv, ...mv.__ddMainAsked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mainStyle(!!mv && mainParked() && !probing());
|
||||||
|
glass();
|
||||||
if (!held()) {
|
if (!held()) {
|
||||||
const parked = !g.__ddQamTop;
|
const parked = !g.__ddQamTop;
|
||||||
g.__ddQamTop = false;
|
g.__ddQamTop = false;
|
||||||
@@ -124,6 +228,25 @@ object SteamQam {
|
|||||||
}
|
}
|
||||||
g.__ddQamTop = false;
|
g.__ddQamTop = false;
|
||||||
}
|
}
|
||||||
|
// Each Split activation gets a fresh probe budget, and a spent one refills after a backoff, so a Steam that was
|
||||||
|
// still loading does not leave the main menu undiscovered for good.
|
||||||
|
if (split() !== !!g.__ddQamSplitOn) { g.__ddQamSplitOn = split(); if (split()) g.__ddMainProbes = 0; }
|
||||||
|
if (split() && !mv) {
|
||||||
|
if (probing()) return;
|
||||||
|
if ((g.__ddMainProbes || 0) >= 3 && Date.now() - (g.__ddMainProbeLast || 0) > 30000) g.__ddMainProbes = 0;
|
||||||
|
if ((g.__ddMainProbes || 0) < 3 && m.m_eOpenSideMenu !== MAIN) {
|
||||||
|
g.__ddMainProbes = (g.__ddMainProbes || 0) + 1;
|
||||||
|
g.__ddMainProbeLast = Date.now();
|
||||||
|
g.__ddMainProbe = Date.now() + 1500;
|
||||||
|
m.OpenMainMenu();
|
||||||
|
c.EnsureCorrectComposition?.();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (g.__ddMainProbed) {
|
||||||
|
g.__ddMainProbed = false;
|
||||||
|
if (m.m_eOpenSideMenu === MAIN) m.OpenQuickAccessMenu(g.__ddQamTab ?? undefined);
|
||||||
|
}
|
||||||
const decky = !!g.DeckyPluginLoader?.tabsHook?.qamBrowserViewPatch;
|
const decky = !!g.DeckyPluginLoader?.tabsHook?.qamBrowserViewPatch;
|
||||||
// Decky hooks the menu after Steam starts; the menu has to unmount for its tab to appear, so reopen on the next tick.
|
// Decky hooks the menu after Steam starts; the menu has to unmount for its tab to appear, so reopen on the next tick.
|
||||||
if (m.m_eOpenSideMenu === QAM && decky && !g.__ddQamDecky) { g.__ddQamDecky = true; m.CloseSideMenus(); return; }
|
if (m.m_eOpenSideMenu === QAM && decky && !g.__ddQamDecky) { g.__ddQamDecky = true; m.CloseSideMenus(); return; }
|
||||||
@@ -136,18 +259,26 @@ object SteamQam {
|
|||||||
if (m.m_eQuickAccessTab != null) g.__ddQamTab = m.m_eQuickAccessTab;
|
if (m.m_eQuickAccessTab != null) g.__ddQamTab = m.m_eQuickAccessTab;
|
||||||
if (!g.__ddQamOn) { g.__ddQamOn = true; c.EnsureCorrectComposition?.(); }
|
if (!g.__ddQamOn) { g.__ddQamOn = true; c.EnsureCorrectComposition?.(); }
|
||||||
for (const v of views()) {
|
for (const v of views()) {
|
||||||
|
if (v.__ddMain) continue;
|
||||||
|
if (!isQam(v)) {
|
||||||
|
// A view parked before the quick access view was known goes back where Steam asked for it.
|
||||||
|
const a = v.__ddAsked;
|
||||||
|
if (a?.[2] > 0 && v.__ddAt >= popup.m_popup.innerWidth) { v.__ddQam.call(v, ...a); v.__ddAt = a[0]; v.__ddW = a[2]; v.__ddH = a[3]; }
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!v.__ddAsked) {
|
if (!v.__ddAsked) {
|
||||||
const b = v.GetBounds?.();
|
const b = v.GetBounds?.();
|
||||||
if (b && b.width > 0) { v.__ddAsked = [b.x, b.y, b.width, b.height]; v.__ddAt = b.x; v.__ddW = b.width; }
|
if (b && b.width > 0) { v.__ddAsked = [b.x, b.y, b.width, b.height]; v.__ddAt = b.x; v.__ddW = b.width; v.__ddH = b.height; }
|
||||||
}
|
}
|
||||||
const a = v.__ddAsked;
|
const a = v.__ddAsked;
|
||||||
if (a?.[2] > 0 && (v.__ddAt < popup.m_popup.innerWidth || (width(a[3]) && v.__ddW !== width(a[3])))) v.SetBounds(...a);
|
const [w, h] = a?.[2] > 0 ? size(a[2], a[3]) : [0, 0];
|
||||||
|
if (a?.[2] > 0 && (v.__ddAt < popup.m_popup.innerWidth || v.__ddW !== w || v.__ddH !== h)) v.SetBounds(...a);
|
||||||
}
|
}
|
||||||
const main = nav?.m_rgGamepadNavigationTrees?.find(t => t.m_ID === "GamepadUI_Full_Root");
|
const main = nav?.m_rgGamepadNavigationTrees?.find(t => t.m_ID === "GamepadUI_Full_Root");
|
||||||
if (main && nav.m_LastActiveNavTree?.m_ID?.startsWith("QuickAccess")) nav.SetActiveNavTree(main);
|
if (main && /^(QuickAccess|MainMenu)/.test(nav.m_LastActiveNavTree?.m_ID ?? "")) nav.SetActiveNavTree(main);
|
||||||
backdrop(true);
|
backdrop(true);
|
||||||
};
|
};
|
||||||
${leaseScript(on, owner, aspect)}
|
${leaseScript(on, owner, aspect, split)}
|
||||||
keep();
|
keep();
|
||||||
if (held() && !g.__ddQamTimer) {
|
if (held() && !g.__ddQamTimer) {
|
||||||
g.__ddQamTimer = setInterval(() => {
|
g.__ddQamTimer = setInterval(() => {
|
||||||
@@ -161,7 +292,8 @@ object SteamQam {
|
|||||||
/** [open] is Steam's open side menu; [top] is true while the menu is shown on the top screen. */
|
/** [open] is Steam's open side menu; [top] is true while the menu is shown on the top screen. */
|
||||||
data class Hold(val open: Int, val top: Boolean)
|
data class Hold(val open: Int, val top: Boolean)
|
||||||
|
|
||||||
fun hold(context: Context, aspect: Float, owner: Long): Hold? = eval(context, script(true, aspect, owner))?.let(::parseHold)
|
fun hold(context: Context, aspect: Float, owner: Long, split: Boolean = false): Hold? =
|
||||||
|
eval(context, script(true, aspect, owner, split))?.let(::parseHold)
|
||||||
|
|
||||||
internal fun parseHold(text: String): Hold? = runCatching {
|
internal fun parseHold(text: String): Hold? = runCatching {
|
||||||
val a = JSONArray(text)
|
val a = JSONArray(text)
|
||||||
@@ -181,7 +313,9 @@ object SteamQam {
|
|||||||
fun target(context: Context): Target? = runCatching {
|
fun target(context: Context): Target? = runCatching {
|
||||||
val devtools = File(AgentGuest.dir(context), "cdp-port").readText().trim().toInt()
|
val devtools = File(AgentGuest.dir(context), "cdp-port").readText().trim().toInt()
|
||||||
val (relay, secret) = parseRelay(helper(context, "start", devtools.toString())) ?: return null
|
val (relay, secret) = parseRelay(helper(context, "start", devtools.toString())) ?: return null
|
||||||
val found = runCatching { parseTarget(relay, get(relay, "/$secret/json"))?.let { it.copy(path = "/$secret${it.path}") } }
|
val found = runCatching {
|
||||||
|
parseTarget(relay, get(relay, "/$secret/json"))?.let { t -> t.copy(path = "/$secret${t.path}", mainPath = t.mainPath?.let { "/$secret$it" }) }
|
||||||
|
}
|
||||||
if (found.getOrNull() == null) helper(context, "stop", relay.toString())
|
if (found.getOrNull() == null) helper(context, "stop", relay.toString())
|
||||||
found.getOrThrow()
|
found.getOrThrow()
|
||||||
}.onFailure { android.util.Log.e(TAG, "no quick access target: $it") }.getOrNull()
|
}.onFailure { android.util.Log.e(TAG, "no quick access target: $it") }.getOrNull()
|
||||||
@@ -232,14 +366,16 @@ object SteamQam {
|
|||||||
|
|
||||||
internal fun parseTarget(port: Int, json: String): Target? {
|
internal fun parseTarget(port: Int, json: String): Target? {
|
||||||
val list = JSONArray(json)
|
val list = JSONArray(json)
|
||||||
for (i in 0 until list.length()) {
|
fun page(prefix: String): String? {
|
||||||
val t = list.optJSONObject(i) ?: continue
|
for (i in 0 until list.length()) {
|
||||||
if (!t.optString("title").startsWith("QuickAccess")) continue
|
val t = list.optJSONObject(i) ?: continue
|
||||||
val ws = t.optString("webSocketDebuggerUrl")
|
if (!t.optString("title").startsWith(prefix)) continue
|
||||||
val path = Regex("^ws://[^/]+(/devtools/page/[A-Za-z0-9-]+)$").find(ws)?.groupValues?.get(1) ?: continue
|
val ws = t.optString("webSocketDebuggerUrl")
|
||||||
return Target(port, path)
|
Regex("^ws://[^/]+(/devtools/page/[A-Za-z0-9-]+)$").find(ws)?.groupValues?.get(1)?.let { return it }
|
||||||
|
}
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
return null
|
return page("QuickAccess")?.let { Target(port, it, page("MainMenu")) }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun eval(context: Context, expression: String): String? = runCatching {
|
private fun eval(context: Context, expression: String): String? = runCatching {
|
||||||
|
|||||||
@@ -105,14 +105,9 @@ object WinComponents {
|
|||||||
const val VCREDIST_ARM64 = "vcredist2022_arm64"
|
const val VCREDIST_ARM64 = "vcredist2022_arm64"
|
||||||
|
|
||||||
internal fun builtInArm64Runtime(): Component {
|
internal fun builtInArm64Runtime(): Component {
|
||||||
fun value(view: String, name: String, type: String, data: String) = Step("set_register_key", JSONObject()
|
val install = Step("install_exe", JSONObject().put("action", "install_exe").put("file_name", "VC_redist.arm64.exe")
|
||||||
.put("action", "set_register_key").put("key", "HKLM\\Software\\${view}Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\arm64")
|
.put("url", "https://aka.ms/vs/17/release/vc_redist.arm64.exe"))
|
||||||
.put("value", name).put("type", type).put("data", data))
|
return Component(VCREDIST_ARM64, "Microsoft Visual C++ 2015-2022 Redistributable (arm64)", "Microsoft", "ready", emptyList(), listOf(install), revision = 2)
|
||||||
val steps = listOf("", "Wow6432Node\\").flatMap { view ->
|
|
||||||
listOf(value(view, "Installed", "REG_DWORD", "1"), value(view, "Major", "REG_DWORD", "14"), value(view, "Minor", "REG_DWORD", "44"),
|
|
||||||
value(view, "Bld", "REG_DWORD", "35211"), value(view, "Rbld", "REG_DWORD", "0"), value(view, "Version", "REG_SZ", "v14.44.35211.00"))
|
|
||||||
}
|
|
||||||
return Component(VCREDIST_ARM64, "Microsoft Visual C++ 2015-2022 ARM64 runtime 14.44.35211 (registry entries only)", "Microsoft", "ready", emptyList(), steps)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun parse(body: String): List<Component>? {
|
private fun parse(body: String): List<Component>? {
|
||||||
|
|||||||
@@ -0,0 +1,163 @@
|
|||||||
|
package com.droiddeck.launcher.store
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.os.Handler
|
||||||
|
import android.os.Looper
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.mutableStateOf
|
||||||
|
import androidx.compose.runtime.setValue
|
||||||
|
import com.droiddeck.launcher.R
|
||||||
|
import com.droiddeck.launcher.runtime.RecompAndroid
|
||||||
|
import com.droiddeck.launcher.runtime.RecompCatalog
|
||||||
|
import com.droiddeck.launcher.runtime.RecompData
|
||||||
|
import com.droiddeck.launcher.runtime.RecompInstaller
|
||||||
|
|
||||||
|
object RecompsState {
|
||||||
|
private val main = Handler(Looper.getMainLooper())
|
||||||
|
|
||||||
|
var entries by mutableStateOf<List<RecompCatalog.Entry>>(emptyList())
|
||||||
|
private set
|
||||||
|
var installed by mutableStateOf<Map<String, RecompInstaller.Installed>>(emptyMap())
|
||||||
|
private set
|
||||||
|
var data by mutableStateOf<Map<String, RecompData.State>>(emptyMap())
|
||||||
|
private set
|
||||||
|
var updates by mutableStateOf<Map<String, RecompInstaller.Release>>(emptyMap())
|
||||||
|
private set
|
||||||
|
var loading by mutableStateOf(false)
|
||||||
|
private set
|
||||||
|
var incompatible by mutableStateOf<Set<String>>(emptySet())
|
||||||
|
private set
|
||||||
|
// The last install failure of each recomp, kept on its page until the next attempt.
|
||||||
|
var errors by mutableStateOf<Map<String, String>>(emptyMap())
|
||||||
|
private set
|
||||||
|
private var seq = 0
|
||||||
|
private var checked = false
|
||||||
|
private var lastSteam: List<Pair<Int, String>> = emptyList()
|
||||||
|
internal var fixed = false
|
||||||
|
private set
|
||||||
|
|
||||||
|
internal fun show(
|
||||||
|
list: List<RecompCatalog.Entry>, have: Map<String, RecompInstaller.Installed>, states: Map<String, RecompData.State>,
|
||||||
|
newer: Map<String, RecompInstaller.Release>,
|
||||||
|
) {
|
||||||
|
fixed = true
|
||||||
|
entries = list; installed = have; data = states; updates = newer; loading = false
|
||||||
|
}
|
||||||
|
|
||||||
|
fun refresh(context: Context, steamOwned: Collection<Pair<Int, String>>, reloadCatalog: Boolean = false) {
|
||||||
|
if (fixed) return
|
||||||
|
val app = context.applicationContext
|
||||||
|
lastSteam = steamOwned.toList()
|
||||||
|
RecompAndroid.onChanged = { main.post { refresh(app, lastSteam) } }
|
||||||
|
RecompAndroid.onFailed = { pkg, message ->
|
||||||
|
main.post { entries.filter { it.android?.pkg == pkg }.forEach { errors = errors + (it.id to message) } }
|
||||||
|
}
|
||||||
|
val n = ++seq
|
||||||
|
loading = entries.isEmpty()
|
||||||
|
Thread({
|
||||||
|
synchronized(refreshLock) {
|
||||||
|
if (n != seq) return@Thread
|
||||||
|
val list = runCatching { RecompCatalog.load(app, reloadCatalog) }.getOrDefault(emptyList())
|
||||||
|
val apps = runCatching { RecompAndroid.installed(app, list) }.getOrDefault(emptyMap())
|
||||||
|
val files = runCatching { RecompInstaller.installed(app) }.getOrDefault(emptyMap())
|
||||||
|
// Catalogs can rename an entry; an install also belongs to the entry with its repo.
|
||||||
|
val byRepo = files.values.filter { it.repo != null }.associateBy { it.repo!!.lowercase() }
|
||||||
|
val chosen = choices(app)
|
||||||
|
// Installs from before the shortcut work, or whose art download failed, get their cover now.
|
||||||
|
list.forEach { e -> (files[e.id] ?: byRepo[e.repo.lowercase()])?.let { inst -> runCatching { com.droiddeck.launcher.runtime.RecompShortcuts.prepare(e, inst) } } }
|
||||||
|
val have = list.mapNotNull { e ->
|
||||||
|
val both = listOfNotNull(files[e.id] ?: byRepo[e.repo.lowercase()], apps[e.id])
|
||||||
|
(both.firstOrNull { it.platform == chosen[e.id] } ?: both.firstOrNull())?.let { e.id to it }
|
||||||
|
}.toMap()
|
||||||
|
// The list shows as soon as the catalog is read; game-file checks follow without hashing anything new.
|
||||||
|
main.post { if (n == seq && entries.isEmpty()) { entries = list; installed = have; loading = false } }
|
||||||
|
if (n != seq) return@Thread
|
||||||
|
val inputs = runCatching { RecompData.inputs(app, steamOwned, list, cachedOnly = true) }.getOrNull()
|
||||||
|
val states = list.associate { e -> e.id to (inputs?.let { RecompData.resolve(e, it) } ?: RecompData.State.BringYourOwn(e.data)) }
|
||||||
|
inputs?.done?.invoke()
|
||||||
|
val apks = runCatching { RecompAndroid.incompatible(app) }.getOrDefault(emptySet())
|
||||||
|
main.post {
|
||||||
|
if (n != seq) return@post
|
||||||
|
entries = list; installed = have; data = states; incompatible = apks; loading = false
|
||||||
|
}
|
||||||
|
if (!checked && have.isNotEmpty()) {
|
||||||
|
checked = true
|
||||||
|
val found = list.filter { it.id in have }.mapNotNull { e ->
|
||||||
|
val i = have.getValue(e.id)
|
||||||
|
val build = RecompCatalog.Platform.of(i.platform.orEmpty())?.let { buildFor(e, it) } ?: return@mapNotNull null
|
||||||
|
val newest = (RecompInstaller.pinned(e, build) ?: runCatching { RecompInstaller.latest(e, build) }.getOrNull())
|
||||||
|
?.takeIf { RecompInstaller.isNewer(it, i) }
|
||||||
|
newest?.let { e.id to it }
|
||||||
|
}.toMap()
|
||||||
|
main.post { updates = found }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, "recomps-refresh").start()
|
||||||
|
}
|
||||||
|
|
||||||
|
private val refreshLock = Any()
|
||||||
|
|
||||||
|
// Checks one recomp's game files against the catalog's hashes, which can take a while for large files.
|
||||||
|
fun verify(context: Context, entry: RecompCatalog.Entry, steamOwned: Collection<Pair<Int, String>>) {
|
||||||
|
if (fixed || !entry.pc || data[entry.id].let { it is RecompData.State.Found && it.checked }) return
|
||||||
|
val app = context.applicationContext
|
||||||
|
Thread({
|
||||||
|
val inputs = runCatching { RecompData.inputs(app, steamOwned, listOf(entry)) }.getOrNull() ?: return@Thread
|
||||||
|
val state = RecompData.resolve(entry, inputs)
|
||||||
|
inputs.done()
|
||||||
|
main.post { data = data + (entry.id to state) }
|
||||||
|
}, "recomps-verify").start()
|
||||||
|
}
|
||||||
|
|
||||||
|
// [chosen] is a build the player picked; it is installed as it is, without swapping in an arm64 twin.
|
||||||
|
fun install(
|
||||||
|
context: Context, entry: RecompCatalog.Entry, steamOwned: Collection<Pair<Int, String>>, release: RecompInstaller.Release? = null,
|
||||||
|
chosen: RecompCatalog.Build? = null,
|
||||||
|
) {
|
||||||
|
val build = chosen ?: installed[entry.id]?.platform?.let { RecompCatalog.Platform.of(it) }?.let { buildFor(entry, it) }
|
||||||
|
?: entry.preferred(incompatible) ?: return
|
||||||
|
errors = errors - entry.id
|
||||||
|
val done = if (build.platform == RecompCatalog.Platform.ANDROID) R.string.recomps_android_started else R.string.recomps_installed
|
||||||
|
if (chosen != null) choose(context, entry.id, chosen.platform)
|
||||||
|
UserAppsState.run(context, entry.name, done, after = {
|
||||||
|
updates = updates - entry.id
|
||||||
|
UserAppsState.lastError?.takeIf { it.startsWith(entry.name + ":") }?.let { errors = errors + (entry.id to it.removePrefix(entry.name + ":").trim()) }
|
||||||
|
refresh(context, steamOwned)
|
||||||
|
com.droiddeck.launcher.frontend.AddedGamesPublisher.later(context) { com.droiddeck.launcher.runtime.RecompShortcuts.addLive(context.applicationContext, entry.id) }
|
||||||
|
}) { app, progress -> RecompInstaller.install(app, entry, build, release, progress, allowTwin = chosen == null) }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Removes an installed recomp and, once it is gone, its non-Steam shortcut.
|
||||||
|
fun remove(context: Context, entry: RecompCatalog.Entry, steamOwned: Collection<Pair<Int, String>>, inst: RecompInstaller.Installed) {
|
||||||
|
val app = context.applicationContext
|
||||||
|
if (inst.appKey.startsWith("android:")) {
|
||||||
|
RecompAndroid.uninstall(app, inst.appKey.removePrefix("android:"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val shortcut = runCatching { com.droiddeck.launcher.runtime.RecompShortcuts.all(app).firstOrNull { it.appKey == inst.appKey }?.appId }.getOrNull()
|
||||||
|
UserAppsState.run(app, entry.name, R.string.recomps_removed, after = {
|
||||||
|
refresh(app, steamOwned)
|
||||||
|
com.droiddeck.launcher.frontend.AddedGamesPublisher.later(app) { shortcut?.let { com.droiddeck.launcher.runtime.RecompShortcuts.removeLive(app, it) } }
|
||||||
|
}) { c, p ->
|
||||||
|
if (inst.appKey.startsWith("added:")) { RecompInstaller.remove(c, inst); null }
|
||||||
|
else com.droiddeck.launcher.runtime.UserApps.list(c).firstOrNull { it.key == inst.appKey }?.let { com.droiddeck.launcher.runtime.UserApps.remove(c, it, p) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun choicesFile(context: Context) = java.io.File(java.io.File(context.filesDir, "recomps").apply { mkdirs() }, "choices.json")
|
||||||
|
|
||||||
|
private fun choices(context: Context): Map<String, String> = runCatching {
|
||||||
|
val o = org.json.JSONObject(choicesFile(context).readText())
|
||||||
|
o.keys().asSequence().associateWith { o.getString(it) }
|
||||||
|
}.getOrDefault(emptyMap())
|
||||||
|
|
||||||
|
// The build the player last picked shows on the card when two builds of a recomp are installed.
|
||||||
|
private fun choose(context: Context, id: String, platform: RecompCatalog.Platform) {
|
||||||
|
val o = runCatching { org.json.JSONObject(choicesFile(context).readText()) }.getOrDefault(org.json.JSONObject())
|
||||||
|
com.droiddeck.launcher.core.FileUtils.writeString(choicesFile(context), o.put(id, platform.key).toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
// An arm64 install found as the twin of an x86-64 Linux release updates through that release.
|
||||||
|
private fun buildFor(entry: RecompCatalog.Entry, platform: RecompCatalog.Platform) =
|
||||||
|
entry.build(platform) ?: entry.build(RecompCatalog.Platform.LINUX_X64).takeIf { platform == RecompCatalog.Platform.LINUX_ARM64 }
|
||||||
|
}
|
||||||
@@ -69,7 +69,7 @@ object UserAppsState {
|
|||||||
UserApps.update(app, target, release, progress).also { if (it == null) main.post { updates = updates - target.key } }
|
UserApps.update(app, target, release, progress).also { if (it == null) main.post { updates = updates - target.key } }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun run(context: Context, label: String, done: Int, work: (Context, (String, Int) -> Unit) -> String?) {
|
internal fun run(context: Context, label: String, done: Int, after: () -> Unit = {}, work: (Context, (String, Int) -> Unit) -> String?) {
|
||||||
if (working != null) return
|
if (working != null) return
|
||||||
val app = context.applicationContext
|
val app = context.applicationContext
|
||||||
working = label; stage = null; percent = -1; lastError = null
|
working = label; stage = null; percent = -1; lastError = null
|
||||||
@@ -85,6 +85,7 @@ object UserAppsState {
|
|||||||
if (problem == null) Toast.makeText(app, app.getString(done, label), Toast.LENGTH_SHORT).show()
|
if (problem == null) Toast.makeText(app, app.getString(done, label), Toast.LENGTH_SHORT).show()
|
||||||
refresh(app)
|
refresh(app)
|
||||||
StoreState.refresh(app)
|
StoreState.refresh(app)
|
||||||
|
after()
|
||||||
}
|
}
|
||||||
}, "user-apps-work").start()
|
}, "user-apps-work").start()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ object StoreLaunch {
|
|||||||
lines += "del \"%~dp0$EA_ENV\""
|
lines += "del \"%~dp0$EA_ENV\""
|
||||||
lines += ":run"
|
lines += ":run"
|
||||||
lines += "if exist \"$EA_ORIGIN\" start \"\" \"$EA_ORIGIN\""
|
lines += "if exist \"$EA_ORIGIN\" start \"\" \"$EA_ORIGIN\""
|
||||||
lines += run
|
lines += "$run %*"
|
||||||
lines += "taskkill /f /im Origin.exe >nul 2>&1"
|
lines += "taskkill /f /im Origin.exe >nul 2>&1"
|
||||||
} else {
|
} else {
|
||||||
lines += run
|
lines += run
|
||||||
|
|||||||
@@ -121,6 +121,8 @@ object StoresState {
|
|||||||
var unfinished by mutableStateOf<List<StoreInstallRoot.Unfinished>>(emptyList())
|
var unfinished by mutableStateOf<List<StoreInstallRoot.Unfinished>>(emptyList())
|
||||||
internal set
|
internal set
|
||||||
|
|
||||||
|
var steamPicking by mutableStateOf<CatalogItem?>(null)
|
||||||
|
|
||||||
fun isUnfinished(item: CatalogItem): Boolean = unfinished.any {
|
fun isUnfinished(item: CatalogItem): Boolean = unfinished.any {
|
||||||
it.store == item.store && (it.id == item.id || (it.id == null && it.folder.name == StoreInstallRoot.folderName(item.title, item.id)))
|
it.store == item.store && (it.id == item.id || (it.id == null && it.folder.name == StoreInstallRoot.folderName(item.title, item.id)))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.droiddeck.launcher.R
|
|||||||
import com.droiddeck.launcher.frontend.AddedGames
|
import com.droiddeck.launcher.frontend.AddedGames
|
||||||
import com.droiddeck.launcher.runtime.BattleNet
|
import com.droiddeck.launcher.runtime.BattleNet
|
||||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||||
|
import com.droiddeck.launcher.session.GameStorage
|
||||||
import com.droiddeck.launcher.stores.CatalogItem
|
import com.droiddeck.launcher.stores.CatalogItem
|
||||||
import com.droiddeck.launcher.stores.InstalledStoreGame
|
import com.droiddeck.launcher.stores.InstalledStoreGame
|
||||||
import com.droiddeck.launcher.stores.Store
|
import com.droiddeck.launcher.stores.Store
|
||||||
@@ -130,13 +131,13 @@ object BattleNetClient {
|
|||||||
StoresState.post { opener?.invoke(args) }
|
StoresState.post { opener?.invoke(args) }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun library(context: Context, root: File = preferred(context)): List<String> =
|
fun library(context: Context, root: File? = preferred(context)): List<String> =
|
||||||
AddedGames.guestPath(context, StoreInstallRoot.storeDir(root, Store.BATTLENET))?.let { listOf("--library", it) }.orEmpty()
|
root?.let { AddedGames.guestPath(context, StoreInstallRoot.storeDir(it, Store.BATTLENET)) }?.let { listOf("--library", it) }.orEmpty()
|
||||||
|
|
||||||
internal fun preferred(context: Context): File {
|
internal fun preferred(context: Context): File? {
|
||||||
val second = StoreInstallRoot.libraryRoot(context)?.absolutePath
|
val second = StoreInstallRoot.libraryRoot(context)?.absolutePath
|
||||||
return StoreInstallRoot.targets(context).firstOrNull { it.root.absolutePath == second && (it.root.isDirectory || it.root.mkdirs()) }?.root
|
return StoreInstallRoot.targets(context).firstOrNull { it.root.absolutePath == second && (it.root.isDirectory || it.root.mkdirs()) }?.root
|
||||||
?: StoreInstallRoot.internalRoot(context)
|
?: StoreInstallRoot.internalRoot(context).takeIf { second == null && !GameStorage.disconnected(context) }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun installGame(context: Context, uid: String, root: File) {
|
fun installGame(context: Context, uid: String, root: File) {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.droiddeck.launcher.stores.gog
|
package com.droiddeck.launcher.stores.gog
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Environment
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
@@ -143,9 +142,9 @@ object GogComet {
|
|||||||
val pb = if (com.droiddeck.launcher.runtime.NativeGuest.forSession(context)) {
|
val pb = if (com.droiddeck.launcher.runtime.NativeGuest.forSession(context)) {
|
||||||
val root = LinuxRuntime.rootDir(context)
|
val root = LinuxRuntime.rootDir(context)
|
||||||
com.droiddeck.launcher.runtime.NativeGuest.processBuilder(context, root,
|
com.droiddeck.launcher.runtime.NativeGuest.processBuilder(context, root,
|
||||||
LinuxRuntime.binds(context, null, null, Environment.getExternalStorageDirectory(), null), guest).redirectErrorStream(true)
|
LinuxRuntime.binds(context, null, null, LinuxRuntime.sharedStorage(context), null), guest).redirectErrorStream(true)
|
||||||
} else {
|
} else {
|
||||||
ProcessBuilder(LinuxRuntime.command(context, null, null, Environment.getExternalStorageDirectory(), guest)).redirectErrorStream(true).also {
|
ProcessBuilder(LinuxRuntime.command(context, null, null, LinuxRuntime.sharedStorage(context), guest)).redirectErrorStream(true).also {
|
||||||
it.environment().apply {
|
it.environment().apply {
|
||||||
remove("LD_PRELOAD"); remove("LD_AUDIT"); remove("LD_LIBRARY_PATH")
|
remove("LD_PRELOAD"); remove("LD_AUDIT"); remove("LD_LIBRARY_PATH")
|
||||||
put("PROOT_LOADER", LinuxRuntime.prootLoader(context).path)
|
put("PROOT_LOADER", LinuxRuntime.prootLoader(context).path)
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ import android.net.Uri
|
|||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import androidx.compose.runtime.getValue
|
|
||||||
import androidx.compose.runtime.mutableStateOf
|
|
||||||
import androidx.compose.runtime.setValue
|
|
||||||
import com.droiddeck.launcher.R
|
import com.droiddeck.launcher.R
|
||||||
import com.droiddeck.launcher.frontend.Library
|
import com.droiddeck.launcher.frontend.Library
|
||||||
import com.droiddeck.launcher.session.SessionService
|
import com.droiddeck.launcher.session.SessionService
|
||||||
@@ -46,8 +43,6 @@ internal object SteamStore {
|
|||||||
/** InvalidPassword, AccessDenied, AccountNotFound, Revoked, Expired, AccountLogonDenied. */
|
/** InvalidPassword, AccessDenied, AccountNotFound, Revoked, Expired, AccountLogonDenied. */
|
||||||
private val REFUSALS = setOf(5, 15, 18, 26, 27, 63)
|
private val REFUSALS = setOf(5, 15, 18, 26, 27, 63)
|
||||||
|
|
||||||
var picking by mutableStateOf<CatalogItem?>(null)
|
|
||||||
|
|
||||||
class Plan(val installDir: String, val downloadBytes: Long, val installBytes: Long, val buildId: String, val linuxBuild: Boolean) {
|
class Plan(val installDir: String, val downloadBytes: Long, val installBytes: Long, val buildId: String, val linuxBuild: Boolean) {
|
||||||
companion object {
|
companion object {
|
||||||
fun of(json: JSONObject): Plan? {
|
fun of(json: JSONObject): Plan? {
|
||||||
@@ -222,7 +217,7 @@ internal object SteamStore {
|
|||||||
toast(context, R.string.steam_store_close_steam)
|
toast(context, R.string.steam_store_close_steam)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
picking = item
|
StoresState.steamPicking = item
|
||||||
}
|
}
|
||||||
|
|
||||||
fun install(context: Context, item: CatalogItem, target: SteamClient.Target) {
|
fun install(context: Context, item: CatalogItem, target: SteamClient.Target) {
|
||||||
|
|||||||
@@ -94,17 +94,16 @@ internal object XboxManifest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun executable(folder: File): String {
|
fun executable(folder: File): String {
|
||||||
for (path in read(folder).executables) {
|
val listed = read(folder).executables
|
||||||
|
for (path in listed) {
|
||||||
require(!path.startsWith('/') && !path.contains(':') && path.split('/').none { it == ".." || it.isEmpty() })
|
require(!path.startsWith('/') && !path.contains(':') && path.split('/').none { it == ".." || it.isEmpty() })
|
||||||
var file = folder
|
val file = path.split('/').fold<String, File?>(folder) { dir, part ->
|
||||||
for (part in path.split('/')) {
|
dir?.listFiles().orEmpty().filter { it.name.equals(part, true) }.singleOrNull()
|
||||||
val matches = file.listFiles().orEmpty().filter { it.name.equals(part, true) }
|
} ?: continue
|
||||||
require(matches.size == 1) { "Missing or ambiguous Xbox launch path." }
|
|
||||||
file = matches.single()
|
|
||||||
}
|
|
||||||
require(file.canonicalPath.startsWith(folder.canonicalPath + File.separator))
|
require(file.canonicalPath.startsWith(folder.canonicalPath + File.separator))
|
||||||
if (file.isFile) return forwarded(folder, file) ?: file.relativeTo(folder).invariantSeparatorsPath
|
if (file.isFile) return forwarded(folder, file) ?: file.relativeTo(folder).invariantSeparatorsPath
|
||||||
}
|
}
|
||||||
|
require(listed.isEmpty()) { "Missing or ambiguous Xbox launch path." }
|
||||||
error("The Xbox package has no supported PC launch executable.")
|
error("The Xbox package has no supported PC launch executable.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.droiddeck.launcher.stores.xbox
|
package com.droiddeck.launcher.stores.xbox
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Environment
|
|
||||||
import com.droiddeck.launcher.core.AddonPack
|
import com.droiddeck.launcher.core.AddonPack
|
||||||
import com.droiddeck.launcher.runtime.LinuxNetworkLinkComponent
|
import com.droiddeck.launcher.runtime.LinuxNetworkLinkComponent
|
||||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||||
@@ -82,7 +81,7 @@ internal object Xodus {
|
|||||||
networkLink.start()
|
networkLink.start()
|
||||||
val runtime = (runtimeDirectory ?: File(app.filesDir, "xbox-runtime")).apply { mkdirs() }
|
val runtime = (runtimeDirectory ?: File(app.filesDir, "xbox-runtime")).apply { mkdirs() }
|
||||||
val root = LinuxRuntime.rootDir(app)
|
val root = LinuxRuntime.rootDir(app)
|
||||||
val external = Environment.getExternalStorageDirectory()
|
val external = LinuxRuntime.sharedStorage(app)
|
||||||
val extraBinds = StoreInstallRoot.externalBindSpecsForXodus(app)
|
val extraBinds = StoreInstallRoot.externalBindSpecsForXodus(app)
|
||||||
val binds = LinuxRuntime.binds(app, null, null, external, extraBinds)
|
val binds = LinuxRuntime.binds(app, null, null, external, extraBinds)
|
||||||
val fastPathPreloaded = runCatching {
|
val fastPathPreloaded = runCatching {
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ import androidx.compose.ui.platform.testTag
|
|||||||
import com.droiddeck.launcher.agent.AgentSetup.Status
|
import com.droiddeck.launcher.agent.AgentSetup.Status
|
||||||
import com.droiddeck.launcher.agent.AgentSetup.Step
|
import com.droiddeck.launcher.agent.AgentSetup.Step
|
||||||
import com.droiddeck.launcher.core.WirelessAdbPairingService
|
import com.droiddeck.launcher.core.WirelessAdbPairingService
|
||||||
|
import com.droiddeck.launcher.session.QuestExperimental
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
internal fun AgentSetupView(modifier: Modifier, firstControl: Modifier = Modifier, onDone: () -> Unit = {}) {
|
internal fun AgentSetupView(modifier: Modifier, firstControl: Modifier = Modifier, onDone: () -> Unit = {}) {
|
||||||
@@ -104,11 +105,16 @@ internal fun AgentSetupView(modifier: Modifier, firstControl: Modifier = Modifie
|
|||||||
var keyOpen by rememberSaveable(harness.id) { mutableStateOf(false) }
|
var keyOpen by rememberSaveable(harness.id) { mutableStateOf(false) }
|
||||||
val (title, hint) = labels(step, harness.name, keyed)
|
val (title, hint) = labels(step, harness.name, keyed)
|
||||||
val lab = AgentHost.lab?.takeIf { it.prepare && it.running }
|
val lab = AgentHost.lab?.takeIf { it.prepare && it.running }
|
||||||
|
val questConnection = step == Step.CONNECTION && status != Status.DONE && QuestExperimental.isSupported()
|
||||||
val detail = when {
|
val detail = when {
|
||||||
step == Step.PREPARE && lab != null ->
|
step == Step.PREPARE && lab != null ->
|
||||||
stringResource(R.string.agent_prepare_progress, lab.permille / 10, clock(lab.etaSeconds.toLong().coerceAtLeast(0)))
|
stringResource(R.string.agent_prepare_progress, lab.permille / 10, clock(lab.etaSeconds.toLong().coerceAtLeast(0)))
|
||||||
keyed && status == Status.DONE && AgentSetup.detail[step] == null ->
|
keyed && status == Status.DONE && AgentSetup.detail[step] == null ->
|
||||||
harness.providers.filter { it.id in AgentSetup.keys }.joinToString(" · ") { it.name }.ifEmpty { stringResource(R.string.agent_step_free_models) }
|
harness.providers.filter { it.id in AgentSetup.keys }.joinToString(" · ") { it.name }.ifEmpty { stringResource(R.string.agent_step_free_models) }
|
||||||
|
// The Quest hint holds the one-time commands, so it stays under the status until the step passes.
|
||||||
|
questConnection -> AgentSetup.detail[step]?.let { "$it\n$hint" } ?: hint
|
||||||
|
// The Quest hint is setup instructions; once connected, the row says what it is for.
|
||||||
|
step == Step.CONNECTION && QuestExperimental.isSupported() -> AgentSetup.detail[step] ?: stringResource(R.string.agent_step_connection_hint)
|
||||||
else -> AgentSetup.detail[step] ?: hint
|
else -> AgentSetup.detail[step] ?: hint
|
||||||
}
|
}
|
||||||
// Shown while the sign-in is pending, so it is still there after a trip to the browser for the key.
|
// Shown while the sign-in is pending, so it is still there after a trip to the browser for the key.
|
||||||
@@ -121,6 +127,7 @@ internal fun AgentSetupView(modifier: Modifier, firstControl: Modifier = Modifie
|
|||||||
Status.TODO, Status.FAILED -> CheckState.WARN
|
Status.TODO, Status.FAILED -> CheckState.WARN
|
||||||
},
|
},
|
||||||
title, detail, divider = index < steps.lastIndex && !showKey,
|
title, detail, divider = index < steps.lastIndex && !showKey,
|
||||||
|
detailLines = if (questConnection) Int.MAX_VALUE else 2,
|
||||||
) {
|
) {
|
||||||
val blocked = (step in setOf(Step.SIGN_IN, Step.GITHUB, Step.BUILD_TOOLS) && AgentSetup.status[Step.INSTALL] != Status.DONE) ||
|
val blocked = (step in setOf(Step.SIGN_IN, Step.GITHUB, Step.BUILD_TOOLS) && AgentSetup.status[Step.INSTALL] != Status.DONE) ||
|
||||||
(step == Step.PREPARE && AgentSetup.status[Step.BUILD_TOOLS] != Status.DONE)
|
(step == Step.PREPARE && AgentSetup.status[Step.BUILD_TOOLS] != Status.DONE)
|
||||||
@@ -258,7 +265,9 @@ internal fun agentStorageWarning(item: AgentStorage.Item) = when (item) {
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun labels(step: Step, harness: String, keyed: Boolean = false): Pair<String, String> = when (step) {
|
private fun labels(step: Step, harness: String, keyed: Boolean = false): Pair<String, String> = when (step) {
|
||||||
Step.CONNECTION -> stringResource(R.string.agent_step_connection) to stringResource(R.string.agent_step_connection_hint)
|
Step.CONNECTION -> stringResource(R.string.agent_step_connection) to
|
||||||
|
if (QuestExperimental.isSupported()) stringResource(R.string.agent_step_connection_quest_hint, LocalContext.current.packageName)
|
||||||
|
else stringResource(R.string.agent_step_connection_hint)
|
||||||
Step.INSTALL -> stringResource(R.string.agent_step_install, harness) to stringResource(R.string.agent_step_install_hint)
|
Step.INSTALL -> stringResource(R.string.agent_step_install, harness) to stringResource(R.string.agent_step_install_hint)
|
||||||
Step.SIGN_IN -> stringResource(R.string.agent_step_sign_in, harness) to stringResource(if (keyed) R.string.agent_step_sign_in_key_hint else R.string.agent_step_sign_in_hint)
|
Step.SIGN_IN -> stringResource(R.string.agent_step_sign_in, harness) to stringResource(if (keyed) R.string.agent_step_sign_in_key_hint else R.string.agent_step_sign_in_hint)
|
||||||
Step.GITHUB -> stringResource(R.string.agent_step_github) to stringResource(R.string.agent_step_github_hint)
|
Step.GITHUB -> stringResource(R.string.agent_step_github) to stringResource(R.string.agent_step_github_hint)
|
||||||
@@ -267,7 +276,7 @@ private fun labels(step: Step, harness: String, keyed: Boolean = false): Pair<St
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun action(step: Step): Int = when (step) {
|
private fun action(step: Step): Int = when (step) {
|
||||||
Step.CONNECTION -> R.string.agent_action_pair
|
Step.CONNECTION -> if (QuestExperimental.isSupported()) R.string.agent_action_allow else R.string.agent_action_pair
|
||||||
Step.INSTALL -> R.string.agent_action_install
|
Step.INSTALL -> R.string.agent_action_install
|
||||||
Step.SIGN_IN, Step.GITHUB -> R.string.agent_action_sign_in
|
Step.SIGN_IN, Step.GITHUB -> R.string.agent_action_sign_in
|
||||||
Step.BUILD_TOOLS -> R.string.agent_action_install
|
Step.BUILD_TOOLS -> R.string.agent_action_install
|
||||||
@@ -276,6 +285,7 @@ private fun action(step: Step): Int = when (step) {
|
|||||||
|
|
||||||
/** The pairing DroidDeck already uses for the phantom process fix; the agent reuses its key. */
|
/** The pairing DroidDeck already uses for the phantom process fix; the agent reuses its key. */
|
||||||
private fun pair(context: android.content.Context) {
|
private fun pair(context: android.content.Context) {
|
||||||
|
if (QuestExperimental.isSupported()) return AgentSetup.trustOnDevice(context)
|
||||||
if (!WirelessAdbPairingService.notificationsEnabled(context)) {
|
if (!WirelessAdbPairingService.notificationsEnabled(context)) {
|
||||||
context.startActivity(android.content.Intent(android.provider.Settings.ACTION_APP_NOTIFICATION_SETTINGS)
|
context.startActivity(android.content.Intent(android.provider.Settings.ACTION_APP_NOTIFICATION_SETTINGS)
|
||||||
.putExtra(android.provider.Settings.EXTRA_APP_PACKAGE, context.packageName)
|
.putExtra(android.provider.Settings.EXTRA_APP_PACKAGE, context.packageName)
|
||||||
|
|||||||
@@ -8,11 +8,14 @@ import androidx.compose.foundation.Canvas
|
|||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.BoxWithConstraints
|
import androidx.compose.foundation.layout.BoxWithConstraints
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.fillMaxHeight
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.outlined.AlignHorizontalCenter
|
import androidx.compose.material.icons.outlined.AlignHorizontalCenter
|
||||||
import androidx.compose.material.icons.outlined.AlignHorizontalLeft
|
import androidx.compose.material.icons.outlined.AlignHorizontalLeft
|
||||||
import androidx.compose.material.icons.outlined.AlignHorizontalRight
|
import androidx.compose.material.icons.outlined.AlignHorizontalRight
|
||||||
|
import androidx.compose.material.icons.outlined.VerticalSplit
|
||||||
import androidx.compose.material.icons.outlined.WidthFull
|
import androidx.compose.material.icons.outlined.WidthFull
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
@@ -72,7 +75,8 @@ internal enum class QamFit(val id: String, @StringRes val label: Int, val icon:
|
|||||||
FULL("full", R.string.bottom_qam_layout_full, Icons.Outlined.WidthFull, 0),
|
FULL("full", R.string.bottom_qam_layout_full, Icons.Outlined.WidthFull, 0),
|
||||||
LEFT("left", R.string.bottom_qam_layout_left, Icons.Outlined.AlignHorizontalLeft, -1),
|
LEFT("left", R.string.bottom_qam_layout_left, Icons.Outlined.AlignHorizontalLeft, -1),
|
||||||
CENTER("center", R.string.bottom_qam_layout_center, Icons.Outlined.AlignHorizontalCenter, 0),
|
CENTER("center", R.string.bottom_qam_layout_center, Icons.Outlined.AlignHorizontalCenter, 0),
|
||||||
RIGHT("right", R.string.bottom_qam_layout_right, Icons.Outlined.AlignHorizontalRight, 1);
|
RIGHT("right", R.string.bottom_qam_layout_right, Icons.Outlined.AlignHorizontalRight, 1),
|
||||||
|
SPLIT("split", R.string.bottom_qam_layout_split, Icons.Outlined.VerticalSplit, 0);
|
||||||
|
|
||||||
val next: QamFit get() = entries[(ordinal + 1) % entries.size]
|
val next: QamFit get() = entries[(ordinal + 1) % entries.size]
|
||||||
|
|
||||||
@@ -92,6 +96,7 @@ internal enum class QamFit(val id: String, @StringRes val label: Int, val icon:
|
|||||||
|
|
||||||
internal object QamLayout {
|
internal object QamLayout {
|
||||||
private const val WIDE_CSS = "div.BasicUI { width: 100% !important; } div[class*=\\\"tab_\\\"] { max-width: none !important; }"
|
private const val WIDE_CSS = "div.BasicUI { width: 100% !important; } div[class*=\\\"tab_\\\"] { max-width: none !important; }"
|
||||||
|
private const val PARKED_CSS = " #Footer { display: none !important; }"
|
||||||
|
|
||||||
/** Scale and left edge of the menu in a box; [align] -1, 0 or 1 places a narrower menu left, centred or right. */
|
/** Scale and left edge of the menu in a box; [align] -1, 0 or 1 places a narrower menu left, centred or right. */
|
||||||
fun fit(boxWidth: Float, boxHeight: Float, contentRight: Float, cssHeight: Float, align: Int = 0): Pair<Float, Float> {
|
fun fit(boxWidth: Float, boxHeight: Float, contentRight: Float, cssHeight: Float, align: Int = 0): Pair<Float, Float> {
|
||||||
@@ -102,10 +107,13 @@ internal object QamLayout {
|
|||||||
fun toCss(x: Float, y: Float, scale: Float, left: Float): Pair<Float, Float> = (x - left) / scale to y / scale
|
fun toCss(x: Float, y: Float, scale: Float, left: Float): Pair<Float, Float> = (x - left) / scale to y / scale
|
||||||
|
|
||||||
/** Makes the menu follow the panel-shaped view (Steam sizes it once, on open) and lifts each tab's 300 px cap, then measures where the content ends. */
|
/** Makes the menu follow the panel-shaped view (Steam sizes it once, on open) and lifts each tab's 300 px cap, then measures where the content ends. */
|
||||||
/** [wide] is false while the menu is shown on the top screen, where it keeps Steam's own layout. */
|
/**
|
||||||
fun contentScript(wide: Boolean): String = "(() => { let s = document.getElementById('dd-qam-wide'); " +
|
* [wide] is false while the menu is shown on the top screen, where it keeps Steam's own layout. [parked] hides the
|
||||||
|
* button-hint footer Steam draws in a game, which stays an empty black strip while the controller is not on the menu.
|
||||||
|
*/
|
||||||
|
fun contentScript(wide: Boolean, parked: Boolean = wide): String = "(() => { let s = document.getElementById('dd-qam-wide'); " +
|
||||||
"if (!s) { s = document.createElement('style'); s.id = 'dd-qam-wide'; document.head.appendChild(s); } " +
|
"if (!s) { s = document.createElement('style'); s.id = 'dd-qam-wide'; document.head.appendChild(s); } " +
|
||||||
"const css = '${if (wide) WIDE_CSS else ""}'; " +
|
"const css = '${(if (wide) WIDE_CSS else "") + (if (parked) PARKED_CSS else "")}'; " +
|
||||||
"if (s.textContent !== css) s.textContent = css; if (document.scrollingElement.scrollLeft) document.scrollingElement.scrollLeft = 0; " +
|
"if (s.textContent !== css) s.textContent = css; if (document.scrollingElement.scrollLeft) document.scrollingElement.scrollLeft = 0; " +
|
||||||
"const w = innerWidth; let right = 0; for (const e of document.body.querySelectorAll('*')) { " +
|
"const w = innerWidth; let right = 0; for (const e of document.body.querySelectorAll('*')) { " +
|
||||||
"const r = e.getBoundingClientRect(); const tab = /(^| )tab_/.test(String(e.className)); " +
|
"const r = e.getBoundingClientRect(); const tab = /(^| )tab_/.test(String(e.className)); " +
|
||||||
@@ -117,17 +125,90 @@ private const val TICK_MS = 1_000L
|
|||||||
private const val FAST_TICK_MS = 150L
|
private const val FAST_TICK_MS = 150L
|
||||||
private const val MAX_RETRY_MS = 4_000L
|
private const val MAX_RETRY_MS = 4_000L
|
||||||
|
|
||||||
/** The last frame shown, so returning to the panel shows the menu at once while the live stream reconnects. */
|
/** One of Steam's menu pages streamed to the panel; the last frame is kept so returning to the panel shows it at once. */
|
||||||
|
internal class MenuStream {
|
||||||
|
@Volatile var page: CdpPage? = null
|
||||||
|
val live = java.util.concurrent.atomic.AtomicBoolean(false)
|
||||||
|
val image = mutableStateOf<ImageBitmap?>(null)
|
||||||
|
val shape = mutableStateOf<FloatArray?>(null)
|
||||||
|
|
||||||
|
fun show(frame: ImageBitmap) {
|
||||||
|
image.value = frame
|
||||||
|
live.set(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Connects to [path] and starts its screencast; false when the page cannot be reached. */
|
||||||
|
fun connect(port: Int, path: String): Boolean {
|
||||||
|
page?.close()
|
||||||
|
page = null
|
||||||
|
live.set(false)
|
||||||
|
val p = runCatching {
|
||||||
|
CdpPage(port, path) { method, params ->
|
||||||
|
if (method == "Page.screencastFrame") {
|
||||||
|
page?.send("Page.screencastFrameAck", JSONObject().put("sessionId", params.optInt("sessionId")))
|
||||||
|
decodeFrame(params.optString("data"))?.let(::show)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.onFailure { android.util.Log.w("SteamQam", "devtools connect: $it") }.getOrNull() ?: return false
|
||||||
|
page = p
|
||||||
|
p.send("Page.enable")
|
||||||
|
val started = p.call("Page.startScreencast", JSONObject().put("format", "jpeg").put("quality", 85)
|
||||||
|
.put("maxWidth", 1920).put("maxHeight", 1440))
|
||||||
|
if (started == null || started.has("error") || !started.has("result")) {
|
||||||
|
p.close()
|
||||||
|
page = null
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Runs [script], which returns the page's [width, height, pixel ratio, content right], and refreshes a still page. */
|
||||||
|
fun refresh(script: String) {
|
||||||
|
val p = page ?: return
|
||||||
|
// The screencast sends frames only when the menu repaints, so a still menu needs one screenshot.
|
||||||
|
if (!live.get()) {
|
||||||
|
p.call("Page.captureScreenshot", JSONObject().put("format", "jpeg").put("quality", 85))
|
||||||
|
?.optJSONObject("result")?.optString("data")?.let(::decodeFrame)?.let(::show)
|
||||||
|
}
|
||||||
|
(p.evaluate(script) as? String)?.let { text ->
|
||||||
|
runCatching {
|
||||||
|
val a = JSONArray(text)
|
||||||
|
val layout = FloatArray(4) { a.getDouble(it).toFloat() }
|
||||||
|
if (!layout.contentEquals(shape.value)) shape.value = layout
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Stops the stream and runs [restore] on the page, which outlives this connection. */
|
||||||
|
fun stop(restore: String) {
|
||||||
|
val p = page ?: return
|
||||||
|
page = null
|
||||||
|
runCatching { p.send("Page.stopScreencast") }
|
||||||
|
runCatching { p.evaluate(restore) }
|
||||||
|
p.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun frame(): QamFrame? {
|
||||||
|
val img = image.value
|
||||||
|
val l = shape.value
|
||||||
|
return if (img != null && l != null && l[0] > 0f) QamFrame(img, l[0], l[1], l[3].coerceIn(l[0] * 0.25f, l[0])) else null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Steam's main menu beside the quick access menu; Steam's side of the hold keeps it in place and filling its view. */
|
||||||
|
internal object MainMenuLayout {
|
||||||
|
const val CONTENT_SCRIPT = "JSON.stringify([innerWidth, innerHeight, devicePixelRatio, innerWidth])"
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Panel streams kept across visits to the panel. */
|
||||||
private object QamCache {
|
private object QamCache {
|
||||||
@Volatile var image: ImageBitmap? = null
|
val qam = MenuStream()
|
||||||
@Volatile var shape: FloatArray? = null
|
val main = MenuStream()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
internal fun SteamQamPanel() {
|
internal fun SteamQamPanel() {
|
||||||
val context = LocalContext.current.applicationContext
|
val context = LocalContext.current.applicationContext
|
||||||
var image by remember { mutableStateOf(QamCache.image) }
|
|
||||||
var shape by remember { mutableStateOf(QamCache.shape) }
|
|
||||||
var failed by remember { mutableStateOf(false) }
|
var failed by remember { mutableStateOf(false) }
|
||||||
var slow by remember { mutableStateOf(false) }
|
var slow by remember { mutableStateOf(false) }
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
@@ -135,78 +216,67 @@ internal fun SteamQamPanel() {
|
|||||||
slow = true
|
slow = true
|
||||||
}
|
}
|
||||||
val fit = QamFit.current(context)
|
val fit = QamFit.current(context)
|
||||||
val holder = remember { arrayOfNulls<CdpPage>(1) }
|
val qam = QamCache.qam
|
||||||
|
val mainMenu = QamCache.main
|
||||||
val owner = remember { SteamQam.newOwner() }
|
val owner = remember { SteamQam.newOwner() }
|
||||||
val relay = remember { intArrayOf(0) }
|
val relay = remember { intArrayOf(0) }
|
||||||
val live = remember { java.util.concurrent.atomic.AtomicBoolean(false) }
|
val mainPath = remember { arrayOfNulls<String>(1) }
|
||||||
val aspect = remember { floatArrayOf(0f) }
|
val aspect = remember { floatArrayOf(0f) }
|
||||||
val measure = Modifier.fillMaxSize().onSizeChanged { if (it.height > 0) aspect[0] = it.width.toFloat() / it.height }
|
val measure = Modifier.fillMaxSize().onSizeChanged { if (it.height > 0) aspect[0] = it.width.toFloat() / it.height }
|
||||||
val show = { frame: ImageBitmap -> image = frame; QamCache.image = frame; live.set(true) }
|
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
var misses = 0
|
var misses = 0
|
||||||
|
// The main menu page backs off on its own, so Quick Access stays available while its neighbour cannot connect.
|
||||||
|
var mainMisses = 0
|
||||||
|
var mainRetryAt = 0L
|
||||||
|
fun split() = QamFit.current(context) == QamFit.SPLIT
|
||||||
// The lease is renewed on its own, so slow discovery or a retry backoff never lets the held menu lapse.
|
// The lease is renewed on its own, so slow discovery or a retry backoff never lets the held menu lapse.
|
||||||
val renew = launch {
|
val renew = launch {
|
||||||
while (isActive) {
|
while (isActive) {
|
||||||
if (SessionState.phase == SessionPhase.READY && aspect[0] > 0f) SteamQam.hold(context, aspect[0], owner)
|
if (SessionState.phase == SessionPhase.READY && aspect[0] > 0f) SteamQam.hold(context, aspect[0], owner, split())
|
||||||
delay(TICK_MS)
|
delay(TICK_MS)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
while (isActive) {
|
while (isActive) {
|
||||||
// Holding the menu before Steam's first frame keeps gamescope from presenting it.
|
// Holding the menu before Steam's first frame keeps gamescope from presenting it.
|
||||||
if (SessionState.phase != SessionPhase.READY) {
|
if (SessionState.phase != SessionPhase.READY || aspect[0] == 0f) {
|
||||||
delay(FAST_TICK_MS)
|
delay(FAST_TICK_MS)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if (aspect[0] == 0f) {
|
val split = split()
|
||||||
delay(FAST_TICK_MS)
|
val held = SteamQam.hold(context, aspect[0], owner, split)
|
||||||
continue
|
|
||||||
}
|
|
||||||
val held = SteamQam.hold(context, aspect[0], owner)
|
|
||||||
ensureActive()
|
ensureActive()
|
||||||
var reached = held != null
|
var reached = held != null
|
||||||
if (held?.open == SteamQam.QUICK_ACCESS) {
|
if (held?.open == SteamQam.QUICK_ACCESS) {
|
||||||
var page = holder[0]
|
if (qam.page?.closed != false) {
|
||||||
if (page == null || page.closed) {
|
val t = SteamQam.target(context)
|
||||||
page?.close()
|
if (t != null) {
|
||||||
live.set(false)
|
|
||||||
page = SteamQam.target(context)?.let { t ->
|
|
||||||
if (relay[0] != 0 && relay[0] != t.port) SteamQam.stopRelay(context, relay[0])
|
if (relay[0] != 0 && relay[0] != t.port) SteamQam.stopRelay(context, relay[0])
|
||||||
relay[0] = t.port
|
relay[0] = t.port
|
||||||
runCatching {
|
mainPath[0] = t.mainPath
|
||||||
CdpPage(t.port, t.path) { method, params ->
|
qam.connect(t.port, t.path)
|
||||||
if (method == "Page.screencastFrame") {
|
mainMenu.stop(MainMenuLayout.CONTENT_SCRIPT)
|
||||||
holder[0]?.send("Page.screencastFrameAck", JSONObject().put("sessionId", params.optInt("sessionId")))
|
|
||||||
decodeFrame(params.optString("data"))?.let(show)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.onFailure { android.util.Log.w("SteamQam", "devtools connect: $it") }.getOrNull()
|
|
||||||
}
|
}
|
||||||
holder[0] = page
|
|
||||||
ensureActive()
|
ensureActive()
|
||||||
page?.send("Page.enable")
|
|
||||||
val started = page?.call("Page.startScreencast", JSONObject().put("format", "jpeg").put("quality", 85)
|
|
||||||
.put("maxWidth", 1920).put("maxHeight", 1440))
|
|
||||||
if (page != null && (started == null || started.has("error") || !started.has("result"))) {
|
|
||||||
page.close()
|
|
||||||
page = null
|
|
||||||
holder[0] = null
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// The screencast sends frames only when the menu repaints, so a still menu needs one screenshot.
|
reached = qam.page?.closed == false
|
||||||
if (!live.get()) {
|
val wide = !held.top && (QamFit.current(context) == QamFit.FULL || split)
|
||||||
page?.call("Page.captureScreenshot", JSONObject().put("format", "jpeg").put("quality", 85))
|
qam.refresh(QamLayout.contentScript(wide, parked = !held.top))
|
||||||
?.optJSONObject("result")?.optString("data")?.let(::decodeFrame)?.let(show)
|
val path = mainPath[0]
|
||||||
}
|
if (split && path != null) {
|
||||||
reached = page != null
|
val now = android.os.SystemClock.elapsedRealtime()
|
||||||
val wide = !held.top && QamFit.current(context) == QamFit.FULL
|
if (mainMenu.page?.closed != false && now >= mainRetryAt) {
|
||||||
(page?.evaluate(QamLayout.contentScript(wide)) as? String)?.let { text ->
|
if (mainMenu.connect(relay[0], path)) {
|
||||||
runCatching {
|
mainMisses = 0
|
||||||
val a = JSONArray(text)
|
} else {
|
||||||
val layout = floatArrayOf(a.getDouble(0).toFloat(), a.getDouble(1).toFloat(), a.getDouble(2).toFloat(), a.getDouble(3).toFloat())
|
mainMisses++
|
||||||
if (!layout.contentEquals(shape)) { shape = layout; QamCache.shape = layout }
|
mainRetryAt = now + minOf(TICK_MS shl minOf(mainMisses - 1, 2), MAX_RETRY_MS)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
mainMenu.refresh(MainMenuLayout.CONTENT_SCRIPT)
|
||||||
|
} else if (!split) {
|
||||||
|
mainMenu.stop(MainMenuLayout.CONTENT_SCRIPT)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
failed = !reached
|
failed = !reached
|
||||||
@@ -214,7 +284,7 @@ internal fun SteamQamPanel() {
|
|||||||
misses = if (reached) 0 else misses + 1
|
misses = if (reached) 0 else misses + 1
|
||||||
val wait = when {
|
val wait = when {
|
||||||
!reached -> minOf(TICK_MS shl minOf(misses - 1, 2), MAX_RETRY_MS)
|
!reached -> minOf(TICK_MS shl minOf(misses - 1, 2), MAX_RETRY_MS)
|
||||||
live.get() -> TICK_MS
|
qam.live.get() && (!split || mainMenu.live.get() || mainMenu.page?.closed != false) -> TICK_MS
|
||||||
else -> FAST_TICK_MS
|
else -> FAST_TICK_MS
|
||||||
}
|
}
|
||||||
val used = QamFit.current(context)
|
val used = QamFit.current(context)
|
||||||
@@ -225,35 +295,46 @@ internal fun SteamQamPanel() {
|
|||||||
} finally {
|
} finally {
|
||||||
withContext(NonCancellable) {
|
withContext(NonCancellable) {
|
||||||
renew.cancelAndJoin()
|
renew.cancelAndJoin()
|
||||||
val page = holder[0]
|
// The pages outlive these connections, so the widened layouts would otherwise stay on the top screen.
|
||||||
holder[0] = null
|
qam.stop(QamLayout.contentScript(wide = false))
|
||||||
runCatching { page?.send("Page.stopScreencast") }
|
mainMenu.stop(MainMenuLayout.CONTENT_SCRIPT)
|
||||||
// The page outlives this connection, so the widened layout would otherwise stay on the top screen.
|
|
||||||
runCatching { page?.evaluate(QamLayout.contentScript(wide = false)) }
|
|
||||||
page?.close()
|
|
||||||
SteamQam.release(context, relay[0], owner)
|
SteamQam.release(context, relay[0], owner)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val img = image
|
val qamFrame = qam.frame()
|
||||||
val l = shape
|
if (qamFrame == null) {
|
||||||
val f = remember(img, l) {
|
|
||||||
if (img != null && l != null && l[0] > 0f) QamFrame(img, l[0], l[1], l[3].coerceIn(l[0] * 0.25f, l[0])) else null
|
|
||||||
}
|
|
||||||
if (f == null) {
|
|
||||||
Box(measure) {
|
Box(measure) {
|
||||||
if (slow) PanelNote(stringResource(if (failed) R.string.bottom_qam_unavailable else R.string.achievements_reading))
|
if (slow) PanelNote(stringResource(if (failed) R.string.bottom_qam_unavailable else R.string.achievements_reading))
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
BoxWithConstraints(measure.background(f.fill)) {
|
if (fit != QamFit.SPLIT) {
|
||||||
|
MenuCanvas(qamFrame, fit.align, measure) { qam.page }
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Each side is as wide as its menu at the shared scale, so neither is shrunk nor padded with empty space.
|
||||||
|
val mainFrame = mainMenu.frame()
|
||||||
|
val mainWidth = mainFrame?.cssWidth ?: SteamQam.MAIN_CSS_WIDTH.toFloat()
|
||||||
|
Row(measure) {
|
||||||
|
val left = Modifier.weight(mainWidth).fillMaxHeight()
|
||||||
|
if (mainFrame != null) MenuCanvas(mainFrame, -1, left) { mainMenu.page }
|
||||||
|
else Box(left.background(qamFrame.fill))
|
||||||
|
MenuCanvas(qamFrame, -1, Modifier.weight(qamFrame.cssWidth).fillMaxHeight()) { qam.page }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Draws [f] scaled into the box, placed by [align], and forwards touches on it to [page]. */
|
||||||
|
@Composable
|
||||||
|
private fun MenuCanvas(f: QamFrame, align: Int, modifier: Modifier, page: () -> CdpPage?) {
|
||||||
|
BoxWithConstraints(modifier.background(f.fill)) {
|
||||||
val density = LocalDensity.current
|
val density = LocalDensity.current
|
||||||
val boxW = with(density) { maxWidth.toPx() }
|
val boxW = with(density) { maxWidth.toPx() }
|
||||||
val boxH = with(density) { maxHeight.toPx() }
|
val boxH = with(density) { maxHeight.toPx() }
|
||||||
val (scale, left) = QamLayout.fit(boxW, boxH, f.contentRight, f.cssHeight, fit.align)
|
val (scale, left) = QamLayout.fit(boxW, boxH, f.contentRight, f.cssHeight, align)
|
||||||
Canvas(
|
Canvas(
|
||||||
Modifier.fillMaxSize().pointerInput(f.cssWidth, f.contentRight, boxW, boxH, fit) {
|
Modifier.fillMaxSize().pointerInput(f.cssWidth, f.contentRight, boxW, boxH, align) {
|
||||||
var touching = false
|
var touching = false
|
||||||
var target: CdpPage? = null
|
var target: CdpPage? = null
|
||||||
try {
|
try {
|
||||||
@@ -268,7 +349,7 @@ internal fun SteamQamPanel() {
|
|||||||
PointerEventType.Release -> "touchEnd"
|
PointerEventType.Release -> "touchEnd"
|
||||||
else -> null
|
else -> null
|
||||||
}?.takeIf { it == "touchStart" || touching } ?: continue
|
}?.takeIf { it == "touchStart" || touching } ?: continue
|
||||||
if (type == "touchStart") target = holder[0]
|
if (type == "touchStart") target = page()
|
||||||
touching = type != "touchEnd"
|
touching = type != "touchEnd"
|
||||||
val points = if (type == "touchEnd") JSONArray()
|
val points = if (type == "touchEnd") JSONArray()
|
||||||
else JSONArray().put(JSONObject().put("x", x.toDouble()).put("y", y.toDouble()))
|
else JSONArray().put(JSONObject().put("x", x.toDouble()).put("y", y.toDouble()))
|
||||||
|
|||||||
@@ -57,12 +57,17 @@ import com.droiddeck.launcher.stores.StoresState
|
|||||||
/** What the Library pretends while a developer previews it. Nothing here is saved: a restart always comes back to [OFF]. */
|
/** What the Library pretends while a developer previews it. Nothing here is saved: a restart always comes back to [OFF]. */
|
||||||
internal enum class LibraryPreview { OFF, NOTHING_INSTALLED, SIGNED_OUT, SAMPLE }
|
internal enum class LibraryPreview { OFF, NOTHING_INSTALLED, SIGNED_OUT, SAMPLE }
|
||||||
|
|
||||||
|
/** How many games the Steam home pretends are installed. Nothing here is saved. */
|
||||||
|
internal enum class SteamHomePreview(val games: Int) { OFF(-1), NONE(0), FEW(3), MANY(12) }
|
||||||
|
|
||||||
internal enum class DrawerPreview { STEAM, DESKTOP, GAME }
|
internal enum class DrawerPreview { STEAM, DESKTOP, GAME }
|
||||||
|
|
||||||
/** Developer tools' preview states: screens that are otherwise hard to reach, shown without changing anything real. */
|
/** Developer tools' preview states: screens that are otherwise hard to reach, shown without changing anything real. */
|
||||||
internal object DevPreview {
|
internal object DevPreview {
|
||||||
var library by mutableStateOf(LibraryPreview.OFF)
|
var library by mutableStateOf(LibraryPreview.OFF)
|
||||||
var drawer by mutableStateOf<DrawerPreview?>(null)
|
var drawer by mutableStateOf<DrawerPreview?>(null)
|
||||||
|
var steamHome by mutableStateOf(SteamHomePreview.OFF)
|
||||||
|
var openSteam by mutableStateOf(false)
|
||||||
/** The UI zoo sheet: where previews are picked, one at a time, only when asked for. */
|
/** The UI zoo sheet: where previews are picked, one at a time, only when asked for. */
|
||||||
var zoo by mutableStateOf(false)
|
var zoo by mutableStateOf(false)
|
||||||
/** Opt-in: a preview button where its state lives (the Library's toolbar), for switching states without the zoo. */
|
/** Opt-in: a preview button where its state lives (the Library's toolbar), for switching states without the zoo. */
|
||||||
@@ -87,6 +92,41 @@ internal fun sampleOwned(store: Store): List<CatalogItem> =
|
|||||||
internal fun sampleInstalled(owned: Map<Store, List<CatalogItem>>): Set<String> =
|
internal fun sampleInstalled(owned: Map<Store, List<CatalogItem>>): Set<String> =
|
||||||
owned.values.flatMap { items -> items.take(SAMPLE_INSTALLED).map { it.key } }.toSet()
|
owned.values.flatMap { items -> items.take(SAMPLE_INSTALLED).map { it.key } }.toSet()
|
||||||
|
|
||||||
|
/** The Steam home's games while a developer previews it: this many invented titles, no art, nothing installed. */
|
||||||
|
internal fun sampleSteamHomeGames(count: Int): List<com.droiddeck.launcher.frontend.Library.SteamGame> = listOf(
|
||||||
|
"Portal 2", "Hades", "Celeste", "Stardew Valley", "Hollow Knight", "Balatro",
|
||||||
|
"Dead Cells", "Terraria", "Vampire Survivors", "Slay the Spire", "Cuphead", "Inscryption",
|
||||||
|
).take(count).mapIndexed { i, name ->
|
||||||
|
com.droiddeck.launcher.frontend.Library.SteamGame(1000 + i, name, art = null, library = "steam", lastPlayed = 1_700_000_000_000L - i * 86_400_000L)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The pill a previewed Steam home shows, so the fake state is never mistaken for the real one. */
|
||||||
|
@Composable
|
||||||
|
internal fun SteamHomePreviewPill(modifier: Modifier = Modifier) {
|
||||||
|
val preview = DevPreview.steamHome
|
||||||
|
if (preview == SteamHomePreview.OFF) return
|
||||||
|
val colors = MaterialTheme.colorScheme
|
||||||
|
val pal = LocalPalette.current
|
||||||
|
val label = stringResource(
|
||||||
|
when (preview) {
|
||||||
|
SteamHomePreview.NONE -> R.string.dev_preview_steam_none
|
||||||
|
SteamHomePreview.FEW -> R.string.dev_preview_steam_few
|
||||||
|
else -> R.string.dev_preview_steam_many
|
||||||
|
},
|
||||||
|
)
|
||||||
|
val end = stringResource(R.string.dev_preview_end)
|
||||||
|
Row(
|
||||||
|
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp),
|
||||||
|
modifier = modifier.background(colors.surface, CircleShape).border(1.dp, pal.signal, CircleShape)
|
||||||
|
.clickable(role = Role.Button, onClickLabel = end) { DevPreview.steamHome = SteamHomePreview.OFF }
|
||||||
|
.padding(start = 14.dp, end = 10.dp, top = 8.dp, bottom = 8.dp).testTag("dev-preview-steam-end"),
|
||||||
|
) {
|
||||||
|
Icon(Icons.Outlined.Visibility, null, tint = pal.signal, modifier = Modifier.size(18.dp))
|
||||||
|
Text(stringResource(R.string.dev_preview_banner, label), fontSize = 13.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground)
|
||||||
|
Icon(Icons.Filled.Close, end, tint = colors.onSurfaceVariant, modifier = Modifier.size(18.dp))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** The pill a previewed Library shows, so the fake state is never mistaken for the real one. */
|
/** The pill a previewed Library shows, so the fake state is never mistaken for the real one. */
|
||||||
@Composable
|
@Composable
|
||||||
internal fun LibraryPreviewPill(modifier: Modifier = Modifier) {
|
internal fun LibraryPreviewPill(modifier: Modifier = Modifier) {
|
||||||
@@ -215,6 +255,17 @@ internal fun UiZooSheet() {
|
|||||||
DrawerPreview.GAME to R.string.session_title_game,
|
DrawerPreview.GAME to R.string.session_title_game,
|
||||||
)) ActionRow(stringResource(label), null, show, onClick = { close(); DevPreview.drawer = mode }, modifier = Modifier.testTag("zoo-drawer-${mode.name.lowercase()}"))
|
)) ActionRow(stringResource(label), null, show, onClick = { close(); DevPreview.drawer = mode }, modifier = Modifier.testTag("zoo-drawer-${mode.name.lowercase()}"))
|
||||||
}
|
}
|
||||||
|
SettingsGroup(stringResource(R.string.dev_preview_steam_home)) {
|
||||||
|
for ((mode, label) in listOf(
|
||||||
|
SteamHomePreview.NONE to R.string.dev_preview_steam_none,
|
||||||
|
SteamHomePreview.FEW to R.string.dev_preview_steam_few,
|
||||||
|
SteamHomePreview.MANY to R.string.dev_preview_steam_many,
|
||||||
|
)) ActionRow(
|
||||||
|
stringResource(label), null, show,
|
||||||
|
onClick = { close(); DevPreview.steamHome = mode; DevPreview.openSteam = true },
|
||||||
|
modifier = Modifier.testTag("zoo-steam-${mode.name.lowercase()}"),
|
||||||
|
)
|
||||||
|
}
|
||||||
SettingsGroup(stringResource(R.string.dev_preview_library)) {
|
SettingsGroup(stringResource(R.string.dev_preview_library)) {
|
||||||
for ((mode, label) in listOf(
|
for ((mode, label) in listOf(
|
||||||
LibraryPreview.NOTHING_INSTALLED to R.string.dev_preview_library_nothing_installed,
|
LibraryPreview.NOTHING_INSTALLED to R.string.dev_preview_library_nothing_installed,
|
||||||
|
|||||||
@@ -267,12 +267,19 @@ private fun Content(
|
|||||||
SteamTabPage(selected, a, modifier.padding(horizontal = padH).padding(top = padV))
|
SteamTabPage(selected, a, modifier.padding(horizontal = padH).padding(top = padV))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (selected == "recomps") {
|
||||||
|
RecompsPage(s, a, onSelect, modifier.padding(horizontal = padH).padding(top = padV))
|
||||||
|
return
|
||||||
|
}
|
||||||
if (selected == "updates") {
|
if (selected == "updates") {
|
||||||
UpdatesPage(s, a, modifier.padding(horizontal = padH).padding(top = padV))
|
UpdatesPage(s, a, modifier.padding(horizontal = padH).padding(top = padV))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (selected == "steam") {
|
if (selected == "steam") {
|
||||||
SteamHome(s, a, modifier)
|
Box(modifier) {
|
||||||
|
SteamHome(s, a, Modifier.fillMaxSize())
|
||||||
|
SteamHomePreviewPill(Modifier.align(androidx.compose.ui.Alignment.BottomCenter).padding(bottom = 20.dp))
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (selected == "store") {
|
if (selected == "store") {
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ import androidx.compose.material.icons.filled.Terminal
|
|||||||
import androidx.compose.material.icons.filled.Apps
|
import androidx.compose.material.icons.filled.Apps
|
||||||
import androidx.compose.material.icons.filled.Settings
|
import androidx.compose.material.icons.filled.Settings
|
||||||
import androidx.compose.material.icons.filled.SdStorage
|
import androidx.compose.material.icons.filled.SdStorage
|
||||||
|
import androidx.compose.material.icons.filled.Memory
|
||||||
import androidx.compose.material.icons.filled.Movie
|
import androidx.compose.material.icons.filled.Movie
|
||||||
import androidx.compose.material.icons.filled.Sync
|
import androidx.compose.material.icons.filled.Sync
|
||||||
import androidx.compose.material.icons.filled.MoreHoriz
|
import androidx.compose.material.icons.filled.MoreHoriz
|
||||||
@@ -208,6 +209,7 @@ internal fun railLabelIcon(key: String): Pair<Int, ImageVector> = when (key) {
|
|||||||
"sync" -> R.string.rail_sync to Icons.Filled.Sync
|
"sync" -> R.string.rail_sync to Icons.Filled.Sync
|
||||||
"decky" -> R.string.rail_decky to DeckyIcon
|
"decky" -> R.string.rail_decky to DeckyIcon
|
||||||
"boot-movies" -> R.string.rail_boot_movies to Icons.Filled.Movie
|
"boot-movies" -> R.string.rail_boot_movies to Icons.Filled.Movie
|
||||||
|
"recomps" -> R.string.rail_recomps to Icons.Filled.Memory
|
||||||
NavTabs.MORE -> R.string.rail_more to Icons.Filled.MoreHoriz
|
NavTabs.MORE -> R.string.rail_more to Icons.Filled.MoreHoriz
|
||||||
else -> R.string.rail_updates to updatesIcon(RunningBuild.kind())
|
else -> R.string.rail_updates to updatesIcon(RunningBuild.kind())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -658,6 +658,11 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
|||||||
LaunchedEffect(SetupTabs.openSection) {
|
LaunchedEffect(SetupTabs.openSection) {
|
||||||
if (SetupTabs.openSection != null && (railSelection != "setup" || s.pageKey != null)) showRailPage("setup", true)
|
if (SetupTabs.openSection != null && (railSelection != "setup" || s.pageKey != null)) showRailPage("setup", true)
|
||||||
}
|
}
|
||||||
|
LaunchedEffect(DevPreview.openSteam) {
|
||||||
|
if (!DevPreview.openSteam) return@LaunchedEffect
|
||||||
|
DevPreview.openSteam = false
|
||||||
|
showRailPage("steam", true)
|
||||||
|
}
|
||||||
LaunchedEffect(DevPreview.openLibrary) {
|
LaunchedEffect(DevPreview.openLibrary) {
|
||||||
if (!DevPreview.openLibrary) return@LaunchedEffect
|
if (!DevPreview.openLibrary) return@LaunchedEffect
|
||||||
DevPreview.openLibrary = false
|
DevPreview.openLibrary = false
|
||||||
@@ -842,7 +847,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
|||||||
com.droiddeck.launcher.stores.StoresState.pendingInstall?.let { item -> StoreTheme(item.store) { InstallWhere(item) } }
|
com.droiddeck.launcher.stores.StoresState.pendingInstall?.let { item -> StoreTheme(item.store) { InstallWhere(item) } }
|
||||||
com.droiddeck.launcher.stores.StoresState.itchPicking?.let { item -> StoreTheme(item.store) { ItchBuildPicker(item) { com.droiddeck.launcher.stores.StoresState.itchPicking = null } } }
|
com.droiddeck.launcher.stores.StoresState.itchPicking?.let { item -> StoreTheme(item.store) { ItchBuildPicker(item) { com.droiddeck.launcher.stores.StoresState.itchPicking = null } } }
|
||||||
com.droiddeck.launcher.stores.StoresState.gameJoltPicking?.let { item -> StoreTheme(item.store) { GameJoltBuildPicker(item) { com.droiddeck.launcher.stores.StoresState.gameJoltPicking = null } } }
|
com.droiddeck.launcher.stores.StoresState.gameJoltPicking?.let { item -> StoreTheme(item.store) { GameJoltBuildPicker(item) { com.droiddeck.launcher.stores.StoresState.gameJoltPicking = null } } }
|
||||||
com.droiddeck.launcher.stores.steam.SteamStore.picking?.let { item -> StoreTheme(item.store) { SteamInstallWhereDialog(item) { com.droiddeck.launcher.stores.steam.SteamStore.picking = null } } }
|
com.droiddeck.launcher.stores.StoresState.steamPicking?.let { item -> StoreTheme(item.store) { SteamInstallWhereDialog(item) { com.droiddeck.launcher.stores.StoresState.steamPicking = null } } }
|
||||||
StepsLayer(screenAt)
|
StepsLayer(screenAt)
|
||||||
UiZooSheet()
|
UiZooSheet()
|
||||||
SessionDrawerPreview(s.secondScreenDisplays)
|
SessionDrawerPreview(s.secondScreenDisplays)
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ internal object SetupTabs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
internal fun CheckRow(state: CheckState, title: String, detail: String?, divider: Boolean = true, action: (@Composable () -> Unit)? = null) {
|
internal fun CheckRow(state: CheckState, title: String, detail: String?, divider: Boolean = true, detailLines: Int = 2, action: (@Composable () -> Unit)? = null) {
|
||||||
val colors = MaterialTheme.colorScheme
|
val colors = MaterialTheme.colorScheme
|
||||||
val pal = LocalPalette.current
|
val pal = LocalPalette.current
|
||||||
val tint = when (state) {
|
val tint = when (state) {
|
||||||
@@ -135,7 +135,7 @@ internal fun CheckRow(state: CheckState, title: String, detail: String?, divider
|
|||||||
}
|
}
|
||||||
Column(modifier = Modifier.weight(1f)) {
|
Column(modifier = Modifier.weight(1f)) {
|
||||||
Text(title, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground)
|
Text(title, fontSize = 15.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground)
|
||||||
if (detail != null) Text(detail, fontSize = 13.sp, color = colors.onSurfaceVariant, maxLines = 2, overflow = TextOverflow.Ellipsis)
|
if (detail != null) Text(detail, fontSize = 13.sp, color = colors.onSurfaceVariant, maxLines = detailLines, overflow = TextOverflow.Ellipsis)
|
||||||
}
|
}
|
||||||
if (action != null) action()
|
if (action != null) action()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ import androidx.compose.ui.unit.dp
|
|||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import coil.compose.AsyncImage
|
import coil.compose.AsyncImage
|
||||||
import com.droiddeck.launcher.R
|
import com.droiddeck.launcher.R
|
||||||
|
import com.droiddeck.launcher.frontend.AddedGameEdits
|
||||||
import com.droiddeck.launcher.frontend.GameRemoval
|
import com.droiddeck.launcher.frontend.GameRemoval
|
||||||
import com.droiddeck.launcher.frontend.Library
|
import com.droiddeck.launcher.frontend.Library
|
||||||
import com.droiddeck.launcher.runtime.CurseForgeApp
|
import com.droiddeck.launcher.runtime.CurseForgeApp
|
||||||
@@ -104,6 +105,7 @@ import com.droiddeck.launcher.runtime.WowAddonCatalog
|
|||||||
import com.droiddeck.launcher.runtime.WowAddons
|
import com.droiddeck.launcher.runtime.WowAddons
|
||||||
import com.droiddeck.launcher.store.UserAppsState
|
import com.droiddeck.launcher.store.UserAppsState
|
||||||
import com.droiddeck.launcher.session.GameSaves
|
import com.droiddeck.launcher.session.GameSaves
|
||||||
|
import com.droiddeck.launcher.session.SessionPrefs
|
||||||
import com.droiddeck.launcher.session.SessionState
|
import com.droiddeck.launcher.session.SessionState
|
||||||
import com.droiddeck.launcher.stores.CatalogItem
|
import com.droiddeck.launcher.stores.CatalogItem
|
||||||
import com.droiddeck.launcher.stores.CloudSaves
|
import com.droiddeck.launcher.stores.CloudSaves
|
||||||
@@ -1001,6 +1003,25 @@ private fun LaunchTab(game: Library.SteamGame, s: FrontEndState, a: FrontEndActi
|
|||||||
}
|
}
|
||||||
val folder = game.gameFiles
|
val folder = game.gameFiles
|
||||||
if (game.library == Library.ADDED && game.source == Library.ADDED && !s.shortcutPicker && folder != null) ShortcutFields(game, folder)
|
if (game.library == Library.ADDED && game.source == Library.ADDED && !s.shortcutPicker && folder != null) ShortcutFields(game, folder)
|
||||||
|
if (game.library == Library.ADDED && Store.byId(game.source) == Store.EA && folder != null) StoreLaunchOptions(folder, a)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun StoreLaunchOptions(folder: File, a: FrontEndActions) {
|
||||||
|
val app = LocalContext.current.applicationContext
|
||||||
|
val scope = rememberCoroutineScope()
|
||||||
|
var saved by remember(folder.path) { mutableStateOf(SessionPrefs.addedGameLaunch(app, folder.path)) }
|
||||||
|
var editing by remember(folder.path) { mutableStateOf(false) }
|
||||||
|
Column(Modifier.fillMaxWidth().tabPanel()) {
|
||||||
|
MenuItem(stringResource(R.string.edit_launch_options), checked = false, detail = saved.ifEmpty { "—" }) { editing = true }
|
||||||
|
}
|
||||||
|
if (editing) TextEntryDialog(stringResource(R.string.edit_launch_options), saved, onDismiss = { editing = false }) { value ->
|
||||||
|
scope.launch {
|
||||||
|
withContext(Dispatchers.IO) { AddedGameEdits.setLaunchOptions(app, folder.path, value) }
|
||||||
|
saved = value
|
||||||
|
a.onAddedGamesChanged(listOf(folder.path))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -174,14 +174,15 @@ private fun InputSettingsContent(onBack: () -> Unit, onChanged: () -> Unit, embe
|
|||||||
detail = if (library.usersOfBindings(b.id).size > 1) stringResource(R.string.input_shared_detail, b.name, library.usersOfBindings(b.id).size)
|
detail = if (library.usersOfBindings(b.id).size > 1) stringResource(R.string.input_shared_detail, b.name, library.usersOfBindings(b.id).size)
|
||||||
else "${profile.name} · ${roleLabel(role)}", onSave = { action ->
|
else "${profile.name} · ${roleLabel(role)}", onSave = { action ->
|
||||||
if (update { l ->
|
if (update { l ->
|
||||||
|
val currentPreset = l.preset(editing.preset)
|
||||||
val geometry = if (!editing.click && elementProperties != null && layout != null) l.withLayout(layout.copy(elements = layout.elements.map {
|
val geometry = if (!editing.click && elementProperties != null && layout != null) l.withLayout(layout.copy(elements = layout.elements.map {
|
||||||
if (it.id == elementProperties!!.id) elementProperties!!.copy(name = elementProperties!!.name.trim().ifBlank { it.name }) else it
|
if (it.id == elementProperties!!.id) elementProperties!!.copy(name = elementProperties!!.name.trim().ifBlank { it.name }) else it
|
||||||
})) else l
|
})) else l
|
||||||
geometry.withPreset(when {
|
geometry.withPreset(when {
|
||||||
editing.element != null && editing.click -> b.copy(clicks = b.clicks + (editing.element.id to action))
|
editing.element != null && editing.click -> currentPreset.copy(clicks = currentPreset.clicks + (editing.element.id to action))
|
||||||
editing.element != null -> b.copy(elements = b.elements + (editing.element.id to action))
|
editing.element != null -> currentPreset.copy(elements = currentPreset.elements + (editing.element.id to action))
|
||||||
editing.key != null -> b.copy(keys = b.keys.filterNot { it.key == editing.key } + PhysicalInputBinding(editing.key, action))
|
editing.key != null -> currentPreset.copy(keys = currentPreset.keys.filterNot { it.key == editing.key } + PhysicalInputBinding(editing.key, action))
|
||||||
else -> b.copy(controls = b.controls + (editing.control to action))
|
else -> currentPreset.copy(controls = currentPreset.controls + (editing.control to action))
|
||||||
}) }) edit = null
|
}) }) edit = null
|
||||||
})
|
})
|
||||||
} else if (!surface) key(page, profileId, role) {
|
} else if (!surface) key(page, profileId, role) {
|
||||||
|
|||||||
@@ -195,6 +195,10 @@ internal fun librarySources(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal fun alwaysLibraryTabs(signedIn: Collection<Store>, stores: Boolean, soundMode: Boolean): Set<String> =
|
||||||
|
(if (soundMode) emptyList() else signedIn.map { it.librarySource }).toSet() +
|
||||||
|
listOfNotNull(Library.ADDED.takeIf { stores }, Store.BATTLENET.id.takeIf { stores })
|
||||||
|
|
||||||
internal object LibraryDisplay {
|
internal object LibraryDisplay {
|
||||||
const val DEFAULT_LEVEL = 2
|
const val DEFAULT_LEVEL = 2
|
||||||
val scales = listOf(0.75f, 0.875f, 1f, 1.2f, 1.45f)
|
val scales = listOf(0.75f, 0.875f, 1f, 1.2f, 1.45f)
|
||||||
@@ -278,7 +282,7 @@ private fun NotInstalledRow(count: Int, expanded: Boolean, keys: Modifier, onFoc
|
|||||||
internal fun libraryColumns(width: Int, base: Int, gap: Int, level: Int): Int =
|
internal fun libraryColumns(width: Int, base: Int, gap: Int, level: Int): Int =
|
||||||
(((width + gap) / (base + gap)).coerceAtLeast(1) + LibraryDisplay.DEFAULT_LEVEL - level).coerceAtLeast(1)
|
(((width + gap) / (base + gap)).coerceAtLeast(1) + LibraryDisplay.DEFAULT_LEVEL - level).coerceAtLeast(1)
|
||||||
|
|
||||||
private class LevelCells(private val base: androidx.compose.ui.unit.Dp, private val level: Int) : GridCells {
|
internal class LevelCells(private val base: androidx.compose.ui.unit.Dp, private val level: Int) : GridCells {
|
||||||
override fun androidx.compose.ui.unit.Density.calculateCrossAxisCellSizes(availableSize: Int, spacing: Int): List<Int> {
|
override fun androidx.compose.ui.unit.Density.calculateCrossAxisCellSizes(availableSize: Int, spacing: Int): List<Int> {
|
||||||
val count = libraryColumns(availableSize, base.roundToPx(), spacing, level)
|
val count = libraryColumns(availableSize, base.roundToPx(), spacing, level)
|
||||||
val usable = (availableSize - spacing * (count - 1)).coerceAtLeast(0)
|
val usable = (availableSize - spacing * (count - 1)).coerceAtLeast(0)
|
||||||
@@ -374,7 +378,7 @@ internal fun LibraryPage(s: FrontEndState, a: FrontEndActions, selected: String,
|
|||||||
.map { it.store.id }.toSet()
|
.map { it.store.id }.toSet()
|
||||||
val sources = librarySources(
|
val sources = librarySources(
|
||||||
all, storeTabs.map { it.store.id },
|
all, storeTabs.map { it.store.id },
|
||||||
listOfNotNull(Store.ITCH.id.takeIf { itchSignedIn && !soundMode }, Store.GAMEJOLT.id.takeIf { gameJoltSignedIn && !soundMode }, Library.ADDED.takeIf { stores }, Store.BATTLENET.id.takeIf { stores }).toSet() + signInChips,
|
alwaysLibraryTabs(owned.keys, stores, soundMode) + signInChips,
|
||||||
favorites, concealed,
|
favorites, concealed,
|
||||||
offStores = if (soundMode) emptySet() else storeTabs.filterNot { it.shown }.map { it.store.id }.toSet(),
|
offStores = if (soundMode) emptySet() else storeTabs.filterNot { it.shown }.map { it.store.id }.toSet(),
|
||||||
places = if (soundMode) DEFAULT_LIBRARY_PLACES else StoreTabsState.libraryPlaces,
|
places = if (soundMode) DEFAULT_LIBRARY_PLACES else StoreTabsState.libraryPlaces,
|
||||||
@@ -931,6 +935,7 @@ private fun LibraryFilters(sources: List<String>, source: String, onSource: (Str
|
|||||||
val label = when (id) {
|
val label = when (id) {
|
||||||
LIBRARY_ALL -> stringResource(R.string.stores_tab_all)
|
LIBRARY_ALL -> stringResource(R.string.stores_tab_all)
|
||||||
Library.ADDED -> stringResource(R.string.library_custom_games)
|
Library.ADDED -> stringResource(R.string.library_custom_games)
|
||||||
|
com.droiddeck.launcher.runtime.RecompShortcuts.SOURCE -> stringResource(R.string.rail_recomps)
|
||||||
LIBRARY_FAVORITES -> stringResource(R.string.soundtracks_favorites)
|
LIBRARY_FAVORITES -> stringResource(R.string.soundtracks_favorites)
|
||||||
LIBRARY_HIDDEN -> stringResource(R.string.apps_filter_hidden)
|
LIBRARY_HIDDEN -> stringResource(R.string.apps_filter_hidden)
|
||||||
else -> store?.shortLabel ?: sourceLabel(id)
|
else -> store?.shortLabel ?: sourceLabel(id)
|
||||||
@@ -963,6 +968,7 @@ private fun LibraryFilters(sources: List<String>, source: String, onSource: (Str
|
|||||||
private fun sourceTitle(src: String): String = when (src) {
|
private fun sourceTitle(src: String): String = when (src) {
|
||||||
LIBRARY_ALL -> stringResource(R.string.library_all_games)
|
LIBRARY_ALL -> stringResource(R.string.library_all_games)
|
||||||
Library.ADDED -> stringResource(R.string.library_custom_games)
|
Library.ADDED -> stringResource(R.string.library_custom_games)
|
||||||
|
com.droiddeck.launcher.runtime.RecompShortcuts.SOURCE -> stringResource(R.string.rail_recomps)
|
||||||
LIBRARY_FAVORITES -> stringResource(R.string.soundtracks_favorites)
|
LIBRARY_FAVORITES -> stringResource(R.string.soundtracks_favorites)
|
||||||
LIBRARY_HIDDEN -> stringResource(R.string.apps_filter_hidden)
|
LIBRARY_HIDDEN -> stringResource(R.string.apps_filter_hidden)
|
||||||
else -> Store.byId(src)?.label ?: sourceLabel(src)
|
else -> Store.byId(src)?.label ?: sourceLabel(src)
|
||||||
|
|||||||
@@ -119,12 +119,12 @@ internal object StoreTabsState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** The Library tabs that are not stores but sort among them in Manage stores. Only Favorites, Custom games and Hidden can be turned off; Hidden starts off. */
|
/** The Library tabs that are not stores but sort among them in Manage stores. Only Favorites, Custom games and Hidden can be turned off; Hidden starts off. */
|
||||||
internal val LIBRARY_OWN_TABS = listOf(LIBRARY_FAVORITES, Library.SOURCE_STEAM, Library.ADDED, LIBRARY_HIDDEN)
|
internal val LIBRARY_OWN_TABS = listOf(LIBRARY_FAVORITES, Library.SOURCE_STEAM, Library.ADDED, com.droiddeck.launcher.runtime.RecompShortcuts.SOURCE, LIBRARY_HIDDEN)
|
||||||
internal val LIBRARY_HIDEABLE_TABS = setOf(LIBRARY_FAVORITES, Library.ADDED, LIBRARY_HIDDEN)
|
internal val LIBRARY_HIDEABLE_TABS = setOf(LIBRARY_FAVORITES, Library.ADDED, com.droiddeck.launcher.runtime.RecompShortcuts.SOURCE, LIBRARY_HIDDEN)
|
||||||
|
|
||||||
/** Favorites, then Steam, ahead of the stores; Custom games and Hidden after them (null: the end). */
|
/** Favorites, then Steam, ahead of the stores; Custom games and Hidden after them (null: the end). */
|
||||||
internal val DEFAULT_LIBRARY_PLACES: List<Pair<String, String?>> =
|
internal val DEFAULT_LIBRARY_PLACES: List<Pair<String, String?>> =
|
||||||
listOf(LIBRARY_FAVORITES to "", Library.SOURCE_STEAM to LIBRARY_FAVORITES, Library.ADDED to null, LIBRARY_HIDDEN to null)
|
listOf(LIBRARY_FAVORITES to "", Library.SOURCE_STEAM to LIBRARY_FAVORITES, Library.ADDED to null, com.droiddeck.launcher.runtime.RecompShortcuts.SOURCE to Library.ADDED, LIBRARY_HIDDEN to null)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Puts the Library's own tabs into a store tab order. Each goes after the tab it follows ("" for first; null or a tab that is gone
|
* Puts the Library's own tabs into a store tab order. Each goes after the tab it follows ("" for first; null or a tab that is gone
|
||||||
@@ -339,6 +339,7 @@ private fun LibraryTabSortRow(id: String, held: Boolean, offset: Float, hint: St
|
|||||||
val label = when (id) {
|
val label = when (id) {
|
||||||
LIBRARY_FAVORITES -> stringResource(R.string.soundtracks_favorites)
|
LIBRARY_FAVORITES -> stringResource(R.string.soundtracks_favorites)
|
||||||
Library.ADDED -> stringResource(R.string.library_custom_games)
|
Library.ADDED -> stringResource(R.string.library_custom_games)
|
||||||
|
com.droiddeck.launcher.runtime.RecompShortcuts.SOURCE -> stringResource(R.string.rail_recomps)
|
||||||
LIBRARY_HIDDEN -> stringResource(R.string.apps_filter_hidden)
|
LIBRARY_HIDDEN -> stringResource(R.string.apps_filter_hidden)
|
||||||
else -> stringResource(R.string.source_steam)
|
else -> stringResource(R.string.source_steam)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ internal object DeveloperTools {
|
|||||||
|
|
||||||
internal object NavTabs {
|
internal object NavTabs {
|
||||||
const val MORE = "more"
|
const val MORE = "more"
|
||||||
val ALL = listOf("steam", "desktop", "games", "downloads", "setup", "updates", "stores", "soundtracks", "components", "storage", "sync", "decky", "boot-movies", "android-apps", "agent")
|
val ALL = listOf("steam", "desktop", "games", "downloads", "setup", "updates", "stores", "soundtracks", "components", "storage", "sync", "decky", "boot-movies", "recomps", "android-apps", "agent")
|
||||||
val DEFAULT_SHELVED = setOf("stores", "soundtracks", "components", "storage", "sync", "decky", "boot-movies", "agent")
|
val DEFAULT_SHELVED = setOf("stores", "soundtracks", "components", "storage", "sync", "decky", "boot-movies", "recomps", "agent")
|
||||||
val DEFAULT_HIDDEN = setOf("android-apps", "agent")
|
val DEFAULT_HIDDEN = setOf("android-apps", "agent")
|
||||||
private val SHELVED_WHEN_NEW = setOf("storage", "sync", "decky", "boot-movies", "agent")
|
private val SHELVED_WHEN_NEW = setOf("storage", "sync", "decky", "boot-movies", "recomps", "agent")
|
||||||
private val OLD_ORDER = listOf("steam", "games", "soundtracks", "stores", "downloads", "desktop", "agent", "components", "android-apps", "storage", "sync", "setup", "updates")
|
private val OLD_ORDER = listOf("steam", "games", "soundtracks", "stores", "downloads", "desktop", "agent", "components", "android-apps", "storage", "sync", "setup", "updates")
|
||||||
private val OLD_SHELVED = setOf("soundtracks", "agent", "storage", "sync")
|
private val OLD_SHELVED = setOf("soundtracks", "agent", "storage", "sync")
|
||||||
private const val LAYOUT_VERSION = 2
|
private const val LAYOUT_VERSION = 2
|
||||||
|
|||||||
@@ -0,0 +1,588 @@
|
|||||||
|
package com.droiddeck.launcher.ui
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.net.Uri
|
||||||
|
import androidx.activity.compose.BackHandler
|
||||||
|
import androidx.compose.foundation.LocalIndication
|
||||||
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.foundation.horizontalScroll
|
||||||
|
import androidx.compose.foundation.hoverable
|
||||||
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||||
|
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.ExperimentalLayoutApi
|
||||||
|
import androidx.compose.foundation.layout.FlowRow
|
||||||
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.Spacer
|
||||||
|
import androidx.compose.foundation.layout.aspectRatio
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.height
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.foundation.layout.width
|
||||||
|
import androidx.compose.foundation.lazy.grid.GridItemSpan
|
||||||
|
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
||||||
|
import androidx.compose.foundation.lazy.grid.items
|
||||||
|
import androidx.compose.foundation.lazy.grid.rememberLazyGridState
|
||||||
|
import androidx.compose.foundation.rememberScrollState
|
||||||
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
|
import androidx.compose.foundation.verticalScroll
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.CheckCircle
|
||||||
|
import androidx.compose.material.icons.filled.FilterAlt
|
||||||
|
import androidx.compose.material.icons.filled.Sort
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.DisposableEffect
|
||||||
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
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.focus.focusRequester
|
||||||
|
import androidx.compose.ui.geometry.Rect
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.layout.ContentScale
|
||||||
|
import androidx.compose.ui.layout.boundsInRoot
|
||||||
|
import androidx.compose.ui.layout.onGloballyPositioned
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.compose.ui.platform.testTag
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.semantics.Role
|
||||||
|
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.sp
|
||||||
|
import coil.compose.AsyncImage
|
||||||
|
import com.droiddeck.launcher.R
|
||||||
|
import com.droiddeck.launcher.frontend.Library
|
||||||
|
import com.droiddeck.launcher.runtime.RecompAndroid
|
||||||
|
import com.droiddeck.launcher.runtime.RecompCatalog
|
||||||
|
import com.droiddeck.launcher.runtime.RecompData
|
||||||
|
import com.droiddeck.launcher.runtime.RecompInstaller
|
||||||
|
import com.droiddeck.launcher.store.RecompsState
|
||||||
|
import com.droiddeck.launcher.store.UserAppsState
|
||||||
|
import com.droiddeck.launcher.stores.Store
|
||||||
|
import com.droiddeck.launcher.stores.StoresState
|
||||||
|
|
||||||
|
// The first five narrow by your state; the HAS_ ones by which builds a project publishes. Every ticked filter must
|
||||||
|
// hold, so Linux ARM64 + Linux x86-64 + Windows leaves only projects with all three.
|
||||||
|
internal enum class RecompFilter(val build: RecompCatalog.Platform? = null) {
|
||||||
|
INSTALLED, OWNED, NATIVE, UPDATE, NO_SETUP,
|
||||||
|
HAS_LINUX_ARM64(RecompCatalog.Platform.LINUX_ARM64), HAS_LINUX_X64(RecompCatalog.Platform.LINUX_X64),
|
||||||
|
HAS_WINDOWS(RecompCatalog.Platform.WINDOWS_X64), HAS_ANDROID(RecompCatalog.Platform.ANDROID),
|
||||||
|
}
|
||||||
|
|
||||||
|
internal enum class RecompSort { BEST, POPULAR, UPDATED, LISTED, TITLE }
|
||||||
|
|
||||||
|
// Kept while the app runs, like the Library's search and sort, so leaving the tab and coming back keeps your place.
|
||||||
|
internal object RecompsView {
|
||||||
|
var query by mutableStateOf("")
|
||||||
|
var filters by mutableStateOf(emptySet<RecompFilter>())
|
||||||
|
var sort by mutableStateOf(RecompSort.BEST)
|
||||||
|
var system by mutableStateOf<String?>(null)
|
||||||
|
var open by mutableStateOf<String?>(null)
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class RecompRow(
|
||||||
|
val entry: RecompCatalog.Entry, val data: RecompData.State, val installed: RecompInstaller.Installed?,
|
||||||
|
val update: RecompInstaller.Release?, val incompatible: Set<String> = emptySet(),
|
||||||
|
) {
|
||||||
|
val platform get() = installed?.platform?.let { RecompCatalog.Platform.of(it) } ?: entry.preferred(incompatible)?.platform
|
||||||
|
|
||||||
|
fun runs(build: RecompCatalog.Build) = build.pkg == null || build.pkg !in incompatible
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun recompRows(): List<RecompRow> = RecompsState.entries.map { e ->
|
||||||
|
RecompRow(e, RecompsState.data[e.id] ?: RecompData.State.BringYourOwn(e.data), RecompsState.installed[e.id], RecompsState.updates[e.id],
|
||||||
|
RecompsState.incompatible)
|
||||||
|
}
|
||||||
|
|
||||||
|
private val NATIVE = setOf(RecompCatalog.Platform.LINUX_ARM64, RecompCatalog.Platform.ANDROID)
|
||||||
|
|
||||||
|
private fun RecompRow.owned() = data is RecompData.State.Found || data is RecompData.State.Owned || data is RecompData.State.Incomplete
|
||||||
|
|
||||||
|
internal fun RecompRow.matches(filter: RecompFilter): Boolean = when (filter) {
|
||||||
|
RecompFilter.INSTALLED -> installed != null
|
||||||
|
RecompFilter.OWNED -> owned()
|
||||||
|
RecompFilter.NATIVE -> platform in NATIVE
|
||||||
|
RecompFilter.UPDATE -> update != null
|
||||||
|
RecompFilter.NO_SETUP -> entry.setup == null
|
||||||
|
else -> entry.build(filter.build!!) != null
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun RecompRow.matches(query: String): Boolean = query.isBlank() || query.trim().split(Regex("\\s+")).all { word ->
|
||||||
|
listOf(entry.name, entry.game, entry.origin, entry.repo).any { it.contains(word, ignoreCase = true) }
|
||||||
|
}
|
||||||
|
|
||||||
|
// The original systems present in the list, most entries first; a system with one entry is not worth a chip.
|
||||||
|
internal fun recompSystems(rows: List<RecompRow>): List<Pair<String, Int>> =
|
||||||
|
rows.groupingBy { it.entry.origin }.eachCount().filter { (origin, n) -> origin.isNotEmpty() && n > 1 }
|
||||||
|
.toList().sortedWith(compareByDescending<Pair<String, Int>> { it.second }.thenBy { it.first })
|
||||||
|
|
||||||
|
// Best for you: installed, then games you have on a store, then native builds, each by popularity.
|
||||||
|
internal fun RecompRow.rank(): Int = when {
|
||||||
|
installed != null -> 0
|
||||||
|
data is RecompData.State.Found -> 1
|
||||||
|
owned() -> 2
|
||||||
|
platform in NATIVE -> 3
|
||||||
|
else -> 4
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun recompOrder(sort: RecompSort): Comparator<RecompRow> = when (sort) {
|
||||||
|
RecompSort.BEST -> compareBy<RecompRow> { it.rank() }.thenByDescending { it.entry.popularity }
|
||||||
|
RecompSort.POPULAR -> compareByDescending { it.entry.popularity }
|
||||||
|
RecompSort.UPDATED -> compareByDescending { it.entry.updated }
|
||||||
|
RecompSort.LISTED -> compareByDescending { it.entry.listed }
|
||||||
|
RecompSort.TITLE -> compareBy { it.entry.name.lowercase() }
|
||||||
|
}.thenBy { it.entry.name.lowercase() }
|
||||||
|
|
||||||
|
internal fun visibleRecomps(rows: List<RecompRow>, query: String, filters: Set<RecompFilter>, system: String?, sort: RecompSort): List<RecompRow> =
|
||||||
|
rows.filter { r -> r.matches(query) && filters.all { r.matches(it) } && (system == null || r.entry.origin == system) }.sortedWith(recompOrder(sort))
|
||||||
|
|
||||||
|
private val RecompTileWidth = 116.dp
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
internal fun RecompsPage(s: FrontEndState, a: FrontEndActions, onSelect: (String) -> Unit, modifier: Modifier) {
|
||||||
|
val ctx = LocalContext.current
|
||||||
|
val steamOwned = s.steamGames.filter { it.source == Library.SOURCE_STEAM }.map { it.appId to it.name }
|
||||||
|
LaunchedEffect(steamOwned.size, StoresState.installed.size, StoresState.library.size) {
|
||||||
|
RecompsState.refresh(ctx, steamOwned)
|
||||||
|
UserAppsState.refresh(ctx)
|
||||||
|
}
|
||||||
|
val lifecycle = androidx.compose.ui.platform.LocalLifecycleOwner.current.lifecycle
|
||||||
|
DisposableEffect(lifecycle) {
|
||||||
|
val observer = androidx.lifecycle.LifecycleEventObserver { _, event ->
|
||||||
|
if (event == androidx.lifecycle.Lifecycle.Event.ON_RESUME) RecompsState.refresh(ctx, steamOwned)
|
||||||
|
}
|
||||||
|
lifecycle.addObserver(observer)
|
||||||
|
onDispose { lifecycle.removeObserver(observer) }
|
||||||
|
}
|
||||||
|
val rows = remember(RecompsState.entries, RecompsState.data, RecompsState.installed, RecompsState.updates, RecompsState.incompatible) { recompRows() }
|
||||||
|
val opened = RecompsView.open?.let { id -> rows.firstOrNull { it.entry.id == id } }
|
||||||
|
if (opened != null) {
|
||||||
|
BackHandler { RecompsView.open = null }
|
||||||
|
RecompDetail(opened, s, a, onSelect, steamOwned, modifier)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val searched = remember(rows, RecompsView.query) { rows.filter { it.matches(RecompsView.query) } }
|
||||||
|
val shown = remember(searched, RecompsView.filters, RecompsView.system, RecompsView.sort) {
|
||||||
|
visibleRecomps(searched, "", RecompsView.filters, RecompsView.system, RecompsView.sort)
|
||||||
|
}
|
||||||
|
val systems = remember(searched, RecompsView.filters) { recompSystems(searched.filter { r -> RecompsView.filters.all { r.matches(it) } }) }
|
||||||
|
val colors = MaterialTheme.colorScheme
|
||||||
|
Column(modifier) {
|
||||||
|
ModeHeader(
|
||||||
|
stringResource(R.string.rail_recomps), RecompsView.query, { RecompsView.query = it },
|
||||||
|
placeholder = stringResource(R.string.recomps_search), inlineWhenStacked = true,
|
||||||
|
lead = {
|
||||||
|
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.padding(end = 4.dp)) {
|
||||||
|
Text(stringResource(R.string.rail_recomps), fontSize = if (LocalNarrowPane.current) 20.sp else 24.sp, fontWeight = FontWeight.Bold,
|
||||||
|
color = colors.onBackground, maxLines = 1)
|
||||||
|
Text(shown.size.toString(), fontSize = 13.sp, color = colors.onSurfaceVariant, maxLines = 1, modifier = Modifier.testTag("recomps-count"))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
) {
|
||||||
|
RecompFilterButton(searched)
|
||||||
|
RecompSortButton()
|
||||||
|
DisplayButton()
|
||||||
|
}
|
||||||
|
ActiveFilters()
|
||||||
|
if (systems.size > 1) Row(
|
||||||
|
Modifier.fillMaxWidth().horizontalScroll(rememberScrollState()).padding(top = 8.dp, bottom = 4.dp),
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
|
) {
|
||||||
|
TabChip(stringResource(R.string.recomps_every_system), RecompsView.system == null, Modifier.testTag("recomps-system-all")) { RecompsView.system = null }
|
||||||
|
systems.forEach { (origin, n) ->
|
||||||
|
TabChip("$origin · $n", RecompsView.system == origin, Modifier.testTag("recomps-system-$origin")) {
|
||||||
|
RecompsView.system = if (RecompsView.system == origin) null else origin
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
UserAppsState.lastError?.let { Box(Modifier.padding(top = 8.dp)) { Note(it) } }
|
||||||
|
when {
|
||||||
|
RecompsState.loading -> Text("…", color = colors.onSurfaceVariant, modifier = Modifier.padding(top = 16.dp))
|
||||||
|
rows.isEmpty() -> Box(Modifier.padding(top = 12.dp)) { Note(stringResource(R.string.recomps_empty)) }
|
||||||
|
shown.isEmpty() -> Box(Modifier.padding(top = 12.dp)) { Note(stringResource(R.string.recomps_none_here)) }
|
||||||
|
else -> {
|
||||||
|
val level = LibraryDisplay.level
|
||||||
|
LazyVerticalGrid(
|
||||||
|
columns = remember(level) { LevelCells(RecompTileWidth, level) }, state = rememberLazyGridState(),
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(12.dp), verticalArrangement = Arrangement.spacedBy(12.dp),
|
||||||
|
contentPadding = PaddingValues(top = 8.dp, bottom = 24.dp),
|
||||||
|
modifier = Modifier.fillMaxSize().testTag("recomps-list"),
|
||||||
|
) {
|
||||||
|
items(shown, key = { it.entry.id }) { row -> RecompTile(row, first = row === shown.first()) { RecompsView.open = row.entry.id } }
|
||||||
|
item(key = "credits", span = { GridItemSpan(maxLineSpan) }) {
|
||||||
|
Text(stringResource(R.string.recomps_credits), fontSize = 11.sp, color = colors.onSurfaceVariant,
|
||||||
|
modifier = Modifier.padding(top = 12.dp).testTag("recomps-credits"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun filterLabel(f: RecompFilter) = stringResource(when (f) {
|
||||||
|
RecompFilter.INSTALLED -> R.string.recomps_filter_installed
|
||||||
|
RecompFilter.OWNED -> R.string.recomps_filter_owned
|
||||||
|
RecompFilter.NATIVE -> R.string.recomps_filter_native
|
||||||
|
RecompFilter.UPDATE -> R.string.recomps_filter_update
|
||||||
|
RecompFilter.NO_SETUP -> R.string.recomps_filter_no_setup
|
||||||
|
RecompFilter.HAS_LINUX_ARM64 -> R.string.recomps_has_linux_arm64
|
||||||
|
RecompFilter.HAS_LINUX_X64 -> R.string.recomps_has_linux_x64
|
||||||
|
RecompFilter.HAS_WINDOWS -> R.string.recomps_has_windows
|
||||||
|
RecompFilter.HAS_ANDROID -> R.string.recomps_has_android
|
||||||
|
})
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun sortLabel(sort: RecompSort) = stringResource(when (sort) {
|
||||||
|
RecompSort.BEST -> R.string.recomps_sort_best
|
||||||
|
RecompSort.POPULAR -> R.string.recomps_sort_popular
|
||||||
|
RecompSort.UPDATED -> R.string.recomps_sort_updated
|
||||||
|
RecompSort.LISTED -> R.string.recomps_sort_listed
|
||||||
|
RecompSort.TITLE -> R.string.recomps_sort_title
|
||||||
|
})
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun RecompFilterButton(rows: List<RecompRow>) {
|
||||||
|
val pal = LocalPalette.current
|
||||||
|
val title = stringResource(R.string.library_filter)
|
||||||
|
var at by remember { mutableStateOf<Rect?>(null) }
|
||||||
|
val counts = remember(rows) { RecompFilter.entries.associateWith { f -> rows.count { it.matches(f) } } }
|
||||||
|
Box(Modifier.onGloballyPositioned { at = it.boundsInRoot() }.testTag("recomps-filter")) {
|
||||||
|
HeaderIconButton(title, Icons.Filled.FilterAlt, "recomps-filter") {
|
||||||
|
val from = at ?: return@HeaderIconButton
|
||||||
|
Steps.ask(StepAsk(
|
||||||
|
anchor = from, side = StepSide.Left, accent = pal.signal, pillCorner = 8.dp, items = RecompFilter.entries.size + 2,
|
||||||
|
handle = { Icon(Icons.Filled.FilterAlt, null, tint = pal.signal, modifier = Modifier.size(18.dp)) },
|
||||||
|
) {
|
||||||
|
StepTitle(title)
|
||||||
|
StepList {
|
||||||
|
var item = 0
|
||||||
|
listOf(R.string.recomps_filter_show to RecompFilter.entries.filter { it.build == null },
|
||||||
|
R.string.recomps_filter_builds to RecompFilter.entries.filter { it.build != null }).forEach { (heading, group) ->
|
||||||
|
Text(stringResource(heading), fontSize = 12.sp, color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
modifier = Modifier.stepItem(item++).padding(start = 4.dp, top = 8.dp, bottom = 2.dp))
|
||||||
|
group.forEach { f ->
|
||||||
|
StepChoice(
|
||||||
|
filterLabel(f), selected = f in RecompsView.filters, enabled = open, trailing = counts[f]?.toString(),
|
||||||
|
modifier = Modifier.fillMaxWidth().stepItem(item++).testTag("recomps-filter-${f.name.lowercase()}")
|
||||||
|
.then(if (f.ordinal == 0) Modifier.focusRequester(first) else Modifier),
|
||||||
|
) {
|
||||||
|
RecompsView.filters = if (f in RecompsView.filters) RecompsView.filters - f else RecompsView.filters + f
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (RecompsView.filters.isNotEmpty()) Box(Modifier.align(Alignment.TopEnd).size(8.dp).clip(CircleShape).background(pal.signal))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun RecompSortButton() {
|
||||||
|
val pal = LocalPalette.current
|
||||||
|
val title = stringResource(R.string.stores_sort)
|
||||||
|
var at by remember { mutableStateOf<Rect?>(null) }
|
||||||
|
Box(Modifier.onGloballyPositioned { at = it.boundsInRoot() }.testTag("recomps-sort")) {
|
||||||
|
HeaderIconButton(title + " · " + sortLabel(RecompsView.sort), Icons.Filled.Sort, "recomps-sort") {
|
||||||
|
val from = at ?: return@HeaderIconButton
|
||||||
|
Steps.ask(StepAsk(
|
||||||
|
anchor = from, side = StepSide.Left, accent = pal.signal, pillCorner = 8.dp, items = RecompSort.entries.size,
|
||||||
|
handle = { Icon(Icons.Filled.Sort, null, tint = pal.signal, modifier = Modifier.size(18.dp)) },
|
||||||
|
) {
|
||||||
|
StepTitle(title)
|
||||||
|
StepList {
|
||||||
|
RecompSort.entries.forEachIndexed { i, sort ->
|
||||||
|
StepChoice(
|
||||||
|
sortLabel(sort), selected = sort == RecompsView.sort, enabled = open,
|
||||||
|
modifier = Modifier.fillMaxWidth().stepItem(i).testTag("recomps-sort-${sort.name.lowercase()}")
|
||||||
|
.then(if (sort == RecompsView.sort) Modifier.focusRequester(first) else Modifier),
|
||||||
|
) {
|
||||||
|
RecompsView.sort = sort
|
||||||
|
Steps.fold()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// The filters in use, each one a tap to remove, so a filtered grid never looks like the whole list.
|
||||||
|
@Composable
|
||||||
|
private fun ActiveFilters() {
|
||||||
|
val filters = RecompsView.filters
|
||||||
|
if (filters.isEmpty() && RecompsView.sort == RecompSort.BEST) return
|
||||||
|
Row(
|
||||||
|
Modifier.fillMaxWidth().horizontalScroll(rememberScrollState()).padding(top = 6.dp),
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(6.dp), verticalAlignment = Alignment.CenterVertically,
|
||||||
|
) {
|
||||||
|
if (RecompsView.sort != RecompSort.BEST) Text(sortLabel(RecompsView.sort), fontSize = 12.sp, color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
modifier = Modifier.padding(end = 6.dp))
|
||||||
|
filters.sortedBy { it.ordinal }.forEach { f ->
|
||||||
|
TabChip(filterLabel(f) + " ✕", true, Modifier.testTag("recomps-active-${f.name.lowercase()}")) { RecompsView.filters = RecompsView.filters - f }
|
||||||
|
}
|
||||||
|
if (filters.size > 1) TabChip(stringResource(R.string.recomps_clear_filters), false) { RecompsView.filters = emptySet() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun platformShort(platform: RecompCatalog.Platform?) = when (platform) {
|
||||||
|
RecompCatalog.Platform.LINUX_ARM64 -> stringResource(R.string.recomps_runs_native)
|
||||||
|
RecompCatalog.Platform.ANDROID -> stringResource(R.string.recomps_runs_android)
|
||||||
|
RecompCatalog.Platform.LINUX_X64 -> stringResource(R.string.recomps_runs_fex)
|
||||||
|
RecompCatalog.Platform.WINDOWS_X64 -> stringResource(R.string.recomps_runs_proton)
|
||||||
|
null -> ""
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun RecompTile(row: RecompRow, first: Boolean, onOpen: () -> Unit) {
|
||||||
|
val pal = LocalPalette.current
|
||||||
|
val src = remember { MutableInteractionSource() }
|
||||||
|
val hot = rememberHot(src)
|
||||||
|
val e = row.entry
|
||||||
|
val installing = UserAppsState.working == e.name
|
||||||
|
Column(
|
||||||
|
Modifier.fillMaxWidth().testTag("recomp-${e.id}").paneItem("recomp:${e.id}").then(if (first) Modifier.paneEntry() else Modifier)
|
||||||
|
.clip(RoundedCornerShape(10.dp)).glideBorder(hot, RoundedCornerShape(10.dp), pal.signal, pal.line)
|
||||||
|
.hoverable(src).clickable(role = Role.Button, interactionSource = src, indication = LocalIndication.current, onClick = onOpen)
|
||||||
|
.controllerConfirm(onClick = onOpen),
|
||||||
|
) {
|
||||||
|
ArtCard(
|
||||||
|
e.name, wide = e.art, tall = e.cover ?: e.art, download = null, hot = hot, capsule = true,
|
||||||
|
chip = if (installing) stringResource(R.string.recomps_installing) else null,
|
||||||
|
badge = { TileBadges(row) },
|
||||||
|
) {
|
||||||
|
Text(listOf(e.origin, platformShort(row.platform)).filter { it.isNotEmpty() }.joinToString(" · "),
|
||||||
|
fontSize = 10.sp, color = Color.White.copy(alpha = 0.75f), maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun androidx.compose.foundation.layout.BoxScope.TileBadges(row: RecompRow) {
|
||||||
|
val pal = LocalPalette.current
|
||||||
|
Column(Modifier.align(Alignment.TopStart).padding(6.dp), verticalArrangement = Arrangement.spacedBy(4.dp)) {
|
||||||
|
if (row.installed != null) Icon(Icons.Filled.CheckCircle, stringResource(R.string.recomps_filter_installed), tint = pal.good,
|
||||||
|
modifier = Modifier.size(18.dp).clip(CircleShape).background(Color.Black.copy(alpha = 0.55f)))
|
||||||
|
val store = when (val d = row.data) {
|
||||||
|
is RecompData.State.Found -> d.store
|
||||||
|
is RecompData.State.Owned -> d.store
|
||||||
|
is RecompData.State.Incomplete -> d.store
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
|
if (store != null) Text(store.shortLabel, fontSize = 9.sp, fontWeight = FontWeight.Bold, color = Color.White,
|
||||||
|
modifier = Modifier.clip(RoundedCornerShape(4.dp)).background(Color.Black.copy(alpha = 0.6f)).padding(horizontal = 5.dp, vertical = 2.dp))
|
||||||
|
}
|
||||||
|
if (row.update != null) Box(Modifier.align(Alignment.TopEnd).padding(7.dp).size(9.dp).clip(CircleShape).background(AttentionAmber))
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun buildLabel(platform: RecompCatalog.Platform?) = stringResource(when (platform) {
|
||||||
|
RecompCatalog.Platform.LINUX_ARM64 -> R.string.recomps_build_linux_arm64
|
||||||
|
RecompCatalog.Platform.LINUX_X64 -> R.string.recomps_build_linux_x64
|
||||||
|
RecompCatalog.Platform.WINDOWS_X64 -> R.string.recomps_build_windows_x64
|
||||||
|
RecompCatalog.Platform.ANDROID -> R.string.recomps_build_android
|
||||||
|
else -> R.string.recomps_build_none
|
||||||
|
})
|
||||||
|
|
||||||
|
private fun storeName(store: Store) = store.shortLabel
|
||||||
|
|
||||||
|
private fun sourceName(source: String): String? = listOf(RecompCatalog.DECOMP_BUDDY, RecompCatalog.RECOMP_LAUNCHER, RecompCatalog.RECOMPA)
|
||||||
|
.firstOrNull { it.id == source }?.name
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun dataLine(data: RecompData.State): Pair<String, Boolean>? = when (data) {
|
||||||
|
RecompData.State.NotNeeded -> null
|
||||||
|
is RecompData.State.Found -> when {
|
||||||
|
data.checked -> stringResource(R.string.recomps_data_found_checked, storeName(data.store)) to true
|
||||||
|
data.exact -> stringResource(R.string.recomps_data_found, storeName(data.store)) to true
|
||||||
|
else -> stringResource(R.string.recomps_data_found_by_name, storeName(data.store)) to false
|
||||||
|
}
|
||||||
|
is RecompData.State.Incomplete -> stringResource(
|
||||||
|
if (data.wrongVersion) R.string.recomps_data_wrong_version else R.string.recomps_data_missing_file,
|
||||||
|
storeName(data.store), data.file.substringAfterLast('/'),
|
||||||
|
) to false
|
||||||
|
is RecompData.State.Owned -> stringResource(R.string.recomps_data_owned, storeName(data.store)) to false
|
||||||
|
is RecompData.State.BringYourOwn -> stringResource(R.string.recomps_data_bring, data.data.label.replace(Regex("^(your own |your )", RegexOption.IGNORE_CASE), "")) to false
|
||||||
|
}
|
||||||
|
|
||||||
|
@OptIn(ExperimentalLayoutApi::class)
|
||||||
|
@Composable
|
||||||
|
private fun RecompDetail(
|
||||||
|
row: RecompRow, s: FrontEndState, a: FrontEndActions, onSelect: (String) -> Unit, steamOwned: List<Pair<Int, String>>, modifier: Modifier,
|
||||||
|
) {
|
||||||
|
val ctx = LocalContext.current
|
||||||
|
val colors = MaterialTheme.colorScheme
|
||||||
|
val pal = LocalPalette.current
|
||||||
|
val e = row.entry
|
||||||
|
val open: (String) -> Unit = { url -> runCatching { ctx.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)) } }
|
||||||
|
var picked by remember(e.id, row.installed?.platform) { mutableStateOf<RecompCatalog.Platform?>(null) }
|
||||||
|
LaunchedEffect(e.id) { RecompsState.verify(ctx, e, steamOwned) }
|
||||||
|
BoxWithConstraints(modifier) {
|
||||||
|
val stacked = maxWidth < 640.dp
|
||||||
|
Column(Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(bottom = 24.dp).testTag("recomp-detail-${e.id}")) {
|
||||||
|
BackLink(stringResource(R.string.rail_recomps)) { RecompsView.open = null }
|
||||||
|
val cover: @Composable () -> Unit = {
|
||||||
|
Box(Modifier.width(if (stacked) 132.dp else 180.dp).aspectRatio(5f / 7f).clip(RoundedCornerShape(12.dp)).background(artBrush(hueOf(e.name))),
|
||||||
|
contentAlignment = Alignment.Center) {
|
||||||
|
Text(e.name.take(1), fontSize = 40.sp, fontWeight = FontWeight.Bold, color = colors.onBackground.copy(alpha = 0.5f))
|
||||||
|
(e.cover ?: e.art)?.let { AsyncImage(model = it, contentDescription = null, contentScale = ContentScale.Crop, modifier = Modifier.matchParentSize()) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val heading: @Composable () -> Unit = {
|
||||||
|
Column(verticalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||||
|
Text(e.name, fontSize = 26.sp, fontWeight = FontWeight.Bold, color = colors.onBackground)
|
||||||
|
val kind = stringResource(if (e.type == "recomp") R.string.recomps_kind_recomp else R.string.recomps_kind_port, e.origin)
|
||||||
|
Text(listOf(e.game.takeIf { it != e.name }, kind).filterNotNull().joinToString(" · "), fontSize = 14.sp, color = colors.onSurfaceVariant)
|
||||||
|
FlowRow(horizontalArrangement = Arrangement.spacedBy(6.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||||
|
Chip(buildLabel(row.platform), ok = row.platform in NATIVE)
|
||||||
|
dataLine(row.data)?.let { (t, ok) -> Chip(t, ok) }
|
||||||
|
if (e.setup != null) Chip(stringResource(R.string.recomps_setup), ok = false)
|
||||||
|
}
|
||||||
|
Spacer(Modifier.height(4.dp))
|
||||||
|
RecompActions(row, s, a, onSelect, steamOwned, open, picked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (stacked) Column(verticalArrangement = Arrangement.spacedBy(14.dp), modifier = Modifier.padding(top = 8.dp)) { cover(); heading() }
|
||||||
|
else Row(horizontalArrangement = Arrangement.spacedBy(22.dp), modifier = Modifier.padding(top = 8.dp)) {
|
||||||
|
cover(); Box(Modifier.weight(1f)) { heading() }
|
||||||
|
}
|
||||||
|
RecompsState.errors[e.id]?.let { Box(Modifier.padding(top = 12.dp).testTag("recomp-error")) { Note(it) } }
|
||||||
|
if (UserAppsState.working == e.name && UserAppsState.stage != null) {
|
||||||
|
Text(UserAppsState.stage.orEmpty(), fontSize = 12.sp, color = pal.signal, modifier = Modifier.padding(top = 10.dp))
|
||||||
|
}
|
||||||
|
DetailSection(stringResource(R.string.recomps_section_needs)) {
|
||||||
|
val found = row.data as? RecompData.State.Found
|
||||||
|
when {
|
||||||
|
found != null -> DetailText(stringResource(R.string.recomps_data_folder, found.guest))
|
||||||
|
row.data is RecompData.State.NotNeeded -> DetailText(stringResource(R.string.recomps_needs_nothing))
|
||||||
|
else -> DetailText(e.data.label)
|
||||||
|
}
|
||||||
|
e.data.file?.let { DetailText(stringResource(R.string.recomps_needs_file, it)) }
|
||||||
|
if (row.data is RecompData.State.BringYourOwn && e.data.note.isNotEmpty() && e.data.note != e.data.label) DetailText(e.data.note)
|
||||||
|
e.setup?.takeIf { it.isNotBlank() }?.let { DetailText(it) }
|
||||||
|
}
|
||||||
|
DetailSection(stringResource(R.string.recomps_section_builds)) {
|
||||||
|
val installedAs = row.installed?.platform?.let { RecompCatalog.Platform.of(it) }
|
||||||
|
e.builds.sortedBy { RecompCatalog.PREFERENCE.indexOf(it.platform).let { i -> if (i < 0) 99 else i } }.forEach { b ->
|
||||||
|
val status = when {
|
||||||
|
installedAs == b.platform -> stringResource(R.string.recomps_build_installed)
|
||||||
|
!row.runs(b) -> stringResource(R.string.recomps_not_for_device)
|
||||||
|
installedAs == RecompCatalog.Platform.LINUX_ARM64 && b.platform == RecompCatalog.Platform.LINUX_X64 &&
|
||||||
|
e.build(RecompCatalog.Platform.LINUX_ARM64) == null -> stringResource(R.string.recomps_build_installed_arm)
|
||||||
|
else -> b.tag
|
||||||
|
}
|
||||||
|
BuildChoice(buildLabel(b.platform), status, selected = (picked ?: row.platform) == b.platform,
|
||||||
|
modifier = Modifier.testTag("recomp-build-${b.platform.key}")) { picked = b.platform }
|
||||||
|
}
|
||||||
|
DetailText(stringResource(R.string.recomps_builds_hint))
|
||||||
|
}
|
||||||
|
DetailSection(stringResource(R.string.recomps_section_about)) {
|
||||||
|
DetailText(e.repo)
|
||||||
|
if (e.license.isNotEmpty()) DetailText(e.license)
|
||||||
|
DetailText(e.sources.mapNotNull { sourceName(it) }.joinToString(" · ") { ctx.getString(R.string.recomps_via, it) })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun DetailSection(title: String, content: @Composable () -> Unit) {
|
||||||
|
Column(Modifier.fillMaxWidth().padding(top = 18.dp), verticalArrangement = Arrangement.spacedBy(4.dp)) {
|
||||||
|
Text(headingUppercase(title), fontSize = 11.sp, fontWeight = FontWeight.Bold, color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
modifier = Modifier.padding(bottom = 2.dp))
|
||||||
|
content()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun DetailText(text: String, strong: Boolean = false) =
|
||||||
|
Text(text, fontSize = 13.sp, color = if (strong) MaterialTheme.colorScheme.onBackground else MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
fontWeight = if (strong) FontWeight.SemiBold else FontWeight.Normal)
|
||||||
|
|
||||||
|
@OptIn(ExperimentalLayoutApi::class)
|
||||||
|
@Composable
|
||||||
|
private fun RecompActions(
|
||||||
|
row: RecompRow, s: FrontEndState, a: FrontEndActions, onSelect: (String) -> Unit, steamOwned: List<Pair<Int, String>>, open: (String) -> Unit,
|
||||||
|
picked: RecompCatalog.Platform?,
|
||||||
|
) {
|
||||||
|
val ctx = LocalContext.current
|
||||||
|
val e = row.entry
|
||||||
|
val busy = UserAppsState.working
|
||||||
|
val mine = busy == e.name
|
||||||
|
val inst = row.installed
|
||||||
|
val chosen = picked?.let { e.build(it) }
|
||||||
|
val switching = inst != null && chosen != null && picked != row.platform
|
||||||
|
val progress = if (mine) UserAppsState.percent.takeIf { it >= 0 }?.let { it / 100f } else null
|
||||||
|
val focus = Modifier.paneEntry()
|
||||||
|
FlowRow(horizontalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||||
|
when {
|
||||||
|
inst == null || switching -> PrimaryButton(
|
||||||
|
when {
|
||||||
|
switching -> stringResource(R.string.recomps_install_instead, buildLabel(picked))
|
||||||
|
picked != null -> stringResource(R.string.recomps_install_build, buildLabel(picked))
|
||||||
|
else -> stringResource(R.string.recomps_install)
|
||||||
|
},
|
||||||
|
enabled = (chosen ?: e.preferred()) != null && busy == null && s.ready, main = true,
|
||||||
|
progress = progress, modifier = focus.testTag("recomp-install-${e.id}"),
|
||||||
|
) { RecompsState.install(ctx, e, steamOwned, chosen = chosen) }
|
||||||
|
inst.appKey.startsWith("android:") -> PrimaryButton(stringResource(R.string.recomps_play), main = true,
|
||||||
|
modifier = focus.testTag("recomp-play-${e.id}")) { RecompAndroid.launch(ctx, inst.appKey.removePrefix("android:")) }
|
||||||
|
inst.appKey.startsWith("added:") -> PrimaryButton(stringResource(R.string.recomps_open_games), main = true, modifier = focus) { onSelect("games") }
|
||||||
|
else -> PrimaryButton(stringResource(R.string.recomps_play), main = true, enabled = !s.busy, modifier = focus.testTag("recomp-play-${e.id}")) {
|
||||||
|
UserAppsState.items.firstOrNull { it.key == inst.appKey }?.let(a.onUserApp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (inst != null && row.update != null) SecondaryButton(stringResource(R.string.recomps_update, row.update.tag), enabled = busy == null,
|
||||||
|
progress = progress) { RecompsState.install(ctx, e, steamOwned, row.update) }
|
||||||
|
(row.data as? RecompData.State.Owned)?.item?.let { item ->
|
||||||
|
SecondaryButton(stringResource(R.string.recomps_install_game)) { StoresState.requestInstall(ctx, item) }
|
||||||
|
}
|
||||||
|
SecondaryButton(stringResource(R.string.recomps_project)) { open(e.homepage) }
|
||||||
|
if (inst != null) SecondaryButton(stringResource(R.string.recomps_remove), enabled = busy == null) {
|
||||||
|
RecompsState.remove(ctx, e, steamOwned, inst)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun BuildChoice(label: String, status: String?, selected: Boolean, modifier: Modifier = Modifier, onClick: () -> Unit) {
|
||||||
|
val colors = MaterialTheme.colorScheme
|
||||||
|
val pal = LocalPalette.current
|
||||||
|
val src = remember { MutableInteractionSource() }
|
||||||
|
val hot = rememberHot(src)
|
||||||
|
val shape = RoundedCornerShape(10.dp)
|
||||||
|
Row(
|
||||||
|
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp),
|
||||||
|
modifier = modifier.fillMaxWidth().clip(shape)
|
||||||
|
.background(if (selected) pal.signal.copy(alpha = 0.12f) else Color.Transparent)
|
||||||
|
.glideBorder(hot, shape, pal.signal, if (selected) pal.signal.copy(alpha = 0.5f) else pal.line)
|
||||||
|
.hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, role = Role.RadioButton, onClick = onClick)
|
||||||
|
.controllerConfirm(onClick = onClick)
|
||||||
|
.padding(horizontal = 12.dp, vertical = 10.dp),
|
||||||
|
) {
|
||||||
|
Box(Modifier.size(18.dp).clip(CircleShape).background(if (selected) pal.signal else Color.Transparent)
|
||||||
|
.glideBorder(false, CircleShape, pal.signal, if (selected) pal.signal else colors.onSurfaceVariant), contentAlignment = Alignment.Center) {
|
||||||
|
if (selected) Box(Modifier.size(7.dp).clip(CircleShape).background(colors.background))
|
||||||
|
}
|
||||||
|
Text(label, fontSize = 14.sp, fontWeight = if (selected) FontWeight.SemiBold else FontWeight.Normal, color = colors.onBackground,
|
||||||
|
modifier = Modifier.weight(1f))
|
||||||
|
if (!status.isNullOrEmpty()) Text(status, fontSize = 12.sp, color = colors.onSurfaceVariant, maxLines = 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,8 @@ package com.droiddeck.launcher.ui
|
|||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import com.droiddeck.launcher.R
|
import com.droiddeck.launcher.R
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import com.droiddeck.launcher.session.SessionPrefs
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
@@ -22,7 +24,7 @@ fun RomsDialog(path: String?, onChoose: () -> Unit, onClear: () -> Unit, onDismi
|
|||||||
text = {
|
text = {
|
||||||
Column {
|
Column {
|
||||||
Text(
|
Text(
|
||||||
stringResource(R.string.roms_text),
|
stringResource(if (SessionPrefs.mountSharedStorage(LocalContext.current)) R.string.roms_text else R.string.roms_text_unmounted),
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
)
|
)
|
||||||
Spacer(Modifier.height(10.dp))
|
Spacer(Modifier.height(10.dp))
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ internal object SettingsIndex {
|
|||||||
|
|
||||||
s(SettingsSection.CONTROLLER, R.string.setup_tab_controller, "gamepad", "buttons", "mapping", "profile", "remap"),
|
s(SettingsSection.CONTROLLER, R.string.setup_tab_controller, "gamepad", "buttons", "mapping", "profile", "remap"),
|
||||||
SettingsEntry(SettingsPlace.TAB, R.string.rail_storage, tab = "storage", words = listOf("sd card", "space", "uninstall", "disk")),
|
SettingsEntry(SettingsPlace.TAB, R.string.rail_storage, tab = "storage", words = listOf("sd card", "space", "uninstall", "disk")),
|
||||||
|
SettingsEntry(SettingsPlace.TAB, R.string.storage_shared_mount, tab = "storage", words = listOf("sdcard", "mount", "privacy", "files")),
|
||||||
SettingsEntry(SettingsPlace.TAB, R.string.rail_sync, tab = "sync", words = listOf("syncthing", "saves")),
|
SettingsEntry(SettingsPlace.TAB, R.string.rail_sync, tab = "sync", words = listOf("syncthing", "saves")),
|
||||||
SettingsEntry(SettingsPlace.TAB, R.string.rail_decky, tab = "decky", words = listOf("plugins", "plugin store", "homebrew", "loader")),
|
SettingsEntry(SettingsPlace.TAB, R.string.rail_decky, tab = "decky", words = listOf("plugins", "plugin store", "homebrew", "loader")),
|
||||||
SettingsEntry(SettingsPlace.TAB, R.string.rail_boot_movies, tab = "boot-movies", words = listOf("startup movie", "boot video", "animation", "steamdeckrepo")),
|
SettingsEntry(SettingsPlace.TAB, R.string.rail_boot_movies, tab = "boot-movies", words = listOf("startup movie", "boot video", "animation", "steamdeckrepo")),
|
||||||
|
|||||||
@@ -113,7 +113,8 @@ internal fun SteamHome(s: FrontEndState, a: FrontEndActions, modifier: Modifier)
|
|||||||
}
|
}
|
||||||
val owned = remember(ownedAll, concealed) { ownedAll.filter { it.first.toLong() !in concealed } }
|
val owned = remember(ownedAll, concealed) { ownedAll.filter { it.first.toLong() !in concealed } }
|
||||||
val featured = remember(featuredAll, concealed) { featuredAll.filter { it.appId.toLong() !in concealed } }
|
val featured = remember(featuredAll, concealed) { featuredAll.filter { it.appId.toLong() !in concealed } }
|
||||||
val games = remember(s.steamGames, LibraryHidden.keys, LibraryHidden.steam) { s.steamGames.filterNot { LibraryHidden.isHidden(hideKey(it), it) }.sortedWith(compareByDescending<Library.SteamGame> { it.lastPlayed }.thenBy { it.gameId }) }
|
val previewing = DevPreview.steamHome
|
||||||
|
val games = remember(s.steamGames, previewing, LibraryHidden.keys, LibraryHidden.steam) { (if (previewing == SteamHomePreview.OFF) s.steamGames else sampleSteamHomeGames(previewing.games)).filterNot { LibraryHidden.isHidden(hideKey(it), it) }.sortedWith(compareByDescending<Library.SteamGame> { it.lastPlayed }.thenBy { it.gameId }) }
|
||||||
val narrow = LocalNarrowPane.current
|
val narrow = LocalNarrowPane.current
|
||||||
var words by remember { mutableStateOf<Rect?>(null) }
|
var words by remember { mutableStateOf<Rect?>(null) }
|
||||||
val mode = com.droiddeck.launcher.session.SessionService.MODE_STEAM
|
val mode = com.droiddeck.launcher.session.SessionService.MODE_STEAM
|
||||||
@@ -163,12 +164,12 @@ internal fun SteamHome(s: FrontEndState, a: FrontEndActions, modifier: Modifier)
|
|||||||
games.isEmpty() -> EmptyLibrary(
|
games.isEmpty() -> EmptyLibrary(
|
||||||
avoid = words,
|
avoid = words,
|
||||||
wall = if (owned.isEmpty() && featured.isEmpty()) null else { { CapsuleWall(emptyList(), owned = owned, featured = featured) } },
|
wall = if (owned.isEmpty() && featured.isEmpty()) null else { { CapsuleWall(emptyList(), owned = owned, featured = featured) } },
|
||||||
) { Box(Modifier.fillMaxSize().graphicsLayer { scaleX = 1.06f; scaleY = 1.06f }) { WallFade() } }
|
) { Box(Modifier.fillMaxSize().graphicsLayer { scaleX = 1.06f; scaleY = 1.06f }) { WallFade(bottomWhenTall = true) } }
|
||||||
games.size < WALL_MIN_GAMES -> CapsuleFan(games)
|
games.size < WALL_MIN_GAMES -> CapsuleFan(games)
|
||||||
else -> CapsuleWall(games, owned = owned, featured = featured)
|
else -> CapsuleWall(games, owned = owned, featured = featured)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
scrim = { if (games.size >= WALL_MIN_GAMES) WallFade() },
|
scrim = { if (games.size >= WALL_MIN_GAMES) WallFade(bottomWhenTall = true) },
|
||||||
words = {
|
words = {
|
||||||
val onboardingActive by com.droiddeck.launcher.session.Onboarding.active.collectAsState()
|
val onboardingActive by com.droiddeck.launcher.session.Onboarding.active.collectAsState()
|
||||||
val onboardingFailed by com.droiddeck.launcher.session.Onboarding.failed.collectAsState()
|
val onboardingFailed by com.droiddeck.launcher.session.Onboarding.failed.collectAsState()
|
||||||
@@ -232,19 +233,35 @@ internal fun Modifier.overhang(by: androidx.compose.ui.unit.Dp = 4.dp): Modifier
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
internal fun WallFade(modifier: Modifier = Modifier.fillMaxSize().overhang()) {
|
internal fun WallFade(modifier: Modifier = Modifier.fillMaxSize().overhang(), bottomWhenTall: Boolean = false) {
|
||||||
val colors = MaterialTheme.colorScheme
|
val colors = MaterialTheme.colorScheme
|
||||||
Box(
|
BoxWithConstraints(modifier) {
|
||||||
modifier.background(
|
if (bottomWhenTall && maxHeight > maxWidth) {
|
||||||
Brush.horizontalGradient(
|
// The words sit at the bottom of a tall page, so the art stays clear above them and darkens only behind them.
|
||||||
0f to colors.background.copy(alpha = 0.86f),
|
Box(
|
||||||
0.34f to colors.background.copy(alpha = 0.6f),
|
Modifier.fillMaxSize().background(
|
||||||
0.68f to colors.background.copy(alpha = 0.14f),
|
Brush.verticalGradient(
|
||||||
1f to colors.background.copy(alpha = 0.04f),
|
0f to colors.background.copy(alpha = 0.12f),
|
||||||
),
|
0.5f to colors.background.copy(alpha = 0.18f),
|
||||||
),
|
0.72f to colors.background.copy(alpha = 0.72f),
|
||||||
)
|
1f to colors.background.copy(alpha = 0.94f),
|
||||||
Box(modifier.background(Brush.verticalGradient(0.6f to Color.Transparent, 1f to colors.background.copy(alpha = 0.75f))))
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
Box(
|
||||||
|
Modifier.fillMaxSize().background(
|
||||||
|
Brush.horizontalGradient(
|
||||||
|
0f to colors.background.copy(alpha = 0.86f),
|
||||||
|
0.34f to colors.background.copy(alpha = 0.6f),
|
||||||
|
0.68f to colors.background.copy(alpha = 0.14f),
|
||||||
|
1f to colors.background.copy(alpha = 0.04f),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
Box(Modifier.fillMaxSize().background(Brush.verticalGradient(0.6f to Color.Transparent, 1f to colors.background.copy(alpha = 0.75f))))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@@ -387,31 +404,45 @@ private fun CapsuleFan(games: List<Library.SteamGame>) {
|
|||||||
transition.animateFloat(0f, 1f, infiniteRepeatable(tween(ms, easing = FastOutSlowInEasing), RepeatMode.Reverse), label = "float")
|
transition.animateFloat(0f, 1f, infiniteRepeatable(tween(ms, easing = FastOutSlowInEasing), RepeatMode.Reverse), label = "float")
|
||||||
}
|
}
|
||||||
val still = Motion.scale == 0f
|
val still = Motion.scale == 0f
|
||||||
val slots = listOf(
|
val landscape = listOf(
|
||||||
FanSlot(0.54f, 0.14f, 0.62f, -9f),
|
FanSlot(0.54f, 0.14f, 0.62f, -9f),
|
||||||
FanSlot(0.70f, 0.24f, 0.56f, 5f),
|
FanSlot(0.70f, 0.24f, 0.56f, 5f),
|
||||||
FanSlot(0.40f, 0.30f, 0.50f, -17f),
|
FanSlot(0.40f, 0.30f, 0.50f, -17f),
|
||||||
)
|
)
|
||||||
|
// A tall page sizes the cards from its width, so they fit any aspect; heights are fractions of the width.
|
||||||
|
val portrait = listOf(
|
||||||
|
FanSlot(0.27f, 0.11f, 0.70f, -9f),
|
||||||
|
FanSlot(0.55f, 0.19f, 0.64f, 5f),
|
||||||
|
FanSlot(0.04f, 0.26f, 0.56f, -17f),
|
||||||
|
)
|
||||||
BoxWithConstraints(
|
BoxWithConstraints(
|
||||||
Modifier.fillMaxSize().drawBehind {
|
Modifier.fillMaxSize().drawBehind {
|
||||||
drawRect(
|
drawRect(
|
||||||
Brush.radialGradient(
|
Brush.radialGradient(
|
||||||
listOf(pal.signal.copy(alpha = 0.14f), Color.Transparent),
|
listOf(pal.signal.copy(alpha = 0.14f), Color.Transparent),
|
||||||
center = Offset(size.width * 0.68f, size.height * 0.45f), radius = size.height * 0.6f,
|
center = if (size.height > size.width) Offset(size.width * 0.55f, size.height * 0.28f) else Offset(size.width * 0.68f, size.height * 0.45f),
|
||||||
|
radius = if (size.height > size.width) size.width * 0.9f else size.height * 0.6f,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
val radius = with(density) { 14.dp.toPx() }
|
val radius = with(density) { 14.dp.toPx() }
|
||||||
|
val tall = maxHeight > maxWidth
|
||||||
|
val slots = if (tall) portrait else landscape
|
||||||
for (i in games.indices.reversed()) {
|
for (i in games.indices.reversed()) {
|
||||||
val slot = slots[i]
|
val slot = slots[i]
|
||||||
val h = maxHeight * slot.height
|
val h = if (tall) maxWidth * slot.height else maxHeight * slot.height
|
||||||
|
val x = if (tall) {
|
||||||
|
// The lean and the float swing the corners out by about h/2 * sin(angle).
|
||||||
|
val swing = h * kotlin.math.sin(Math.toRadians(kotlin.math.abs(slot.lean) + 2.0)).toFloat() / 2f
|
||||||
|
(maxWidth * slot.x).coerceIn(swing, (maxWidth - h * 2f / 3f - swing).coerceAtLeast(swing))
|
||||||
|
} else maxWidth * slot.x
|
||||||
val v: State<Float> = floats[i]
|
val v: State<Float> = floats[i]
|
||||||
val look = WallCapsule(artBrush(hueOf(games[i].name)), games[i].art)
|
val look = WallCapsule(artBrush(hueOf(games[i].name)), games[i].art)
|
||||||
val art = look.art?.let { rememberCapsuleArt(it, with(density) { Size((h * 2f / 3f).toPx(), h.toPx()) }, radius) }
|
val art = look.art?.let { rememberCapsuleArt(it, with(density) { Size((h * 2f / 3f).toPx(), h.toPx()) }, radius) }
|
||||||
Spacer(
|
Spacer(
|
||||||
Modifier
|
Modifier
|
||||||
.offset(x = maxWidth * slot.x, y = maxHeight * slot.y)
|
.offset(x = x, y = maxHeight * slot.y)
|
||||||
.size(h * 2f / 3f, h)
|
.size(h * 2f / 3f, h)
|
||||||
.graphicsLayer {
|
.graphicsLayer {
|
||||||
val t = if (still) 0f else v.value
|
val t = if (still) 0f else v.value
|
||||||
|
|||||||
@@ -168,6 +168,20 @@ internal fun StoragePanel(s: FrontEndState, a: FrontEndActions) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun SharedStorageGroup() {
|
||||||
|
val ctx = LocalContext.current
|
||||||
|
var on by remember { mutableStateOf(SessionPrefs.mountSharedStorage(ctx)) }
|
||||||
|
SettingsGroup(stringResource(R.string.setup_runtime)) {
|
||||||
|
SettingsRow(stringResource(R.string.storage_shared_mount), stringResource(R.string.storage_shared_mount_hint)) {
|
||||||
|
ToggleSwitch(on, label = stringResource(R.string.storage_shared_mount), modifier = Modifier.testTag("setting-shared-storage")) {
|
||||||
|
SessionPrefs.setMountSharedStorage(ctx, it)
|
||||||
|
on = it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun DefaultStorageGroup() {
|
private fun DefaultStorageGroup() {
|
||||||
val ctx = LocalContext.current
|
val ctx = LocalContext.current
|
||||||
@@ -347,6 +361,7 @@ private fun OverviewContent(report: StorageSummary, sessionRunning: Boolean, wid
|
|||||||
Note(stringResource(R.string.storage_session_running))
|
Note(stringResource(R.string.storage_session_running))
|
||||||
}
|
}
|
||||||
DefaultStorageGroup()
|
DefaultStorageGroup()
|
||||||
|
SharedStorageGroup()
|
||||||
SectionTitle(stringResource(R.string.storage_where), null)
|
SectionTitle(stringResource(R.string.storage_where), null)
|
||||||
val unused = report.unusedTools
|
val unused = report.unusedTools
|
||||||
val tiles = listOf<@Composable (Modifier) -> Unit>(
|
val tiles = listOf<@Composable (Modifier) -> Unit>(
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ internal fun sourceColours(source: String): SourceColours = when (source) {
|
|||||||
internal fun sourceLabel(source: String): String = when (source) {
|
internal fun sourceLabel(source: String): String = when (source) {
|
||||||
Library.SOURCE_STEAM, Store.STEAM.id -> stringResource(R.string.source_steam)
|
Library.SOURCE_STEAM, Store.STEAM.id -> stringResource(R.string.source_steam)
|
||||||
Library.SOURCE_COLLECTION -> stringResource(R.string.soundtracks_collections)
|
Library.SOURCE_COLLECTION -> stringResource(R.string.soundtracks_collections)
|
||||||
|
com.droiddeck.launcher.runtime.RecompShortcuts.SOURCE -> stringResource(R.string.rail_recomps)
|
||||||
Store.GOG.id -> Store.GOG.label
|
Store.GOG.id -> Store.GOG.label
|
||||||
Store.EPIC.id -> Store.EPIC.label
|
Store.EPIC.id -> Store.EPIC.label
|
||||||
Store.AMAZON.id -> Store.AMAZON.label
|
Store.AMAZON.id -> Store.AMAZON.label
|
||||||
|
|||||||
@@ -1265,6 +1265,11 @@
|
|||||||
<string name="agent_action_prepare">تحضير</string>
|
<string name="agent_action_prepare">تحضير</string>
|
||||||
<string name="agent_connection_off">تعذّر الوصول إلى تصحيح الأخطاء اللاسلكي؛ زر الاقتران يشغّله</string>
|
<string name="agent_connection_off">تعذّر الوصول إلى تصحيح الأخطاء اللاسلكي؛ زر الاقتران يشغّله</string>
|
||||||
<string name="agent_action_pair">اقتران</string>
|
<string name="agent_action_pair">اقتران</string>
|
||||||
|
<string name="agent_step_connection_quest_hint">لا يحتوي Quest على شاشة اقتران. من حاسوب، شغّل مرة واحدة: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS و adb tcpip 5555. ثم اضغط «السماح» واقبل الطلب في النظارة</string>
|
||||||
|
<string name="agent_action_allow">السماح</string>
|
||||||
|
<string name="agent_connection_quest_waiting">اقبل «السماح بتصحيح الأخطاء؟» في النظارة مع تحديد «السماح دائمًا»</string>
|
||||||
|
<string name="agent_connection_quest_failed">تعذّر الاتصال. اقبل طلب تصحيح الأخطاء في النظارة، وإن لم يظهر، شغّل adb tcpip 5555 من حاسوب ثم حاول مجددًا</string>
|
||||||
|
<string name="agent_connection_quest_off">تعذّر الوصول إلى تصحيح الأخطاء اللاسلكي. اضغط «السماح» لإعداده من جديد</string>
|
||||||
<string name="agent_action_install">تثبيت</string>
|
<string name="agent_action_install">تثبيت</string>
|
||||||
<string name="agent_action_sign_in">تسجيل الدخول</string>
|
<string name="agent_action_sign_in">تسجيل الدخول</string>
|
||||||
<string name="upd_pr">PR #%1$d</string>
|
<string name="upd_pr">PR #%1$d</string>
|
||||||
@@ -1492,6 +1497,7 @@
|
|||||||
<string name="rail_percent">%1$d%%</string>
|
<string name="rail_percent">%1$d%%</string>
|
||||||
<string name="rail_resume_named">استئناف %1$s</string>
|
<string name="rail_resume_named">استئناف %1$s</string>
|
||||||
<string name="roms_text">يظهر باسم /root/ROMs في كل جلسة. مساحة التخزين الداخلية متاحة في /root/Storage.</string>
|
<string name="roms_text">يظهر باسم /root/ROMs في كل جلسة. مساحة التخزين الداخلية متاحة في /root/Storage.</string>
|
||||||
|
<string name="roms_text_unmounted">يظهر باسم /root/ROMs في كل جلسة.</string>
|
||||||
<string name="roms_none">لم يتم اختيار مجلد</string>
|
<string name="roms_none">لم يتم اختيار مجلد</string>
|
||||||
<string name="roms_applies">يُطبَّق في الجلسة التالية. بطاقات SD مدعومة.</string>
|
<string name="roms_applies">يُطبَّق في الجلسة التالية. بطاقات SD مدعومة.</string>
|
||||||
<string name="roms_choose">اختيار مجلد</string>
|
<string name="roms_choose">اختيار مجلد</string>
|
||||||
@@ -2230,6 +2236,7 @@
|
|||||||
<string name="bottom_qam_layout_left">يسار</string>
|
<string name="bottom_qam_layout_left">يسار</string>
|
||||||
<string name="bottom_qam_layout_center">وسط</string>
|
<string name="bottom_qam_layout_center">وسط</string>
|
||||||
<string name="bottom_qam_layout_right">يمين</string>
|
<string name="bottom_qam_layout_right">يمين</string>
|
||||||
|
<string name="bottom_qam_layout_split">مقسّم</string>
|
||||||
<string name="bottom_qam_unavailable">قائمة الوصول السريع في Steam غير متاحة بعد.</string>
|
<string name="bottom_qam_unavailable">قائمة الوصول السريع في Steam غير متاحة بعد.</string>
|
||||||
<string name="bottom_page_telemetry">إحصاءات داخل اللعبة</string>
|
<string name="bottom_page_telemetry">إحصاءات داخل اللعبة</string>
|
||||||
<string name="bottom_hud_group">مؤشرات الشاشة السفلية</string>
|
<string name="bottom_hud_group">مؤشرات الشاشة السفلية</string>
|
||||||
@@ -3339,6 +3346,8 @@
|
|||||||
<string name="storage_default_group">موقع التثبيت</string>
|
<string name="storage_default_group">موقع التثبيت</string>
|
||||||
<string name="storage_default_title">التخزين الافتراضي</string>
|
<string name="storage_default_title">التخزين الافتراضي</string>
|
||||||
<string name="storage_default_hint">تُثبَّت ألعاب المتاجر الجديدة في الموقع المحدد. تبقى الألعاب الحالية في مكانها. تحتفظ مكتبات Steam بإعدادها الخاص.</string>
|
<string name="storage_default_hint">تُثبَّت ألعاب المتاجر الجديدة في الموقع المحدد. تبقى الألعاب الحالية في مكانها. تحتفظ مكتبات Steam بإعدادها الخاص.</string>
|
||||||
|
<string name="storage_shared_mount">مساحة تخزين الهاتف في Linux</string>
|
||||||
|
<string name="storage_shared_mount_hint">يربط مساحة التخزين الداخلية لهاتفك في /root/Storage. عند إيقافه، تُربط فقط مجلدات الألعاب التي أضفتها منها. لا تتأثر بطاقات SD. يُطبَّق في الجلسة التالية.</string>
|
||||||
<string name="storage_default_ask">السؤال في كل مرة</string>
|
<string name="storage_default_ask">السؤال في كل مرة</string>
|
||||||
<string name="storage_default_ask_detail">اختر وجهة لكل تثبيت</string>
|
<string name="storage_default_ask_detail">اختر وجهة لكل تثبيت</string>
|
||||||
<string name="storage_default_internal">مساحة التخزين الداخلية</string>
|
<string name="storage_default_internal">مساحة التخزين الداخلية</string>
|
||||||
|
|||||||
@@ -1280,6 +1280,11 @@
|
|||||||
<string name="agent_action_prepare">Preparar</string>
|
<string name="agent_action_prepare">Preparar</string>
|
||||||
<string name="agent_connection_off">No se puede acceder a la depuración inalámbrica; Vincular la activa</string>
|
<string name="agent_connection_off">No se puede acceder a la depuración inalámbrica; Vincular la activa</string>
|
||||||
<string name="agent_action_pair">Vincular</string>
|
<string name="agent_action_pair">Vincular</string>
|
||||||
|
<string name="agent_step_connection_quest_hint">Quest no tiene pantalla de vinculación. Desde una computadora, ejecuta una vez: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS y adb tcpip 5555. Luego toca Permitir y acepta el aviso en el visor</string>
|
||||||
|
<string name="agent_action_allow">Permitir</string>
|
||||||
|
<string name="agent_connection_quest_waiting">Acepta «¿Permitir depuración?» en el visor, con Permitir siempre marcado</string>
|
||||||
|
<string name="agent_connection_quest_failed">No se pudo conectar. Acepta el aviso de depuración en el visor o, si no apareció, ejecuta adb tcpip 5555 desde una computadora y vuelve a intentarlo</string>
|
||||||
|
<string name="agent_connection_quest_off">No se puede acceder a la depuración inalámbrica. Toca Permitir para configurarla de nuevo</string>
|
||||||
<string name="agent_action_install">Instalar</string>
|
<string name="agent_action_install">Instalar</string>
|
||||||
<string name="agent_action_sign_in">Iniciar sesión</string>
|
<string name="agent_action_sign_in">Iniciar sesión</string>
|
||||||
<string name="upd_pr">PR #%1$d</string>
|
<string name="upd_pr">PR #%1$d</string>
|
||||||
@@ -1538,6 +1543,7 @@
|
|||||||
<string name="rail_percent">%1$d%%</string>
|
<string name="rail_percent">%1$d%%</string>
|
||||||
<string name="rail_resume_named">Reanudar %1$s</string>
|
<string name="rail_resume_named">Reanudar %1$s</string>
|
||||||
<string name="roms_text">Aparece como /root/ROMs en cada sesión. El almacenamiento interno está en /root/Storage.</string>
|
<string name="roms_text">Aparece como /root/ROMs en cada sesión. El almacenamiento interno está en /root/Storage.</string>
|
||||||
|
<string name="roms_text_unmounted">Aparece como /root/ROMs en cada sesión.</string>
|
||||||
<string name="roms_none">Ninguna carpeta elegida</string>
|
<string name="roms_none">Ninguna carpeta elegida</string>
|
||||||
<string name="roms_applies">Se aplica en la próxima sesión. Las tarjetas SD funcionan.</string>
|
<string name="roms_applies">Se aplica en la próxima sesión. Las tarjetas SD funcionan.</string>
|
||||||
<string name="roms_choose">Elegir carpeta</string>
|
<string name="roms_choose">Elegir carpeta</string>
|
||||||
@@ -2225,6 +2231,7 @@
|
|||||||
<string name="bottom_qam_layout_left">Izquierda</string>
|
<string name="bottom_qam_layout_left">Izquierda</string>
|
||||||
<string name="bottom_qam_layout_center">Centro</string>
|
<string name="bottom_qam_layout_center">Centro</string>
|
||||||
<string name="bottom_qam_layout_right">Derecha</string>
|
<string name="bottom_qam_layout_right">Derecha</string>
|
||||||
|
<string name="bottom_qam_layout_split">Dividido</string>
|
||||||
<string name="bottom_qam_unavailable">El menú de acceso rápido de Steam aún no está disponible.</string>
|
<string name="bottom_qam_unavailable">El menú de acceso rápido de Steam aún no está disponible.</string>
|
||||||
<string name="bottom_page_telemetry">Estadísticas del juego</string>
|
<string name="bottom_page_telemetry">Estadísticas del juego</string>
|
||||||
<string name="bottom_hud_group">HUD de la pantalla inferior</string>
|
<string name="bottom_hud_group">HUD de la pantalla inferior</string>
|
||||||
@@ -3215,6 +3222,8 @@
|
|||||||
<string name="storage_default_group">Ubicación de instalación</string>
|
<string name="storage_default_group">Ubicación de instalación</string>
|
||||||
<string name="storage_default_title">Almacenamiento predeterminado</string>
|
<string name="storage_default_title">Almacenamiento predeterminado</string>
|
||||||
<string name="storage_default_hint">Las nuevas instalaciones de las tiendas van a la ubicación seleccionada. Los juegos existentes se quedan donde están. Las bibliotecas de Steam conservan su propio ajuste.</string>
|
<string name="storage_default_hint">Las nuevas instalaciones de las tiendas van a la ubicación seleccionada. Los juegos existentes se quedan donde están. Las bibliotecas de Steam conservan su propio ajuste.</string>
|
||||||
|
<string name="storage_shared_mount">Almacenamiento del teléfono en Linux</string>
|
||||||
|
<string name="storage_shared_mount_hint">Monta el almacenamiento interno de tu teléfono en /root/Storage. Si está desactivado, solo se montan las carpetas de juegos que agregaste desde ahí. No afecta a las tarjetas SD. Se aplica en la próxima sesión.</string>
|
||||||
<string name="storage_default_ask">Preguntar siempre</string>
|
<string name="storage_default_ask">Preguntar siempre</string>
|
||||||
<string name="storage_default_ask_detail">Elige un destino para cada instalación</string>
|
<string name="storage_default_ask_detail">Elige un destino para cada instalación</string>
|
||||||
<string name="storage_default_internal">Almacenamiento interno</string>
|
<string name="storage_default_internal">Almacenamiento interno</string>
|
||||||
|
|||||||
@@ -1249,6 +1249,11 @@
|
|||||||
<string name="agent_action_prepare">Подготви</string>
|
<string name="agent_action_prepare">Подготви</string>
|
||||||
<string name="agent_connection_off">Безжичното отстраняване на грешки не е достъпно; сдвояването го включва</string>
|
<string name="agent_connection_off">Безжичното отстраняване на грешки не е достъпно; сдвояването го включва</string>
|
||||||
<string name="agent_action_pair">Сдвой</string>
|
<string name="agent_action_pair">Сдвой</string>
|
||||||
|
<string name="agent_step_connection_quest_hint">Quest няма екран за сдвояване. От компютър изпълнете веднъж: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS и adb tcpip 5555. След това докоснете „Разреши“ и приемете запитването в шлема</string>
|
||||||
|
<string name="agent_action_allow">Разреши</string>
|
||||||
|
<string name="agent_connection_quest_waiting">Приемете „Разрешаване на отстраняването на грешки?“ в шлема с отметка „Винаги разрешавай“</string>
|
||||||
|
<string name="agent_connection_quest_failed">Неуспешно свързване. Приемете запитването за отстраняване на грешки в шлема, а ако не се е появило, изпълнете adb tcpip 5555 от компютър и опитайте отново</string>
|
||||||
|
<string name="agent_connection_quest_off">Безжичното отстраняване на грешки не е достъпно. Докоснете „Разреши“, за да го настроите отново</string>
|
||||||
<string name="agent_action_install">Инсталирай</string>
|
<string name="agent_action_install">Инсталирай</string>
|
||||||
<string name="agent_action_sign_in">Влез</string>
|
<string name="agent_action_sign_in">Влез</string>
|
||||||
<string name="upd_pr">PR #%1$d</string>
|
<string name="upd_pr">PR #%1$d</string>
|
||||||
@@ -1460,6 +1465,7 @@
|
|||||||
<string name="rail_percent">%1$d%%</string>
|
<string name="rail_percent">%1$d%%</string>
|
||||||
<string name="rail_resume_named">Продължаване на %1$s</string>
|
<string name="rail_resume_named">Продължаване на %1$s</string>
|
||||||
<string name="roms_text">Показва се като /root/ROMs във всяка сесия. Вътрешната памет е на /root/Storage.</string>
|
<string name="roms_text">Показва се като /root/ROMs във всяка сесия. Вътрешната памет е на /root/Storage.</string>
|
||||||
|
<string name="roms_text_unmounted">Показва се като /root/ROMs във всяка сесия.</string>
|
||||||
<string name="roms_none">Няма избрана папка</string>
|
<string name="roms_none">Няма избрана папка</string>
|
||||||
<string name="roms_applies">Прилага се от следващата сесия. SD картите работят.</string>
|
<string name="roms_applies">Прилага се от следващата сесия. SD картите работят.</string>
|
||||||
<string name="roms_choose">Избор на папка</string>
|
<string name="roms_choose">Избор на папка</string>
|
||||||
@@ -2130,6 +2136,7 @@
|
|||||||
<string name="bottom_qam_layout_left">Вляво</string>
|
<string name="bottom_qam_layout_left">Вляво</string>
|
||||||
<string name="bottom_qam_layout_center">В центъра</string>
|
<string name="bottom_qam_layout_center">В центъра</string>
|
||||||
<string name="bottom_qam_layout_right">Вдясно</string>
|
<string name="bottom_qam_layout_right">Вдясно</string>
|
||||||
|
<string name="bottom_qam_layout_split">Разделено</string>
|
||||||
<string name="bottom_qam_unavailable">Менюто за бърз достъп на Steam още не е налично.</string>
|
<string name="bottom_qam_unavailable">Менюто за бърз достъп на Steam още не е налично.</string>
|
||||||
<string name="bottom_page_telemetry">Статистика в играта</string>
|
<string name="bottom_page_telemetry">Статистика в играта</string>
|
||||||
<string name="bottom_hud_group">HUD на долния екран</string>
|
<string name="bottom_hud_group">HUD на долния екран</string>
|
||||||
@@ -3219,6 +3226,8 @@
|
|||||||
<string name="storage_default_group">Място за инсталиране</string>
|
<string name="storage_default_group">Място за инсталиране</string>
|
||||||
<string name="storage_default_title">Хранилище по подразбиране</string>
|
<string name="storage_default_title">Хранилище по подразбиране</string>
|
||||||
<string name="storage_default_hint">Новите инсталации от магазини отиват в избраното място. Съществуващите игри остават, където са. Библиотеките на Steam запазват собствената си настройка.</string>
|
<string name="storage_default_hint">Новите инсталации от магазини отиват в избраното място. Съществуващите игри остават, където са. Библиотеките на Steam запазват собствената си настройка.</string>
|
||||||
|
<string name="storage_shared_mount">Хранилище на телефона в Linux</string>
|
||||||
|
<string name="storage_shared_mount_hint">Монтира вътрешната памет на телефона ви в /root/Storage. Когато е изключено, се монтират само папките с игри, които сте добавили от нея. SD картите не се засягат. Прилага се от следващата сесия.</string>
|
||||||
<string name="storage_default_ask">Питане всеки път</string>
|
<string name="storage_default_ask">Питане всеки път</string>
|
||||||
<string name="storage_default_ask_detail">Избор на място за всяка инсталация</string>
|
<string name="storage_default_ask_detail">Избор на място за всяка инсталация</string>
|
||||||
<string name="storage_default_internal">Вътрешна памет</string>
|
<string name="storage_default_internal">Вътрешна памет</string>
|
||||||
|
|||||||
@@ -1257,6 +1257,11 @@
|
|||||||
<string name="agent_action_prepare">Připravit</string>
|
<string name="agent_action_prepare">Připravit</string>
|
||||||
<string name="agent_connection_off">Bezdrátové ladění není dostupné; Spárovat ho zapne</string>
|
<string name="agent_connection_off">Bezdrátové ladění není dostupné; Spárovat ho zapne</string>
|
||||||
<string name="agent_action_pair">Spárovat</string>
|
<string name="agent_action_pair">Spárovat</string>
|
||||||
|
<string name="agent_step_connection_quest_hint">Quest nemá obrazovku párování. Z počítače jednou spusťte: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS a adb tcpip 5555. Pak klepněte na Povolit a potvrďte výzvu v headsetu</string>
|
||||||
|
<string name="agent_action_allow">Povolit</string>
|
||||||
|
<string name="agent_connection_quest_waiting">V headsetu potvrďte „Povolit ladění?“ se zaškrtnutým Vždy povolit</string>
|
||||||
|
<string name="agent_connection_quest_failed">Nepodařilo se připojit. Potvrďte výzvu k ladění v headsetu, a pokud se neobjevila, spusťte z počítače adb tcpip 5555 a zkuste to znovu</string>
|
||||||
|
<string name="agent_connection_quest_off">Bezdrátové ladění není dostupné. Klepnutím na Povolit ho nastavíte znovu</string>
|
||||||
<string name="agent_action_install">Instalovat</string>
|
<string name="agent_action_install">Instalovat</string>
|
||||||
<string name="agent_action_sign_in">Přihlásit se</string>
|
<string name="agent_action_sign_in">Přihlásit se</string>
|
||||||
<string name="upd_pr">PR #%1$d</string>
|
<string name="upd_pr">PR #%1$d</string>
|
||||||
@@ -1476,6 +1481,7 @@
|
|||||||
<string name="rail_percent">%1$d%%</string>
|
<string name="rail_percent">%1$d%%</string>
|
||||||
<string name="rail_resume_named">Obnovit %1$s</string>
|
<string name="rail_resume_named">Obnovit %1$s</string>
|
||||||
<string name="roms_text">V každé relaci se zobrazí jako /root/ROMs. Vnitřní úložiště je v /root/Storage.</string>
|
<string name="roms_text">V každé relaci se zobrazí jako /root/ROMs. Vnitřní úložiště je v /root/Storage.</string>
|
||||||
|
<string name="roms_text_unmounted">V každé relaci se zobrazí jako /root/ROMs.</string>
|
||||||
<string name="roms_none">Nevybrána žádná složka</string>
|
<string name="roms_none">Nevybrána žádná složka</string>
|
||||||
<string name="roms_applies">Použije se v další relaci. SD karty fungují.</string>
|
<string name="roms_applies">Použije se v další relaci. SD karty fungují.</string>
|
||||||
<string name="roms_choose">Vybrat složku</string>
|
<string name="roms_choose">Vybrat složku</string>
|
||||||
@@ -2180,6 +2186,7 @@
|
|||||||
<string name="bottom_qam_layout_left">Vlevo</string>
|
<string name="bottom_qam_layout_left">Vlevo</string>
|
||||||
<string name="bottom_qam_layout_center">Na střed</string>
|
<string name="bottom_qam_layout_center">Na střed</string>
|
||||||
<string name="bottom_qam_layout_right">Vpravo</string>
|
<string name="bottom_qam_layout_right">Vpravo</string>
|
||||||
|
<string name="bottom_qam_layout_split">Rozděleno</string>
|
||||||
<string name="bottom_qam_unavailable">Nabídka rychlého přístupu Steamu zatím není k dispozici.</string>
|
<string name="bottom_qam_unavailable">Nabídka rychlého přístupu Steamu zatím není k dispozici.</string>
|
||||||
<string name="bottom_page_telemetry">Statistiky ve hře</string>
|
<string name="bottom_page_telemetry">Statistiky ve hře</string>
|
||||||
<string name="bottom_hud_group">HUD na spodní obrazovce</string>
|
<string name="bottom_hud_group">HUD na spodní obrazovce</string>
|
||||||
@@ -3279,6 +3286,8 @@
|
|||||||
<string name="storage_default_group">Umístění instalace</string>
|
<string name="storage_default_group">Umístění instalace</string>
|
||||||
<string name="storage_default_title">Výchozí úložiště</string>
|
<string name="storage_default_title">Výchozí úložiště</string>
|
||||||
<string name="storage_default_hint">Nové instalace z obchodů půjdou do vybraného umístění. Stávající hry zůstanou, kde jsou. Knihovny Steamu mají vlastní nastavení.</string>
|
<string name="storage_default_hint">Nové instalace z obchodů půjdou do vybraného umístění. Stávající hry zůstanou, kde jsou. Knihovny Steamu mají vlastní nastavení.</string>
|
||||||
|
<string name="storage_shared_mount">Úložiště telefonu v Linuxu</string>
|
||||||
|
<string name="storage_shared_mount_hint">Připojí vnitřní úložiště telefonu do /root/Storage. Když je vypnuto, připojí se jen složky her, které jste z něj přidali. Karet SD se to netýká. Projeví se v příští relaci.</string>
|
||||||
<string name="storage_default_ask">Vždy se zeptat</string>
|
<string name="storage_default_ask">Vždy se zeptat</string>
|
||||||
<string name="storage_default_ask_detail">Vybrat cíl u každé instalace</string>
|
<string name="storage_default_ask_detail">Vybrat cíl u každé instalace</string>
|
||||||
<string name="storage_default_internal">Interní úložiště</string>
|
<string name="storage_default_internal">Interní úložiště</string>
|
||||||
|
|||||||
@@ -1249,6 +1249,11 @@
|
|||||||
<string name="agent_action_prepare">Forbered</string>
|
<string name="agent_action_prepare">Forbered</string>
|
||||||
<string name="agent_connection_off">Trådløs fejlfinding kan ikke nås; Par slår den til</string>
|
<string name="agent_connection_off">Trådløs fejlfinding kan ikke nås; Par slår den til</string>
|
||||||
<string name="agent_action_pair">Par</string>
|
<string name="agent_action_pair">Par</string>
|
||||||
|
<string name="agent_step_connection_quest_hint">Quest har ingen parringsskærm. Kør én gang fra en computer: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS og adb tcpip 5555. Tryk derefter på Tillad, og godkend prompten i headsettet</string>
|
||||||
|
<string name="agent_action_allow">Tillad</string>
|
||||||
|
<string name="agent_connection_quest_waiting">Godkend “Tillad fejlretning?” i headsettet med Tillad altid markeret</string>
|
||||||
|
<string name="agent_connection_quest_failed">Kunne ikke oprette forbindelse. Godkend fejlretningsprompten i headsettet, eller kør adb tcpip 5555 fra en computer og prøv igen, hvis den ikke dukkede op</string>
|
||||||
|
<string name="agent_connection_quest_off">Trådløs fejlretning kan ikke nås. Tryk på Tillad for at konfigurere den igen</string>
|
||||||
<string name="agent_action_install">Installer</string>
|
<string name="agent_action_install">Installer</string>
|
||||||
<string name="agent_action_sign_in">Log ind</string>
|
<string name="agent_action_sign_in">Log ind</string>
|
||||||
<string name="upd_pr">PR #%1$d</string>
|
<string name="upd_pr">PR #%1$d</string>
|
||||||
@@ -1460,6 +1465,7 @@
|
|||||||
<string name="rail_percent">%1$d%%</string>
|
<string name="rail_percent">%1$d%%</string>
|
||||||
<string name="rail_resume_named">Genoptag %1$s</string>
|
<string name="rail_resume_named">Genoptag %1$s</string>
|
||||||
<string name="roms_text">Vises som /root/ROMs i hver session. Intern lagerplads er på /root/Storage.</string>
|
<string name="roms_text">Vises som /root/ROMs i hver session. Intern lagerplads er på /root/Storage.</string>
|
||||||
|
<string name="roms_text_unmounted">Vises som /root/ROMs i hver session.</string>
|
||||||
<string name="roms_none">Ingen mappe valgt</string>
|
<string name="roms_none">Ingen mappe valgt</string>
|
||||||
<string name="roms_applies">Gælder fra næste session. SD-kort fungerer.</string>
|
<string name="roms_applies">Gælder fra næste session. SD-kort fungerer.</string>
|
||||||
<string name="roms_choose">Vælg mappe</string>
|
<string name="roms_choose">Vælg mappe</string>
|
||||||
@@ -2130,6 +2136,7 @@
|
|||||||
<string name="bottom_qam_layout_left">Venstre</string>
|
<string name="bottom_qam_layout_left">Venstre</string>
|
||||||
<string name="bottom_qam_layout_center">Midte</string>
|
<string name="bottom_qam_layout_center">Midte</string>
|
||||||
<string name="bottom_qam_layout_right">Højre</string>
|
<string name="bottom_qam_layout_right">Højre</string>
|
||||||
|
<string name="bottom_qam_layout_split">Delt</string>
|
||||||
<string name="bottom_qam_unavailable">Steams menu til hurtig adgang er ikke tilgængelig endnu.</string>
|
<string name="bottom_qam_unavailable">Steams menu til hurtig adgang er ikke tilgængelig endnu.</string>
|
||||||
<string name="bottom_page_telemetry">Statistik i spillet</string>
|
<string name="bottom_page_telemetry">Statistik i spillet</string>
|
||||||
<string name="bottom_hud_group">HUD på nederste skærm</string>
|
<string name="bottom_hud_group">HUD på nederste skærm</string>
|
||||||
@@ -3219,6 +3226,8 @@
|
|||||||
<string name="storage_default_group">Installationsplacering</string>
|
<string name="storage_default_group">Installationsplacering</string>
|
||||||
<string name="storage_default_title">Standardlager</string>
|
<string name="storage_default_title">Standardlager</string>
|
||||||
<string name="storage_default_hint">Nye butiksinstallationer går til den valgte placering. Eksisterende spil bliver, hvor de er. Steam-biblioteker har deres egen indstilling.</string>
|
<string name="storage_default_hint">Nye butiksinstallationer går til den valgte placering. Eksisterende spil bliver, hvor de er. Steam-biblioteker har deres egen indstilling.</string>
|
||||||
|
<string name="storage_shared_mount">Telefonens lager i Linux</string>
|
||||||
|
<string name="storage_shared_mount_hint">Monterer telefonens interne lager på /root/Storage. Når det er slået fra, monteres kun de spilmapper, du har tilføjet derfra. SD-kort påvirkes ikke. Træder i kraft ved næste session.</string>
|
||||||
<string name="storage_default_ask">Spørg hver gang</string>
|
<string name="storage_default_ask">Spørg hver gang</string>
|
||||||
<string name="storage_default_ask_detail">Vælg en placering for hver installation</string>
|
<string name="storage_default_ask_detail">Vælg en placering for hver installation</string>
|
||||||
<string name="storage_default_internal">Internt lager</string>
|
<string name="storage_default_internal">Internt lager</string>
|
||||||
|
|||||||
@@ -1241,6 +1241,11 @@
|
|||||||
<string name="agent_action_prepare">Vorbereiten</string>
|
<string name="agent_action_prepare">Vorbereiten</string>
|
||||||
<string name="agent_connection_off">Wireless-Debugging ist nicht erreichbar; Koppeln schaltet es ein</string>
|
<string name="agent_connection_off">Wireless-Debugging ist nicht erreichbar; Koppeln schaltet es ein</string>
|
||||||
<string name="agent_action_pair">Koppeln</string>
|
<string name="agent_action_pair">Koppeln</string>
|
||||||
|
<string name="agent_step_connection_quest_hint">Quest hat keinen Kopplungsbildschirm. Führe einmal an einem Computer aus: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS und adb tcpip 5555. Tippe dann auf Zulassen und bestätige die Abfrage im Headset</string>
|
||||||
|
<string name="agent_action_allow">Zulassen</string>
|
||||||
|
<string name="agent_connection_quest_waiting">Bestätige „Debugging zulassen?“ im Headset mit aktiviertem „Immer zulassen“</string>
|
||||||
|
<string name="agent_connection_quest_failed">Verbindung fehlgeschlagen. Bestätige die Debugging-Abfrage im Headset. Falls keine erschienen ist, führe adb tcpip 5555 an einem Computer aus und versuche es erneut</string>
|
||||||
|
<string name="agent_connection_quest_off">Kabelloses Debugging ist nicht erreichbar. Tippe auf Zulassen, um es neu einzurichten</string>
|
||||||
<string name="agent_action_install">Installieren</string>
|
<string name="agent_action_install">Installieren</string>
|
||||||
<string name="agent_action_sign_in">Anmelden</string>
|
<string name="agent_action_sign_in">Anmelden</string>
|
||||||
<string name="upd_pr">PR #%1$d</string>
|
<string name="upd_pr">PR #%1$d</string>
|
||||||
@@ -1452,6 +1457,7 @@
|
|||||||
<string name="rail_percent">%1$d %%</string>
|
<string name="rail_percent">%1$d %%</string>
|
||||||
<string name="rail_resume_named">%1$s fortsetzen</string>
|
<string name="rail_resume_named">%1$s fortsetzen</string>
|
||||||
<string name="roms_text">Erscheint in jeder Sitzung als /root/ROMs. Der interne Speicher liegt unter /root/Storage.</string>
|
<string name="roms_text">Erscheint in jeder Sitzung als /root/ROMs. Der interne Speicher liegt unter /root/Storage.</string>
|
||||||
|
<string name="roms_text_unmounted">Erscheint in jeder Sitzung als /root/ROMs.</string>
|
||||||
<string name="roms_none">Kein Ordner ausgewählt</string>
|
<string name="roms_none">Kein Ordner ausgewählt</string>
|
||||||
<string name="roms_applies">Gilt ab der nächsten Sitzung. SD-Karten funktionieren.</string>
|
<string name="roms_applies">Gilt ab der nächsten Sitzung. SD-Karten funktionieren.</string>
|
||||||
<string name="roms_choose">Ordner auswählen</string>
|
<string name="roms_choose">Ordner auswählen</string>
|
||||||
@@ -2122,6 +2128,7 @@
|
|||||||
<string name="bottom_qam_layout_left">Links</string>
|
<string name="bottom_qam_layout_left">Links</string>
|
||||||
<string name="bottom_qam_layout_center">Mitte</string>
|
<string name="bottom_qam_layout_center">Mitte</string>
|
||||||
<string name="bottom_qam_layout_right">Rechts</string>
|
<string name="bottom_qam_layout_right">Rechts</string>
|
||||||
|
<string name="bottom_qam_layout_split">Geteilt</string>
|
||||||
<string name="bottom_qam_unavailable">Das Schnellzugriffsmenü von Steam ist noch nicht verfügbar.</string>
|
<string name="bottom_qam_unavailable">Das Schnellzugriffsmenü von Steam ist noch nicht verfügbar.</string>
|
||||||
<string name="bottom_page_telemetry">Spielstatistiken</string>
|
<string name="bottom_page_telemetry">Spielstatistiken</string>
|
||||||
<string name="bottom_hud_group">HUD für den unteren Bildschirm</string>
|
<string name="bottom_hud_group">HUD für den unteren Bildschirm</string>
|
||||||
@@ -3219,6 +3226,8 @@
|
|||||||
<string name="storage_default_group">Installationsort</string>
|
<string name="storage_default_group">Installationsort</string>
|
||||||
<string name="storage_default_title">Standardspeicher</string>
|
<string name="storage_default_title">Standardspeicher</string>
|
||||||
<string name="storage_default_hint">Neue Store-Installationen landen am ausgewählten Ort. Vorhandene Spiele bleiben, wo sie sind. Steam-Bibliotheken behalten ihre eigene Einstellung.</string>
|
<string name="storage_default_hint">Neue Store-Installationen landen am ausgewählten Ort. Vorhandene Spiele bleiben, wo sie sind. Steam-Bibliotheken behalten ihre eigene Einstellung.</string>
|
||||||
|
<string name="storage_shared_mount">Telefonspeicher in Linux</string>
|
||||||
|
<string name="storage_shared_mount_hint">Bindet den internen Speicher deines Telefons unter /root/Storage ein. Wenn aus, werden nur Spielordner eingebunden, die du daraus hinzugefügt hast. SD-Karten sind nicht betroffen. Gilt ab der nächsten Sitzung.</string>
|
||||||
<string name="storage_default_ask">Jedes Mal fragen</string>
|
<string name="storage_default_ask">Jedes Mal fragen</string>
|
||||||
<string name="storage_default_ask_detail">Für jede Installation ein Ziel wählen</string>
|
<string name="storage_default_ask_detail">Für jede Installation ein Ziel wählen</string>
|
||||||
<string name="storage_default_internal">Interner Speicher</string>
|
<string name="storage_default_internal">Interner Speicher</string>
|
||||||
|
|||||||
@@ -1249,6 +1249,11 @@
|
|||||||
<string name="agent_action_prepare">Προετοιμασία</string>
|
<string name="agent_action_prepare">Προετοιμασία</string>
|
||||||
<string name="agent_connection_off">Η ασύρματη αποσφαλμάτωση δεν είναι προσβάσιμη · η Σύζευξη την ενεργοποιεί</string>
|
<string name="agent_connection_off">Η ασύρματη αποσφαλμάτωση δεν είναι προσβάσιμη · η Σύζευξη την ενεργοποιεί</string>
|
||||||
<string name="agent_action_pair">Σύζευξη</string>
|
<string name="agent_action_pair">Σύζευξη</string>
|
||||||
|
<string name="agent_step_connection_quest_hint">Το Quest δεν έχει οθόνη σύζευξης. Από έναν υπολογιστή, εκτελέστε μία φορά: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS και adb tcpip 5555. Μετά πατήστε «Να επιτραπεί» και αποδεχτείτε το μήνυμα στο headset</string>
|
||||||
|
<string name="agent_action_allow">Να επιτραπεί</string>
|
||||||
|
<string name="agent_connection_quest_waiting">Αποδεχτείτε το «Να επιτραπεί ο εντοπισμός σφαλμάτων;» στο headset, με επιλεγμένο το «Να επιτρέπεται πάντα»</string>
|
||||||
|
<string name="agent_connection_quest_failed">Δεν ήταν δυνατή η σύνδεση. Αποδεχτείτε το μήνυμα εντοπισμού σφαλμάτων στο headset ή, αν δεν εμφανίστηκε, εκτελέστε adb tcpip 5555 από υπολογιστή και δοκιμάστε ξανά</string>
|
||||||
|
<string name="agent_connection_quest_off">Ο ασύρματος εντοπισμός σφαλμάτων δεν είναι προσβάσιμος. Πατήστε «Να επιτραπεί» για να τον ρυθμίσετε ξανά</string>
|
||||||
<string name="agent_action_install">Εγκατάσταση</string>
|
<string name="agent_action_install">Εγκατάσταση</string>
|
||||||
<string name="agent_action_sign_in">Σύνδεση</string>
|
<string name="agent_action_sign_in">Σύνδεση</string>
|
||||||
<string name="upd_pr">PR #%1$d</string>
|
<string name="upd_pr">PR #%1$d</string>
|
||||||
@@ -1460,6 +1465,7 @@
|
|||||||
<string name="rail_percent">%1$d%%</string>
|
<string name="rail_percent">%1$d%%</string>
|
||||||
<string name="rail_resume_named">Συνέχιση %1$s</string>
|
<string name="rail_resume_named">Συνέχιση %1$s</string>
|
||||||
<string name="roms_text">Εμφανίζεται ως /root/ROMs σε κάθε συνεδρία. Ο εσωτερικός χώρος αποθήκευσης βρίσκεται στο /root/Storage.</string>
|
<string name="roms_text">Εμφανίζεται ως /root/ROMs σε κάθε συνεδρία. Ο εσωτερικός χώρος αποθήκευσης βρίσκεται στο /root/Storage.</string>
|
||||||
|
<string name="roms_text_unmounted">Εμφανίζεται ως /root/ROMs σε κάθε συνεδρία.</string>
|
||||||
<string name="roms_none">Δεν έχει επιλεγεί φάκελος</string>
|
<string name="roms_none">Δεν έχει επιλεγεί φάκελος</string>
|
||||||
<string name="roms_applies">Ισχύει από την επόμενη συνεδρία. Οι κάρτες SD λειτουργούν.</string>
|
<string name="roms_applies">Ισχύει από την επόμενη συνεδρία. Οι κάρτες SD λειτουργούν.</string>
|
||||||
<string name="roms_choose">Επιλογή φακέλου</string>
|
<string name="roms_choose">Επιλογή φακέλου</string>
|
||||||
@@ -2130,6 +2136,7 @@
|
|||||||
<string name="bottom_qam_layout_left">Αριστερά</string>
|
<string name="bottom_qam_layout_left">Αριστερά</string>
|
||||||
<string name="bottom_qam_layout_center">Κέντρο</string>
|
<string name="bottom_qam_layout_center">Κέντρο</string>
|
||||||
<string name="bottom_qam_layout_right">Δεξιά</string>
|
<string name="bottom_qam_layout_right">Δεξιά</string>
|
||||||
|
<string name="bottom_qam_layout_split">Διαιρεμένο</string>
|
||||||
<string name="bottom_qam_unavailable">Το μενού γρήγορης πρόσβασης του Steam δεν είναι ακόμη διαθέσιμο.</string>
|
<string name="bottom_qam_unavailable">Το μενού γρήγορης πρόσβασης του Steam δεν είναι ακόμη διαθέσιμο.</string>
|
||||||
<string name="bottom_page_telemetry">Στατιστικά παιχνιδιού</string>
|
<string name="bottom_page_telemetry">Στατιστικά παιχνιδιού</string>
|
||||||
<string name="bottom_hud_group">HUD κάτω οθόνης</string>
|
<string name="bottom_hud_group">HUD κάτω οθόνης</string>
|
||||||
@@ -3219,6 +3226,8 @@
|
|||||||
<string name="storage_default_group">Τοποθεσία εγκατάστασης</string>
|
<string name="storage_default_group">Τοποθεσία εγκατάστασης</string>
|
||||||
<string name="storage_default_title">Προεπιλεγμένος αποθηκευτικός χώρος</string>
|
<string name="storage_default_title">Προεπιλεγμένος αποθηκευτικός χώρος</string>
|
||||||
<string name="storage_default_hint">Οι νέες εγκαταστάσεις από καταστήματα πηγαίνουν στην επιλεγμένη τοποθεσία. Τα υπάρχοντα παιχνίδια μένουν όπου είναι. Οι βιβλιοθήκες Steam διατηρούν τη δική τους ρύθμιση.</string>
|
<string name="storage_default_hint">Οι νέες εγκαταστάσεις από καταστήματα πηγαίνουν στην επιλεγμένη τοποθεσία. Τα υπάρχοντα παιχνίδια μένουν όπου είναι. Οι βιβλιοθήκες Steam διατηρούν τη δική τους ρύθμιση.</string>
|
||||||
|
<string name="storage_shared_mount">Αποθηκευτικός χώρος τηλεφώνου στο Linux</string>
|
||||||
|
<string name="storage_shared_mount_hint">Προσαρτά τον εσωτερικό χώρο αποθήκευσης του τηλεφώνου σας στο /root/Storage. Όταν είναι απενεργοποιημένο, προσαρτώνται μόνο οι φάκελοι παιχνιδιών που προσθέσατε από αυτόν. Οι κάρτες SD δεν επηρεάζονται. Ισχύει από την επόμενη συνεδρία.</string>
|
||||||
<string name="storage_default_ask">Ερώτηση κάθε φορά</string>
|
<string name="storage_default_ask">Ερώτηση κάθε φορά</string>
|
||||||
<string name="storage_default_ask_detail">Επιλογή προορισμού για κάθε εγκατάσταση</string>
|
<string name="storage_default_ask_detail">Επιλογή προορισμού για κάθε εγκατάσταση</string>
|
||||||
<string name="storage_default_internal">Εσωτερικός αποθηκευτικός χώρος</string>
|
<string name="storage_default_internal">Εσωτερικός αποθηκευτικός χώρος</string>
|
||||||
|
|||||||
@@ -1253,6 +1253,11 @@
|
|||||||
<string name="agent_action_prepare">Preparar</string>
|
<string name="agent_action_prepare">Preparar</string>
|
||||||
<string name="agent_connection_off">No se puede acceder a la depuración inalámbrica; Emparejar la activa</string>
|
<string name="agent_connection_off">No se puede acceder a la depuración inalámbrica; Emparejar la activa</string>
|
||||||
<string name="agent_action_pair">Emparejar</string>
|
<string name="agent_action_pair">Emparejar</string>
|
||||||
|
<string name="agent_step_connection_quest_hint">Quest no tiene pantalla de vinculación. Desde un ordenador, ejecuta una vez: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS y adb tcpip 5555. Después toca Permitir y acepta el aviso en el visor</string>
|
||||||
|
<string name="agent_action_allow">Permitir</string>
|
||||||
|
<string name="agent_connection_quest_waiting">Acepta «¿Permitir depuración?» en el visor, con Permitir siempre marcado</string>
|
||||||
|
<string name="agent_connection_quest_failed">No se pudo conectar. Acepta el aviso de depuración en el visor o, si no apareció, ejecuta adb tcpip 5555 desde un ordenador y vuelve a intentarlo</string>
|
||||||
|
<string name="agent_connection_quest_off">No se puede acceder a la depuración inalámbrica. Toca Permitir para configurarla de nuevo</string>
|
||||||
<string name="agent_action_install">Instalar</string>
|
<string name="agent_action_install">Instalar</string>
|
||||||
<string name="agent_action_sign_in">Iniciar sesión</string>
|
<string name="agent_action_sign_in">Iniciar sesión</string>
|
||||||
<string name="upd_pr">PR #%1$d</string>
|
<string name="upd_pr">PR #%1$d</string>
|
||||||
@@ -1468,6 +1473,7 @@
|
|||||||
<string name="rail_percent">%1$d%%</string>
|
<string name="rail_percent">%1$d%%</string>
|
||||||
<string name="rail_resume_named">Reanudar %1$s</string>
|
<string name="rail_resume_named">Reanudar %1$s</string>
|
||||||
<string name="roms_text">Aparece como /root/ROMs en cada sesión. El almacenamiento interno está en /root/Storage.</string>
|
<string name="roms_text">Aparece como /root/ROMs en cada sesión. El almacenamiento interno está en /root/Storage.</string>
|
||||||
|
<string name="roms_text_unmounted">Aparece como /root/ROMs en cada sesión.</string>
|
||||||
<string name="roms_none">Ninguna carpeta elegida</string>
|
<string name="roms_none">Ninguna carpeta elegida</string>
|
||||||
<string name="roms_applies">Se aplica en la próxima sesión. Las tarjetas SD funcionan.</string>
|
<string name="roms_applies">Se aplica en la próxima sesión. Las tarjetas SD funcionan.</string>
|
||||||
<string name="roms_choose">Elegir carpeta</string>
|
<string name="roms_choose">Elegir carpeta</string>
|
||||||
@@ -2155,6 +2161,7 @@
|
|||||||
<string name="bottom_qam_layout_left">Izquierda</string>
|
<string name="bottom_qam_layout_left">Izquierda</string>
|
||||||
<string name="bottom_qam_layout_center">Centro</string>
|
<string name="bottom_qam_layout_center">Centro</string>
|
||||||
<string name="bottom_qam_layout_right">Derecha</string>
|
<string name="bottom_qam_layout_right">Derecha</string>
|
||||||
|
<string name="bottom_qam_layout_split">Dividido</string>
|
||||||
<string name="bottom_qam_unavailable">El menú de acceso rápido de Steam aún no está disponible.</string>
|
<string name="bottom_qam_unavailable">El menú de acceso rápido de Steam aún no está disponible.</string>
|
||||||
<string name="bottom_page_telemetry">Estadísticas del juego</string>
|
<string name="bottom_page_telemetry">Estadísticas del juego</string>
|
||||||
<string name="bottom_hud_group">HUD de la pantalla inferior</string>
|
<string name="bottom_hud_group">HUD de la pantalla inferior</string>
|
||||||
@@ -3249,6 +3256,8 @@
|
|||||||
<string name="storage_default_group">Ubicación de instalación</string>
|
<string name="storage_default_group">Ubicación de instalación</string>
|
||||||
<string name="storage_default_title">Almacenamiento predeterminado</string>
|
<string name="storage_default_title">Almacenamiento predeterminado</string>
|
||||||
<string name="storage_default_hint">Las nuevas instalaciones de las tiendas van a la ubicación seleccionada. Los juegos existentes se quedan donde están. Las bibliotecas de Steam conservan su propio ajuste.</string>
|
<string name="storage_default_hint">Las nuevas instalaciones de las tiendas van a la ubicación seleccionada. Los juegos existentes se quedan donde están. Las bibliotecas de Steam conservan su propio ajuste.</string>
|
||||||
|
<string name="storage_shared_mount">Almacenamiento del teléfono en Linux</string>
|
||||||
|
<string name="storage_shared_mount_hint">Monta el almacenamiento interno del teléfono en /root/Storage. Si está desactivado, solo se montan las carpetas de juegos que has añadido desde ahí. No afecta a las tarjetas SD. Se aplica en la próxima sesión.</string>
|
||||||
<string name="storage_default_ask">Preguntar siempre</string>
|
<string name="storage_default_ask">Preguntar siempre</string>
|
||||||
<string name="storage_default_ask_detail">Elige un destino para cada instalación</string>
|
<string name="storage_default_ask_detail">Elige un destino para cada instalación</string>
|
||||||
<string name="storage_default_internal">Almacenamiento interno</string>
|
<string name="storage_default_internal">Almacenamiento interno</string>
|
||||||
|
|||||||
@@ -1249,6 +1249,11 @@
|
|||||||
<string name="agent_action_prepare">Valmistele</string>
|
<string name="agent_action_prepare">Valmistele</string>
|
||||||
<string name="agent_connection_off">Langaton virheenkorjaus ei ole tavoitettavissa; Parita ottaa sen käyttöön</string>
|
<string name="agent_connection_off">Langaton virheenkorjaus ei ole tavoitettavissa; Parita ottaa sen käyttöön</string>
|
||||||
<string name="agent_action_pair">Parita</string>
|
<string name="agent_action_pair">Parita</string>
|
||||||
|
<string name="agent_step_connection_quest_hint">Questissa ei ole laiteparinäkymää. Suorita kerran tietokoneelta: adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS ja adb tcpip 5555. Napauta sitten Salli ja hyväksy kehote laseissa</string>
|
||||||
|
<string name="agent_action_allow">Salli</string>
|
||||||
|
<string name="agent_connection_quest_waiting">Hyväksy ”Sallitaanko virheenkorjaus?” laseissa, kun Salli aina on valittuna</string>
|
||||||
|
<string name="agent_connection_quest_failed">Yhteyttä ei saatu. Hyväksy virheenkorjauskehote laseissa, tai jos sitä ei näkynyt, suorita adb tcpip 5555 tietokoneelta ja yritä uudelleen</string>
|
||||||
|
<string name="agent_connection_quest_off">Langatonta virheenkorjausta ei tavoiteta. Määritä se uudelleen napauttamalla Salli</string>
|
||||||
<string name="agent_action_install">Asenna</string>
|
<string name="agent_action_install">Asenna</string>
|
||||||
<string name="agent_action_sign_in">Kirjaudu sisään</string>
|
<string name="agent_action_sign_in">Kirjaudu sisään</string>
|
||||||
<string name="upd_pr">PR #%1$d</string>
|
<string name="upd_pr">PR #%1$d</string>
|
||||||
@@ -1460,6 +1465,7 @@
|
|||||||
<string name="rail_percent">%1$d %%</string>
|
<string name="rail_percent">%1$d %%</string>
|
||||||
<string name="rail_resume_named">Jatka: %1$s</string>
|
<string name="rail_resume_named">Jatka: %1$s</string>
|
||||||
<string name="roms_text">Näkyy sessiossa polussa /root/ROMs. Sisäinen tallennustila on /root/Storage.</string>
|
<string name="roms_text">Näkyy sessiossa polussa /root/ROMs. Sisäinen tallennustila on /root/Storage.</string>
|
||||||
|
<string name="roms_text_unmounted">Näkyy sessiossa polussa /root/ROMs.</string>
|
||||||
<string name="roms_none">Kansiota ei valittu</string>
|
<string name="roms_none">Kansiota ei valittu</string>
|
||||||
<string name="roms_applies">Vaikuttaa seuraavaan istuntoon. SD-kortit toimivat.</string>
|
<string name="roms_applies">Vaikuttaa seuraavaan istuntoon. SD-kortit toimivat.</string>
|
||||||
<string name="roms_choose">Valitse kansio</string>
|
<string name="roms_choose">Valitse kansio</string>
|
||||||
@@ -2130,6 +2136,7 @@
|
|||||||
<string name="bottom_qam_layout_left">Vasen</string>
|
<string name="bottom_qam_layout_left">Vasen</string>
|
||||||
<string name="bottom_qam_layout_center">Keskellä</string>
|
<string name="bottom_qam_layout_center">Keskellä</string>
|
||||||
<string name="bottom_qam_layout_right">Oikea</string>
|
<string name="bottom_qam_layout_right">Oikea</string>
|
||||||
|
<string name="bottom_qam_layout_split">Jaettu</string>
|
||||||
<string name="bottom_qam_unavailable">Steamin pikavalikko ei ole vielä käytettävissä.</string>
|
<string name="bottom_qam_unavailable">Steamin pikavalikko ei ole vielä käytettävissä.</string>
|
||||||
<string name="bottom_page_telemetry">Pelinsisäiset tilastot</string>
|
<string name="bottom_page_telemetry">Pelinsisäiset tilastot</string>
|
||||||
<string name="bottom_hud_group">Alanäytön HUD</string>
|
<string name="bottom_hud_group">Alanäytön HUD</string>
|
||||||
@@ -3219,6 +3226,8 @@
|
|||||||
<string name="storage_default_group">Asennussijainti</string>
|
<string name="storage_default_group">Asennussijainti</string>
|
||||||
<string name="storage_default_title">Oletustallennustila</string>
|
<string name="storage_default_title">Oletustallennustila</string>
|
||||||
<string name="storage_default_hint">Uudet kauppa-asennukset menevät valittuun sijaintiin. Nykyiset pelit pysyvät paikoillaan. Steam-kirjastoilla on oma asetuksensa.</string>
|
<string name="storage_default_hint">Uudet kauppa-asennukset menevät valittuun sijaintiin. Nykyiset pelit pysyvät paikoillaan. Steam-kirjastoilla on oma asetuksensa.</string>
|
||||||
|
<string name="storage_shared_mount">Puhelimen tallennustila Linuxissa</string>
|
||||||
|
<string name="storage_shared_mount_hint">Liittää puhelimen sisäisen tallennustilan polkuun /root/Storage. Kun pois päältä, liitetään vain sieltä lisäämäsi pelikansiot. SD-kortit eivät muutu. Tulee voimaan seuraavassa istunnossa.</string>
|
||||||
<string name="storage_default_ask">Kysy aina</string>
|
<string name="storage_default_ask">Kysy aina</string>
|
||||||
<string name="storage_default_ask_detail">Valitse kohde jokaiselle asennukselle</string>
|
<string name="storage_default_ask_detail">Valitse kohde jokaiselle asennukselle</string>
|
||||||
<string name="storage_default_internal">Sisäinen tallennustila</string>
|
<string name="storage_default_internal">Sisäinen tallennustila</string>
|
||||||
|
|||||||
@@ -1252,6 +1252,11 @@
|
|||||||
<string name="agent_action_prepare">Préparer</string>
|
<string name="agent_action_prepare">Préparer</string>
|
||||||
<string name="agent_connection_off">Le débogage sans fil n\'est pas accessible ; « Associer » l\'active</string>
|
<string name="agent_connection_off">Le débogage sans fil n\'est pas accessible ; « Associer » l\'active</string>
|
||||||
<string name="agent_action_pair">Associer</string>
|
<string name="agent_action_pair">Associer</string>
|
||||||
|
<string name="agent_step_connection_quest_hint">Le Quest n\'a pas d\'écran d\'association. Depuis un ordinateur, exécutez une fois : adb shell pm grant %1$s android.permission.WRITE_SECURE_SETTINGS et adb tcpip 5555. Touchez ensuite Autoriser et acceptez la demande dans le casque</string>
|
||||||
|
<string name="agent_action_allow">Autoriser</string>
|
||||||
|
<string name="agent_connection_quest_waiting">Acceptez « Autoriser le débogage ? » dans le casque, avec Toujours autoriser coché</string>
|
||||||
|
<string name="agent_connection_quest_failed">Connexion impossible. Acceptez la demande de débogage dans le casque ou, si elle n\'est pas apparue, exécutez adb tcpip 5555 depuis un ordinateur et réessayez</string>
|
||||||
|
<string name="agent_connection_quest_off">Le débogage sans fil est injoignable. Touchez Autoriser pour le configurer à nouveau</string>
|
||||||
<string name="agent_action_install">Installer</string>
|
<string name="agent_action_install">Installer</string>
|
||||||
<string name="agent_action_sign_in">Se connecter</string>
|
<string name="agent_action_sign_in">Se connecter</string>
|
||||||
<string name="upd_pr">PR #%1$d</string>
|
<string name="upd_pr">PR #%1$d</string>
|
||||||
@@ -1467,6 +1472,7 @@
|
|||||||
<string name="rail_percent">%1$d%%</string>
|
<string name="rail_percent">%1$d%%</string>
|
||||||
<string name="rail_resume_named">Reprendre %1$s</string>
|
<string name="rail_resume_named">Reprendre %1$s</string>
|
||||||
<string name="roms_text">Affiché comme /root/ROMs dans chaque session. Le stockage interne se trouve dans /root/Storage.</string>
|
<string name="roms_text">Affiché comme /root/ROMs dans chaque session. Le stockage interne se trouve dans /root/Storage.</string>
|
||||||
|
<string name="roms_text_unmounted">Affiché comme /root/ROMs dans chaque session.</string>
|
||||||
<string name="roms_none">Aucun dossier sélectionné</string>
|
<string name="roms_none">Aucun dossier sélectionné</string>
|
||||||
<string name="roms_applies">Prendra effet à la prochaine session. Prend en charge les cartes SD.</string>
|
<string name="roms_applies">Prendra effet à la prochaine session. Prend en charge les cartes SD.</string>
|
||||||
<string name="roms_choose">Choisir un dossier</string>
|
<string name="roms_choose">Choisir un dossier</string>
|
||||||
@@ -2154,6 +2160,7 @@
|
|||||||
<string name="bottom_qam_layout_left">Gauche</string>
|
<string name="bottom_qam_layout_left">Gauche</string>
|
||||||
<string name="bottom_qam_layout_center">Centre</string>
|
<string name="bottom_qam_layout_center">Centre</string>
|
||||||
<string name="bottom_qam_layout_right">Droite</string>
|
<string name="bottom_qam_layout_right">Droite</string>
|
||||||
|
<string name="bottom_qam_layout_split">Partagé</string>
|
||||||
<string name="bottom_qam_unavailable">Le menu d’accès rapide de Steam n’est pas encore disponible.</string>
|
<string name="bottom_qam_unavailable">Le menu d’accès rapide de Steam n’est pas encore disponible.</string>
|
||||||
<string name="bottom_page_telemetry">Statistiques en jeu</string>
|
<string name="bottom_page_telemetry">Statistiques en jeu</string>
|
||||||
<string name="bottom_hud_group">HUD de l\'écran du bas</string>
|
<string name="bottom_hud_group">HUD de l\'écran du bas</string>
|
||||||
@@ -3248,6 +3255,8 @@
|
|||||||
<string name="storage_default_group">Emplacement d\'installation</string>
|
<string name="storage_default_group">Emplacement d\'installation</string>
|
||||||
<string name="storage_default_title">Stockage par défaut</string>
|
<string name="storage_default_title">Stockage par défaut</string>
|
||||||
<string name="storage_default_hint">Les nouvelles installations depuis les boutiques vont à l\'emplacement sélectionné. Les jeux existants restent où ils sont. Les bibliothèques Steam gardent leur propre réglage.</string>
|
<string name="storage_default_hint">Les nouvelles installations depuis les boutiques vont à l\'emplacement sélectionné. Les jeux existants restent où ils sont. Les bibliothèques Steam gardent leur propre réglage.</string>
|
||||||
|
<string name="storage_shared_mount">Stockage du téléphone dans Linux</string>
|
||||||
|
<string name="storage_shared_mount_hint">Monte le stockage interne de votre téléphone dans /root/Storage. Désactivé, seuls les dossiers de jeux que vous y avez ajoutés sont montés. Les cartes SD ne sont pas concernées. S\'applique à la prochaine session.</string>
|
||||||
<string name="storage_default_ask">Toujours demander</string>
|
<string name="storage_default_ask">Toujours demander</string>
|
||||||
<string name="storage_default_ask_detail">Choisir une destination pour chaque installation</string>
|
<string name="storage_default_ask_detail">Choisir une destination pour chaque installation</string>
|
||||||
<string name="storage_default_internal">Stockage interne</string>
|
<string name="storage_default_internal">Stockage interne</string>
|
||||||
|
|||||||
Loaded 100 of 232 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user