Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

GL loader work #276

Merged
merged 14 commits into from Feb 23, 2024
Merged

GL loader work #276

merged 14 commits into from Feb 23, 2024

Conversation

sfan5
Copy link
Member

@sfan5 sfan5 commented Jan 16, 2024

TODO:

  • make extpointer mandatory
  • figure out why the first commit broke world rendering on gles2 (not my fault?)
  • Drop unused exts from COGLESCoreExtensionHandler
  • Make COGLES2ExtensionHandler use loader
  • Make COGLES1ExtensionHandler use loader
  • Drop unused exts and functions from COpenGLExtensionHandler (big oof)
  • Make COpenGLExtensionHandler use loader
  • Enable unified OGLES2 everywhere
  • Drop legacy OGLES2 driver
  • Identify and migrate other GL calls (there are none)
  • Deal with glext.h ?!
  • macOS support should automatically start working at this point

Edit: I crossed half out because I'm not actually sure what the way forward is. The GLES2 driver has some sort of unified stuff where the new support code uses GL instead of direct calls, while I assume GLES1 is meant to be dropped and GL to be replaced by GL3.

Edit 2: currently achieved goals:

  • ogles2 is link-free
  • opengl3 is link-free
  • ogles1 and opengl are not link-free. this would be significant work for little gain because these are planned to be dropped.
  • macos is only possible with sdl now. possibly fixable by shipping a copy of glext.h (SDL doesn't work so well last time someone tested it)

@sfan5 sfan5 added the WIP Work-in-Progress label Jan 16, 2024
@sfan5 sfan5 mentioned this pull request Jan 16, 2024
29 tasks
@sfan5 sfan5 force-pushed the glsym branch 4 times, most recently from 4d957d2 to ceeb75c Compare January 17, 2024 10:23
@sfan5
Copy link
Member Author

sfan5 commented Jan 18, 2024

@numberZero thoughts?

@SmallJoker
Copy link
Member

(after requested in IRC)

I can confirm that OpenGL 2 still works (also with shaders) on Ubuntu/Linux, 64-bit. SDL2 / OpenGL 3 / OpenGL ES support not enabled.

@lhofhansl
Copy link
Contributor

lhofhansl commented Feb 17, 2024

I can confirm that OpenGL (4.6) still works on Linux, with shaders. FSAA also still works.
Browsed through the changes, all looks reasonable.

As stated above, only test on Linux.

@sfan5
Copy link
Member Author

sfan5 commented Feb 18, 2024

bad news: there's something wrong with either this PR or the unified GLES2 driver on Android:
test

nothing useful to be seen in the log, of course

@sfan5 sfan5 added the WIP Work-in-Progress label Feb 18, 2024
@grorp
Copy link
Member

grorp commented Feb 18, 2024

isn't this what it usually looks like when the Irrlicht shaders are missing?

@sfan5
Copy link
Member Author

sfan5 commented Feb 18, 2024

Yes, however I'm reasonably sure that they aren't missing. The assets ZIP has them at least.

Edit:

Added some debug output and loading them doesn't seem to be the issue:

02-18 15:32:07.331 31617   386 D Minetest: 2024-02-18 15:32:07: INFO[Main]: Irrlicht: Loaded 382 bytes for vertex shader Renderer2D.vsh
02-18 15:32:07.331 31617   386 D Minetest: 2024-02-18 15:32:07: INFO[Main]: Irrlicht: Loaded 334 bytes for frag shader Renderer2D.fsh
02-18 15:32:07.343 31617   386 D Minetest: 2024-02-18 15:32:07: INFO[Main]: Irrlicht: Loaded 382 bytes for vertex shader Renderer2D.vsh
02-18 15:32:07.343 31617   386 D Minetest: 2024-02-18 15:32:07: INFO[Main]: Irrlicht: Loaded 129 bytes for frag shader Renderer2D_noTex.fsh

@sfan5
Copy link
Member Author

sfan5 commented Feb 18, 2024

this is what renderdoc has to say about it:
grafik

also this:
grafik

@sfan5
Copy link
Member Author

sfan5 commented Feb 21, 2024

Fixed it.

@sfan5 sfan5 force-pushed the glsym branch 2 times, most recently from 9a4ab61 to 3a55467 Compare February 21, 2024 21:03
this makes the OpenGL 3 driver free of GL symbol references!
primary reason:
The unified GLES2 driver requires OpenGL headers (really), which Android does not provide.
Problem: Since the removal of !_IRR_OPENGL_USE_EXTPOINTER_ we require some quite recent
symbols to compile the legacy GL driver. (*) Since the previous commit we prefer including
them via SDL but those are sometimes too old.

(*) This was in fact always a problem since USE_EXTPOINTER is the default.
    I guess people just had recent enough headers usually.
@sfan5 sfan5 merged commit 6168210 into master Feb 23, 2024
38 checks passed
@sfan5 sfan5 deleted the glsym branch February 23, 2024 20:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants