@@ -342,7 +342,7 @@ class GLUniform {
342342 const std::string _type;
343343
344344 // In multiples of 4 bytes
345- GLuint _std430Size;
345+ const GLuint _std430Size;
346346 const GLuint _std430Alignment;
347347 GLuint _nextUniformOffset;
348348
@@ -370,7 +370,7 @@ class GLUniform {
370370 _shader->RegisterUniform ( this );
371371 }
372372
373- bool CacheValue ( void * value ) {
373+ bool CacheValue ( const void * value ) {
374374 uint32_t * currentValue;
375375
376376 const bool bufferUniform = ( _shader->UseMaterialSystem () && _updateType == MATERIAL_OR_PUSH )
@@ -429,10 +429,6 @@ class GLUniform {
429429 void UpdateShaderProgramUniformLocation ( ShaderProgramDescriptor* shaderProgram ) {
430430 shaderProgram->uniformLocations [_locationIndex] = glGetUniformLocation ( shaderProgram->id , _name.c_str () );
431431 }
432-
433- virtual size_t GetSize () {
434- return 0 ;
435- }
436432};
437433
438434class GLShaderManager {
@@ -578,10 +574,6 @@ class GLUniformSampler : protected GLUniform {
578574 }
579575
580576 public:
581- size_t GetSize () override {
582- return sizeof ( GLuint64 );
583- }
584-
585577 void SetValue ( GLuint value ) {
586578 if ( !CacheValue ( &value ) ) {
587579 return ;
@@ -645,11 +637,6 @@ class GLUniform1i : protected GLUniform
645637 ShaderProgramDescriptor* p = _shader->GetProgram ();
646638 glUniform1i ( p->uniformLocations [ _locationIndex ], value );
647639 }
648- public:
649- size_t GetSize () override
650- {
651- return sizeof ( int );
652- }
653640};
654641
655642class GLUniform1ui : protected GLUniform {
@@ -666,10 +653,6 @@ class GLUniform1ui : protected GLUniform {
666653 ShaderProgramDescriptor* p = _shader->GetProgram ();
667654 glUniform1ui ( p->uniformLocations [_locationIndex], value );
668655 }
669- public:
670- size_t GetSize () override {
671- return sizeof ( uint );
672- }
673656};
674657
675658class GLUniform1Bool : protected GLUniform {
@@ -687,11 +670,6 @@ class GLUniform1Bool : protected GLUniform {
687670 ShaderProgramDescriptor* p = _shader->GetProgram ();
688671 glUniform1i ( p->uniformLocations [_locationIndex], value );
689672 }
690-
691- public:
692- size_t GetSize () override {
693- return sizeof ( int );
694- }
695673};
696674
697675class GLUniform1f : protected GLUniform
@@ -710,11 +688,6 @@ class GLUniform1f : protected GLUniform
710688 ShaderProgramDescriptor* p = _shader->GetProgram ();
711689 glUniform1f ( p->uniformLocations [ _locationIndex ], value );
712690 }
713- public:
714- size_t GetSize () override
715- {
716- return sizeof ( float );
717- }
718691};
719692
720693class GLUniform1fv : protected GLUniform
@@ -751,11 +724,6 @@ class GLUniform2f : protected GLUniform
751724 ShaderProgramDescriptor* p = _shader->GetProgram ();
752725 glUniform2f ( p->uniformLocations [ _locationIndex ], v[ 0 ], v[ 1 ] );
753726 }
754-
755- size_t GetSize () override
756- {
757- return sizeof ( vec2_t );
758- }
759727};
760728
761729class GLUniform3f : protected GLUniform
@@ -774,11 +742,6 @@ class GLUniform3f : protected GLUniform
774742 ShaderProgramDescriptor* p = _shader->GetProgram ();
775743 glUniform3f ( p->uniformLocations [ _locationIndex ], v[ 0 ], v[ 1 ], v[ 2 ] );
776744 }
777- public:
778- size_t GetSize () override
779- {
780- return sizeof ( vec3_t );
781- }
782745};
783746
784747class GLUniform4f : protected GLUniform
@@ -797,11 +760,6 @@ class GLUniform4f : protected GLUniform
797760 ShaderProgramDescriptor* p = _shader->GetProgram ();
798761 glUniform4f ( p->uniformLocations [ _locationIndex ], v[ 0 ], v[ 1 ], v[ 2 ], v[ 3 ] );
799762 }
800- public:
801- size_t GetSize () override
802- {
803- return sizeof ( vec4_t );
804- }
805763};
806764
807765class GLUniform4fv : protected GLUniform
@@ -838,11 +796,6 @@ class GLUniformMatrix4f : protected GLUniform
838796 ShaderProgramDescriptor* p = _shader->GetProgram ();
839797 glUniformMatrix4fv ( p->uniformLocations [ _locationIndex ], 1 , transpose, m );
840798 }
841- public:
842- size_t GetSize () override
843- {
844- return sizeof ( matrix_t );
845- }
846799};
847800
848801class GLUniformMatrix32f : protected GLUniform {
@@ -862,10 +815,6 @@ class GLUniformMatrix32f : protected GLUniform {
862815 ShaderProgramDescriptor* p = _shader->GetProgram ();
863816 glUniformMatrix3x2fv ( p->uniformLocations [_locationIndex], 1 , transpose, m );
864817 }
865- public:
866- size_t GetSize () override {
867- return 6 * sizeof ( float );
868- }
869818};
870819
871820class GLUniformMatrix4fv : protected GLUniform
0 commit comments