[Xcb] To do

Josh Triplett josh.trip at verizon.net
Thu Feb 3 10:35:48 PST 2005


[Re-CCed to the list]

Jeremy Kolb wrote:
> A list of GLX_RENDER_COMMAND is kind of tricky as it appears that
> they're all variable length.  From what I can tell the structure is a
> header of 2 CARD16s : length, opcode.  Then the size of the struct is
> length bytes in total.  After this header is some combinations of
> CARD8/16/32.

XCB can handle variable-length lists of variable-length structures just
fine. :)

I took a look at the GLX specification; it appears that the Render
request contains any number of GLX_RENDER_COMMAND structures, and each
GLX_RENDER_COMMAND contains a 16-bit length, a 16-bit opcode, and a
number of additional data bytes specified by the length (which includes
the length and opcode).  Based on that, you want something like this in
the Render request:

<list type="GLX_RENDER_COMMAND" name="render_commands" />

(The absence of a length expression will cause the creation of a local
render_commands_len parameter.)

For the GLX_RENDER_COMMAND structure, you want:

<struct name="GLX_RENDER_COMMAND">
  <field type="CARD16" name="length" />
  <field type="CARD16" name="opcode" />
  <list  type="BYTE"   name="data">
    <op op="-">
      <fieldref>length</fieldref>
      <value>4</value>
    </op>
  </list>
</struct>

You could alternatively express the list as CARD16s (which the spec
seems to), and use (length-4)/2 as the length expression.

(I just added '-' as a possible operator in expressions, for this purpose.)

- Josh Triplett
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20050203/233eb107/signature.pgp


More information about the xcb mailing list