Allow more than 2gigs of texture memory... Fix shader buggles.
# Conflicts: # indra/newview/llviewertexturelist.cpp
This commit is contained in:
@@ -746,6 +746,10 @@ BOOL LLGLSLShader::mapUniforms(const vector<LLStaticHashedString> * 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<LLStaticHashedString> * 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;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
// extern
|
||||
const S32Megabytes gMinVideoRam(32);
|
||||
const S32Megabytes gMaxVideoRam(2048);
|
||||
const S32Megabytes gMaxVideoRam(2048*4); // Bump to 8 gibibyte.
|
||||
|
||||
|
||||
// statics
|
||||
|
||||
@@ -1276,7 +1276,7 @@ LLPointer<LLImageJ2C> LLViewerTextureList::convertToUploadFile(LLPointer<LLImage
|
||||
// Returns min setting for TextureMemory (in MB)
|
||||
S32Megabytes LLViewerTextureList::getMinVideoRamSetting()
|
||||
{
|
||||
S32Megabytes system_ram = gSysMemory.getPhysicalMemoryClamped();
|
||||
S32Megabytes system_ram = gSysMemory.getPhysicalMemoryKB();
|
||||
//min texture mem sets to 64M if total physical mem is more than 1.5GB
|
||||
return (system_ram > 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;
|
||||
|
||||
Reference in New Issue
Block a user