Commit graph xserver/Xext/glx/indirect_program.c
Author SHA1 Message Date
Enrico Weigelt, metux IT consult
1fced9e85f glx: use rpcbuf reply path in GetCompressedTexImage / GetProgramString
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>
2026-06-26 19:34:14 +02:00
Enrico Weigelt, metux IT consult
e67ba8438a glx: byte-swap contextTag in swapped GetProgramString
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>
2026-06-26 18:43:17 +02:00
Enrico Weigelt, metux IT consult
1a094d6bf6 glx: byte-swap reply in swapped GetCompressedTexImage / GetProgramString
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>
2026-06-26 18:43:17 +02:00
Enrico Weigelt, metux IT consult
876c782094 treewide: clean up includes of misc.h
adding include/ prefix to it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-19 19:24:57 +02:00
Enrico Weigelt, metux IT consult
dd4c8d4ecb glx: move it under Xext/
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-17 15:17:56 +02:00
Renamed from glx/indirect_program.c (Browse further)