Skip to content

Commit

Permalink
ref_gl: workaround using fake arb functions on GLES (Mali400 has stub…
Browse files Browse the repository at this point in the history
… glBindBufferARB somehow\!)
  • Loading branch information
mittorn committed Nov 1, 2023
1 parent 75e9852 commit 92fcf09
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ref/gl/gl_opengl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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++ )
Expand All @@ -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;
Expand Down

0 comments on commit 92fcf09

Please sign in to comment.