Skip to content

WIP: GL4ES compatibility#1902

Draft
illwieckz wants to merge 10 commits intomasterfrom
illwieckz/gl4es
Draft

WIP: GL4ES compatibility#1902
illwieckz wants to merge 10 commits intomasterfrom
illwieckz/gl4es

Conversation

@illwieckz
Copy link
Member

@illwieckz illwieckz commented Feb 18, 2026

I flag it as draft to make it obvious I'm not intending to merge this for the 0.56 release.

I'm just pushing it because it's somewhat usable and as Linus Torvalds said once:

Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it ;)

This implements some compatibility code path making possible to run the Dæmon engine and the Unvanquished game on OpenGL ES hardware using the GL4ES translation layer.

In fact this basically implements some compatibility code path for GL ES 2 (what currently targets GL4ES) for when GL4ES isn't able to translate OpenGL to GL ES because of GL ES limitation.

The purpose of this is to allow me to test the engine on more hardware. I used this to confirm the bug we observe on PowerVR-derivated hardware like Apple AGX/Moore Threads is indeed reproducible on PowerVR:

The only Imagination-branded PowerVR device I own is soldered on a RISC-V board, and while there is a Vulkan Mesa driver being on development for it (purposed to be a backend for the Mesa zink OpenGL translation layer), the RISC-V architecture of the said board is very new and then the whole Linux support is experimental and so getting the game running on GL4ES is far less work than doing platform-enablement at the whole distro level. So that allows me to use the proprietary OpenGL ES Imagination driver for PowerVR which is bundled with the distro provided for the board (the Proprietary Imagination Vulkan driver isn't featureful enough to run Zink). I even don't have to rebuild neither the kernel, neither Mesa!

This also brings more rewrite of existing compatibility code in a better way.

I started to implement ways to detect the underlying hardware when running API translators, this may be extended to things like VirGL, Zink or Parallels in the future.

GL4ES actually added such wanted feature on my request:

I have more ideas for some rework on the driver/hardware detection (especially moving things like TRANSLATOR to a different variable than HARDWARE).

So this doesn't only benefit GL4ES and PowerVR.

@illwieckz illwieckz marked this pull request as draft February 18, 2026 05:28
{
Log::Debug( "Building concatenated %s program.", shaderTypeName[ concatenated.type ] );
// WIP
// Log::Warn( "Concatenated source:\n<<<\n%s\n>>>", concatenated.shaderSource );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: delete this

"Disable mat3x2 GLSL support on GL4ES",
Cvar::NONE, true );
static Cvar::Cvar<bool> workaround_glDriver_gl4es_disableTexture3D(
"workaround.glDriver.gl4es.disableTexture3D",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename glDriver as glTranslator, as we would also be able to detect the underlying driver and route code from that detection.

@illwieckz
Copy link
Member Author

illwieckz commented Feb 18, 2026

On a side note, as recently discussed on the Chat, this may help us to port the game to Android.

There are three kinds of requirements for Android:

  • Build support, figured out (patches unmerged, but they do exist, we can already run a server with those patches)
  • NaCl support (work in progress) or Wasm.
  • GLES (directly or through GL4ES, this) or Vulkan (work in progress) when Vulkan is available.

This assuming a Linux-like environment on Android, like Termux. Direct Android integration would require more work.

@illwieckz illwieckz changed the title Draft: GL4ES compatibility WIP: GL4ES compatibility Feb 18, 2026
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.

1 participant

Comments