[Interest] Metal-accelerated QPainter on macOS with MoltenGL?

Adam Twardoch (Lists) list.adam at twardoch.com
Sat Aug 25 01:23:57 CEST 2018


The QPainter calls used for 2D drawing can be run on QOpenGLPaintDevice.

http://doc.qt.io/qt-5/qopenglpaintdevice.html ) as shown in
http://doc.qt.io/qt-5/qtgui-openglwindow-example.html

I can construct a QOpenGLWidget and then possibly set the format to OpenGL
ES 2.0.

http://doc.qt.io/qt-5/qopenglwidget.html

The commercial MoltenGL library provides a live translation of OpenGL ES
2.0 into the Apple Metal API on macOS and iOS. Qt already has some
experience with MoltenVK (the Vulkan->Metal translation lib), but I think
MoltenGL is also interesting (I know that the developers of MoltenGL are
interested opensourcing the lib if they get some financial support, much
the same way they did with MoltenVK).

https://moltengl.com/moltengl/

Would it be possible to use the QPainter engine with QOpenGLWidget in such
a way that Qt actually “draws to MoltenGL” on macOS and then MoltenGL uses
Metal to accelerate the drawing?

Since Apple is deprecating OpenGL and there is currently no Vulkan-based
QPainter engine (where then MoltenVK could be used) — I think Qt widgets
with QOpenGLWidget that uses OpenGL ES 2.0 and with MoltenGL could provide
a sensible way forward for hardware-accelerared Qt widget rendering on the
Apple platforms.

But is this easily possible?

Regards,
Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180825/657ebe8a/attachment.html>


More information about the Interest mailing list