Merge branch 'master' of git://github.com/Shyotl/SingularityViewer
This commit is contained in:
@@ -746,6 +746,10 @@ BOOL LLGLSLShader::mapUniforms(const vector<LLStaticHashedString> * uniforms)
|
|||||||
gl_uniform_data_t gl_uniform;
|
gl_uniform_data_t gl_uniform;
|
||||||
GLsizei length;
|
GLsizei length;
|
||||||
glGetActiveUniformARB(mProgramObject, i, 1024, &length, &gl_uniform.size, &gl_uniform.type, (GLcharARB *)name);
|
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)
|
if (gl_uniform.size < 0 || length <= 0)
|
||||||
continue;
|
continue;
|
||||||
gl_uniform.name = std::string(name, length);
|
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)
|
if (gl_uniform.texunit_priority == UINT_MAX)
|
||||||
{
|
{
|
||||||
S32 idx;
|
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;
|
gl_uniform.texunit_priority = idx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1154,7 +1154,7 @@ void LLShaderMgr::initAttribsAndUniforms()
|
|||||||
mReservedUniforms.push_back("specularMap");
|
mReservedUniforms.push_back("specularMap");
|
||||||
mReservedUniforms.push_back("bumpMap");
|
mReservedUniforms.push_back("bumpMap");
|
||||||
mReservedUniforms.push_back("environmentMap");
|
mReservedUniforms.push_back("environmentMap");
|
||||||
mReservedUniforms.push_back("cloude_noise_texture");
|
mReservedUniforms.push_back("cloud_noise_texture");
|
||||||
mReservedUniforms.push_back("fullbright");
|
mReservedUniforms.push_back("fullbright");
|
||||||
mReservedUniforms.push_back("lightnorm");
|
mReservedUniforms.push_back("lightnorm");
|
||||||
mReservedUniforms.push_back("sunlight_color_copy");
|
mReservedUniforms.push_back("sunlight_color_copy");
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
// extern
|
// extern
|
||||||
const S32Megabytes gMinVideoRam(32);
|
const S32Megabytes gMinVideoRam(32);
|
||||||
const S32Megabytes gMaxVideoRam(2048);
|
const S32Megabytes gMaxVideoRam(2048*4); // Bump to 8 gibibyte.
|
||||||
|
|
||||||
|
|
||||||
// statics
|
// statics
|
||||||
|
|||||||
@@ -1284,7 +1284,7 @@ LLPointer<LLImageJ2C> LLViewerTextureList::convertToUploadFile(LLPointer<LLImage
|
|||||||
// Returns min setting for TextureMemory (in MB)
|
// Returns min setting for TextureMemory (in MB)
|
||||||
S32Megabytes LLViewerTextureList::getMinVideoRamSetting()
|
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
|
//min texture mem sets to 64M if total physical mem is more than 1.5GB
|
||||||
return (system_ram > S32Megabytes(1500)) ? S32Megabytes(64) : gMinVideoRam ;
|
return (system_ram > S32Megabytes(1500)) ? S32Megabytes(64) : gMinVideoRam ;
|
||||||
}
|
}
|
||||||
@@ -1328,8 +1328,7 @@ S32Megabytes LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, fl
|
|||||||
LL_WARNS() << "VRAM amount not detected, defaulting to " << max_texmem << " MB" << LL_ENDL;
|
LL_WARNS() << "VRAM amount not detected, defaulting to " << max_texmem << " MB" << LL_ENDL;
|
||||||
}
|
}
|
||||||
|
|
||||||
S32Megabytes system_ram = gSysMemory.getPhysicalMemoryClamped(); // In MB
|
S32Megabytes system_ram = gSysMemory.getPhysicalMemoryKB(); // In MB
|
||||||
//LL_INFOS() << "*** DETECTED " << system_ram << " MB of system memory." << LL_ENDL;
|
|
||||||
if (get_recommended)
|
if (get_recommended)
|
||||||
max_texmem = llmin(max_texmem, system_ram/2);
|
max_texmem = llmin(max_texmem, system_ram/2);
|
||||||
else
|
else
|
||||||
@@ -1381,7 +1380,7 @@ void LLViewerTextureList::updateMaxResidentTexMem(S32Megabytes mem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//system mem
|
//system mem
|
||||||
S32Megabytes system_ram = gSysMemory.getPhysicalMemoryClamped();
|
S32Megabytes system_ram = gSysMemory.getPhysicalMemoryKB();
|
||||||
|
|
||||||
//minimum memory reserved for non-texture use.
|
//minimum memory reserved for non-texture use.
|
||||||
//if system_raw >= 1GB, reserve at least 512MB for non-texture use;
|
//if system_raw >= 1GB, reserve at least 512MB for non-texture use;
|
||||||
|
|||||||
Reference in New Issue
Block a user