Problem with PyQt, SIP openGL on macos ARM

Iván Yossi ghevan at gmail.com
Mon Jul 26 15:08:38 BST 2021


Hi, Im a developer at krita and we use sip an pyqt extensively, however after upgrading  SIP to version 6.1.1 and PyQt to 5.15 openGL we encountered a problem only on macos on arm arquitecture.

The problem in question is a black texture loaded and is shown on terminal as:

qt.qpa.openglcontext: Could not create NSOpenGLContext with shared context, falling back to unshared context.
Warning: Photoshop IRB data is not padded to even size
qt.qpa.openglcontext: Could not create NSOpenGLContext with shared context, falling back to unshared context.
UNSUPPORTED (log once): POSSIBLE ISSUE: unit 0 GLD_TEXTURE_INDEX_2D is unloadable and bound to sampler type (Float) - using zero texture because texture unloadable
CoreSVG has logged an error. Set environment variabe "CORESVG_VERBOSE" to learn more.

digging around it seems the problem is that on arm macOS the M1 chip openGL initialization is very sensitve needing the QSurfaceFormat initialization (version 4.1 is prefered and Coreprofile) be done  before any openGL context is loaded.

The code in krita loads openGL like this and using SIP 4.19.19 does show the correct textures on arm native binaries, however this is not the case when moving to the more recent SIP. I tried to dig on pyqt and sip code but im unfamiliar and could not come up with anything useful. However I can test any patch or idea that could lead to a successful texture loading on arm macOS when using current SIP.

Iván Yossi
<ghevan at gmail.com>
IRC: ivanyossi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210726/d5ee9dd2/attachment.htm>


More information about the PyQt mailing list