Convert the GetCompressedTexImage (indirect_texture_compression.c) and
GetProgramString (indirect_program.c) handlers, including their swapped
variants, to the rpcbuf reply path. The image/string payload is a raw byte
stream (x_rpcbuf_write_binary_pad()); X_SEND_REPLY_WITH_RPCBUF() derives the
length and swaps the header, and the width field is swapped via
X_REPLY_FIELD_CARD32() (keyed on client->swapped). This removes the
__GLX_BEGIN_REPLY/__GLX_SEND_HEADER/__GLX_SEND_VOID_ARRAY macros and the
explicit do_swap handling of the reply.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
DoGetProgramString() read req->contextTag without byte-swapping even on the
swapped path (do_swap=TRUE), although it swaps the target/pname request fields
just below and although the sibling swapped handlers
(__glXDispSwap_GetCompressedTexImage and the singlepixswap.c handlers) all
swap contextTag. A byte-swapped client calling glXGetProgramStringARB thus
passed a wrong-endian context tag to __glXForceCurrent(), which failed to find
the context (cx == NULL) and made the request error out before any reply was
sent — so the swapped GetProgramString path never worked end to end.
Byte-swap contextTag when do_swap is set, matching the other swapped handlers.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
The byte-swapped indirect dispatch paths __glXDispSwap_GetCompressedTexImage()
(indirect_texture_compression.c) and DoGetProgramString(..., do_swap=TRUE)
(indirect_program.c, reached via __glXDispSwap_GetProgramStringARB()) built
the reply but never byte-swapped it: neither __GLX_SWAP_REPLY_HEADER() nor a
swap of the 'width' field was applied. A byte-swapped client thus received the
reply header length/sequence and the width field in the wrong byte order.
Swap the reply header and the width field on the swapped path, matching the
other swapped GLX handlers. (The payload is a raw byte stream and needs no
swapping.)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>