Allow more than 2gigs of texture memory... Fix shader buggles.

This commit is contained in:
Shyotl
2019-03-18 00:11:24 -05:00
parent a224c392e8
commit e0194d4d06
4 changed files with 10 additions and 6 deletions

View File

@@ -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;
}