Bug 59013 - GLES2: definition of glShaderSource is not compliant with the specification
Summary: GLES2: definition of glShaderSource is not compliant with the specification
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-04 07:45 UTC by SmSpillaz
Modified: 2013-01-05 03:18 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description SmSpillaz 2013-01-04 07:45:12 UTC
glShaderSource is defined in the GLES2 spec as so:

void glShaderSource(	GLuint shader,
 	GLsizei count,
 	const GLchar **string,
 	const GLint *length);

However trunk mesa (and 9.1.0) has a definition like this:

GL_APICALL void         GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);

The difference being const GLchar **string, vs const GLchar* const* string

That means that if you have a function pointer to glShaderSource using the old definition, and assign the new function to it, it will fail to compile.

(And I know that code using function pointers to core functionality is insane, but it is better than using ifdefs to switch between using function pointers where that functionality is extension-only, and real function declarations where it is core functionality)
Comment 1 Ian Romanick 2013-01-04 20:39:09 UTC
We just redistribute the official GLES2/gl2.h from Khronos.  If anything, I believe the specification is incorrect.  Please report upstream at khronos.org.

http://www.khronos.org/registry/gles/api/2.0/gl2.h
Comment 2 SmSpillaz 2013-01-05 03:18:44 UTC
Okay, I've filed a bug upstream (https://www.khronos.org/bugzilla/show_bug.cgi?id=761)

Though, I'm wondering why it changed so recently.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.