diff options
author | Howard Stearns <howard.stearns@gmail.com> | 2022-08-26 09:50:08 -0700 |
---|---|---|
committer | Howard Stearns <howard.stearns@gmail.com> | 2022-08-26 09:50:08 -0700 |
commit | 1b5c13fd446dbf9193aca9baa66f62edb1393875 (patch) | |
tree | 890beda21760a9be16afe868689c9099fe6202ca | |
parent | a8d122365db280d04552dbc23db9c43dbf1cb400 (diff) | |
parent | 509cfcad3167d6ea464c5bb19397daaf537a5594 (diff) |
Merge branch 'brad/opengl-core-profile-mac' of bitbucket.org:lindenlab/viewer into SL-17967
-rw-r--r-- | indra/llrender/llgl.cpp | 20 | ||||
-rw-r--r-- | indra/llwindow/llopenglview-objc.mm | 1 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl | 8 |
3 files changed, 23 insertions, 6 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); diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index fd20f2ad15..f6d90f3479 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -256,6 +256,7 @@ attributedStringInfo getSegments(NSAttributedString *str) NSOpenGLPFADepthSize, 24, NSOpenGLPFAAlphaSize, 8, NSOpenGLPFAColorSize, 24, + NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core, 0 }; diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl index 1175f3e644..91d041cafa 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl @@ -76,6 +76,10 @@ void main() vec3 final_color = vec3(0, 0, 0); vec2 tc = getScreenXY(vary_fragcoord); vec3 pos = getPosition(tc).xyz; + if (pos.z < far_z) + { + discard; + } float envIntensity; // not used for this shader vec3 n; @@ -124,10 +128,6 @@ void main() } else { - if (pos.z < far_z) - { - discard; - } float noise = texture2D(noiseMap, tc/128.0).b; |