glx: Remove some truly ancient unused code

The "left here but disabled" comment dates to 2004! The idea here is to
add extensions implied by a particular GL version to the GL extension
string, but nothing useful is accomplished by doing so, and this is all
only used in the case of indirect rendering anyway.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10223>
This commit is contained in:
Adam Jackson
2021-04-13 16:21:09 -04:00
committed by Marge Bot
parent b2ecd0d589
commit 6b6a1ef075
3 changed files with 3 additions and 60 deletions
+1 -20
View File
@@ -839,14 +839,11 @@ __glXCalculateUsableExtensions(struct glx_screen * psc,
*
* \param gc Pointer to GLX context.
* \param server_string Extension string from the server.
* \param major_version GL major version from the server.
* \param minor_version GL minor version from the server.
*/
void
__glXCalculateUsableGLExtensions(struct glx_context * gc,
const char *server_string,
int major_version, int minor_version)
const char *server_string)
{
struct glx_screen *psc = gc->psc;
unsigned char server_support[__GL_EXT_BYTES];
@@ -860,22 +857,6 @@ __glXCalculateUsableGLExtensions(struct glx_context * gc,
__glXProcessServerString(known_gl_extensions, server_string,
server_support);
/* Handle lazy servers that don't export all the extensions strings that
* are part of the GL core version that they support.
*/
for (i = 0; i < __GL_EXT_BYTES; i++) {
if ((known_gl_extensions[i].version_major != 0)
&& ((major_version > known_gl_extensions[i].version_major)
|| ((major_version == known_gl_extensions[i].version_major)
&& (minor_version >=
known_gl_extensions[i].version_minor)))) {
SET_BIT(server_support, known_gl_extensions[i].bit);
}
}
/* An extension is supported if the client-side (i.e., libGL) supports
* it and the server supports it or the client-side library supports it
* and it only needs client-side support.
+1 -3
View File
@@ -270,9 +270,7 @@ extern void __glXParseExtensionOverride(struct glx_screen *psc,
extern void __IndirectGlParseExtensionOverride(struct glx_screen *psc,
const char *override);
extern void __glXCalculateUsableGLExtensions(struct glx_context *gc,
const char *server_string,
int major_version,
int minor_version);
const char *server_string);
extern char *__glXGetClientGLExtensionString(void);
extern GLboolean __glExtensionBitIsEnabled(struct glx_context *gc,
+1 -37
View File
@@ -742,43 +742,7 @@ __indirect_glGetString(GLenum name)
}
case GL_EXTENSIONS:{
int major = 1;
int minor = 0;
/* This code is currently disabled. I was reminded that some
* vendors intentionally exclude some extensions from their
* extension string that are part of the core version they
* advertise. In particular, on Nvidia drivers this means that
* the functionality is supported by the driver, but is not
* hardware accelerated. For example, a TNT will show core
* version 1.5, but most of the post-1.2 functionality is a
* software fallback.
*
* I don't want to break applications that rely on this odd
* behavior. At the same time, the code is written and tested,
* so I didn't want to throw it away. Therefore, the code is here
* but disabled. In the future, we may wish to and an environment
* variable to enable it.
*/
#if 0
/* Call glGetString just to make sure that gc->server_major and
* gc->server_minor are set. This version may be higher than we
* can completely support, but it may imply support for some
* extensions that we can support.
*
* For example, at the time of this writing, the client-side
* library only supports upto core GL version 1.2. However, cubic
* textures, multitexture, multisampling, and some other 1.3
* features are supported. If the server reports back version
* 1.3, but does not report all of those extensions, we will
* enable them.
*/
(void *) glGetString(GL_VERSION);
major = gc->server_major, minor = gc->server_minor;
#endif
__glXCalculateUsableGLExtensions(gc, (char *) s, major, minor);
__glXCalculateUsableGLExtensions(gc, (char *) s);
free(s);
s = gc->extensions;
break;