platformsupport/scenes/opengl: fix format filtering
We support formats that are neither 10 nor 8 bits per color, so the filtering needs to reflect that
This commit is contained in:
parent
ea75c094a9
commit
d0a9e90716
1 changed files with 11 additions and 4 deletions
|
@ -149,14 +149,21 @@ void AbstractEglBackend::initWayland()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto filterFormats = [this](uint32_t bpc) {
|
auto filterFormats = [this](std::optional<uint32_t> bpc) {
|
||||||
const auto formats = m_display->supportedDrmFormats();
|
const auto formats = m_display->supportedDrmFormats();
|
||||||
QHash<uint32_t, QList<uint64_t>> set;
|
QHash<uint32_t, QList<uint64_t>> set;
|
||||||
for (auto it = formats.constBegin(); it != formats.constEnd(); it++) {
|
for (auto it = formats.constBegin(); it != formats.constEnd(); it++) {
|
||||||
const auto info = formatInfo(it.key());
|
const auto info = formatInfo(it.key());
|
||||||
if (info && info->bitsPerColor == bpc) {
|
if (!info || (bpc && bpc != info->bitsPerColor)) {
|
||||||
set.insert(it.key(), it.value());
|
continue;
|
||||||
}
|
}
|
||||||
|
const bool duplicate = std::any_of(m_tranches.begin(), m_tranches.end(), [fmt = it.key()](const auto &tranche) {
|
||||||
|
return tranche.formatTable.contains(fmt);
|
||||||
|
});
|
||||||
|
if (duplicate) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
set.insert(it.key(), it.value());
|
||||||
}
|
}
|
||||||
return set;
|
return set;
|
||||||
};
|
};
|
||||||
|
@ -175,7 +182,7 @@ void AbstractEglBackend::initWayland()
|
||||||
m_tranches.append({
|
m_tranches.append({
|
||||||
.device = deviceId(),
|
.device = deviceId(),
|
||||||
.flags = {},
|
.flags = {},
|
||||||
.formatTable = filterFormats(-1),
|
.formatTable = filterFormats(std::nullopt),
|
||||||
});
|
});
|
||||||
|
|
||||||
LinuxDmaBufV1ClientBufferIntegration *dmabuf = waylandServer()->linuxDmabuf();
|
LinuxDmaBufV1ClientBufferIntegration *dmabuf = waylandServer()->linuxDmabuf();
|
||||||
|
|
Loading…
Reference in a new issue