KhronosGroup / OpenGL-API

OpenGL and OpenGL ES API Issue Tracker
34 stars 5 forks source link

`bufSize` parameter inconsistencies. #52

Closed NicolBolas closed 4 years ago

NicolBolas commented 5 years ago

Most parameters named bufSize specify the size of a buffer in bytes. However, a few parameters do not; they instead represent the count of items (typically integers) in a buffer. These functions include:

There may be more.

The names of these bufSize parameters should be changed to make it clear that they are not buffer sizes, but are instead counts of items in the buffer. This misuse of terms even caused problems in the conformance test suites, where the CTS assumed that many of these bufSize uses were in bytes, not in values. The internal format query was fixed in the CTS, but glSynciv remains broken.

pdaniell-nv commented 5 years ago

Discussed briefly in the OpenGL/ES meeting today and we agree that "bufSize" is not a good name for this parameter for these functions. Perhaps "count" would be better.

We're happy to fix this. We need to come up with a list of functions that needs to be fixed. @NicolBolas do have a list in mind you can share? Thanks.

NicolBolas commented 5 years ago

I believe the following is a complete list of functions where bufSize is used and it pertains to an array count rather than a byte count:

glGetInternalformatSampleivNV glGetInternalformati64v glGetInternalformativ glGetProgramResourcefvNV (also, this doesn't have a len attribute in the gl.xml file) glGetProgramResourceiv glGetSynciv glGetSyncivAPPLE glQueryResourceNV glVDPAUGetSurfaceivNV

Also, while parameter names are being changed, there were several functions in the gl.xml file that used the lowercase bufsize rather than interCaps bufSize:

glGetActiveSubroutineName glGetActiveSubroutineUniformName glGetCoverageModulationTableNV glGetDebugMessageLogAMD glGetTranslatedShaderSourceANGLE

pdaniell-nv commented 5 years ago

I have made a PR with the XML changes here. However, that shouldn't be merged until the specs have also been updated with the new names. @oddhack Could you update the OpenGL and OpenGL ES specs with the parameter name changes to core functions above? Thanks.