Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: New XML-based API Registry released

  1. #1
    Administrator Contributor
    Join Date
    Jan 2002
    Location
    Mt. View, CA
    Posts
    97

    New XML-based API Registry released

    The old gl.spec & related files are being retired, replaced by an XML-based description of the GL, GLX, WGL, GL ES, and EGL APIs as has been promised since slightly before the Dark Ages. The XML files & Python scripts to process them and generate headers are in the public-access portion of Khronos Subversion, and the GL, GLX, and WGL headers generated from them are also there and linked from the registry index.

    The GL, GLX, and WGL headers should be equivalent to the old headers generated from .spec, although they are structured differently and in some cases, enums and entry points have moved from one extension #if block to another (each extension / core version now references all the tokens and commands it introduces, even if some prior extension also references them, and if a token or entry point appears in more than one extension, it will only appear in the .h at the first place it's referred to). The GLES and EGL headers on the Khronos Registry website will probably be updated to be generated from the corresponding Registries fairly soon, if the corresponding Working Groups are OK with that.

    The new format includes a Relax NG compact schema, and all the XML validates against that. There's a short description of the tags in the README.txt. It captures most, but not all of the information in the .spec files in a more semantically expressive way, describes types in C syntax instead of the generic type syntax used in .spec, and does not include array length information (which was often inaccurate in the .spec files). If you are using .spec to generate bindings to other languages, you'll have to translate the C types to your output types. The header generation scripts are intended to be extensible to other output formats fairly easily, though we haven't done anything with it but C headers.

    The old .spec files and GL, GLX, and WGL headers generated from them are still available under a relocated Subversion path, but we don't plan to update .spec in the future. A large number of .spec bugs that people had submitted have been addressed in the XML registry and closed, or in a few cases, WONTFIXed because they referred to specific properties of .spec that don't exist in the XML. It might be possible to do a mechanical translation from the XML back to .spec format - it would not be easy, because the XML is structured very differently and there are a lot of one-off hacks in .spec that aren't needed in the XML - but hopefully people can adapt their uses to work directly with the XML instead. It's possible the schema will need additions to accomodate some uses, feedback on that can be provided here.
    Jon Leech
    Khronos API Registrar
    ARB Ecosystem TSG Chair
    GL/EGL/GLES Spec Editor
    ...and suchlike

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    Thank you for doing this.

    Also, you now have your first bug report on the new spec files Followed by two more

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,129
    Relax NG compact schema
    Most awesome!

  4. #4
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    Quote Originally Posted by thokra View Post
    Most awesome!
    Even better, it has actual documentation in it explaining what the elements mean.

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,129
    Quote Originally Posted by Alfonse
    it has actual documentation
    *rubs eyes for about a minute*

    Well damn, this is almost like solid software engineering.

  6. #6
    Administrator Contributor
    Join Date
    Jan 2002
    Location
    Mt. View, CA
    Posts
    97
    The "actual documentation" is more complete (and prettier) now: see PDF
    Jon Leech
    Khronos API Registrar
    ARB Ecosystem TSG Chair
    GL/EGL/GLES Spec Editor
    ...and suchlike

  7. #7
    Administrator Contributor
    Join Date
    Jan 2002
    Location
    Mt. View, CA
    Posts
    97
    Since there was a good deal of demand for it, I've added the parameter/return type and array length annotations from gl.spec and enum*.spec into gl.xml. This required some schema additions, and pretty massive changes to gl.xml - I haven't done this for glx.xml or wgl.xml yet but will if this is well received.

    There are a lot of caveats about the accuracy and completeness of these annotations, discussed in section 18.3 of the readme.pdf. I haven't done anything to make the annotations any more useful than they were in the .spec files, simply provided access to most of the same annotations (with exceptions as noted in the readme). If people do find these annotations useful, I hope they will be willing to build on this framework and fill in more enumerant group definitions and parameter tagging, since the vast majority of modern GL APIs don't have the annotations even in the .spec files.

    I see there are some patches submitted in Bugzilla already and will get to those next.
    Jon Leech
    Khronos API Registrar
    ARB Ecosystem TSG Chair
    GL/EGL/GLES Spec Editor
    ...and suchlike

  8. #8
    Administrator Contributor
    Join Date
    Jan 2002
    Location
    Mt. View, CA
    Posts
    97
    Bruce Merry (of Bugle fame, among other things) wrote some scripts to detect possible command aliases and proposed a bunch for addition to gl.xml, which has been done now. There are a few more tweaks to the parameter annotations as well. Thanks, Bruce!
    Jon Leech
    Khronos API Registrar
    ARB Ecosystem TSG Chair
    GL/EGL/GLES Spec Editor
    ...and suchlike

  9. #9
    Junior Member Regular Contributor
    Join Date
    Sep 2000
    Location
    France
    Posts
    185
    Thanks for this !!

    I was about to write yet another parser for gles headers, I'm happy not to have to

  10. #10
    Junior Member Regular Contributor Lucretia's Avatar
    Join Date
    Mar 2000
    Location
    Leeds, West Yorkshire, England
    Posts
    117
    Hi,

    Well, it's about time this happened tbh, but from my cursory look I am surprised that:

    1. You've kept the C stuff inside the main XML files where they really should be external to that and kept somewhere language specific.
    2. You've added "GL_" and "gl" where the original specs didn't, this means all strongly typed languages have to go through the aggro of checking for and stripping them.
    3. You seem to assume all enums are bitfields to be ANDed together where in the original specs you could easily see they were separate, had specific values and were not all enumerations, i.e. some are constants of a type to be ANDed.


    I could be wrong, I hope I am, but this is what I saw.

    Thanks,
    Luke.
    Luke A. Guest

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •