SHA256
1
0
forked from pool/Mesa
Mesa/0004-glx-pass-implicit-load-param-through-allocation.patch
Stefan Dirsch f72bdc5d3e - 0001-loader-delete-unused-param-from-pipe_loader_sw_probe.patch,
0002-glx-fix-some-indentation.patch,
  0003-glx-add-an-implicit-param-to-createScreen.patch,
  0004-glx-pass-implicit-load-param-through-allocation.patch,
  0005-dri-plumb-a-implicit-param-through-createNewScreen-i.patch,
  0006-gbm-plumb-an-implicit-param-through-device-creation.patch,
  0007-frontends-dri-plumb-an-implicit-param-through-screen.patch,
  0008-pipe-loader-plumb-a-flag-for-implicit-driver-load-th.patch,
  0009-zink-don-t-print-error-messages-when-failing-an-impl.patch
  * get rid of error message:
    'MESA: error: ZINK: vkEnumeratePhysicalDevices failed
    (VK_ERROR_INITIALIZATION_FAILED)' 
    [gitlab mesa issue #10802]

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/Mesa?expand=0&rev=1273
2024-03-19 08:04:25 +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.3/src/glx/glxext.c
===================================================================
--- mesa-24.0.3.orig/src/glx/glxext.c
+++ mesa-24.0.3/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;
@@ -929,14 +929,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, false);
- fail = !AllocAndFetchScreenConfigs(dpy, dpyPriv, False);
+ fail = !AllocAndFetchScreenConfigs(dpy, dpyPriv, False, true);
}
#endif
if (fail) {
Index: mesa-24.0.3/src/glx/glxclient.h
===================================================================
--- mesa-24.0.3.orig/src/glx/glxclient.h
+++ mesa-24.0.3/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
{
/**