OpenGL-Registry icon indicating copy to clipboard operation
OpenGL-Registry copied to clipboard

working on some missing enum groups

Open 3b opened this issue 5 years ago • 13 comments

Not done yet, but could use more eyes (and runs through other binding generators) to see if there are any obvious mistakes so far.

Adding in anything missing that has been found by cl-opengl users, along with whatever I can find missing by scraping the cl-opengl wrappers (and also just went through the 4.6 compat spec and added most of the glGet* and IsEnabled since that was a big chunk of what was missing for wrappers).

3b avatar Oct 04 '20 02:10 3b

LGTM so far.

Perksey avatar Oct 04 '20 14:10 Perksey

OK, possibly done with edits for now if people want to look at it more closely. Leaving PR as draft for now until I finish my local testing.

3b avatar Oct 14 '20 21:10 3b

I'll look at trying to minimize changes that would affect existing groups, and keep existing names where possible, Some will still end up split and some parameter groups changed, though, unless we want to just keep piling "wrong" enums into random groups because they were once applied to the wrong function.

3b avatar Oct 15 '20 21:10 3b

@Perksey I merged VertexAttribEnum and VertexAttribPropertyARB into a single group GetVertexAttribPName, does that look reasonable, or should those be kept as duplicates?

was: (some names reformatted oddly since i queried them from my bindings)

VertexAttribEnum:
   :CURRENT-VERTEX-ATTRIB
   :VERTEX-ATTRIB-ARRAY-BUFFER-BINDING
   :VERTEX-ATTRIB-ARRAY-DIVISOR
   :VERTEX-ATTRIB-ARRAY-ENABLED
   :VERTEX-ATTRIB-ARRAY-INTEGER
   :VERTEX-ATTRIB-ARRAY-NORMALIZED
   :VERTEX-ATTRIB-ARRAY-SIZE
   :VERTEX-ATTRIB-ARRAY-STRIDE
   :VERTEX-ATTRIB-ARRAY-TYPE

   glGetVertexAttribIiv: pname = VertexAttribEnum
   glGetVertexAttribIuiv: pname = VertexAttribEnum
   glGetVertexAttribLdv: pname = VertexAttribEnum
   glGetVertexAttribLui64vARB: pname = VertexAttribEnum
   glGetVertexAttribIivEXT: pname = VertexAttribEnum
   glGetVertexAttribIuivEXT: pname = VertexAttribEnum
   glGetVertexAttribLdvEXT: pname = VertexAttribEnum
   glGetVertexAttribLi64vNV: pname = VertexAttribEnum
   glGetVertexAttribLui64vNV: pname = VertexAttribEnum
VertexAttribPropertyARB:
   :CURRENT-VERTEX-ATTRIB
   :VERTEX-ATTRIB-ARRAY-BUFFER-BINDING
   :VERTEX-ATTRIB-ARRAY-DIVISOR
   :VERTEX-ATTRIB-ARRAY-ENABLED
   :VERTEX-ATTRIB-ARRAY-INTEGER
   :VERTEX-ATTRIB-ARRAY-INTEGER-EXT
   :VERTEX-ATTRIB-ARRAY-LONG
   :VERTEX-ATTRIB-ARRAY-NORMALIZED
   :VERTEX-ATTRIB-ARRAY-SIZE
   :VERTEX-ATTRIB-ARRAY-STRIDE
   :VERTEX-ATTRIB-ARRAY-TYPE
   :VERTEX-ATTRIB-BINDING
   :VERTEX-ATTRIB-RELATIVE-OFFSET

   glGetVertexAttribdv: pname = VertexAttribPropertyARB
   glGetVertexAttribfv: pname = VertexAttribPropertyARB
   glGetVertexAttribiv: pname = VertexAttribPropertyARB

   glGetVertexAttribdvARB: pname = VertexAttribPropertyARB
   glGetVertexAttribfvARB: pname = VertexAttribPropertyARB
   glGetVertexAttribivARB: pname = VertexAttribPropertyARB

new:

  :CURRENT-VERTEX-ATTRIB
  :CURRENT-VERTEX-ATTRIB-ARB
  :VERTEX-ATTRIB-ARRAY-BUFFER-BINDING
  :VERTEX-ATTRIB-ARRAY-BUFFER-BINDING-ARB
  :VERTEX-ATTRIB-ARRAY-DIVISOR
  :VERTEX-ATTRIB-ARRAY-DIVISOR-ANGLE
  :VERTEX-ATTRIB-ARRAY-DIVISOR-ARB
  :VERTEX-ATTRIB-ARRAY-DIVISOR-EXT
  :VERTEX-ATTRIB-ARRAY-DIVISOR-NV
  :VERTEX-ATTRIB-ARRAY-ENABLED
  :VERTEX-ATTRIB-ARRAY-ENABLED-ARB
  :VERTEX-ATTRIB-ARRAY-INTEGER
  :VERTEX-ATTRIB-ARRAY-INTEGER-EXT
  :VERTEX-ATTRIB-ARRAY-LONG
  :VERTEX-ATTRIB-ARRAY-NORMALIZED
  :VERTEX-ATTRIB-ARRAY-NORMALIZED-ARB
  :VERTEX-ATTRIB-ARRAY-SIZE
  :VERTEX-ATTRIB-ARRAY-SIZE-ARB
  :VERTEX-ATTRIB-ARRAY-STRIDE
  :VERTEX-ATTRIB-ARRAY-STRIDE-ARB
  :VERTEX-ATTRIB-ARRAY-TYPE
  :VERTEX-ATTRIB-ARRAY-TYPE-ARB
  :VERTEX-ATTRIB-BINDING
  :VERTEX-ATTRIB-MAP1-COEFF-APPLE :VERTEX-ATTRIB-MAP1-DOMAIN-APPLE
  :VERTEX-ATTRIB-MAP1-ORDER-APPLE :VERTEX-ATTRIB-MAP1-SIZE-APPLE
  :VERTEX-ATTRIB-MAP2-COEFF-APPLE :VERTEX-ATTRIB-MAP2-DOMAIN-APPLE
  :VERTEX-ATTRIB-MAP2-ORDER-APPLE :VERTEX-ATTRIB-MAP2-SIZE-APPLE
  :VERTEX-ATTRIB-RELATIVE-OFFSET
  :VERTEX-ELEMENT-SWIZZLE-AMD

  glGetVertexAttribIiv: pname = GetVertexAttribPName
  glGetVertexAttribIivEXT: pname = GetVertexAttribPName
  glGetVertexAttribIuiv: pname = GetVertexAttribPName
  glGetVertexAttribIuivEXT: pname = GetVertexAttribPName
  glGetVertexAttribLdv: pname = GetVertexAttribPName
  glGetVertexAttribLdvEXT: pname = GetVertexAttribPName
  glGetVertexAttribLi64vNV: pname = GetVertexAttribPName
  glGetVertexAttribLui64vARB: pname = GetVertexAttribPName
  glGetVertexAttribLui64vNV: pname = GetVertexAttribPName
  glGetVertexAttribdv: pname = GetVertexAttribPName
  glGetVertexAttribdvARB: pname = GetVertexAttribPName
  glGetVertexAttribfv: pname = GetVertexAttribPName
  glGetVertexAttribfvARB: pname = GetVertexAttribPName
  glGetVertexAttribiv: pname = GetVertexAttribPName
  glGetVertexAttribivARB: pname = GetVertexAttribPName

3b avatar Oct 17 '20 21:10 3b

Looks like the only correct use of VertexAttribEnumNV was for the pname of GetProgramParameterfvNV and GetProgramParameterdvNV, which I switched to use ProgramParameterPNameNV instead. None of the other places using it accepted the one enum in that group (PROGRAM_PARAMETE_NV), so doesn't seem worth preserving that group name.

3b avatar Oct 17 '20 21:10 3b

Removed changes to deprecated group tags, and renamed some groups to old names where they still matched reasonably well.

VertexArrayPNameAPPLE was pretty much useless before (it contained enums for param but was used on pname), so it got renamed to VertexArrayParamAPPLE and replaced with a group containing correct enums for pname.

VertexAttribEnumNV was similarly mostly wrong, but ProgramParameterPNameNV could be renamed back to that if keeping the old name for the one place it worked (GetProgramParameter[df]vNV) is worth having a confusing group name.

Let me know if you think it is worth duplicating SamplerParameterPName to SamplerParameterI + SamplerParameterF and/or GetVertexAttribPName to VertexAttribEnum+VertexAttribPropertyARB`

3b avatar Oct 17 '20 22:10 3b

That change sounds fine, though if we are making breaking changes it's generally best to leave the old groups around so that all that's required is a simple implicit or explicit cast for users of the groups.

Perksey avatar Oct 18 '20 16:10 Perksey

@pdaniell-nv contains NVIDIA vendor extension grouping changes, comments would be appreciated,

Perksey avatar Oct 18 '20 16:10 Perksey

OK, will add the old group names back in addition to the merged ones, and rename the apple one. any suggestions for the name of the enum that actually gets passed to the pname argument?

What do you think about adding in a section for group aliases, so we can eventually drop the extra unused groups and just replace them with something like <group name="SamplerparameterI" alias="SamplerParameterPName">? I already have one of those as a manual type alias in my bindings from e04fd38, so seems like something that could be useful in general.

3b avatar Oct 18 '20 23:10 3b

@pdaniell-nv contains NVIDIA vendor extension grouping changes, comments would be appreciated,

I skimmed through and didn't see anything objectionable. We don't use the enum groups so if they work for consumers of those properties I'm happy.

pdaniell-nv avatar Oct 19 '20 22:10 pdaniell-nv

Awesome, yeah just figured I'd ping you in here to make sure that none of the values being marked as applicable to the extension functions are bogus :)

Perksey avatar Oct 20 '20 18:10 Perksey

We would love to see this PR getting merged at opentk. Anything you need to be done that we can assist with?

frederikja163 avatar May 19 '21 20:05 frederikja163

@frederikja163 : reports that at least some of it is actively useful, and that the rest doesn't break things for existing code is helpful.

I'll push this back up towards the top of my todo list, but still a few things ahead of it so won't be able to get back to it immediately. If you have time before then, feel free to take care of some or all of the requested changes (I think it was mostly restoring old group names?).

3b avatar May 23 '21 05:05 3b