Skip to content

Commit

Permalink
fix gamescope for older GPUs (#1930)
Browse files Browse the repository at this point in the history
* gamescope: make the SDL backend the default backend for all builds

* add back funny patches

* Obsolete gamescope-legacy with wrapper script, fix multiarch subpackage

* fix dependency issue

* terra downstream script patches

* add the ctrl patch properly

* revert

* update to 3.15.0

* simplify wrapper script

* handle calling gamescope-legacy from non-gamescope session

* Use my PR patch for gamescope fallback

* format patch from github

* update patch

---------

Signed-off-by: Cappy Ishihara <[email protected]>
  • Loading branch information
korewaChino authored Aug 25, 2024
1 parent 36362e0 commit e334d5d
Show file tree
Hide file tree
Showing 13 changed files with 395 additions and 671 deletions.
36 changes: 36 additions & 0 deletions anda/games/gamescope/0001-cstdint.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From 5529e8ac8f3232ec6233e33286834548e1d8018d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <[email protected]>
Date: Sun, 8 Oct 2023 22:10:33 +0200
Subject: [PATCH] <cstdint>

---
src/reshade/source/effect_parser_stmt.cpp | 1 +
src/reshade/source/effect_token.hpp | 1 +
2 files changed, 2 insertions(+)

diff --git a/src/reshade/source/effect_parser_stmt.cpp b/src/reshade/source/effect_parser_stmt.cpp
index 7829729..f126be2 100644
--- a/src/reshade/source/effect_parser_stmt.cpp
+++ b/src/reshade/source/effect_parser_stmt.cpp
@@ -9,6 +9,7 @@
#include <cctype> // std::toupper
#include <cassert>
#include <functional>
+#include <limits>
#include <string_view>

struct on_scope_exit
diff --git a/src/reshade/source/effect_token.hpp b/src/reshade/source/effect_token.hpp
index 072d439..e4bb633 100644
--- a/src/reshade/source/effect_token.hpp
+++ b/src/reshade/source/effect_token.hpp
@@ -5,6 +5,7 @@

#pragma once

+#include <cstdint>
#include <string>
#include <vector>

--
2.41.0
21 changes: 21 additions & 0 deletions anda/games/gamescope/0001-limits.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
From 88ce1e5de62886aa14c74421cde6130e16e70d7d Mon Sep 17 00:00:00 2001
From: psykose <[email protected]>
Date: Sat, 6 Jul 2024 20:52:50 +0200
Subject: [PATCH] utils: include limits.h for PATH_MAX

---
src/Utils/Process.cpp | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/Utils/Process.cpp b/src/Utils/Process.cpp
index e71786f75..3e748e0d3 100644
--- a/src/Utils/Process.cpp
+++ b/src/Utils/Process.cpp
@@ -21,6 +21,7 @@
#include <pthread.h>
#include <stdlib.h>
#include <dirent.h>
+#include <limits.h>
#include <unistd.h>
#include <sys/types.h>
#include <signal.h>
239 changes: 0 additions & 239 deletions anda/games/gamescope/1231.patch

This file was deleted.

34 changes: 34 additions & 0 deletions anda/games/gamescope/1483.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From ca58cb2453e6d9ef44d799e394ee9950b7a35b30 Mon Sep 17 00:00:00 2001
From: Cappy Ishihara <[email protected]>
Date: Wed, 21 Aug 2024 03:56:53 +0700
Subject: [PATCH] Check if current GPU supports Vulkan DRM modifiers when
`--backend=auto` is used.

This works around #1218 by making use of the new backend option added in #1321,
but adds a check to automatically fall back to the SDL backend if the current
GPU does not support Vulkan DRM modifiers.
---
src/main.cpp | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/main.cpp b/src/main.cpp
index ca4001249..bc6b16904 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -817,9 +817,13 @@ int main(int argc, char **argv)
if ( eCurrentBackend == gamescope::GamescopeBackend::Auto )
{
if ( g_pOriginalWaylandDisplay != NULL )
- eCurrentBackend = gamescope::GamescopeBackend::Wayland;
- else if ( g_pOriginalDisplay != NULL )
- eCurrentBackend = gamescope::GamescopeBackend::SDL;
+ // Additional check if the current GPU supports Vulkan DRM modifiers
+ // Fallback to SDL if not supported (e.g Older AMD GPUs like Polaris 10/20)
+ if ( vulkan_supports_modifiers() )
+ eCurrentBackend = gamescope::GamescopeBackend::Wayland;
+ else
+ eCurrentBackend = gamescope::GamescopeBackend::SDL;
+
else
eCurrentBackend = gamescope::GamescopeBackend::DRM;
}
Loading

0 comments on commit e334d5d

Please sign in to comment.