Skip to content

Commit f0c0c6a

Browse files
matte-schwartzmisyltoad
authored andcommitted
layer: Fix 32-bit layer crash
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
1 parent bafa157 commit f0c0c6a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: layer/VkLayer_FROG_gamescope_wsi.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1082,9 +1082,9 @@ namespace GamescopeWSILayer {
10821082
gamescope_swapchain_destroy(state->object);
10831083
}
10841084
GamescopeSwapchain::remove(swapchain);
1085-
fprintf(stderr, "[Gamescope WSI] Destroying swapchain: %p\n", swapchain);
1085+
fprintf(stderr, "[Gamescope WSI] Destroying swapchain: %p\n", reinterpret_cast<void*>(swapchain));
10861086
pDispatch->DestroySwapchainKHR(device, swapchain, pAllocator);
1087-
fprintf(stderr, "[Gamescope WSI] Destroyed swapchain: %p\n", swapchain);
1087+
fprintf(stderr, "[Gamescope WSI] Destroyed swapchain: %p\n", reinterpret_cast<void*>(swapchain));
10881088
}
10891089

10901090
static VkResult CreateSwapchainKHR(
@@ -1166,7 +1166,7 @@ namespace GamescopeWSILayer {
11661166

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

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

12531253
gamescope_swapchain_swapchain_feedback(

0 commit comments

Comments
 (0)