chore: Update to gamescope 3.14.17

This commit is contained in:
Kyle Gospodnetich 2024-05-22 14:03:12 -07:00
parent e058a36bf9
commit 759d1eedfe
2 changed files with 2 additions and 103 deletions

View File

@ -2,11 +2,11 @@
%global _default_patch_fuzz 2
%global build_timestamp %(date +"%Y%m%d")
%global gamescope_tag 3.14.16
%global gamescope_tag 3.14.17
Name: gamescope
Version: 100.%{gamescope_tag}
Release: 3.bazzite
Release: 1.bazzite
Summary: Micro-compositor for video games on Wayland
License: BSD
@ -21,7 +21,6 @@ Patch2: disable-steam-touch-click-atom.patch
Patch3: external-rotation.patch
Patch4: panel-type.patch
Patch5: deckhd.patch
Patch6: modifiers.patch
BuildRequires: meson >= 0.54.0
BuildRequires: ninja-build

View File

@ -1,100 +0,0 @@
From 4ca3986582d7a45162da9c99e85044a8b9a0fd65 Mon Sep 17 00:00:00 2001
From: Joshua Ashton <joshua@froggi.es>
Date: Sat, 18 May 2024 18:47:52 +0100
Subject: [PATCH] wayland_backend: Hopefully fix GPUs wehere modifiers are not
supported
---
src/wayland_backend.cpp | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/src/wayland_backend.cpp b/src/wayland_backend.cpp
index a8b067320..ddc6c10df 100644
--- a/src/wayland_backend.cpp
+++ b/src/wayland_backend.cpp
@@ -73,6 +73,7 @@ namespace gamescope
gamescope::ConVar<bool> cv_wayland_mouse_warp_without_keyboard_focus( "wayland_mouse_warp_without_keyboard_focus", true, "Should we only forward mouse warps to the app when we have keyboard focus?" );
gamescope::ConVar<bool> cv_wayland_mouse_relmotion_without_keyboard_focus( "wayland_mouse_relmotion_without_keyboard_focus", false, "Should we only forward mouse relative motion to the app when we have keyboard focus?" );
+ gamescope::ConVar<bool> cv_wayland_use_modifiers( "wayland_use_modifiers", true, "Use DMA-BUF modifiers?" );
class CWaylandConnector;
class CWaylandPlane;
@@ -532,6 +533,8 @@ namespace gamescope
void SetFullscreen( bool bFullscreen ); // Thread safe, can be called from the input thread.
void UpdateFullscreenState();
+ bool SupportsFormat( uint32_t uDRMFormat ) const;
+
void SetHostCompositorIsCurrentlyVRR( bool bActive ) { m_bHostCompositorIsCurrentlyVRR = bActive; }
bool CurrentDisplaySupportsVRR() const { return m_bHostCompositorIsCurrentlyVRR; }
@@ -598,6 +601,7 @@ namespace gamescope
zwp_relative_pointer_v1 *m_pRelativePointer = nullptr;
std::unordered_map<uint32_t, std::vector<uint64_t>> m_FormatModifiers;
+ std::unordered_set<uint32_t> m_ModifierlessFormats;
std::unordered_map<uint32_t, wl_buffer *> m_ImportedFbs;
uint32_t m_uPointerEnterSerial = 0;
@@ -1270,15 +1274,15 @@ namespace gamescope
void CWaylandBackend::GetPreferredOutputFormat( VkFormat *pPrimaryPlaneFormat, VkFormat *pOverlayPlaneFormat ) const
{
VkFormat u8BitFormat = VK_FORMAT_UNDEFINED;
- if ( m_FormatModifiers.contains( DRM_FORMAT_ARGB8888 ) )
+ if ( SupportsFormat( DRM_FORMAT_ARGB8888 ) )
u8BitFormat = VK_FORMAT_B8G8R8A8_UNORM;
- else if ( m_FormatModifiers.contains( DRM_FORMAT_ABGR8888 ) )
+ else if ( SupportsFormat( DRM_FORMAT_ABGR8888 ) )
u8BitFormat = VK_FORMAT_R8G8B8A8_UNORM;
VkFormat u10BitFormat = VK_FORMAT_UNDEFINED;
- if ( m_FormatModifiers.contains( DRM_FORMAT_ABGR2101010 ) )
+ if ( SupportsFormat( DRM_FORMAT_ABGR2101010 ) )
u10BitFormat = VK_FORMAT_A2B10G10R10_UNORM_PACK32;
- else if ( m_FormatModifiers.contains( DRM_FORMAT_ARGB2101010 ) )
+ else if ( SupportsFormat( DRM_FORMAT_ARGB2101010 ) )
u10BitFormat = VK_FORMAT_A2R10G10B10_UNORM_PACK32;
assert( u8BitFormat != VK_FORMAT_UNDEFINED );
@@ -1478,10 +1482,16 @@ namespace gamescope
bool CWaylandBackend::UsesModifiers() const
{
- return true;
+ if ( !cv_wayland_use_modifiers )
+ return false;
+
+ return !m_FormatModifiers.empty();
}
std::span<const uint64_t> CWaylandBackend::GetSupportedModifiers( uint32_t uDrmFormat ) const
{
+ if ( !UsesModifiers() )
+ return std::span<const uint64_t>{};
+
auto iter = m_FormatModifiers.find( uDrmFormat );
if ( iter == m_FormatModifiers.end() )
return std::span<const uint64_t>{};
@@ -1744,6 +1754,13 @@ namespace gamescope
}
}
+ bool CWaylandBackend::SupportsFormat( uint32_t uDRMFormat ) const
+ {
+ return UsesModifiers()
+ ? m_FormatModifiers.contains( uDRMFormat )
+ : m_ModifierlessFormats.contains( uDRMFormat );
+ }
+
/////////////////////
// Wayland Callbacks
/////////////////////
@@ -1831,6 +1848,8 @@ namespace gamescope
//xdg_log.infof( "Modifier: %s (0x%" PRIX32 ") %lx", drmGetFormatName( uFormat ), uFormat, ulModifier );
if ( ulModifier != DRM_FORMAT_MOD_INVALID )
m_FormatModifiers[uFormat].emplace_back( ulModifier );
+ else
+ m_ModifierlessFormats.emplace( uFormat );
}
// Output