PDA

View Full Version : Bugs in openGL Registry (registry/api/GL/glext.h)



Clancy101
10-06-2014, 11:06 AM
For example:



GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount)
GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);


The const void *const*indices and const GLchar *const*string should be const void **indices and const GLchar **string.

There are similar errors in other parts of the registry as well, so, whomever updated it, needs to fix it.

Clancy101
10-06-2014, 11:17 AM
typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount);
GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount);
typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex);
GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex);
typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar *const*strings);
GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar *const*strings);
typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length);
GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length);
typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount);
GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount);
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride);
GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride);

Notice all the const ____ *const* bugs.

arekkusu
10-06-2014, 11:50 AM
Why do you think that is a bug?

Clancy101
10-06-2014, 11:58 AM
Isn't it obvious?
Look at: https://www.opengl.org/sdk/docs/man3/xhtml/glMultiDrawElements.xml


NameglMultiDrawElements — render multiple sets of primitives by specifying indices of array data elementsC Specification

void glMultiDrawElements(GLenum mode,
const GLsizei * count,
GLenum type,
const GLvoid ** indices,
GLsizei primcount);


vs


GLAPI void APIENTRY glMultiDrawElements (GLenum mode,
const GLsizei *count,
GLenum type,
const void *const*indices,
GLsizei drawcount)


const GLvoid **indices != const void *const*indices

arekkusu
10-06-2014, 02:07 PM
So, the man page (https://www.opengl.org/sdk/docs/man3/xhtml/glMultiDrawElements.xml) derived from the GL3.3 specification matches the old GL3.3 headers. And the man page (https://www.opengl.org/sdk/docs/man4/html/glMultiDrawElements.xhtml) derived from the GL4.5 specification matches the GL4.5 headers. What is the bug?

Clancy101
10-06-2014, 04:03 PM
So, the man page (https://www.opengl.org/sdk/docs/man3/xhtml/glMultiDrawElements.xml) derived from the GL3.3 specification matches the old GL3.3 headers. And the man page (https://www.opengl.org/sdk/docs/man4/html/glMultiDrawElements.xhtml) derived from the GL4.5 specification matches the GL4.5 headers. What is the bug? The bug is, it should be the same for all versions of the headers, not one way for 3.x, and another way for 4.x Heck, IMO, it should also not be const GLvoid* const* but be GLvoid const* const* instead for example.

arekkusu
10-06-2014, 04:29 PM
So, you are arguing that API should not change after the initial publication.
Khronos disagrees, and changed several prototypes in 2012 (see appendix L of the GL4.2 spec.)

Since they don't retroactively edit previously published specifications, it seems correct to me to leave the previously published man pages in sync with the older specs. You can choose whichever versions of the spec/header you want, but you'd best choose the matching man pages.