From 7e6e64e4769c83b00e6f326f0f6fef8b84e80d45 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 25 Jan 2018 09:13:43 +0100 Subject: [PATCH] Backed out changeset dba5b62f57e5: Changes to llglshader.cpp are already in Alex Ivy and the OSX SDK version needs to be set via build variables in a separate repository --- indra/cmake/Variables.cmake | 15 +++----- indra/llrender/llglslshader.cpp | 68 +++++++++------------------------ 2 files changed, 22 insertions(+), 61 deletions(-) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 520fb99bf6..a320d61209 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -152,16 +152,11 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(DARWIN 1) # now we only support Xcode 6.0 using 10.9 (Mavericks), minimum OS 10.7 (Lion) - # Be a bit more flexible: support Xcode 6 to 9 and SDKs from 10.9 to 10.13 + # Be a bit more flexible: support Xcode 6 or 7 and SDKs from 10.9 to 10.11 #set(XCODE_VERSION 6.0) - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9) + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7) #set(CMAKE_OSX_SYSROOT macosx10.9) - if(IS_DIRECTORY "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk") - # Assume Xcode 9 if High Sierra SDK is present - set(XCODE_VERSION 9.2) - set(CMAKE_OSX_SYSROOT macosx10.13) - message(STATUS "OS X SDK 10.13 found.") - elseif(IS_DIRECTORY "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk") + if(IS_DIRECTORY "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk") # Assume Xcode 7 if Sierra SDK is present set(XCODE_VERSION 7.3) set(CMAKE_OSX_SYSROOT macosx10.12) @@ -181,9 +176,9 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(XCODE_VERSION 6.0) set(CMAKE_OSX_SYSROOT macosx10.9) message(STATUS "OS X SDK 10.9 found.") - else(IS_DIRECTORY "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk") + else(IS_DIRECTORY "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk") message(FATAL_ERROR "Unable to determine which OS X SDK to use. Giving up.") - endif(IS_DIRECTORY "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk") + endif(IS_DIRECTORY "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk") set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0") set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL 3) diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index e5e5ce081b..d3e85fbfa2 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -416,9 +416,7 @@ BOOL LLGLSLShader::createShader(std::vector * attributes, { GLhandleARB shaderhandle = LLShaderMgr::instance()->loadShaderFile((*fileIter).first, mShaderLevel, (*fileIter).second, &mDefines, mFeatures.mIndexedTextureChannels); LL_DEBUGS("ShaderLoading") << "SHADER FILE: " << (*fileIter).first << " mShaderLevel=" << mShaderLevel << LL_ENDL; - // Xcode 9 compatibility - //if (shaderhandle > 0) - if (shaderhandle) + if (shaderhandle > 0) { attachObject(shaderhandle); } @@ -1007,9 +1005,7 @@ S32 LLGLSLShader::disableTexture(S32 uniform, LLTexUnit::eTextureType mode) void LLGLSLShader::uniform1i(U32 index, GLint x) { - // Xcode 9 compatibiltiy - //if (mProgramObject > 0) - if (mProgramObject) + if (mProgramObject > 0) { if (mUniform.size() <= index) { @@ -1031,9 +1027,7 @@ void LLGLSLShader::uniform1i(U32 index, GLint x) void LLGLSLShader::uniform1f(U32 index, GLfloat x) { - // Xcode 9 compatibiltiy - //if (mProgramObject > 0) - if (mProgramObject) + if (mProgramObject > 0) { if (mUniform.size() <= index) { @@ -1055,9 +1049,7 @@ void LLGLSLShader::uniform1f(U32 index, GLfloat x) void LLGLSLShader::uniform2f(U32 index, GLfloat x, GLfloat y) { - // Xcode 9 compatibiltiy - //if (mProgramObject > 0) - if (mProgramObject) + if (mProgramObject > 0) { if (mUniform.size() <= index) { @@ -1080,9 +1072,7 @@ void LLGLSLShader::uniform2f(U32 index, GLfloat x, GLfloat y) void LLGLSLShader::uniform3f(U32 index, GLfloat x, GLfloat y, GLfloat z) { - // Xcode 9 compatibiltiy - //if (mProgramObject > 0) - if (mProgramObject) + if (mProgramObject > 0) { if (mUniform.size() <= index) { @@ -1105,9 +1095,7 @@ void LLGLSLShader::uniform3f(U32 index, GLfloat x, GLfloat y, GLfloat z) void LLGLSLShader::uniform4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - // Xcode 9 compatibiltiy - //if (mProgramObject > 0) - if (mProgramObject) + if (mProgramObject > 0) { if (mUniform.size() <= index) { @@ -1130,9 +1118,7 @@ void LLGLSLShader::uniform4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat void LLGLSLShader::uniform1iv(U32 index, U32 count, const GLint* v) { - // Xcode 9 compatibiltiy - //if (mProgramObject > 0) - if (mProgramObject) + if (mProgramObject > 0) { if (mUniform.size() <= index) { @@ -1155,9 +1141,7 @@ void LLGLSLShader::uniform1iv(U32 index, U32 count, const GLint* v) void LLGLSLShader::uniform1fv(U32 index, U32 count, const GLfloat* v) { - // Xcode 9 compatibiltiy - //if (mProgramObject > 0) - if (mProgramObject) + if (mProgramObject > 0) { if (mUniform.size() <= index) { @@ -1180,9 +1164,7 @@ void LLGLSLShader::uniform1fv(U32 index, U32 count, const GLfloat* v) void LLGLSLShader::uniform2fv(U32 index, U32 count, const GLfloat* v) { - // Xcode 9 compatibiltiy - //if (mProgramObject > 0) - if (mProgramObject) + if (mProgramObject > 0) { if (mUniform.size() <= index) { @@ -1205,9 +1187,7 @@ void LLGLSLShader::uniform2fv(U32 index, U32 count, const GLfloat* v) void LLGLSLShader::uniform3fv(U32 index, U32 count, const GLfloat* v) { - // Xcode 9 compatibiltiy - //if (mProgramObject > 0) - if (mProgramObject) + if (mProgramObject > 0) { if (mUniform.size() <= index) { @@ -1230,9 +1210,7 @@ void LLGLSLShader::uniform3fv(U32 index, U32 count, const GLfloat* v) void LLGLSLShader::uniform4fv(U32 index, U32 count, const GLfloat* v) { - // Xcode 9 compatibiltiy - //if (mProgramObject > 0) - if (mProgramObject) + if (mProgramObject > 0) { if (mUniform.size() <= index) { @@ -1255,9 +1233,7 @@ void LLGLSLShader::uniform4fv(U32 index, U32 count, const GLfloat* v) void LLGLSLShader::uniformMatrix2fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v) { - // Xcode 9 compatibiltiy - //if (mProgramObject > 0) - if (mProgramObject) + if (mProgramObject > 0) { if (mUniform.size() <= index) { @@ -1274,9 +1250,7 @@ void LLGLSLShader::uniformMatrix2fv(U32 index, U32 count, GLboolean transpose, c void LLGLSLShader::uniformMatrix3fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v) { - // Xcode 9 compatibiltiy - //if (mProgramObject > 0) - if (mProgramObject) + if (mProgramObject > 0) { if (mUniform.size() <= index) { @@ -1293,9 +1267,7 @@ void LLGLSLShader::uniformMatrix3fv(U32 index, U32 count, GLboolean transpose, c void LLGLSLShader::uniformMatrix3x4fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v) { - // Xcode 9 compatibiltiy - //if (mProgramObject > 0) - if (mProgramObject) + if (mProgramObject > 0) { if (mUniform.size() <= index) { @@ -1312,9 +1284,7 @@ void LLGLSLShader::uniformMatrix3x4fv(U32 index, U32 count, GLboolean transpose, void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v) { - // Xcode 9 compatibiltiy - //if (mProgramObject > 0) - if (mProgramObject) + if (mProgramObject > 0) { if (mUniform.size() <= index) { @@ -1332,9 +1302,7 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c GLint LLGLSLShader::getUniformLocation(const LLStaticHashedString& uniform) { GLint ret = -1; - // Xcode 9 compatibiltiy - //if (mProgramObject > 0) - if (mProgramObject) + if (mProgramObject > 0) { LLStaticStringTable::iterator iter = mUniformMap.find(uniform); if (iter != mUniformMap.end()) @@ -1358,9 +1326,7 @@ GLint LLGLSLShader::getUniformLocation(const LLStaticHashedString& uniform) GLint LLGLSLShader::getUniformLocation(U32 index) { GLint ret = -1; - // Xcode 9 compatibiltiy - //if (mProgramObject > 0) - if (mProgramObject) + if (mProgramObject > 0) { llassert(index < mUniform.size()); return mUniform[index];