Commit 5338d1a2 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

backends: We need to make current before calling importDmaBufAsTexture

Calls it for the WaylandBackend, ensures the declaration of the pointer
to the EglBackend in the drm case is done in the correct scope.
parent e25a86bc
Pipeline #192660 passed with stage
in 25 minutes and 30 seconds
......@@ -648,7 +648,6 @@ std::optional<DmaBufParams> DrmBackend::testCreateDmaBuf(const QSize &size, quin
std::shared_ptr<DmaBufTexture> DrmBackend::createDmaBufTexture(const QSize &size, quint32 format, uint64_t modifier)
{
const auto eglBackend = dynamic_cast<EglGbmBackend *>(m_renderBackend);
QVector<uint64_t> mods = {modifier};
gbm_bo *bo = createBo(size, format, mods);
if (!bo) {
......@@ -658,6 +657,7 @@ std::shared_ptr<DmaBufTexture> DrmBackend::createDmaBufTexture(const QSize &size
// The bo will be kept around until the last fd is closed.
const DmaBufAttributes attributes = dmaBufAttributesForBo(bo);
gbm_bo_destroy(bo);
const auto eglBackend = static_cast<EglGbmBackend *>(m_renderBackend);
eglBackend->makeCurrent();
return std::make_shared<DmaBufTexture>(eglBackend->importDmaBufAsTexture(attributes), attributes);
}
......
......@@ -1050,6 +1050,7 @@ std::shared_ptr<DmaBufTexture> WaylandBackend::createDmaBufTexture(const QSize &
// The bo will be kept around until the last fd is closed.
const DmaBufAttributes attributes = dmaBufAttributesForBo(bo);
gbm_bo_destroy(bo);
m_eglBackend->makeCurrent();
return std::make_shared<DmaBufTexture>(m_eglBackend->importDmaBufAsTexture(attributes), attributes);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment