mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 15:56:01 +00:00
Adds a Performance mode switch under Mode settings > Frame rate, off by default and stored per mode like the frame limit. Off keeps today's behaviour. On: - with no frame limit, the compositor hands buffers back to the game as soon as they are replaced instead of once per refresh, and gamescope's WSI layer is asked for at least 8 swapchain images; a chosen frame limit still paces - DROIDDECK_WSI_BYPASS_CHECK_MS=100 lets gamescope's WSI layer reuse its present-time Xwayland bypass check (patch 0117, gamescope-3.16.29-p13); WINE_OFFSCREEN_CHECK_MS=100 does the same for winex11 once a DroidDeck-Proton release carries that fix. Off sets both to 0. The gamescope pack now ships the patched WSI layer and SessionFiles stages it over the runtime's stock copy. Two per-game options, off by default: PROTON_DXVK_D3D8 and WINE_D3D_CONFIG renderer=vulkan|gl. AIO Graphics Test on an AYANEO Pocket FIT (Adreno 750), off -> on: Vulkan 204 -> 1787, OpenGL 296 -> 2169, D3D12 308 -> 3563, D3D11 1133 -> 2874, D3D9 1253 -> 3098 fps; DiRT Showdown 92.2 -> 93.4 (GPU-bound).
56 lines
2.1 KiB
Diff
56 lines
2.1 KiB
Diff
--- a/layer/VkLayer_FROG_gamescope_wsi.cpp 2026-10-25 07:56:48.179978889 +0000
|
|
+++ b/layer/VkLayer_FROG_gamescope_wsi.cpp 2026-10-25 07:56:48.207978889 +0000
|
|
@@ -23,6 +23,8 @@
|
|
#include <optional>
|
|
|
|
#include <poll.h>
|
|
+#include <time.h>
|
|
+#include <cstdlib>
|
|
#include <sys/stat.h>
|
|
// For limiter file.
|
|
#include <time.h>
|
|
@@ -476,6 +478,34 @@
|
|
// Cached for comparison.
|
|
std::optional<VkRect2D> cachedWindowRect;
|
|
|
|
+ // canBypassXWayland costs several X round trips; at present time it is refreshed at most
|
|
+ // every DROIDDECK_WSI_BYPASS_CHECK_MS (default 0 = every present; DroidDeck's Performance mode sets 100).
|
|
+ std::optional<bool> presentBypass;
|
|
+ bool presentBypassHdr = false;
|
|
+ uint64_t presentBypassNs = 0;
|
|
+
|
|
+ static uint64_t presentBypassIntervalNs() {
|
|
+ static const uint64_t interval = [] {
|
|
+ const char *v = getenv("DROIDDECK_WSI_BYPASS_CHECK_MS");
|
|
+ return uint64_t(v && *v ? strtoull(v, nullptr, 10) : 0) * 1000000ull;
|
|
+ }();
|
|
+ return interval;
|
|
+ }
|
|
+
|
|
+ bool canBypassXWaylandAtPresent(bool hdrColorspace) {
|
|
+ if (isWayland())
|
|
+ return true;
|
|
+ timespec ts;
|
|
+ clock_gettime(CLOCK_MONOTONIC, &ts);
|
|
+ const uint64_t now = uint64_t(ts.tv_sec) * 1000000000ull + uint64_t(ts.tv_nsec);
|
|
+ if (!presentBypass || presentBypassHdr != hdrColorspace || now - presentBypassNs >= presentBypassIntervalNs()) {
|
|
+ presentBypass = canBypassXWayland(hdrColorspace);
|
|
+ presentBypassHdr = hdrColorspace;
|
|
+ presentBypassNs = now;
|
|
+ }
|
|
+ return *presentBypass;
|
|
+ }
|
|
+
|
|
bool isWayland() const {
|
|
// Is native Wayland?
|
|
return connection == nullptr;
|
|
@@ -1597,7 +1627,7 @@
|
|
continue;
|
|
}
|
|
|
|
- const bool canBypass = gamescopeSurface->canBypassXWayland(gamescopeSwapchain->isHdrColorspace);
|
|
+ const bool canBypass = gamescopeSurface->canBypassXWaylandAtPresent(gamescopeSwapchain->isHdrColorspace);
|
|
if (canBypass != gamescopeSwapchain->isBypassingXWayland) {
|
|
if (canBypass) {
|
|
if (!(gamescopeSurface->flags & GamescopeLayerClient::Flag::NoSuboptimal))
|