Skip to content

pcmi: add support for OpenGL ES 3.0#3094

Merged
j9ac9k merged 2 commits intopyqtgraph:masterfrom
pijyoi:pcmi-gles3
Jul 13, 2024
Merged

pcmi: add support for OpenGL ES 3.0#3094
j9ac9k merged 2 commits intopyqtgraph:masterfrom
pijyoi:pcmi-gles3

Conversation

@pijyoi
Copy link
Copy Markdown
Contributor

@pijyoi pijyoi commented Jul 13, 2024

On master, the OpenGL implementation of PColorMeshItem uses GLSL 1.40 if the OpenGL version is detected to be >= 3.1, otherwise it falls back to shaders that are compatible with both OpenGL 2.0 and OpenGL ES 2.0.

This would fail on a system with OpenGL ES >= 3.1, as the GLSL 1.40 shaders are not compatible.

This PR makes the flat shaders compatible with OpenGL ES >= 3.0.

However, I don't have a system with OpenGL ES 3.0 and a Qt compiled against OpenGL ES to actually test it out.
(A Raspberry Pi 4 running 32-bit Raspberry Pi OS would be such a candidate system)

A less ideal fix would be to unconditionally use the non-flat shaders if any version of OpenGL ES is being used.

@pijyoi
Copy link
Copy Markdown
Contributor Author

pijyoi commented Jul 13, 2024

It turns out that Raspberry Pi OS 32-bits does run on the RPI5 (It runs with a 64-bit kernel and 32-bit userland), so I was able to test out this PR to be working on an OpenGL ES >= 3.0 system and Qt libraries built against OpenGL ES.

The import also needs to be fixed to import PyQt5's ES2 module, since on such systems, only that module is available to be imported.

@pijyoi pijyoi marked this pull request as ready for review July 13, 2024 13:06
@pijyoi
Copy link
Copy Markdown
Contributor Author

pijyoi commented Jul 13, 2024

Also found out that on Raspberry Pi OS 32-bits (Bookworm),
while Qt5 is compiled against OpenGL ES,
Qt6 is compiled against OpenGL Desktop.

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Jul 13, 2024

Thanks @pijyoi for expanding capability! LGTM Merging.

@j9ac9k j9ac9k merged commit fa17ccf into pyqtgraph:master Jul 13, 2024
@pijyoi pijyoi deleted the pcmi-gles3 branch July 13, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants