wayland/screencopy: support dmabufs in vulkan mode

This commit is contained in:
reakjra 2026-02-09 18:20:14 +01:00 committed by outfoxxed
parent 158db16b93
commit a99519c3ad
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
8 changed files with 375 additions and 2 deletions

View file

@ -13,6 +13,7 @@
#include <qqmlengine.h>
#include <qqmlinfo.h>
#include <qqmllist.h>
#include <qquickgraphicsconfiguration.h>
#include <qquickitem.h>
#include <qquickwindow.h>
#include <qregion.h>
@ -147,6 +148,15 @@ void ProxyWindowBase::ensureQWindow() {
this->window = nullptr; // createQQuickWindow may indirectly reference this->window
this->window = this->createQQuickWindow();
this->window->setFormat(format);
// needed for vulkan dmabuf import, qt ignores these if not applicable
auto graphicsConfig = this->window->graphicsConfiguration();
graphicsConfig.setDeviceExtensions({
"VK_KHR_external_memory_fd",
"VK_EXT_external_memory_dma_buf",
"VK_EXT_image_drm_format_modifier",
});
this->window->setGraphicsConfiguration(graphicsConfig);
}
void ProxyWindowBase::createWindow() {