diff --git a/src/util/00-mesa-defaults.conf b/src/util/00-mesa-defaults.conf index cb0e6e659e..ccc6d16e93 100644 --- a/src/util/00-mesa-defaults.conf +++ b/src/util/00-mesa-defaults.conf @@ -128,6 +128,7 @@ TODO: document the other workarounds. diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index 3d5ae0b694..3010fffe1c 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -123,6 +123,13 @@ _mesa_GetString( GLenum name ) ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, NULL); + const char *forcedvendor = getenv("allow_vendor_override"); + if ((forcedvendor) && (name==GL_VENDOR)) { + if (ctx->Driver.GetString(ctx, name)=="X.Org") { + return (const GLubyte *) forcedvendor; + } + } + /* this is a required driver function */ assert(ctx->Driver.GetString); { diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c index af9e3325f9..34a26ddbe6 100644 --- a/src/gallium/state_trackers/dri/dri_context.c +++ b/src/gallium/state_trackers/dri/dri_context.c @@ -79,6 +79,10 @@ dri_create_context(gl_api api, const struct gl_config * visual, goto fail; } + if (driQueryOptionstr(optionCache, "allow_vendor_override")) { + setenv("allow_vendor_override", driQueryOptionstr(optionCache, "allow_vendor_override"), 1); + } + memset(&attribs, 0, sizeof(attribs)); switch (api) { case API_OPENGLES: diff --git a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h index 9db0dc0111..932e7a5ab7 100644 --- a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h +++ b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h @@ -31,6 +31,7 @@ DRI_CONF_SECTION_DEBUG DRI_CONF_GLSL_CORRECT_DERIVATIVES_AFTER_DISCARD("false") DRI_CONF_ALLOW_GLSL_LAYOUT_QUALIFIER_ON_FUNCTION_PARAMETERS("false") DRI_CONF_FORCE_COMPAT_PROFILE("false") + DRI_CONF_ALLOW_VENDOR_OVERRIDE() DRI_CONF_SECTION_END DRI_CONF_SECTION_MISCELLANEOUS diff --git a/src/util/xmlpool/t_options.h b/src/util/xmlpool/t_options.h index 80ddf0e203..7c2b9212ff 100644 --- a/src/util/xmlpool/t_options.h +++ b/src/util/xmlpool/t_options.h @@ -140,6 +140,11 @@ DRI_CONF_OPT_BEGIN_B(allow_glsl_layout_qualifier_on_function_parameters, def) \ DRI_CONF_DESC(en,gettext("Allow layout qualifiers on function parameters.")) \ DRI_CONF_OPT_END +#define DRI_CONF_ALLOW_VENDOR_OVERRIDE(def) \ +DRI_CONF_OPT_BEGIN(allow_vendor_override, string, def) \ + DRI_CONF_DESC(en,gettext("Allow GPU vendor to be overridden.")) \ +DRI_CONF_OPT_END + #define DRI_CONF_FORCE_COMPAT_PROFILE(def) \ DRI_CONF_OPT_BEGIN_B(force_compat_profile, def) \ DRI_CONF_DESC(en,gettext("Force an OpenGL compatibility context")) \ diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index bde461b43a..044dc9174f 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -2603,6 +2603,13 @@ _GLX_PUBLIC void (*glXGetProcAddressARB(const GLubyte * procName)) (void) typedef void (*gl_function) (void); gl_function f; + if (strcmp((const char *) procName, "glNamedStringARB") == 0 || + strcmp((const char *) procName, "glDeleteNamedStringARB") == 0 || + strcmp((const char *) procName, "glCompileShaderIncludeARB") == 0 || + strcmp((const char *) procName, "glIsNamedStringARB") == 0 || + strcmp((const char *) procName, "glGetNamedStringARB") == 0 || + strcmp((const char *) procName, "glGetNamedStringivARB") == 0) + return NULL; /* Search the table of GLX and internal functions first. If that * fails and the supplied name could be a valid core GL name, try