From 45cd621b9ed1c7e8dc73f51d2f6ad21ce272a22c Mon Sep 17 00:00:00 2001 From: Jack Greiner Date: Sat, 5 Oct 2024 09:50:33 -0400 Subject: [PATCH] Add fix for https://github.com/ValveSoftware/gamescope/issues/1218 --- 001-fix-sdl-backend-on-rx580.patch | 11 --------- 001-pr-1548.patch | 39 ++++++++++++++++++++++++++++++ gamescope.spec | 2 +- 3 files changed, 40 insertions(+), 12 deletions(-) delete mode 100644 001-fix-sdl-backend-on-rx580.patch create mode 100644 001-pr-1548.patch diff --git a/001-fix-sdl-backend-on-rx580.patch b/001-fix-sdl-backend-on-rx580.patch deleted file mode 100644 index 68cddfe..0000000 --- a/001-fix-sdl-backend-on-rx580.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/rendervulkan.cpp 2024-10-05 08:39:13.515975808 -0400 -+++ b/src/rendervulkan.cpp 2024-10-05 08:40:56.954189908 -0400 -@@ -2799,7 +2799,7 @@ - } - else - { -- if ( !GetBackend()->SupportsFormat( drmFormat ) ) -+ if ( GetBackend()->UsesModifiers() && !GetBackend()->SupportsFormat( drmFormat ) ) - return false; - - wlr_drm_format_set_add( &sampledDRMFormats, drmFormat, DRM_FORMAT_MOD_INVALID ); diff --git a/001-pr-1548.patch b/001-pr-1548.patch new file mode 100644 index 0000000..c7d7307 --- /dev/null +++ b/001-pr-1548.patch @@ -0,0 +1,39 @@ +From c9cda2e202a16078a6dd06f95d3e5bf5dd36708c Mon Sep 17 00:00:00 2001 +From: laurirasanen +Date: Sun, 29 Sep 2024 19:54:49 +0300 +Subject: [PATCH] rendervulkan: Fix getting drm formats on sdl backend + +--- + src/rendervulkan.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/rendervulkan.cpp b/src/rendervulkan.cpp +index d61fd73ea..4c9010438 100644 +--- a/src/rendervulkan.cpp ++++ b/src/rendervulkan.cpp +@@ -2059,7 +2059,7 @@ bool CVulkanTexture::BInit( uint32_t width, uint32_t height, uint32_t depth, uin + assert( drmFormat == pDMA->format ); + } + +- if ( GetBackend()->UsesModifiers() && g_device.supportsModifiers() && pDMA && pDMA->modifier != DRM_FORMAT_MOD_INVALID ) ++ if ( g_device.supportsModifiers() && pDMA && pDMA->modifier != DRM_FORMAT_MOD_INVALID ) + { + VkExternalImageFormatProperties externalImageProperties = { + .sType = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES, +@@ -2781,14 +2781,14 @@ bool vulkan_init_format(VkFormat format, uint32_t drmFormat) + uint64_t modifier = modifierProps[j].drmFormatModifier; + + if ( !is_image_format_modifier_supported( format, drmFormat, modifier ) ) +- continue; ++ continue; + + if ( ( modifierProps[j].drmFormatModifierTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT ) == 0 ) + { + continue; + } + +- if ( !gamescope::Algorithm::Contains( GetBackend()->GetSupportedModifiers( drmFormat ), modifier ) ) ++ if ( GetBackend()->UsesModifiers() && !gamescope::Algorithm::Contains( GetBackend()->GetSupportedModifiers( drmFormat ), modifier ) ) + continue; + + wlr_drm_format_set_add( &sampledDRMFormats, drmFormat, modifier ); diff --git a/gamescope.spec b/gamescope.spec index aa5d516..5a9d8b1 100644 --- a/gamescope.spec +++ b/gamescope.spec @@ -13,7 +13,7 @@ License: BSD URL: https://github.com/ValveSoftware/gamescope # Create stb.pc to satisfy dependency('stb') Source0: stb.pc -Patch0: 001-fix-sdl-backend-on-rx580.patch +Patch0: 001-pr-1548.patch Patch1: 002-pr-1231.patch BuildRequires: meson >= 0.54.0