Use the OpenGL registry to convert integer literals in gl*() calls back into constants #56

Closed
opened 4 years ago by gpe · 4 comments
gpe commented 4 years ago
Owner
https://raw.githubusercontent.com/KhronosGroup/OpenGL-Registry/master/xml/gl.xml
Poster
Owner

Remaining items:

  • Check all gl calls manually. Some of them are missing constants - e.g. glTexEnvi values.
  • Can we do anything about return values? Only seem to be used for checking the framebuffer status.
  • Can we do anything about the GL_TEXTURE0 + n pattern?
  • Related to the above: ternaries - i.e. blah ? GL_XXX : GL_YYY
  • What is the mysterious glTexImage2D call with an internalformat of 4 - is that a bug?
  • The code for inserting extra GL constants in order seems to be broken.
  • Use upper case for the hex literals we create in the GL class.

I guess it's a moot point now, but something else I wondered was whether we need to worry about the group->enums mapping at all. I think we do though.

Some of the extension methods in GlConstantTransformer might be useful more generally, or we might even want to move them to GlRegistry. (I think it'd be somewhat nice if GlRegistry didn't know about JavaParser types though.)

Should we use DI to pass the GlRegistry to the GlConstantTransformer?

Remaining items: * [x] Check all gl calls manually. Some of them are missing constants - e.g. glTexEnvi values. * [x] Can we do anything about return values? Only seem to be used for checking the framebuffer status. * [x] Can we do anything about the `GL_TEXTURE0 + n` pattern? * [x] Related to the above: ternaries - i.e. `blah ? GL_XXX : GL_YYY` * [ ] What is the mysterious `glTexImage2D` call with an `internalformat` of 4 - is that a bug? * [x] The code for inserting extra GL constants in order seems to be broken. * [x] Use upper case for the hex literals we create in the GL class. I guess it's a moot point now, but something else I wondered was whether we need to worry about the group->enums mapping at all. I think we do though. Some of the extension methods in GlConstantTransformer might be useful more generally, or we might even want to move them to GlRegistry. (I think it'd be somewhat nice if GlRegistry didn't know about JavaParser types though.) Should we use DI to pass the GlRegistry to the GlConstantTransformer?
gpe added the
deobfuscator
label 4 years ago
gpe added the
feature
label 4 years ago
Poster
Owner
  • We could also set the argument names in the GL interface itself.
* [x] We could also set the argument names in the GL interface itself.
Poster
Owner
  • The transformer currenty adds some constants with silly vendor suffixes, like _SGIS. We should check these exhaustively and fix the groups in the registry where appropriate.
* [x] The transformer currenty adds some constants with silly vendor suffixes, like `_SGIS`. We should check these exhaustively and fix the groups in the registry where appropriate.
Poster
Owner

Everything apart from the mysterious internalformat of 4 has been completed, so I'm closing this.

Everything apart from the mysterious `internalformat` of 4 has been completed, so I'm closing this.
gpe closed this issue 4 years ago
Sign in to join this conversation.
Loading…
There is no content yet.