<div dir="ltr">Thank you Ian, Jose and Matt.<div>I'll take a look at the pointers you provided. Probably would come back with some more questions.  </div><div><br></div><div>Thanks, </div><div>    Shervin</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 10, 2015 at 3:55 PM, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 06/10/2015 03:05 PM, Shervin Sharifi wrote:<br>
> Thanks Ian.<br>
> If I want to implement the actual CompSize function, how should I figure<br>
> out the details?<br>
<br>
</span>The way I did it for the GLX protocol code in Mesa is to make a<br>
glFoo_compsize function for each GL function that has a variable sized<br>
array as input.  Often these functions can be shared (e.g., the function<br>
for glTexParameteriv and glTexParameterfv are the same).<br>
<br>
You have to read the docs to figure out that, for example, passing<br>
GL_TEXTURE_BASE_LEVEL to glTexParameteriv means there's 1 value but<br>
passing GL_TEXTURE_BORDER_COLOR means there are 4 values.  I implemented<br>
that in Mesa (many years before the current Khronos XML existed) by<br>
having additional decorations in my XML.  Each enum specifies which<br>
functions can use it and how many values it carries.<br>
<br>
The Khronos XML specifies which enums can be passed to which functions<br>
(via <group>), but it doesn't look like it has any information about how<br>
much data goes along with it. :(<br>
<span class=""><br>
> Thanks,<br>
>    Shervin<br>
><br>
> On Wed, Jun 10, 2015 at 2:56 PM, Ian Romanick <<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a><br>
</span><div><div class="h5">> <mailto:<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>>> wrote:<br>
><br>
>     On 06/10/2015 11:25 AM, Shervin Sharifi wrote:<br>
>     > Hi,<br>
>     ><br>
>     >  This may not be the right forum to ask this, but I didn't know of a<br>
>     > better forum, so I thought I can ask here.<br>
>     ><br>
>     >  I'm new to OpenGL. I am looking at XML registry for OpenGL and there<br>
>     > are some parameters with attributes containing a function COMPSIZE (I've<br>
>     > pasted an example below).<br>
>     >  I tried to find information on what the COMPSIZE function is, where/how<br>
>     > it is used, etc, but couldn't find documentation or credible information<br>
>     > on the Internet.<br>
>     >  Any information or pointer to that would be really helpful.<br>
><br>
>     It's a signal to code generation scripts that the size of the data<br>
>     referenced by the "pointer" parameter depends on the values of "type"<br>
>     and "stride".  For example, GLX protocol code uses this to know how much<br>
>     image data to send to the server for glTexImage2D.<br>
><br>
>     >  Thanks,<br>
>     >     Shervin<br>
>     ><br>
>     ><br>
>     ><br>
>     > This example is from gl.xml in the OpenGL registry:<br>
>     ><br>
>     >         <command><br>
>     >             <proto>void <name>glBinormalPointerEXT</name></proto><br>
>     >             <param group="BinormalPointerTypeEXT"><ptype>GLenum</ptype><br>
>     > <name>type</name></param><br>
>     >             <param><ptype>GLsizei</ptype> <name>stride</name></param><br>
>     >             <param len="COMPSIZE(type,stride)">const void<br>
>     > *<name>pointer</name></param><br>
>     >         </command><br>
>     ><br>
>     ><br>
>     > _______________________________________________<br>
>     > mesa-dev mailing list<br>
</div></div>>     > <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a> <mailto:<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a>><br>
>     > <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
><br>
><br>
<br>
</blockquote></div><br></div>