Update ToGLES( fix occlusion query and other small things )

This commit is contained in:
nillerusr
2022-01-09 19:32:21 +03:00
parent d651c2b38d
commit ead7bfc155
17 changed files with 373 additions and 266 deletions
+1
View File
@@ -42,6 +42,7 @@ void GLMRendererInfo::Init( GLMRendererInfoFields *info )
m_info.m_atiNewer = true;
m_info.m_hasGammaWrites = true;
m_info.m_cantAttachSRGB = false;
// If you haven't created a GL context by now (and initialized gGL), you're about to crash.
+12 -3
View File
@@ -60,6 +60,7 @@ const int kBogusSwapInterval = INT_MAX;
#if defined ANDROID || defined TOGLES
static void *l_gl4es = NULL;
static void *l_egl = NULL;
static void *l_gles = NULL;
typedef void *(*t_glGetProcAddress)( const char * );
t_glGetProcAddress _glGetProcAddress;
@@ -194,7 +195,14 @@ void *VoidFnPtrLookup_GlMgr(const char *fn, bool &okay, const bool bRequired, vo
#if defined ANDROID || defined TOGLES
// SDL does the right thing, so we never need to use tier0 in this case.
if( _glGetProcAddress )
{
retval = _glGetProcAddress(fn);
Msg("_glGetProcAddress(%s) = %x\n", fn, retval);
if( !retval && l_gles )
retval = dlsym( l_gles, fn );
}
//printf("CDynamicFunctionOpenGL: SDL_GL_GetProcAddress(\"%s\") returned %p\n", fn, retval);
if ((retval == NULL) && (fallback != NULL))
{
@@ -507,8 +515,8 @@ InitReturnVal_t CSDLMgr::Init()
SDL_GL_SetAttribute( SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG );
}
#ifdef TOGLES
if (SDL_GL_LoadLibrary("libGLESv2.so") == -1)
#if defined( TOGLES )
if (SDL_GL_LoadLibrary("libGLESv3.so") == -1)
#else
if (SDL_GL_LoadLibrary(NULL) == -1)
#endif
@@ -583,6 +591,7 @@ InitReturnVal_t CSDLMgr::Init()
#ifdef TOGLES
l_egl = dlopen("libEGL.so", RTLD_LAZY);
l_gles = dlopen("libGLESv3.so", RTLD_LAZY);
if( l_egl )
_glGetProcAddress = (t_glGetProcAddress)dlsym(l_egl, "eglGetProcAddress");
@@ -590,7 +599,6 @@ InitReturnVal_t CSDLMgr::Init()
SET_GL_ATTR(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SET_GL_ATTR(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SET_GL_ATTR(SDL_GL_CONTEXT_MINOR_VERSION, 0);
#elif ANDROID
bool m_bOGL = false;
@@ -1405,6 +1413,7 @@ void CSDLMgr::ShowPixels( CShowPixelsParams *params )
m_flPrevGLSwapWindowTime = tm.GetDurationInProgress().GetMillisecondsF();
CheckGLError( __LINE__ );
}
#endif // DX_TO_GL_ABSTRACTION