diff options
author | Brad Linden <46733234+brad-linden@users.noreply.github.com> | 2024-06-18 11:48:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-18 11:48:37 -0700 |
commit | 4e593dcded0ab1cc033a9be4d0489d12a8305a7e (patch) | |
tree | eb12b6af64b6da0444776034025fec9141ce41ce /indra/llrender | |
parent | 3da16d1899324b358ac0d27ddd99bf8214f6fb54 (diff) | |
parent | 7342ebf43aa7500afe7410b49689a3aefa669e58 (diff) |
Merge pull request #1797 from secondlife/release/maint-a
merge release/maint-a into develop and close maint-a
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llglslshader.cpp | 59 | ||||
-rw-r--r-- | indra/llrender/llrender.h | 1 |
2 files changed, 40 insertions, 20 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 79979657f1..e22df46b28 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -1099,7 +1099,8 @@ S32 LLGLSLShader::bindTexture(S32 uniform, LLTexture* texture, LLTexUnit::eTextu if (uniform < 0 || uniform >= (S32)mTexture.size()) { - LL_SHADER_UNIFORM_ERRS() << "Uniform out of range: " << uniform << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << uniform << LL_ENDL; + llassert(false); return -1; } @@ -1120,6 +1121,8 @@ S32 LLGLSLShader::bindTexture(S32 uniform, LLRenderTarget* texture, bool depth, if (uniform < 0 || uniform >= (S32)mTexture.size()) { + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << uniform << LL_ENDL; + llassert(false); return -1; } @@ -1167,7 +1170,8 @@ S32 LLGLSLShader::unbindTexture(S32 uniform, LLTexUnit::eTextureType mode) if (uniform < 0 || uniform >= (S32)mTexture.size()) { - LL_SHADER_UNIFORM_ERRS() << "Uniform out of range: " << uniform << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << uniform << LL_ENDL; + llassert(false); return -1; } @@ -1192,7 +1196,8 @@ S32 LLGLSLShader::enableTexture(S32 uniform, LLTexUnit::eTextureType mode, LLTex if (uniform < 0 || uniform >= (S32)mTexture.size()) { - LL_SHADER_UNIFORM_ERRS() << "Uniform out of range: " << uniform << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << uniform << LL_ENDL; + llassert(false); return -1; } @@ -1213,7 +1218,8 @@ S32 LLGLSLShader::disableTexture(S32 uniform, LLTexUnit::eTextureType mode, LLTe if (uniform < 0 || uniform >= (S32)mTexture.size()) { - LL_SHADER_UNIFORM_ERRS() << "Uniform out of range: " << uniform << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << uniform << LL_ENDL; + llassert(false); return -1; } S32 index = mTexture[uniform]; @@ -1244,7 +1250,8 @@ void LLGLSLShader::uniform1i(U32 index, GLint x) { if (mUniform.size() <= index) { - LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; + llassert(false); return; } @@ -1269,7 +1276,8 @@ void LLGLSLShader::uniform1f(U32 index, GLfloat x) { if (mUniform.size() <= index) { - LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; + llassert(false); return; } @@ -1304,7 +1312,8 @@ void LLGLSLShader::uniform2f(U32 index, GLfloat x, GLfloat y) { if (mUniform.size() <= index) { - LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; + llassert(false); return; } @@ -1330,7 +1339,8 @@ void LLGLSLShader::uniform3f(U32 index, GLfloat x, GLfloat y, GLfloat z) { if (mUniform.size() <= index) { - LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; + llassert(false); return; } @@ -1356,7 +1366,8 @@ void LLGLSLShader::uniform4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat { if (mUniform.size() <= index) { - LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; + llassert(false); return; } @@ -1382,7 +1393,8 @@ void LLGLSLShader::uniform1iv(U32 index, U32 count, const GLint* v) { if (mUniform.size() <= index) { - LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; + llassert(false); return; } @@ -1408,7 +1420,8 @@ void LLGLSLShader::uniform4iv(U32 index, U32 count, const GLint* v) { if (mUniform.size() <= index) { - LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; + llassert(false); return; } @@ -1435,7 +1448,8 @@ void LLGLSLShader::uniform1fv(U32 index, U32 count, const GLfloat* v) { if (mUniform.size() <= index) { - LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; + llassert(false); return; } @@ -1461,7 +1475,8 @@ void LLGLSLShader::uniform2fv(U32 index, U32 count, const GLfloat* v) { if (mUniform.size() <= index) { - LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; + llassert(false); return; } @@ -1487,7 +1502,8 @@ void LLGLSLShader::uniform3fv(U32 index, U32 count, const GLfloat* v) { if (mUniform.size() <= index) { - LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; + llassert(false); return; } @@ -1513,7 +1529,8 @@ void LLGLSLShader::uniform4fv(U32 index, U32 count, const GLfloat* v) { if (mUniform.size() <= index) { - LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; + llassert(false); return; } @@ -1540,7 +1557,8 @@ void LLGLSLShader::uniformMatrix2fv(U32 index, U32 count, GLboolean transpose, c { if (mUniform.size() <= index) { - LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; + llassert(false); return; } @@ -1560,7 +1578,8 @@ void LLGLSLShader::uniformMatrix3fv(U32 index, U32 count, GLboolean transpose, c { if (mUniform.size() <= index) { - LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; + llassert(false); return; } @@ -1580,7 +1599,8 @@ void LLGLSLShader::uniformMatrix3x4fv(U32 index, U32 count, GLboolean transpose, { if (mUniform.size() <= index) { - LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; + llassert(false); return; } @@ -1600,7 +1620,8 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c { if (mUniform.size() <= index) { - LL_SHADER_UNIFORM_ERRS() << "Uniform index out of bounds." << LL_ENDL; + LL_WARNS_ONCE("Shader") << "Uniform index out of bounds. Size: " << (S32)mUniform.size() << " index: " << index << LL_ENDL; + llassert(false); return; } diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index ebdc9e751d..be9f3895e7 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -548,6 +548,5 @@ glh::matrix4f gl_perspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloa glh::matrix4f gl_lookat(LLVector3 eye, LLVector3 center, LLVector3 up); #define LL_SHADER_LOADING_WARNS(...) LL_WARNS() -#define LL_SHADER_UNIFORM_ERRS(...) LL_ERRS("Shader") #endif |