Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source generation script rewrite #318

Open
mariob92 opened this issue Aug 27, 2021 · 10 comments
Open

Source generation script rewrite #318

mariob92 opened this issue Aug 27, 2021 · 10 comments

Comments

@mariob92
Copy link

Hello,

I'm writing a new source generation script from scratch.

If you are interested: https://github.com/MarBg92/glew/tree/source-gen-python
It's in an early state yet, but it can already generate the wglew.h file.

Improvements:

  • It's far more faster: Don't need to download the whole OpenGL registry, it only needs the .xml files
  • It doesn't need to scan the extension specification text files and so it don't needs those ugly helper scripts (filter_gl_ext.sh) to hack in some missing function and enum definitions. (I haven't checked every single entry, but the few I have checked are all present in the .xml files)

At the moment there is no support for the GL_REGAL_* extensions (from the glfixes repo) yet, because it seems that this is no part of the official OpenGL Registry, but it should be no problem to write a small .xml file which then can be parsed in.

@nigels-com
Copy link
Owner

I applaud the effort to replace the Perl, Bash and Makefile code generation.
If you can reach parity (generate the same code) it would be good for GLEW to switch over.
Just so you know, there is some Python there already, but isn't a complete replacement, yet.

Things like Regal extensions probably don't matter in the real world, but it's hard to say for sure.
I've been reluctant to curate, aiming for backwards compatibility for the most part.

@nigels-com
Copy link
Owner

Anything further about this?

@mariob92
Copy link
Author

mariob92 commented Apr 2, 2022

I haven't done much on this in the last time, but there is already some progress.
eglew.h, glxew.h and wglew.h can already be generated. I look forward to implement glew.h, glew.c and glewinfo.c soon.

But it would be hard to guarantee full backwards compatibility because GLEW has some legacy extensions (mostly REGAL and ANGLE) that are not part of the official OpenGL Registry. Maybe they can be hard coded into the source files.

@nigels-com
Copy link
Owner

Not hard to author a residual XML for REGAL, ANGLE etc.
Don't let that be a blocker.
But there will be a bunch of other nit-picky differences, I imagine.

@eabase
Copy link

eabase commented Feb 15, 2025

Link in OP is dead.
What's that status of this?
Can't be that difficult to rewrite to Py3. Probably an average AI can do it in a few seconds.

@nigels-com
Copy link
Owner

The status is that this is awaiting a contribution.
It's not strictly necessary, but it would be nice to have, for sure.

@eabase
Copy link

eabase commented Feb 15, 2025

Can you point me to the script(s) that need to be updated?

@nigels-com
Copy link
Owner

nigels-com commented Feb 15, 2025

The perl scripts are located here in auto/bin.
My perl is not great, and not getting any better over the years.
If AI can convert it to Python3 and the output matches the perl, that would be impressive! Try it! 😄

@eabase
Copy link

eabase commented Feb 16, 2025

Oooh Noo! Not Perl!

I was reading Python in the linked issue.
I might be able to help with the Python, but Perl is PITA as it's SED RegEx++ all the way , even if you know Bash well. We need an AI to port that code top python or something.

@nigels-com
Copy link
Owner

LOL! Well, it works. And in a pinch I can coax it to do what's needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants