PEXlib Requests and Output Commands


For an overview and related topics, see Introduction to PEXlib.

Topics in this section include:

Like the X protocol, the PEX protocol is composed of a set of requests, replies, errors, and events. About half of the functions defined in PEXlib directly generate requests, and about half do not. The latter half are the Output Command functions. Output Commands are "graphical elements" that are grouped into primitives, attributes, and control OC's. PEX defines two requests for transferring OC's to the implementation, one for storing OC's in PEX structures and one for immediate rendering. PEXlib does not define functions for these two specific requests. Instead, each OC has a corresponding PEXlib function that packs the OC into either a PEXRCStoreElements or PEXRCRenderOutputCommands request. The PEXlib implementation usually packs OC's from successive OC function invocations into a single request and keeps packing OC's into this request for as long as possible. Packing stops when the maximum request size is reached or when the application invokes a function that requires the generation of a different request. PEXlib then sends the PEXRCStoreElements or PEXRCRenderOutputCommands request to the implementation.

For more information, please see Rendering and Storing Output Commands.


Large Requests

The standard X protocol mechanism limits the maximum protocol request size to 64K words. There are several places, especially with some of the new 5.2 functions, where you may exceed this limit. The texture map creation and Put Z Buffer functions can easily exceed this limit. Large output commands, discussed below, can also exceed the limit. In response to this problem, the X Consortium has specified the BRE (Big Request Extension). X servers that support PEX 5.2 should also support BRE to allow the PEX client to use large output commands and to work with large textures and Z buffer data. If the X server does not support the BRE, then PEXlib 5.2 clients need to take precautions to avoid generating requests that are too large when working with these larger data items.


Large Output Commands

Prior to PEX 5.2, the largest output command was limited to 64K words in size. PEX 5.2 now employs a "large OC" mechanism that is very similar to the approach that the BRE uses. Of course, in order to store or render large OC's, the BRE must be present to correctly process the larger request required to transport the large OC's to the server. Again, if the BRE is not present, the PEXlib application must take care to avoid generating OC's that are larger than 64K words.