Skip to content

Commit

Permalink
Merge pull request #475 from Jovian-Experiments/gamescope-3.16
Browse files Browse the repository at this point in the history
gamescope{,-session}: 3.15.15 -> 3.16.1-1 + 32-bit crash fix
  • Loading branch information
K900 authored Feb 4, 2025
2 parents e8a9343 + 414e29f commit 8b90c8d
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkgs/gamescope-session/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ let
};
in stdenv.mkDerivation(finalAttrs: {
pname = "gamescope-session";
version = "3.15.15-1";
version = "3.16.1-1";

src = fetchFromGitHub {
owner = "Jovian-Experiments";
repo = "PKGBUILDs-mirror";
rev = "jupiter-main/gamescope-${finalAttrs.version}";
hash = "sha256-/Jpfg592UcQtlSVKInQyA5cT9EjVZ+XvpLMjIu/b4iU=";
hash = "sha256-vaUyDvCHseIYOQ7yQKLfa0QhiDt3nSPjEgidQRTj8v0=";
};

patches = [
Expand Down
59 changes: 59 additions & 0 deletions pkgs/gamescope/32bit-crash-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
From ec4e002c4b84ffbe008198fc2d39f4aecc0e0e56 Mon Sep 17 00:00:00 2001
From: Matthew Schwartz <matthew.schwartz@linux.dev>
Date: Fri, 31 Jan 2025 17:21:47 -0800
Subject: [PATCH] layer: Fix 32-bit layer crash
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Some fprintf pointers added in "layer: Fix oldSwapchain when going in/out
of XWayland bypassing" will crash when executed in the 32-bit WSI layer.

GCC also warns about the pointer usage when compiling the 32-bit layer:
"warning: format ‘%p’ expects argument of type ‘void*’, but argument 3
has type ‘VkSwapchainKHR’ {aka ‘long long unsigned int’} [-Wformat=]"

To keep it simple, let's just reinterpret_cast the problematic pointers
to void*.

Closes: #1718
Closes: #1736
---
layer/VkLayer_FROG_gamescope_wsi.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/layer/VkLayer_FROG_gamescope_wsi.cpp b/layer/VkLayer_FROG_gamescope_wsi.cpp
index 718a2604f3..5bd1408bf7 100644
--- a/layer/VkLayer_FROG_gamescope_wsi.cpp
+++ b/layer/VkLayer_FROG_gamescope_wsi.cpp
@@ -1076,9 +1076,9 @@ namespace GamescopeWSILayer {
gamescope_swapchain_destroy(state->object);
}
GamescopeSwapchain::remove(swapchain);
- fprintf(stderr, "[Gamescope WSI] Destroying swapchain: %p\n", swapchain);
+ fprintf(stderr, "[Gamescope WSI] Destroying swapchain: %p\n", reinterpret_cast<void*>(swapchain));
pDispatch->DestroySwapchainKHR(device, swapchain, pAllocator);
- fprintf(stderr, "[Gamescope WSI] Destroyed swapchain: %p\n", swapchain);
+ fprintf(stderr, "[Gamescope WSI] Destroyed swapchain: %p\n", reinterpret_cast<void*>(swapchain));
}

static VkResult CreateSwapchainKHR(
@@ -1160,7 +1160,7 @@ namespace GamescopeWSILayer {

fprintf(stderr, "[Gamescope WSI] Creating swapchain for xid: 0x%0x - oldSwapchain: %p - provided minImageCount: %u - minImageCount: %u - format: %s - colorspace: %s - flip: %s\n",
gamescopeSurface->window,
- pCreateInfo->oldSwapchain,
+ reinterpret_cast<void*>(pCreateInfo->oldSwapchain),
pCreateInfo->minImageCount,
minImageCount,
vkroots::helpers::enumString(pCreateInfo->imageFormat),
@@ -1241,7 +1241,7 @@ namespace GamescopeWSILayer {

fprintf(stderr, "[Gamescope WSI] Created swapchain for xid: 0x%0x swapchain: %p - imageCount: %u\n",
gamescopeSurface->window,
- *pSwapchain,
+ reinterpret_cast<void*>(*pSwapchain),
imageCount);

gamescope_swapchain_swapchain_feedback(

8 changes: 6 additions & 2 deletions pkgs/gamescope/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
# version shipped by the vendor, ensuring feature level is equivalent.

gamescope'.overrideAttrs(old: rec {
version = "3.15.15";
version = "3.16.1";

src = fetchFromGitHub {
owner = "ValveSoftware";
repo = "gamescope";
rev = version;
fetchSubmodules = true;
hash = "sha256-FiPSGzfA3YH9TED8E5hpfpd+IQGthvwsxAFXZuqVZ4Q=";
hash = "sha256-+0QGt4UADJmZok2LzvL+GBad0t4vVL4HXq27399zH3Y=";
};

patches = old.patches or [] ++ [
./32bit-crash-fix.patch
];
})

0 comments on commit 8b90c8d

Please sign in to comment.