From cf0b11ea3e17fd533c0f76946dd9c4967a6ba99d Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Wed, 9 Jul 2025 20:49:58 +0500 Subject: [PATCH] fix: added workaround for work with nvk Signed-off-by: Boris Yumankulov --- usr/bin/portproton-gamescope | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/usr/bin/portproton-gamescope b/usr/bin/portproton-gamescope index 4fd0c9b..c015193 100755 --- a/usr/bin/portproton-gamescope +++ b/usr/bin/portproton-gamescope @@ -7,23 +7,19 @@ for i in "${HOME}"/.config/environment.d/*.conf; do done set +a -# Fix intel color corruption -# might come with some performance degradation but is better than a corrupted -# color image -export INTEL_DEBUG=norbc -export mesa_glthread=true +# Gamescope parameters +GAMESCOPE_PARAMS="" -# This should be used by default by gamescope. Cannot hurt to force it anyway. -# Reported better framelimiting with this enabled -export ENABLE_GAMESCOPE_WSI=1 - -# Some environment variables by default (taken from Deck session) -export SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0 - -# Add custom vulkan adapter if specified -if [ -n "$VULKAN_ADAPTER" ]; then - GAMESCOPECMD= " --prefer-vk-device $VULKAN_ADAPTER" +# Check if NVK driver is in use +if vulkaninfo 2>/dev/null | grep -i "driverName" | grep -q "NVK"; then + # Workaround for https://gitlab.freedesktop.org/mesa/mesa/-/issues/13478 + GAMESCOPE_PARAMS+=" --backend sdl -f" fi -# Start client application -gamescope $GAMESCOPECMD -- portprotonqt --fullscreen +# Prefer a specific Vulkan adapter if defined +if [ -n "$VULKAN_ADAPTER" ]; then + GAMESCOPE_PARAMS+=" --prefer-vk-device $VULKAN_ADAPTER" +fi + +# Start client application with Gamescope +gamescope $GAMESCOPE_PARAMS -- portprotonqt --fullscreen