Heads up: proposed Mir platform changes
-
As a part of getting the NVIDIA binary platform up to a fully-supported state (and, in particular, supporting EGL clients) I'm proposing some changes to the core interfaces Mir provides from the platform.
Specifically, the interface that client buffers provide the renderer will change from
gl::TextureSource
(a thing that can be uploaded into a GL texture) togl::Texture
(a thing that is a GL texture, and provides a shader that will render said texture).This is of interest to Unity8 developers in two ways:
- It changes the interfaces that the
android
platform has to provide to the rest of Mir, and - It changes the interface that
QtMir
's renderer uses to extract the content of client buffers for rendering in the Qt scene.
I don't believe that these changes will be difficult for either end to adapt to, but please check out the merge proposal and feel free to give feedback if this new interface is difficult for either end of UBports.
- It changes the interfaces that the
-
So, I've had a chat with Gerry Boland (former primary developer of QtMir) and while this is not entirely straightforward to adapt QtMir to it does look feasible.
The relevant changes would be in MirSurfaceItem. Excerpts of the relevant IRC log:
to provide shaders, need to implement QSGMaterial somehow - https://doc.qt.io/qt-5/qsgsimplematerialshader.html
and then use it in https://doc.qt.io/qt-5/qsggeometrynode.html#setMaterial
https://codereview.qt-project.org/#/c/70577/7/lib/yuv_video_node.cpp looks vaguely appropriate.
YUVAVideoMaterial is an implementation of QSGMaterial, whose createShader() implementation returns that handy QSGMaterialShader
I think that's a good template to follow
QtMir would need to have aQSGMaterial
that also derived frommir::graphics::gl::Program
, and took the necessary shader fragments and smushed them into the shader source it returns.
Provide that as themir::graphics::gl::ProgramFactory
and then theTexture
will supply you with the appropriateQSGMaterial