Thread: [PyOpenGL-Users] Anyone feel like looking up glGet constant return sizes?
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2014-04-02 14:35:46
|
One of the things that PyOpenGL does when you call GL's glGet* family of functions is to auto-allocate the return array. It does this with a (manually maintained) mapping from enum/constant -> array-dimensions which is defined in src/glgetsizes.csv in the source tree. I have fallen *way* behind in keeping up with this list, so there are currently 54 known glGet-capable constants that don't have a defined size (there are *other* constants that should be mapped I'm sure, but only those constants which show up in a formal extension description on OpenGL.org actually get automatically recognized as ones to annotate). The work is mostly mechanical, you have to look up the constant, find the spec, read through it to see what is expected when you do glGet* for that constant, and determine what the array shape should be. Most of the glGet operations return a single value, but every once in a while you'll find one that returns an array, a string, etc. If anyone feels like hunting down some of those constants and sending me a ping with their values, that would be great. If you felt like checking out the source, doing a few dozen, and sending a bzr patch, that would be even nicer. The fact that I've fallen so far behind was brought to my attention by the fact that the constants for the various debug extensions were not properly mapped in glGet, so you had to manually pass in the data arrays to do any debug extension work. Enjoy, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Walter W. <hom...@gm...> - 2014-04-03 09:53:31
|
I hope this is what you are looking for...just asked the OpenGL IRC. They told me they are listed in the xml files in this folder https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/ and can be parsed. Or in glcorearb.h https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/GL/glcorearb.h Hope that helps, Walter |
From: Mike C. F. <mcf...@vr...> - 2014-04-08 04:15:47
|
On 14-04-03 05:53 AM, Walter White wrote: > I hope this is what you are looking for...just asked the OpenGL IRC. > They told me they are listed in the xml files in this folder > > https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/ > > and can be parsed. > > Or in glcorearb.h > https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/GL/glcorearb.h > > Hope that helps, > > Walter It did help, as it reminded me that the enum-groups are present in the xml files, so I can be sure we get all of the constants groups/tracked. However the xml files don't specify the *sizes* of the result arrays. That is, there's a notation saying CALCSIZE() in the xml files, but nothing I can see that tells you what the CALCSIZE() operation should do given a particular parameter. I suppose we could have a fallback path where we did what PyOpenGL 1.x did, namely allocate a huge buffer, fill it with an obscure value, and count how many values are not set to the obscure value on completion. That feels pretty gross, though. Thanks, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Walter W. <hom...@gm...> - 2014-04-10 16:41:43
|
I guess you mean COMPSIZE()? Did some research on this and I found a Python script in Chromium git repo that parses the OpenGL specs. Starting at line 202 is a function parse_arg which parses the COMPSIZE parameter starting at line 234. It looks a bit cryptic to me, but maybe you can find out what they are doing. You can find it here: http://git.chromium.org/gitweb/?p=external/p3/regal.git;a=blob_plain;f=src/apitrace/specs/scripts/glspec.py;hb=f21b08d5bf82f6670ecea07a44a77d537cfc4f24 Kind regards, Walter Am 08.04.2014 06:15, schrieb Mike C. Fletcher: > On 14-04-03 05:53 AM, Walter White wrote: >> I hope this is what you are looking for...just asked the OpenGL IRC. >> They told me they are listed in the xml files in this folder >> >> https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/ >> >> and can be parsed. >> >> Or in glcorearb.h >> https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/GL/glcorearb.h >> >> Hope that helps, >> >> Walter > It did help, as it reminded me that the enum-groups are present in the > xml files, so I can be sure we get all of the constants groups/tracked. > However the xml files don't specify the *sizes* of the result arrays. > That is, there's a notation saying CALCSIZE() in the xml files, but > nothing I can see that tells you what the CALCSIZE() operation should do > given a particular parameter. > > I suppose we could have a fallback path where we did what PyOpenGL 1.x > did, namely allocate a huge buffer, fill it with an obscure value, and > count how many values are not set to the obscure value on completion. > That feels pretty gross, though. > > Thanks, > Mike > |
From: Mike C. F. <mcf...@vr...> - 2014-04-10 19:30:12
|
On 14-04-10 12:41 PM, Walter White wrote: > I guess you mean COMPSIZE()? Did some research on this and > I found a Python script in Chromium git repo > that parses the OpenGL specs. > > Starting at line 202 is a function parse_arg which parses > the COMPSIZE parameter starting at line 234. > It looks a bit cryptic to me, but maybe you can find out > what they are doing. > > You can find it here: > > http://git.chromium.org/gitweb/?p=external/p3/regal.git;a=blob_plain;f=src/apitrace/specs/scripts/glspec.py;hb=f21b08d5bf82f6670ecea07a44a77d537cfc4f24 Thanks, that's exactly what I needed. They appear to be using a manually maintained mapping in regaltrace.cpp, but that's okay, someone else's manual can be our automatic. The approach of having all getsizes in the same mapping works nicely too, as we can use the same code/lookup for all of the output parameters. Much obliged, Mike > Am 08.04.2014 06:15, schrieb Mike C. Fletcher: >> On 14-04-03 05:53 AM, Walter White wrote: >>> I hope this is what you are looking for...just asked the OpenGL IRC. >>> They told me they are listed in the xml files in this folder >>> >>> https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/ >>> >>> and can be parsed. >>> >>> Or in glcorearb.h >>> https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/GL/glcorearb.h >>> >>> Hope that helps, >>> >>> Walter >> It did help, as it reminded me that the enum-groups are present in the >> xml files, so I can be sure we get all of the constants groups/tracked. >> However the xml files don't specify the *sizes* of the result arrays. >> That is, there's a notation saying CALCSIZE() in the xml files, but >> nothing I can see that tells you what the CALCSIZE() operation should do >> given a particular parameter. >> >> I suppose we could have a fallback path where we did what PyOpenGL 1.x >> did, namely allocate a huge buffer, fill it with an obscure value, and >> count how many values are not set to the obscure value on completion. >> That feels pretty gross, though. >> >> Thanks, >> Mike >> > > ------------------------------------------------------------------------------ > Put Bad Developers to Shame > Dominate Development with Jenkins Continuous Integration > Continuously Automate Build, Test & Deployment > Start a new project now. Try Jenkins in the cloud. > http://p.sf.net/sfu/13600_Cloudbees > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |