Conflicts: drawer pages moved into functions on main (upscaler group now in
DrawerGamePage), launch.sh WSI bypass line, recipes.json/runtime_inputs.py
lists (main's IME entries + the upscale layer), game-environment tests (both
classes kept).
Use independent portrait and landscape alignment, with Top and 1280×800 as the default in Steam portrait. Keep explicit resolutions and existing controls modes.
Commit Android IME text through the focused renderer and submit only after delivery is confirmed. Restore Steam pinyin on Ubuntu rc7 and allow older runtimes to start normally without IBus.
* fix(display): copy the game and the window above it in one GPU submit
When a game's frames go on the layer-copy path and a window sits above
the game, each scene copied the game frame and then the window above it
with two separate submits and two CPU waits. Each wait queued behind
the game's own GPU work, so a GPU-bound game lost on-screen frames to
the second wait.
Record both copies in one command buffer, merge their release fences,
and wait once per scene. The zero-copy path and the single-layer copy
path are unchanged.
* Check overlay eligibility against the frame's own game geometry and keep both release waits when a fence merge fails
The Bionic launcher no longer forces the WSI layer's XWayland bypass; the layer runs its normal eligibility check, cached for 100 ms. The compositor logs, rate-limited, why a frame or layer candidate leaves the zero-copy path: no registered gralloc buffer, a failed direct present, or a rejected candidate draw.
Tested on a 60 Hz Adreno handheld with the forced bypass on and off and with two driver versions: every run stayed on the zero-copy path at about 60 fps.
When a frame's acquire fence cannot be exported from its dma-buf, the frame takes the layer-copy path instead of reaching the display unfenced. Fixes#3410.
CAS derives texel centres from the input size in its push constants instead of textureSize on the imported scene image, as the previous CAS shader did. Fixes the grid of black marks with CAS on 10-bit game images on Adreno 8xx.
When the kernel cannot attach a display release fence to the buffer, the
compositor waits on the fence itself. A second release of the same buffer
before that fence signalled overwrote the pending wait, so the first wait
removed the second one and then fired again with no source to remove,
crashing the compositor and losing the session.
A second unsignalled fence is now merged into the pending wait, and a
signalled or attached one leaves the pending wait in charge of the
deferred release.
DroidDeck-Bionic preloads libfakeinput.so into its Wine processes
(tools/bionic-runtime/build.sh builds fakeinput_steam.cpp for bionic). The
fortified read/poll/ppoll entry points (#2916) call glibc's __chk_fail, which
bionic does not export, so the bionic build of the library cannot be loaded:
"CANNOT LINK EXECUTABLE .../wine: cannot locate symbol "__chk_fail"" and no
Wine program starts. Every DroidDeck-Bionic pack built from main since #2916 is
affected (r67 predates it).
The bounds failures now go through fakeinput_chk_fail(): abort() on bionic,
__chk_fail() as before on glibc. tools/tests/test_fakeinput_bionic.py fails if
__chk_fail is named outside the non-bionic branch again.
Co-authored-by: The412Banner <the412banner@users.noreply.github.com>
* Prepare FrameGen for instance-owned scratch lifecycle
* Make DD-FG rebuild and teardown completion-aware
* Restore DD-FG namespace boundary
* Isolate DD-FG scratch state and reclaim resources on rebuild
* Declare per-instance scratch builder before recording code
* Make DD-FG ring teardown report unsafe GPU completion
* Retain DD-FG input ring until GPU completion is confirmed
* Add DD-FG lifecycle and resource-isolation tests
* Cover DD-FG teardown and rebuild failure cases
* Document DD-FG scratch ownership and teardown semantics
* Guard DD-FG teardown when GPU completion cannot be queried
* docs: clarify DD-FG device-loss teardown
* fix: define DD-FG scratch state before resize
* fix: define DD-FG scratch state before resize
* fix(ddfg): wait for the GPU before replacing the input ring on resize
* Fix DD-FG ring cleanup after device loss
* Propagate DD-FG device-loss status
* Retain DD-FG resources when GPU completion is unknown
* Retain DD-FG resources when GPU completion is unknown
* Retain DD-FG resources when GPU completion is unknown
* Retain DD-FG resources when GPU completion is unknown
* Retain DD-FG resources when GPU completion is unknown
* Retry DD-FG cleanup after an idle-wait failure
* Test DD-FG cleanup retry after GPU wait failure
---------
Co-authored-by: maxjivi05 <maxjividen@gmail.com>
* fix(input): programs built with _FORTIFY_SOURCE read the virtual pads
Fortified builds, Flatpak runtimes among them, call __read_chk, __poll_chk
and __ppoll_chk in place of read, poll and ppoll, and glibc's versions go
straight to the kernel. Such programs opened a pad through the shim but read
its backing ring file instead of events, so they never saw input: Marathon
Recompiled's SDL reads the pad through __read_chk.
The shim now provides all three, with glibc's bounds checks, on the same
paths as read, poll and ppoll.
* fix(input): keep glibc's __read_chk for descriptors that are not pads
Only pad descriptors take the shim's read path; the rest go to the next
__read_chk, so fortified reads keep libc's cancellation point. The test
also polls the empty ring with a zero timeout, which a __poll_chk that
bypasses the shim would report as ready.
---------
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
Port of the NeuralScale layer (previous commit) for DroidDeck:
- Layer VK_LAYER_DROIDDECK_upscale, library libVkLayer_droiddeck_upscale.so,
implicit manifest template (DROIDDECK_UPSCALE=1 / DROIDDECK_UPSCALE_DISABLE=1).
- Settings read as DROIDDECK_UPSCALE_<KEY>, then WINLATOR_FSR4_<KEY>.
- No hardcoded com.winlator.cmod data dir; without a dir frames get the blit
fallback.
- Compiled NPU graph caches go to <dir>/<htp arch>/ (v79/v81 from HTP_ARCH,
the SoC properties or the mapped QNN stub) instead of <dir>/v81/.
- The arch stub is loaded from the QNN library search list first, so
NATIVELIB_DIR is enough without LD_LIBRARY_PATH.
- driverID/driverName are only rewritten with GPU_SPOOF word "1";
SPOOF_DLSS=1 alone reports RTX vendor/device IDs.
- APK build via app/src/main/cpp/CMakeLists.txt; glibc build for the PRoot
guest (build-glibc.sh, DD_UPSCALE_NO_ANDROID: QNN stubs, stderr log) in
the runtime recipe, installed to usr/local/lib/droiddeck-upscale-layer/.
- -Bsymbolic so the exported vkGetInstanceProcAddr is not interposed by a
libvulkan in the global scope.
- Pack scripts take their paths as arguments.
Seam protocol, buffer sizes, magic values and backend IDs are unchanged.
* Release zero-copy display buffers at latch; gamescope waits for scanout before reusing an image
* Test that zero-copy releases follow the kernel's fence attach, not the buffer kind
* Pin the gamescope build that waits for scanout before reusing an image
* Probe the fallback output image for scanout so the composite waits on it too
* Pin the gamescope build that probes the fallback output image
## Problem
Zero-copy layer transitions could leave the compositor in an
inconsistent state when allocating an `ASurfaceTransaction` completion
callback failed.
Some failure paths released the current or previous `ASurfaceControl`
even though the transaction had not been applied. This could invalidate
layer state or release resources before the transition completed.
## Fix
- Cancel and delete transactions when completion callback allocation
fails.
- Preserve the current layer and buffer state instead of releasing
resources prematurely.
- Roll back surface swaps when presentation cannot proceed.
- Return an error from failed presentation paths and leave the layer
available for recovery.
- Apply the same failure handling to presentation, layer hiding and
surface retirement.
## Tests
- `git diff --check`: passed.
- Native build: not run locally.
- Device testing:
> Tested on one device and helped with his problem, test build is up for
further testing.
- **Perf:** Optimize DD FrameGen flow image initialization and shader
sampling.
> FrameGen should start faster and be more reliable.
- **Perf:** Skip unused FLOWREG image initialization and remove
redundant final FLOWREG barrier.
- **Perf:** Use initialization barriers for fresh framegen images.
> Helps with reliability and performance.
- **Perf:** Reserve capacity for image initialization barriers and Use
fixed storage for image initialization barriers.
- **Perf:** Batch FrameGen image descriptor updates and some FrameGen
image barriers.
> Less calls to the vulkan API.
- **Perf:** Skip unused global motion reduction sums.
- **Docs:** Add OF3_FLOWREG shader documents and some comments.
> This should be helpful when making future changes in the shader, only
for testing and development.
## Fixes
- Fix: Derive OF3 Flow Length from Array Size.
> Should make future changes easier.
- Fix: DD FrameGen scratch resource leak on resize.
- Fix: Present semaphore synchronization to prevent device loss on some
devices.
> Reported by a user, DDFG never worked on his device, this didn't
actually helped him, but im keeping because it can be useful for other
devices.
> issue reported on discord [Link to bug
report](https://discord.com/channels/1552707793247539220/1575946870151446589)
> This file contains the investigation made, in Portuguese:

## Performance
**OLD DroidDeck FrameGen**
| FPS (reported) | 1% low | Frametime | Game | DDFG | Device | DD
version |
|:--:|:--:|:--:|:--|:--:|:--|:--|
| 39.9 → 118.8 | 16.1 | 25.1 ms | Mass Effect | 3× | RP Nova, 12 GB,
Snapdragon 8 Gen 2 | 0.7.11 Stable |
| 32.5 → 91.4 | 21.9 | ## | NieR:Automata | 3× | S26U, SD 8 EG 5, Adr
840 | Preview b08d8e8 |
| 25.2 → 60.0 | ## | ## | Roadside Research | 4× | Odin2 Portal, Adreno
740 | 0.7.11 Stable |
*Report 1 — coleslaw117*
*Report 2 — twitchlemaxou*
*Report 3 — Dylon*
**NEW DroidDeck FrameGen**
| FPS (reported) | 1% low | Frametime | Game | DDFG | Device | DD
version |
|:--:|:--:|:--:|:--|:--:|:--|:--|
## Testing
- All checkd on Github green
- APK compiles
- All verification passed on my fork
- Working on test build
* perf(effects): half-precision upscalers, AMD CAS and a gather-based NIS from Bannerlator
The screen-effect chain ran every upscaler and CAS in fp32, and NIS read its
36-tap support and coefficient tables per pixel. Ported from Bannerlator
(The412Banner/Bannerlator 16595ed8 + 671feb8c), where the same shaders run in
its Wayland compositor:
- SGSR, SGSR HQ, FSR EASU and RCAS get a half-precision build of the same
source (-DDD_HALF=1, *_half_frag.h). The divide-by-zero guards DroidDeck
added to EASU, RCAS and CAS are kept.
- CAS: AMD's FidelityFX CAS (ffx_cas.h v1.0.2, 5-tap), half precision.
- NIS: a prepass writes the scene with luma in alpha at scene size
(nis_luma.frag); nis3.frag gathers that luma and reads its coefficient banks
from a 4 KB uniform buffer (nis_coef.h, set 1 of its own pipeline layout).
Without the buffer, NIS falls back to nis.frag.
- debug.droiddeck.upscale.shaders=old builds the previous fp32 set, for A/B.
The half SGSR, SGSR HQ, CAS, NIS luma and nis3 SPIR-V is identical to
Bannerlator's (glslang 16.2.0). Notices: AMD CAS added to
THIRD_PARTY_NOTICES.txt; NVIDIA NIS covers the new NIS files.
* fix(effects): NIS prepass address at full precision; fast NIS only where it is safe
From review:
- nis_luma.frag: the half build made gl_FragCoord RelaxedPrecision, so a
16-bit load rounds pixel centres past x = 1024 (1279.5 -> 1280) and
texelFetch reads the wrong or an outside texel. Only colour and luma are
mediump now; the load and the integer address stay full precision
(checked in the SPIR-V).
- Fast NIS keeps luma in alpha, so it runs only on chain formats with at
least 8 alpha bits; the 10-bit HDR composition format (2-bit alpha) uses
nis.frag.
- A driver that rejects nis3_half or nis_luma_half gets nis.frag instead of
a disabled effects chain.
- If the NIS luma target cannot be allocated, that frame uses SGSR from the
scene instead of skipping every effect.