From 61ef8c008743e97a08a675048a5854331f1ee55c Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 15 Aug 2024 01:06:15 +0200 Subject: [PATCH] opengl/egldisplay: add the invalid modifier to the correct list Adding the invalid modifier to nonExternalOnlyModifiers even for formats that otherwise only have external_only modifiers means that KWin will advertise support for this modifier to clients, but using the format without external_only samplers fails. --- src/opengl/egldisplay.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/opengl/egldisplay.cpp b/src/opengl/egldisplay.cpp index fb9dd383ab..b4e9a54b97 100644 --- a/src/opengl/egldisplay.cpp +++ b/src/opengl/egldisplay.cpp @@ -308,7 +308,11 @@ QHash EglDisplay::queryImportFormats() cons if (!drmFormatInfo.allModifiers.empty()) { if (!drmFormatInfo.allModifiers.contains(DRM_FORMAT_MOD_INVALID)) { drmFormatInfo.allModifiers.push_back(DRM_FORMAT_MOD_INVALID); - drmFormatInfo.nonExternalOnlyModifiers.push_back(DRM_FORMAT_MOD_INVALID); + if (!drmFormatInfo.nonExternalOnlyModifiers.empty()) { + drmFormatInfo.nonExternalOnlyModifiers.push_back(DRM_FORMAT_MOD_INVALID); + } else { + drmFormatInfo.externalOnlyModifiers.push_back(DRM_FORMAT_MOD_INVALID); + } } ret.insert(format, drmFormatInfo); }