aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llglslshader.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:50 -0500
committerJacek Antonelli2008-08-15 23:45:50 -0500
commit2a4dea528f670b9bb1f77ef27a8a1dd16603d114 (patch)
tree95c68e362703c9099d571ecbdc6142b1cda1e005 /linden/indra/newview/llglslshader.cpp
parentSecond Life viewer sources 1.20.6 (diff)
downloadmeta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.zip
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.gz
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.bz2
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.xz
Second Life viewer sources 1.20.7
Diffstat (limited to 'linden/indra/newview/llglslshader.cpp')
-rw-r--r--linden/indra/newview/llglslshader.cpp116
1 files changed, 52 insertions, 64 deletions
diff --git a/linden/indra/newview/llglslshader.cpp b/linden/indra/newview/llglslshader.cpp
index 5c8f156..afbafde 100644
--- a/linden/indra/newview/llglslshader.cpp
+++ b/linden/indra/newview/llglslshader.cpp
@@ -34,6 +34,7 @@
34#include "llfeaturemanager.h" 34#include "llfeaturemanager.h"
35#include "llglslshader.h" 35#include "llglslshader.h"
36 36
37#include "llfile.h"
37#include "llviewerwindow.h" 38#include "llviewerwindow.h"
38#include "llviewercontrol.h" 39#include "llviewercontrol.h"
39#include "pipeline.h" 40#include "pipeline.h"
@@ -42,16 +43,16 @@
42#include "llwaterparammanager.h" 43#include "llwaterparammanager.h"
43#include "llsky.h" 44#include "llsky.h"
44#include "llvosky.h" 45#include "llvosky.h"
45#include "llglimmediate.h" 46#include "llrender.h"
46 47
47#if LL_DARWIN 48#if LL_DARWIN
48#include "OpenGL/OpenGL.h" 49#include "OpenGL/OpenGL.h"
49#endif 50#endif
50 51
51#ifdef LL_RELEASE_FOR_DOWNLOAD 52#ifdef LL_RELEASE_FOR_DOWNLOAD
52#define UNIFORM_ERRS llwarns 53#define UNIFORM_ERRS LL_WARNS_ONCE("Shader")
53#else 54#else
54#define UNIFORM_ERRS llerrs 55#define UNIFORM_ERRS LL_ERRS("Shader")
55#endif 56#endif
56 57
57// Lots of STL stuff in here, using namespace std to keep things more readable 58// Lots of STL stuff in here, using namespace std to keep things more readable
@@ -60,20 +61,6 @@ using std::pair;
60using std::make_pair; 61using std::make_pair;
61using std::string; 62using std::string;
62 63
63/*
64//utility shader objects (not shader programs)
65GLhandleARB gSumLightsVertex;
66GLhandleARB gLightVertex;
67GLhandleARB gLightFuncVertex;
68GLhandleARB gLightFragment;
69GLhandleARB gWaterFogFragment;
70
71//utility WindLight shader objects (not shader programs)
72GLhandleARB gWindLightVertex;
73GLhandleARB gWindLightFragment;
74GLhandleARB gGammaFragment;
75*/
76
77LLVector4 gShinyOrigin; 64LLVector4 gShinyOrigin;
78 65
79//object shaders 66//object shaders
@@ -506,11 +493,11 @@ void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns)
506 LLString log = get_object_log(ret); 493 LLString log = get_object_log(ret);
507 if (warns) 494 if (warns)
508 { 495 {
509 llwarns << log << llendl; 496 LL_WARNS("ShaderLoading") << log << LL_ENDL;
510 } 497 }
511 else 498 else
512 { 499 {
513 llinfos << log << llendl; 500 LL_DEBUGS("ShaderLoading") << log << LL_ENDL;
514 } 501 }
515} 502}
516 503
@@ -520,10 +507,10 @@ GLhandleARB LLShaderMgr::loadShaderFile(const LLString& filename, S32 & shader_l
520 error = glGetError(); 507 error = glGetError();
521 if (error != GL_NO_ERROR) 508 if (error != GL_NO_ERROR)
522 { 509 {
523 llwarns << "GL ERROR entering loadShaderFile(): " << error << llendl; 510 LL_WARNS("ShaderLoading") << "GL ERROR entering loadShaderFile(): " << error << LL_ENDL;
524 } 511 }
525 512
526 llinfos << "Loading shader file: " << filename << " class " << shader_level << llendl; 513 LL_DEBUGS("ShaderLoading") << "Loading shader file: " << filename << " class " << shader_level << LL_ENDL;
527 514
528 if (filename.empty()) 515 if (filename.empty())
529 { 516 {
@@ -532,7 +519,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const LLString& filename, S32 & shader_l
532 519
533 520
534 //read in from file 521 //read in from file
535 FILE* file = NULL; 522 LLFILE* file = NULL;
536 523
537 S32 try_gpu_class = shader_level; 524 S32 try_gpu_class = shader_level;
538 S32 gpu_class; 525 S32 gpu_class;
@@ -544,20 +531,18 @@ GLhandleARB LLShaderMgr::loadShaderFile(const LLString& filename, S32 & shader_l
544 fname << gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "shaders/class"); 531 fname << gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "shaders/class");
545 fname << gpu_class << "/" << filename; 532 fname << gpu_class << "/" << filename;
546 533
547 llinfos << "Looking in " << fname.str().c_str() << llendl; 534 LL_DEBUGS("ShaderLoading") << "Looking in " << fname.str().c_str() << LL_ENDL;
548 file = fopen(fname.str().c_str(), "r"); /* Flawfinder: ignore */ 535 file = LLFile::fopen(fname.str().c_str(), "r"); /* Flawfinder: ignore */
549 if (file) 536 if (file)
550 { 537 {
551#if !LL_RELEASE_FOR_DOWNLOAD 538 LL_INFOS("ShaderLoading") << "Loading file: shaders/class" << gpu_class << "/" << filename << " (Want class " << gpu_class << ")" << LL_ENDL;
552 llinfos << "Found shader file: " << fname.str() << llendl;
553#endif
554 break; // done 539 break; // done
555 } 540 }
556 } 541 }
557 542
558 if (file == NULL) 543 if (file == NULL)
559 { 544 {
560 llinfos << "GLSL Shader file not found: " << filename << llendl; 545 LL_WARNS("ShaderLoading") << "GLSL Shader file not found: " << filename << LL_ENDL;
561 return 0; 546 return 0;
562 } 547 }
563 548
@@ -580,7 +565,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const LLString& filename, S32 & shader_l
580 error = glGetError(); 565 error = glGetError();
581 if (error != GL_NO_ERROR) 566 if (error != GL_NO_ERROR)
582 { 567 {
583 llwarns << "GL ERROR in glCreateShaderObjectARB: " << error << llendl; 568 LL_WARNS("ShaderLoading") << "GL ERROR in glCreateShaderObjectARB: " << error << LL_ENDL;
584 } 569 }
585 else 570 else
586 { 571 {
@@ -589,7 +574,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const LLString& filename, S32 & shader_l
589 error = glGetError(); 574 error = glGetError();
590 if (error != GL_NO_ERROR) 575 if (error != GL_NO_ERROR)
591 { 576 {
592 llwarns << "GL ERROR in glShaderSourceARB: " << error << llendl; 577 LL_WARNS("ShaderLoading") << "GL ERROR in glShaderSourceARB: " << error << LL_ENDL;
593 } 578 }
594 else 579 else
595 { 580 {
@@ -598,7 +583,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const LLString& filename, S32 & shader_l
598 error = glGetError(); 583 error = glGetError();
599 if (error != GL_NO_ERROR) 584 if (error != GL_NO_ERROR)
600 { 585 {
601 llwarns << "GL ERROR in glCompileShaderARB: " << error << llendl; 586 LL_WARNS("ShaderLoading") << "GL ERROR in glCompileShaderARB: " << error << LL_ENDL;
602 } 587 }
603 } 588 }
604 } 589 }
@@ -616,7 +601,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const LLString& filename, S32 & shader_l
616 if (error != GL_NO_ERROR || success == GL_FALSE) 601 if (error != GL_NO_ERROR || success == GL_FALSE)
617 { 602 {
618 //an error occured, print log 603 //an error occured, print log
619 llwarns << "GLSL Compilation Error: (" << error << ") in " << filename << llendl; 604 LL_WARNS("ShaderLoading") << "GLSL Compilation Error: (" << error << ") in " << filename << LL_ENDL;
620 dumpObjectLog(ret); 605 dumpObjectLog(ret);
621 ret = 0; 606 ret = 0;
622 } 607 }
@@ -641,7 +626,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const LLString& filename, S32 & shader_l
641 shader_level--; 626 shader_level--;
642 return loadShaderFile(filename,shader_level,type); 627 return loadShaderFile(filename,shader_level,type);
643 } 628 }
644 llwarns << "Failed to load " << filename << llendl; 629 LL_WARNS("ShaderLoading") << "Failed to load " << filename << LL_ENDL;
645 } 630 }
646 return ret; 631 return ret;
647} 632}
@@ -655,7 +640,7 @@ BOOL LLShaderMgr::linkProgramObject(GLhandleARB obj, BOOL suppress_errors)
655 if (!suppress_errors && success == GL_FALSE) 640 if (!suppress_errors && success == GL_FALSE)
656 { 641 {
657 //an error occured, print log 642 //an error occured, print log
658 llwarns << "GLSL Linker Error:" << llendl; 643 LL_WARNS("ShaderLoading") << "GLSL Linker Error:" << LL_ENDL;
659 } 644 }
660 645
661// NOTE: Removing LL_DARWIN block as it doesn't seem to actually give the correct answer, 646// NOTE: Removing LL_DARWIN block as it doesn't seem to actually give the correct answer,
@@ -675,7 +660,7 @@ BOOL LLShaderMgr::linkProgramObject(GLhandleARB obj, BOOL suppress_errors)
675 CGLGetParameter (ctx, kCGLCPGPUFragmentProcessing, &fragmentGPUProcessing); 660 CGLGetParameter (ctx, kCGLCPGPUFragmentProcessing, &fragmentGPUProcessing);
676 if (!fragmentGPUProcessing || !vertexGPUProcessing) 661 if (!fragmentGPUProcessing || !vertexGPUProcessing)
677 { 662 {
678 llwarns << "GLSL Linker: Running in Software:" << llendl; 663 LL_WARNS("ShaderLoading") << "GLSL Linker: Running in Software:" << LL_ENDL;
679 success = GL_FALSE; 664 success = GL_FALSE;
680 suppress_errors = FALSE; 665 suppress_errors = FALSE;
681 } 666 }
@@ -685,7 +670,7 @@ BOOL LLShaderMgr::linkProgramObject(GLhandleARB obj, BOOL suppress_errors)
685 LLString::toLower(log); 670 LLString::toLower(log);
686 if (log.find("software") != LLString::npos) 671 if (log.find("software") != LLString::npos)
687 { 672 {
688 llwarns << "GLSL Linker: Running in Software:" << llendl; 673 LL_WARNS("ShaderLoading") << "GLSL Linker: Running in Software:" << LL_ENDL;
689 success = GL_FALSE; 674 success = GL_FALSE;
690 suppress_errors = FALSE; 675 suppress_errors = FALSE;
691 } 676 }
@@ -706,7 +691,7 @@ BOOL LLShaderMgr::validateProgramObject(GLhandleARB obj)
706 glGetObjectParameterivARB(obj, GL_OBJECT_VALIDATE_STATUS_ARB, &success); 691 glGetObjectParameterivARB(obj, GL_OBJECT_VALIDATE_STATUS_ARB, &success);
707 if (success == GL_FALSE) 692 if (success == GL_FALSE)
708 { 693 {
709 llwarns << "GLSL program not valid: " << llendl; 694 LL_WARNS("ShaderLoading") << "GLSL program not valid: " << LL_ENDL;
710 dumpObjectLog(obj); 695 dumpObjectLog(obj);
711 } 696 }
712 else 697 else
@@ -757,7 +742,7 @@ void LLShaderMgr::setShaders()
757 gPipeline.setLightingDetail(-1); 742 gPipeline.setLightingDetail(-1);
758 743
759 // Shaders 744 // Shaders
760 llinfos << "\n~~~~~~~~~~~~~~~~~~\n Loading Shaders:\n~~~~~~~~~~~~~~~~~~" << llendl; 745 LL_INFOS("ShaderLoading") << "\n~~~~~~~~~~~~~~~~~~\n Loading Shaders:\n~~~~~~~~~~~~~~~~~~" << LL_ENDL;
761 for (S32 i = 0; i < SHADER_COUNT; i++) 746 for (S32 i = 0; i < SHADER_COUNT; i++)
762 { 747 {
763 sVertexShaderLevel[i] = 0; 748 sVertexShaderLevel[i] = 0;
@@ -1625,7 +1610,7 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes,
1625 for ( ; fileIter != mShaderFiles.end(); fileIter++ ) 1610 for ( ; fileIter != mShaderFiles.end(); fileIter++ )
1626 { 1611 {
1627 GLhandleARB shaderhandle = LLShaderMgr::loadShaderFile((*fileIter).first, mShaderLevel, (*fileIter).second); 1612 GLhandleARB shaderhandle = LLShaderMgr::loadShaderFile((*fileIter).first, mShaderLevel, (*fileIter).second);
1628 lldebugs << "SHADER FILE: " << (*fileIter).first << " mShaderLevel=" << mShaderLevel << llendl; 1613 LL_DEBUGS("ShaderLoading") << "SHADER FILE: " << (*fileIter).first << " mShaderLevel=" << mShaderLevel << LL_ENDL;
1629 if (mShaderLevel > 0) 1614 if (mShaderLevel > 0)
1630 { 1615 {
1631 attachObject(shaderhandle); 1616 attachObject(shaderhandle);
@@ -1647,12 +1632,12 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes,
1647 } 1632 }
1648 if( !success ) 1633 if( !success )
1649 { 1634 {
1650 llwarns << "Failed to link shader: " << mName << llendl; 1635 LL_WARNS("ShaderLoading") << "Failed to link shader: " << mName << LL_ENDL;
1651 1636
1652 // Try again using a lower shader level; 1637 // Try again using a lower shader level;
1653 if (mShaderLevel > 0) 1638 if (mShaderLevel > 0)
1654 { 1639 {
1655 llwarns << "Failed to link using shader level " << mShaderLevel << ". Trying again using shader level " << (mShaderLevel - 1) << "." << llendl; 1640 LL_WARNS("ShaderLoading") << "Failed to link using shader level " << mShaderLevel << " trying again using shader level " << (mShaderLevel - 1) << LL_ENDL;
1656 mShaderLevel--; 1641 mShaderLevel--;
1657 return createShader(attributes,uniforms); 1642 return createShader(attributes,uniforms);
1658 } 1643 }
@@ -1671,7 +1656,7 @@ BOOL LLGLSLShader::attachObject(std::string object)
1671 } 1656 }
1672 else 1657 else
1673 { 1658 {
1674 llwarns << "Attempting to attach shader object that hasn't been compiled: " << object << llendl; 1659 LL_WARNS("ShaderLoading") << "Attempting to attach shader object that hasn't been compiled: " << object << LL_ENDL;
1675 return FALSE; 1660 return FALSE;
1676 } 1661 }
1677} 1662}
@@ -1686,7 +1671,7 @@ void LLGLSLShader::attachObject(GLhandleARB object)
1686 } 1671 }
1687 else 1672 else
1688 { 1673 {
1689 llwarns << "Attempting to attach non existing shader object. " << llendl; 1674 LL_WARNS("ShaderLoading") << "Attempting to attach non existing shader object. " << LL_ENDL;
1690 } 1675 }
1691} 1676}
1692 1677
@@ -1718,7 +1703,7 @@ BOOL LLGLSLShader::mapAttributes(const vector<string> * attributes)
1718 if (index != -1) 1703 if (index != -1)
1719 { 1704 {
1720 mAttribute[i] = index; 1705 mAttribute[i] = index;
1721 // llinfos << "Attribute " << name << " assigned to channel " << index << llendl; 1706 LL_DEBUGS("ShaderLoading") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
1722 } 1707 }
1723 } 1708 }
1724 if (attributes != NULL) 1709 if (attributes != NULL)
@@ -1730,7 +1715,7 @@ BOOL LLGLSLShader::mapAttributes(const vector<string> * attributes)
1730 if (index != -1) 1715 if (index != -1)
1731 { 1716 {
1732 mAttribute[LLShaderMgr::sReservedAttribs.size() + i] = index; 1717 mAttribute[LLShaderMgr::sReservedAttribs.size() + i] = index;
1733 // llinfos << "Attribute " << name << " assigned to channel " << index << llendl; 1718 LL_DEBUGS("ShaderLoading") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
1734 } 1719 }
1735 } 1720 }
1736 } 1721 }
@@ -1759,9 +1744,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector<string> * uniforms)
1759 if (location != -1) 1744 if (location != -1)
1760 { 1745 {
1761 mUniformMap[name] = location; 1746 mUniformMap[name] = location;
1762#if 0 // !LL_RELEASE_FOR_DOWNLOAD 1747 LL_DEBUGS("ShaderLoading") << "Uniform " << name << " is at location " << location << LL_ENDL;
1763 llinfos << "Uniform " << name << " is at location " << location << llendl;
1764#endif
1765 1748
1766 //find the index of this uniform 1749 //find the index of this uniform
1767 for (S32 i = 0; i < (S32) LLShaderMgr::sReservedUniforms.size(); i++) 1750 for (S32 i = 0; i < (S32) LLShaderMgr::sReservedUniforms.size(); i++)
@@ -1798,7 +1781,7 @@ GLint LLGLSLShader::mapUniformTextureChannel(GLint location, GLenum type)
1798 if (type >= GL_SAMPLER_1D_ARB && type <= GL_SAMPLER_2D_RECT_SHADOW_ARB) 1781 if (type >= GL_SAMPLER_1D_ARB && type <= GL_SAMPLER_2D_RECT_SHADOW_ARB)
1799 { //this here is a texture 1782 { //this here is a texture
1800 glUniform1iARB(location, mActiveTextureChannels); 1783 glUniform1iARB(location, mActiveTextureChannels);
1801 llinfos << "Assigned to texture channel " << mActiveTextureChannels << llendl; 1784 LL_DEBUGS("ShaderLoading") << "Assigned to texture channel " << mActiveTextureChannels << LL_ENDL;
1802 return mActiveTextureChannels++; 1785 return mActiveTextureChannels++;
1803 } 1786 }
1804 return -1; 1787 return -1;
@@ -1866,17 +1849,22 @@ void LLGLSLShader::unbind()
1866 } 1849 }
1867} 1850}
1868 1851
1852void LLGLSLShader::bindNoShader(void)
1853{
1854 glUseProgramObjectARB(0);
1855}
1856
1869S32 LLGLSLShader::enableTexture(S32 uniform, S32 mode) 1857S32 LLGLSLShader::enableTexture(S32 uniform, S32 mode)
1870{ 1858{
1871 if (uniform < 0 || uniform >= (S32)mTexture.size()) 1859 if (uniform < 0 || uniform >= (S32)mTexture.size())
1872 { 1860 {
1873 UNIFORM_ERRS << "LLGLSLShader::enableTexture: uniform out of range: " << uniform << llendl; 1861 UNIFORM_ERRS << "Uniform out of range: " << uniform << LL_ENDL;
1874 return -1; 1862 return -1;
1875 } 1863 }
1876 S32 index = mTexture[uniform]; 1864 S32 index = mTexture[uniform];
1877 if (index != -1) 1865 if (index != -1)
1878 { 1866 {
1879 glActiveTextureARB(GL_TEXTURE0_ARB+index); 1867 gGL.getTexUnit(index)->activate();
1880 glEnable(mode); 1868 glEnable(mode);
1881 } 1869 }
1882 return index; 1870 return index;
@@ -1886,13 +1874,13 @@ S32 LLGLSLShader::disableTexture(S32 uniform, S32 mode)
1886{ 1874{
1887 if (uniform < 0 || uniform >= (S32)mTexture.size()) 1875 if (uniform < 0 || uniform >= (S32)mTexture.size())
1888 { 1876 {
1889 UNIFORM_ERRS << "LLGLSLShader::disableTexture: uniform out of range: " << uniform << llendl; 1877 UNIFORM_ERRS << "Uniform out of range: " << uniform << LL_ENDL;
1890 return -1; 1878 return -1;
1891 } 1879 }
1892 S32 index = mTexture[uniform]; 1880 S32 index = mTexture[uniform];
1893 if (index != -1) 1881 if (index != -1)
1894 { 1882 {
1895 glActiveTextureARB(GL_TEXTURE0_ARB+index); 1883 gGL.getTexUnit(index)->activate();
1896 glDisable(mode); 1884 glDisable(mode);
1897 } 1885 }
1898 return index; 1886 return index;
@@ -1904,7 +1892,7 @@ void LLGLSLShader::uniform1f(U32 index, GLfloat x)
1904 { 1892 {
1905 if (mUniform.size() <= index) 1893 if (mUniform.size() <= index)
1906 { 1894 {
1907 UNIFORM_ERRS << "Uniform index out of bounds." << llendl; 1895 UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
1908 return; 1896 return;
1909 } 1897 }
1910 1898
@@ -1926,7 +1914,7 @@ void LLGLSLShader::uniform2f(U32 index, GLfloat x, GLfloat y)
1926 { 1914 {
1927 if (mUniform.size() <= index) 1915 if (mUniform.size() <= index)
1928 { 1916 {
1929 UNIFORM_ERRS << "Uniform index out of bounds." << llendl; 1917 UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
1930 return; 1918 return;
1931 } 1919 }
1932 1920
@@ -1949,7 +1937,7 @@ void LLGLSLShader::uniform3f(U32 index, GLfloat x, GLfloat y, GLfloat z)
1949 { 1937 {
1950 if (mUniform.size() <= index) 1938 if (mUniform.size() <= index)
1951 { 1939 {
1952 UNIFORM_ERRS << "Uniform index out of bounds." << llendl; 1940 UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
1953 return; 1941 return;
1954 } 1942 }
1955 1943
@@ -1972,7 +1960,7 @@ void LLGLSLShader::uniform4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat
1972 { 1960 {
1973 if (mUniform.size() <= index) 1961 if (mUniform.size() <= index)
1974 { 1962 {
1975 UNIFORM_ERRS << "Uniform index out of bounds." << llendl; 1963 UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
1976 return; 1964 return;
1977 } 1965 }
1978 1966
@@ -1995,7 +1983,7 @@ void LLGLSLShader::uniform1fv(U32 index, U32 count, const GLfloat* v)
1995 { 1983 {
1996 if (mUniform.size() <= index) 1984 if (mUniform.size() <= index)
1997 { 1985 {
1998 UNIFORM_ERRS << "Uniform index out of bounds." << llendl; 1986 UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
1999 return; 1987 return;
2000 } 1988 }
2001 1989
@@ -2018,7 +2006,7 @@ void LLGLSLShader::uniform2fv(U32 index, U32 count, const GLfloat* v)
2018 { 2006 {
2019 if (mUniform.size() <= index) 2007 if (mUniform.size() <= index)
2020 { 2008 {
2021 UNIFORM_ERRS << "Uniform index out of bounds." << llendl; 2009 UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
2022 return; 2010 return;
2023 } 2011 }
2024 2012
@@ -2041,7 +2029,7 @@ void LLGLSLShader::uniform3fv(U32 index, U32 count, const GLfloat* v)
2041 { 2029 {
2042 if (mUniform.size() <= index) 2030 if (mUniform.size() <= index)
2043 { 2031 {
2044 UNIFORM_ERRS << "Uniform index out of bounds." << llendl; 2032 UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
2045 return; 2033 return;
2046 } 2034 }
2047 2035
@@ -2064,7 +2052,7 @@ void LLGLSLShader::uniform4fv(U32 index, U32 count, const GLfloat* v)
2064 { 2052 {
2065 if (mUniform.size() <= index) 2053 if (mUniform.size() <= index)
2066 { 2054 {
2067 UNIFORM_ERRS << "Uniform index out of bounds." << llendl; 2055 UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
2068 return; 2056 return;
2069 } 2057 }
2070 2058
@@ -2087,7 +2075,7 @@ void LLGLSLShader::uniformMatrix2fv(U32 index, U32 count, GLboolean transpose, c
2087 { 2075 {
2088 if (mUniform.size() <= index) 2076 if (mUniform.size() <= index)
2089 { 2077 {
2090 UNIFORM_ERRS << "Uniform index out of bounds." << llendl; 2078 UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
2091 return; 2079 return;
2092 } 2080 }
2093 2081
@@ -2104,7 +2092,7 @@ void LLGLSLShader::uniformMatrix3fv(U32 index, U32 count, GLboolean transpose, c
2104 { 2092 {
2105 if (mUniform.size() <= index) 2093 if (mUniform.size() <= index)
2106 { 2094 {
2107 UNIFORM_ERRS << "Uniform index out of bounds." << llendl; 2095 UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
2108 return; 2096 return;
2109 } 2097 }
2110 2098
@@ -2121,7 +2109,7 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c
2121 { 2109 {
2122 if (mUniform.size() <= index) 2110 if (mUniform.size() <= index)
2123 { 2111 {
2124 UNIFORM_ERRS << "Uniform index out of bounds." << llendl; 2112 UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
2125 return; 2113 return;
2126 } 2114 }
2127 2115