Skip to content

Handle GLbitmask/GLbitfield correctly #7

@httpdigest

Description

@httpdigest

Here is what I think should be the correct way of handling those. The steps are being excercised for the example of "glBufferStorage" and its flags GLbitfield parameter:

  1. for all /registry/enums elements that have a type="bitmask" attribute, the generator has to build a separate group with the enum values defined in that element (hint: the "group" attribute cannot be used for anything since it is hardly ever referenced anywhere)
  2. for each /registry/feature/require (example GL_VERSION_4_4) and /registry/extensions/extension/require (example GL_ARB_buffer_storage) elements, we first have to search whether there is a <command> defined in it (example glBufferStorage) that takes at least one GLbitfield parameter. This information is found in the corresponding /registry/commands/command element.
  3. If we found at least one such command, we have to match all enum elements in /registry/feature/require (example GL_VERSION_4_4) and /registry/extensions/extension/require (example GL_ARB_buffer_storage) with all previously created bitmask groups to see which of the enums are bitfield enums. For each enum found in a group A that group A is then considered a candidate group when looking up the name(s) of a GLbitfield argument by its value for a called command defined by this extension or core GL version.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions