summaryrefslogtreecommitdiff
path: root/indra/llrender/llgl.cpp
diff options
context:
space:
mode:
authorBrad Kittenbrink <brad@lindenlab.com>2022-06-27 10:16:27 -0700
committerBrad Kittenbrink <brad@lindenlab.com>2022-08-26 09:30:01 -0700
commit509cfcad3167d6ea464c5bb19397daaf537a5594 (patch)
tree33d5584e75ebe1bfec22afc94256cd5df85f13c0 /indra/llrender/llgl.cpp
parent7923f255b6815f2a687ef1fbaad5ef11465d6756 (diff)
experiments for turning on opengl core profile on mac for DRTVWR-559
Diffstat (limited to 'indra/llrender/llgl.cpp')
-rw-r--r--indra/llrender/llgl.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 8ebaf77eec..46065404e7 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -595,11 +595,13 @@ bool LLGLManager::initGL()
parse_glsl_version(mGLSLVersionMajor, mGLSLVersionMinor);
#if LL_DARWIN
+ // TODO maybe switch to using a core profile for GL 3.2?
+ // https://stackoverflow.com/a/19868861
//never use GLSL greater than 1.20 on OSX
- if (mGLSLVersionMajor > 1 || mGLSLVersionMinor >= 30)
+ if (mGLSLVersionMajor > 1 || mGLSLVersionMinor > 30)
{
mGLSLVersionMajor = 1;
- mGLSLVersionMinor = 20;
+ mGLSLVersionMinor = 30;
}
#endif
}
@@ -1012,6 +1014,20 @@ void LLGLManager::initExtensions()
mHasPointParameters = FALSE;
mHasTextureRectangle = FALSE;
#else // LL_MESA_HEADLESS //important, gGLHExts.mSysExts is uninitialized until after glh_init_extensions is called
+
+#if 0 && LL_DARWIN
+ // populate gGLHExts.mSysExts for core profile
+ GLint num_extensions;
+ glGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions);
+ std::string all_extensions("GL_ARB_multitexture ");
+ for(GLint i = 0; i < num_extensions; ++i) {
+ char const * extension = (char const *)glGetStringi(GL_EXTENSIONS, i);
+ all_extensions += extension;
+ all_extensions += ' ';
+ }
+ gGLHExts.mSysExts = strdup(all_extensions.data());
+#endif
+
mHasMultitexture = glh_init_extensions("GL_ARB_multitexture");
mHasATIMemInfo = ExtensionExists("GL_ATI_meminfo", gGLHExts.mSysExts); //Basic AMD method, also see mHasAMDAssociations
mHasNVXMemInfo = ExtensionExists("GL_NVX_gpu_memory_info", gGLHExts.mSysExts);