SHA256
1
0
forked from pool/Mesa
Mesa/0004-glx-pass-implicit-load-param-through-allocation.patch
Stefan Dirsch 289416652d - Update to bugfix release 24.0.5
- supersedes mesa-fix-llvm18.patch
- adjusted 0004-glx-pass-implicit-load-param-through-allocation.patch,
  0010-glx-silence-more-implicit-load-zink-errors.patch

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/Mesa?expand=0&rev=1283
2024-04-20 19:40:41 +00:00

77 lines
3.0 KiB
Diff

From e7c5f94a79ff0e545dfdc95703a541a0d43d739f Mon Sep 17 00:00:00 2001
From: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Date: Tue, 12 Mar 2024 09:42:06 -0400
Subject: [PATCH 4/9] glx: pass implicit load param through allocation
---
src/glx/glxext.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
Index: mesa-24.0.5/src/glx/glxext.c
===================================================================
--- mesa-24.0.5.orig/src/glx/glxext.c
+++ mesa-24.0.5/src/glx/glxext.c
@@ -763,7 +763,7 @@ glx_screen_cleanup(struct glx_screen *ps
** If that works then fetch the per screen configs data.
*/
static Bool
-AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv, Bool zink)
+AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv, Bool zink, Bool implicit)
{
struct glx_screen *psc;
GLint i, screens;
@@ -783,19 +783,19 @@ AllocAndFetchScreenConfigs(Display * dpy
#if defined(GLX_USE_DRM)
#if defined(HAVE_DRI3)
if (priv->dri3Display)
- psc = priv->dri3Display->createScreen(i, priv, false);
+ psc = priv->dri3Display->createScreen(i, priv, implicit);
#endif /* HAVE_DRI3 */
if (psc == NULL && priv->dri2Display)
- psc = priv->dri2Display->createScreen(i, priv, false);
+ psc = priv->dri2Display->createScreen(i, priv, implicit);
#endif /* GLX_USE_DRM */
#ifdef GLX_USE_WINDOWSGL
if (psc == NULL && priv->windowsdriDisplay)
- psc = priv->windowsdriDisplay->createScreen(i, priv, false);
+ psc = priv->windowsdriDisplay->createScreen(i, priv, implicit);
#endif
if (psc == NULL && priv->driswDisplay)
- psc = priv->driswDisplay->createScreen(i, priv, false);
+ psc = priv->driswDisplay->createScreen(i, priv, psc == GLX_LOADER_USE_ZINK ? false : implicit);
#endif /* GLX_DIRECT_RENDERING && !GLX_USE_APPLEGL */
bool indirect = false;
@@ -930,14 +930,14 @@ __glXInitialize(Display * dpy)
}
#endif
- if (!AllocAndFetchScreenConfigs(dpy, dpyPriv, zink | try_zink)) {
+ if (!AllocAndFetchScreenConfigs(dpy, dpyPriv, zink | try_zink, zink || try_zink ? try_zink : !env)) {
Bool fail = True;
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
if (try_zink) {
free(dpyPriv->screens);
dpyPriv->driswDisplay->destroyDisplay(dpyPriv->driswDisplay);
dpyPriv->driswDisplay = driswCreateDisplay(dpy, TRY_ZINK_NO);
- fail = !AllocAndFetchScreenConfigs(dpy, dpyPriv, False);
+ fail = !AllocAndFetchScreenConfigs(dpy, dpyPriv, False, true);
}
#endif
if (fail) {
Index: mesa-24.0.5/src/glx/glxclient.h
===================================================================
--- mesa-24.0.5.orig/src/glx/glxclient.h
+++ mesa-24.0.5/src/glx/glxclient.h
@@ -78,6 +78,8 @@ typedef struct __GLXDRIdisplayRec __GLXD
typedef struct __GLXDRIscreenRec __GLXDRIscreen;
typedef struct __GLXDRIdrawableRec __GLXDRIdrawable;
+#define GLX_LOADER_USE_ZINK ((struct glx_screen *)(uintptr_t)-1)
+
struct __GLXDRIdisplayRec
{
/**