BindingGenerator conflates core and extension constants
numberZero opened this issue · 2 comments
BindingGenerator conflates constant names with different vendor suffixes. But these constants aren’t always equal. I’ve written a tool and it found 18 discrepancies in glcorearb.h
and gl2ext.h
together.
Khronos/Khronos discrepancy:
- GL_UNSIGNED_INT_10_10_10_2: 0x8036 (core), 0x8df6 (OES)
- GL_HALF_FLOAT: 0x140b (core), 0x8d61 (OES)
- GL_GEOMETRY_VERTICES_OUT: 0x8916 (core), 0x8dda (ARB)
- GL_GEOMETRY_INPUT_TYPE: 0x8917 (core), 0x8ddb (ARB)
- GL_GEOMETRY_OUTPUT_TYPE: 0x8918 (core), 0x8ddc (ARB)
Khronos/major vendor discrepancy:
- GL_DEPTH_COMPONENT32F: 0x8cac (core), 0x8dab (NV)
- GL_DEPTH32F_STENCIL8: 0x8cad (core), 0x8dac (NV)
- GL_UNSIGNED_INT64: 0x140f (ARB, NV), 0x8bc2 (AMD)
Other:
- GL_TEXTURE_WIDTH: 0x1000 (core), 0x8bd2 (QCOM)
- GL_TEXTURE_HEIGHT: 0x1001 (core), 0x8bd3 (QCOM)
- GL_TEXTURE_INTERNAL_FORMAT: 0x1003 (core), 0x8bd5 (QCOM)
- GL_TEXTURE_DEPTH: 0x8071 (core), 0x8bd4 (QCOM)
- GL_RENDERBUFFER_SAMPLES: 0x8cab (core, ANGLE, APPLE, EXT, NV), 0x9133 (IMG)
- GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: 0x8d56 (core, ANGLE, APPLE, EXT, NV), 0x9134 (IMG)
- GL_MAX_SAMPLES: 0x8d57 (core, ANGLE, APPLE, EXT, NV), 0x9135 (IMG)
- GL_TEXTURE_SAMPLES: 0x9106 (core), 0x9136 (IMG)
- GL_TEXTURE_TARGET: 0x1006 (core), 0x8bda (QCOM)
- GL_CONSERVATIVE_RASTERIZATION: 0x83fe (INTEL), 0x9346 (NV)
I think that’s not a big problem but still, needs to be sorted out somehow.
Since hecks is gone and you would be the only consumer of these GL bindings you'd have to fix this yourself.
Maybe we should switch to something like glad instead?
you'd have to fix this yourself.
Actually I plan to work on this, gradually, in the context of #160. It may be that there is nothing to worry of as these things are in the core already in the target GL versions, I need to check for that first.
Maybe we should switch to something like glad instead?
Maybe. Not that I like GLAD specifically (due to overuse of macros, mainly) but that may be a good way nevertheless. And it’s better than GLEW IIRC.