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.
This commit is contained in:
Xaver Hugl 2024-08-15 01:06:15 +02:00
parent 2cc3f9cdee
commit 61ef8c0087

View file

@ -308,7 +308,11 @@ QHash<uint32_t, EglDisplay::DrmFormatInfo> EglDisplay::queryImportFormats() cons
if (!drmFormatInfo.allModifiers.empty()) {
if (!drmFormatInfo.allModifiers.contains(DRM_FORMAT_MOD_INVALID)) {
drmFormatInfo.allModifiers.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);
}