diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index abd135882..09aedf278 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -746,6 +746,10 @@ BOOL LLGLSLShader::mapUniforms(const vector * uniforms) gl_uniform_data_t gl_uniform; GLsizei length; glGetActiveUniformARB(mProgramObject, i, 1024, &length, &gl_uniform.size, &gl_uniform.type, (GLcharARB *)name); + if (length && name[length - 1] == '\0') + { + --length; // Some drivers can't be trusted... + } if (gl_uniform.size < 0 || length <= 0) continue; gl_uniform.name = std::string(name, length); @@ -762,7 +766,7 @@ BOOL LLGLSLShader::mapUniforms(const vector * uniforms) if (gl_uniform.texunit_priority == UINT_MAX) { S32 idx; - if (sscanf(gl_uniform.name.c_str(), "tex%d", &idx) && idx < (S32)max_index) + if (sscanf(gl_uniform.name.c_str(), "tex%d", &idx)) { gl_uniform.texunit_priority = idx; } diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 37a0ea424..9b5adf60c 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -1154,7 +1154,7 @@ void LLShaderMgr::initAttribsAndUniforms() mReservedUniforms.push_back("specularMap"); mReservedUniforms.push_back("bumpMap"); mReservedUniforms.push_back("environmentMap"); - mReservedUniforms.push_back("cloude_noise_texture"); + mReservedUniforms.push_back("cloud_noise_texture"); mReservedUniforms.push_back("fullbright"); mReservedUniforms.push_back("lightnorm"); mReservedUniforms.push_back("sunlight_color_copy"); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 0df6af561..1f97ff20b 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -65,7 +65,7 @@ // extern const S32Megabytes gMinVideoRam(32); -const S32Megabytes gMaxVideoRam(2048); +const S32Megabytes gMaxVideoRam(2048*4); // Bump to 8 gibibyte. // statics diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 885ba2d87..3eab781c9 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1276,7 +1276,7 @@ LLPointer LLViewerTextureList::convertToUploadFile(LLPointer S32Megabytes(1500)) ? S32Megabytes(64) : gMinVideoRam ; } @@ -1320,8 +1320,7 @@ S32Megabytes LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, fl LL_WARNS() << "VRAM amount not detected, defaulting to " << max_texmem << " MB" << LL_ENDL; } - S32Megabytes system_ram = gSysMemory.getPhysicalMemoryClamped(); // In MB - //LL_INFOS() << "*** DETECTED " << system_ram << " MB of system memory." << LL_ENDL; + S32Megabytes system_ram = gSysMemory.getPhysicalMemoryKB(); // In MB if (get_recommended) max_texmem = llmin(max_texmem, system_ram/2); else @@ -1373,7 +1372,7 @@ void LLViewerTextureList::updateMaxResidentTexMem(S32Megabytes mem) } //system mem - S32Megabytes system_ram = gSysMemory.getPhysicalMemoryClamped(); + S32Megabytes system_ram = gSysMemory.getPhysicalMemoryKB(); //minimum memory reserved for non-texture use. //if system_raw >= 1GB, reserve at least 512MB for non-texture use;