platforms/drm: Make context current before EGLStreams calls
attachStreamConsumer and resetOutput are not called as part of the scene render and as such the context might not be set. All credit goes to Simon Spinner for his investigation. BUG: 437573
This commit is contained in:
parent
1e5fae1e91
commit
600c1e0a54
1 changed files with 6 additions and 0 deletions
|
@ -196,6 +196,9 @@ void EglStreamBackend::attachStreamConsumer(KWaylandServer::SurfaceInterface *su
|
||||||
void *eglStream,
|
void *eglStream,
|
||||||
wl_array *attribs)
|
wl_array *attribs)
|
||||||
{
|
{
|
||||||
|
if (!m_outputs.isEmpty()) {
|
||||||
|
makeContextCurrent(m_outputs.first());
|
||||||
|
}
|
||||||
QVector<EGLAttrib> streamAttribs;
|
QVector<EGLAttrib> streamAttribs;
|
||||||
streamAttribs << EGL_WAYLAND_EGLSTREAM_WL << (EGLAttrib)eglStream;
|
streamAttribs << EGL_WAYLAND_EGLSTREAM_WL << (EGLAttrib)eglStream;
|
||||||
EGLAttrib *attribArray = (EGLAttrib *)attribs->data;
|
EGLAttrib *attribArray = (EGLAttrib *)attribs->data;
|
||||||
|
@ -224,6 +227,9 @@ void EglStreamBackend::attachStreamConsumer(KWaylandServer::SurfaceInterface *su
|
||||||
|
|
||||||
connect(surface, &KWaylandServer::SurfaceInterface::destroyed, this,
|
connect(surface, &KWaylandServer::SurfaceInterface::destroyed, this,
|
||||||
[surface, this]() {
|
[surface, this]() {
|
||||||
|
if (!m_outputs.isEmpty()) {
|
||||||
|
makeContextCurrent(m_outputs.first());
|
||||||
|
}
|
||||||
const StreamTexture &st = m_streamTextures.take(surface);
|
const StreamTexture &st = m_streamTextures.take(surface);
|
||||||
pEglDestroyStreamKHR(eglDisplay(), st.stream);
|
pEglDestroyStreamKHR(eglDisplay(), st.stream);
|
||||||
glDeleteTextures(1, &st.texture);
|
glDeleteTextures(1, &st.texture);
|
||||||
|
|
Loading…
Reference in a new issue