From 92fcf090abd0c812805bd1daf26e39e88948da3c Mon Sep 17 00:00:00 2001 From: mittorn Date: Thu, 2 Nov 2023 02:06:02 +0300 Subject: [PATCH] ref_gl: workaround using fake arb functions on GLES (Mali400 has stub glBindBufferARB somehow\!) --- ref/gl/gl_opengl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ref/gl/gl_opengl.c b/ref/gl/gl_opengl.c index 268ec496..efcab149 100644 --- a/ref/gl/gl_opengl.c +++ b/ref/gl/gl_opengl.c @@ -549,13 +549,15 @@ qboolean GL_CheckExtension( const char *name, const dllfunc_t *funcs, const char for( func = funcs; func && func->name; func++ ) { // functions are cleared before all the extensions are evaluated +#ifndef XASH_GLES // arb on gles is last (TODO: separate search tables for GLES/CORE) if(( *func->func = (void *)gEngfuncs.GL_GetProcAddress( func->name )) == NULL ) +#endif { string name; char *end; size_t i = 0; #ifdef XASH_GLES - const char *suffixes[] = { "", "EXT", "OES" }; + const char *suffixes[] = { "", "EXT", "OES", "ARB" }; #else const char *suffixes[] = { "", "EXT" }; #endif @@ -569,7 +571,9 @@ qboolean GL_CheckExtension( const char *name, const dllfunc_t *funcs, const char else // I need Q_strstrnul { end = name + Q_strlen( name ); +#ifndef XASH_GLES i++; // skip empty suffix +#endif } for( ; i < sizeof( suffixes ) / sizeof( suffixes[0] ); i++ ) @@ -581,6 +585,9 @@ qboolean GL_CheckExtension( const char *name, const dllfunc_t *funcs, const char if(( f = gEngfuncs.GL_GetProcAddress( name ))) { // GL_GetProcAddress prints errors about missing functions, so tell user that we found it with different name +#ifdef XASH_GLES + if(i != 0) +#endif gEngfuncs.Con_Printf( S_NOTE "found %s\n", name ); *func->func = f;