From 09bbf71e6863c9d69046fb27467da3158d8e2c8b Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 18 Feb 2025 11:43:17 -0500 Subject: [PATCH] glx: Make #undef GLX_INDIRECT_RENDERING do something MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not that meson lets you reach this state yet, but if you did, you'd still build all of the indirect code but the linker would gc most of it. Reviewed-by: Alyssa Rosenzweig Reviewed-by: Eric Engestrom Reviewed-by: Marek Olšák Acked-By: Mike Blumenkrantz Part-of: --- src/glx/create_context.c | 2 ++ src/glx/glxcmds.c | 4 ++++ src/glx/glxext.c | 2 ++ 3 files changed, 8 insertions(+) diff --git a/src/glx/create_context.c b/src/glx/create_context.c index 6f6e2852030..eced2430b36 100644 --- a/src/glx/create_context.c +++ b/src/glx/create_context.c @@ -108,9 +108,11 @@ glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config, (const uint32_t *) attrib_list, &error); } else if (!direct) { +#ifdef GLX_INDIRECT_RENDERING gc = indirect_create_context_attribs(psc, cfg, share, num_attribs, (const uint32_t *) attrib_list, &error); +#endif } #endif diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index a1fb748303e..ec1de6929f0 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -321,8 +321,10 @@ CreateContext(Display *dpy, int generic_id, struct glx_config *config, #else if (allowDirect && psc->vtable->create_context) gc = psc->vtable->create_context(psc, config, shareList, renderType); +#ifdef GLX_INDIRECT_RENDERING if (!gc) gc = indirect_create_context(psc, config, shareList, renderType); +#endif #endif if (!gc) return NULL; @@ -1318,7 +1320,9 @@ glXImportContextEXT(Display *dpy, GLXContextID contextID) if (mode == NULL) return NULL; +#ifdef GLX_INDIRECT_RENDERING ctx = indirect_create_context(psc, mode, NULL, renderType); +#endif if (ctx == NULL) return NULL; diff --git a/src/glx/glxext.c b/src/glx/glxext.c index fa2399c513b..9cc4fab9ce6 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -916,7 +916,9 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv, enum glx_dr #else if (psc == NULL && !zink) { +#ifdef GLX_INDIRECT_RENDERING psc = indirect_create_screen(i, priv); +#endif indirect = true; } #endif