Re: [Mesa-dev] COMPSIZE function in OpenGL XML registry

2015-06-11 Thread Shervin Sharifi
Thank you Ian, Jose and Matt.
I'll take a look at the pointers you provided. Probably would come back
with some more questions.

Thanks,
Shervin



On Wed, Jun 10, 2015 at 3:55 PM, Ian Romanick i...@freedesktop.org wrote:

 On 06/10/2015 03:05 PM, Shervin Sharifi wrote:
  Thanks Ian.
  If I want to implement the actual CompSize function, how should I figure
  out the details?

 The way I did it for the GLX protocol code in Mesa is to make a
 glFoo_compsize function for each GL function that has a variable sized
 array as input.  Often these functions can be shared (e.g., the function
 for glTexParameteriv and glTexParameterfv are the same).

 You have to read the docs to figure out that, for example, passing
 GL_TEXTURE_BASE_LEVEL to glTexParameteriv means there's 1 value but
 passing GL_TEXTURE_BORDER_COLOR means there are 4 values.  I implemented
 that in Mesa (many years before the current Khronos XML existed) by
 having additional decorations in my XML.  Each enum specifies which
 functions can use it and how many values it carries.

 The Khronos XML specifies which enums can be passed to which functions
 (via group), but it doesn't look like it has any information about how
 much data goes along with it. :(

  Thanks,
 Shervin
 
  On Wed, Jun 10, 2015 at 2:56 PM, Ian Romanick i...@freedesktop.org
  mailto:i...@freedesktop.org wrote:
 
  On 06/10/2015 11:25 AM, Shervin Sharifi wrote:
   Hi,
  
This may not be the right forum to ask this, but I didn't know of
 a
   better forum, so I thought I can ask here.
  
I'm new to OpenGL. I am looking at XML registry for OpenGL and
 there
   are some parameters with attributes containing a function COMPSIZE
 (I've
   pasted an example below).
I tried to find information on what the COMPSIZE function is,
 where/how
   it is used, etc, but couldn't find documentation or credible
 information
   on the Internet.
Any information or pointer to that would be really helpful.
 
  It's a signal to code generation scripts that the size of the data
  referenced by the pointer parameter depends on the values of type
  and stride.  For example, GLX protocol code uses this to know how
 much
  image data to send to the server for glTexImage2D.
 
Thanks,
   Shervin
  
  
  
   This example is from gl.xml in the OpenGL registry:
  
   command
   protovoid nameglBinormalPointerEXT/name/proto
   param
 group=BinormalPointerTypeEXTptypeGLenum/ptype
   nametype/name/param
   paramptypeGLsizei/ptype
 namestride/name/param
   param len=COMPSIZE(type,stride)const void
   *namepointer/name/param
   /command
  
  
   ___
   mesa-dev mailing list
   mesa-dev@lists.freedesktop.org mailto:
 mesa-dev@lists.freedesktop.org
   http://lists.freedesktop.org/mailman/listinfo/mesa-dev
 
 


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] COMPSIZE function in OpenGL XML registry

2015-06-10 Thread Matt Turner
On Wed, Jun 10, 2015 at 11:25 AM, Shervin Sharifi sherv...@gmail.com wrote:
 Hi,

  This may not be the right forum to ask this, but I didn't know of a better
 forum, so I thought I can ask here.

  I'm new to OpenGL. I am looking at XML registry for OpenGL and there are
 some parameters with attributes containing a function COMPSIZE (I've pasted
 an example below).
  I tried to find information on what the COMPSIZE function is, where/how it
 is used, etc, but couldn't find documentation or credible information on the
 Internet.
  Any information or pointer to that would be really helpful.

  Thanks,
 Shervin



 This example is from gl.xml in the OpenGL registry:

 command
 protovoid nameglBinormalPointerEXT/name/proto
 param group=BinormalPointerTypeEXTptypeGLenum/ptype
 nametype/name/param
 paramptypeGLsizei/ptype namestride/name/param
 param len=COMPSIZE(type,stride)const void
 *namepointer/name/param
 /command

I'm just speculating, but I don't think there's really a definition of
COMPSIZE or anything. I think it's just a way of saying that, for
instance, the size of the memory pointed by the pointer parameter to
glBinormalPointerEXT is a function of the type and stride
parameters.

Other functions, like glBitmap have similar things:

param len=COMPSIZE(width,height)const
ptypeGLubyte/ptype *namebitmap/name/param

That is, the size of the block of memory pointed to by bitmap is
described by the width and height parameters.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] COMPSIZE function in OpenGL XML registry

2015-06-10 Thread Ian Romanick
On 06/10/2015 03:05 PM, Shervin Sharifi wrote:
 Thanks Ian.
 If I want to implement the actual CompSize function, how should I figure
 out the details? 

The way I did it for the GLX protocol code in Mesa is to make a
glFoo_compsize function for each GL function that has a variable sized
array as input.  Often these functions can be shared (e.g., the function
for glTexParameteriv and glTexParameterfv are the same).

You have to read the docs to figure out that, for example, passing
GL_TEXTURE_BASE_LEVEL to glTexParameteriv means there's 1 value but
passing GL_TEXTURE_BORDER_COLOR means there are 4 values.  I implemented
that in Mesa (many years before the current Khronos XML existed) by
having additional decorations in my XML.  Each enum specifies which
functions can use it and how many values it carries.

The Khronos XML specifies which enums can be passed to which functions
(via group), but it doesn't look like it has any information about how
much data goes along with it. :(

 Thanks, 
Shervin
 
 On Wed, Jun 10, 2015 at 2:56 PM, Ian Romanick i...@freedesktop.org
 mailto:i...@freedesktop.org wrote:
 
 On 06/10/2015 11:25 AM, Shervin Sharifi wrote:
  Hi,
 
   This may not be the right forum to ask this, but I didn't know of a
  better forum, so I thought I can ask here.
 
   I'm new to OpenGL. I am looking at XML registry for OpenGL and there
  are some parameters with attributes containing a function COMPSIZE (I've
  pasted an example below).
   I tried to find information on what the COMPSIZE function is, where/how
  it is used, etc, but couldn't find documentation or credible information
  on the Internet.
   Any information or pointer to that would be really helpful.
 
 It's a signal to code generation scripts that the size of the data
 referenced by the pointer parameter depends on the values of type
 and stride.  For example, GLX protocol code uses this to know how much
 image data to send to the server for glTexImage2D.
 
   Thanks,
  Shervin
 
 
 
  This example is from gl.xml in the OpenGL registry:
 
  command
  protovoid nameglBinormalPointerEXT/name/proto
  param group=BinormalPointerTypeEXTptypeGLenum/ptype
  nametype/name/param
  paramptypeGLsizei/ptype namestride/name/param
  param len=COMPSIZE(type,stride)const void
  *namepointer/name/param
  /command
 
 
  ___
  mesa-dev mailing list
  mesa-dev@lists.freedesktop.org mailto:mesa-dev@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/mesa-dev
 
 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] COMPSIZE function in OpenGL XML registry

2015-06-10 Thread Shervin Sharifi
Thank you.
I think there should be a way to calculate the size of the memory location
pointed by that pointer.
For cases where there is no shared memory between the client and the
server, the memory contents should be copied back and forth, which means
the size of the pointer should be known (unless I'm missing something).

Thanks,
  Shervin



On Wed, Jun 10, 2015 at 11:44 AM, Matt Turner matts...@gmail.com wrote:

 On Wed, Jun 10, 2015 at 11:25 AM, Shervin Sharifi sherv...@gmail.com
 wrote:
  Hi,
 
   This may not be the right forum to ask this, but I didn't know of a
 better
  forum, so I thought I can ask here.
 
   I'm new to OpenGL. I am looking at XML registry for OpenGL and there are
  some parameters with attributes containing a function COMPSIZE (I've
 pasted
  an example below).
   I tried to find information on what the COMPSIZE function is, where/how
 it
  is used, etc, but couldn't find documentation or credible information on
 the
  Internet.
   Any information or pointer to that would be really helpful.
 
   Thanks,
  Shervin
 
 
 
  This example is from gl.xml in the OpenGL registry:
 
  command
  protovoid nameglBinormalPointerEXT/name/proto
  param group=BinormalPointerTypeEXTptypeGLenum/ptype
  nametype/name/param
  paramptypeGLsizei/ptype namestride/name/param
  param len=COMPSIZE(type,stride)const void
  *namepointer/name/param
  /command

 I'm just speculating, but I don't think there's really a definition of
 COMPSIZE or anything. I think it's just a way of saying that, for
 instance, the size of the memory pointed by the pointer parameter to
 glBinormalPointerEXT is a function of the type and stride
 parameters.

 Other functions, like glBitmap have similar things:

 param len=COMPSIZE(width,height)const
 ptypeGLubyte/ptype *namebitmap/name/param

 That is, the size of the block of memory pointed to by bitmap is
 described by the width and height parameters.

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] COMPSIZE function in OpenGL XML registry

2015-06-10 Thread Ian Romanick
On 06/10/2015 11:25 AM, Shervin Sharifi wrote:
 Hi,
  
  This may not be the right forum to ask this, but I didn't know of a
 better forum, so I thought I can ask here.
 
  I'm new to OpenGL. I am looking at XML registry for OpenGL and there
 are some parameters with attributes containing a function COMPSIZE (I've
 pasted an example below).
  I tried to find information on what the COMPSIZE function is, where/how
 it is used, etc, but couldn't find documentation or credible information
 on the Internet.
  Any information or pointer to that would be really helpful. 

It's a signal to code generation scripts that the size of the data
referenced by the pointer parameter depends on the values of type
and stride.  For example, GLX protocol code uses this to know how much
image data to send to the server for glTexImage2D.

  Thanks, 
 Shervin
 
 
 
 This example is from gl.xml in the OpenGL registry:
 
 command
 protovoid nameglBinormalPointerEXT/name/proto
 param group=BinormalPointerTypeEXTptypeGLenum/ptype
 nametype/name/param
 paramptypeGLsizei/ptype namestride/name/param
 param len=COMPSIZE(type,stride)const void
 *namepointer/name/param
 /command
 
 
 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] COMPSIZE function in OpenGL XML registry

2015-06-10 Thread Shervin Sharifi
Thanks Ian.
If I want to implement the actual CompSize function, how should I figure
out the details?

Thanks,
   Shervin

On Wed, Jun 10, 2015 at 2:56 PM, Ian Romanick i...@freedesktop.org wrote:

 On 06/10/2015 11:25 AM, Shervin Sharifi wrote:
  Hi,
 
   This may not be the right forum to ask this, but I didn't know of a
  better forum, so I thought I can ask here.
 
   I'm new to OpenGL. I am looking at XML registry for OpenGL and there
  are some parameters with attributes containing a function COMPSIZE (I've
  pasted an example below).
   I tried to find information on what the COMPSIZE function is, where/how
  it is used, etc, but couldn't find documentation or credible information
  on the Internet.
   Any information or pointer to that would be really helpful.

 It's a signal to code generation scripts that the size of the data
 referenced by the pointer parameter depends on the values of type
 and stride.  For example, GLX protocol code uses this to know how much
 image data to send to the server for glTexImage2D.

   Thanks,
  Shervin
 
 
 
  This example is from gl.xml in the OpenGL registry:
 
  command
  protovoid nameglBinormalPointerEXT/name/proto
  param group=BinormalPointerTypeEXTptypeGLenum/ptype
  nametype/name/param
  paramptypeGLsizei/ptype namestride/name/param
  param len=COMPSIZE(type,stride)const void
  *namepointer/name/param
  /command
 
 
  ___
  mesa-dev mailing list
  mesa-dev@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/mesa-dev


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] COMPSIZE function in OpenGL XML registry

2015-06-10 Thread Jose Fonseca

I'm not sure what you are trying to accomplish.

if you're doing some sort of serialization of OpenGL calls other than 
GLX, then it might be worthwhile to look at


  https://github.com/apitrace/apitrace/blob/master/specs/glapi.py
  https://github.com/apitrace/apitrace/blob/master/helpers/glsize.hpp

Jose

On 10/06/15 23:05, Shervin Sharifi wrote:

Thanks Ian.
If I want to implement the actual CompSize function, how should I figure
out the details?

Thanks,
Shervin

On Wed, Jun 10, 2015 at 2:56 PM, Ian Romanick i...@freedesktop.org
mailto:i...@freedesktop.org wrote:

On 06/10/2015 11:25 AM, Shervin Sharifi wrote:
 Hi,

  This may not be the right forum to ask this, but I didn't know of a
 better forum, so I thought I can ask here.

  I'm new to OpenGL. I am looking at XML registry for OpenGL and there
 are some parameters with attributes containing a function COMPSIZE (I've
 pasted an example below).
  I tried to find information on what the COMPSIZE function is, where/how
 it is used, etc, but couldn't find documentation or credible information
 on the Internet.
  Any information or pointer to that would be really helpful.

It's a signal to code generation scripts that the size of the data
referenced by the pointer parameter depends on the values of type
and stride.  For example, GLX protocol code uses this to know how much
image data to send to the server for glTexImage2D.

  Thanks,
 Shervin



 This example is from gl.xml in the OpenGL registry:

 command
 protovoid nameglBinormalPointerEXT/name/proto
 param group=BinormalPointerTypeEXTptypeGLenum/ptype
 nametype/name/param
 paramptypeGLsizei/ptype namestride/name/param
 param len=COMPSIZE(type,stride)const void
 *namepointer/name/param
 /command


  ___
  mesa-dev mailing list
  mesa-dev@lists.freedesktop.org
mailto:mesa-dev@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/mesa-dev




___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev