@@ -341,7 +341,7 @@ class GLUniform {
341341 const std::string _type;
342342
343343 // In multiples of 4 bytes
344- GLuint _std430Size;
344+ const GLuint _std430Size;
345345 const GLuint _std430Alignment;
346346 GLuint _nextUniformOffset;
347347
@@ -369,7 +369,7 @@ class GLUniform {
369369 _shader->RegisterUniform ( this );
370370 }
371371
372- bool CacheValue ( void * value ) {
372+ bool CacheValue ( const void * value ) {
373373 uint32_t * currentValue;
374374
375375 const bool bufferUniform = ( _shader->UseMaterialSystem () && _updateType == MATERIAL_OR_PUSH )
@@ -428,10 +428,6 @@ class GLUniform {
428428 void UpdateShaderProgramUniformLocation ( ShaderProgramDescriptor* shaderProgram ) {
429429 shaderProgram->uniformLocations [_locationIndex] = glGetUniformLocation ( shaderProgram->id , _name.c_str () );
430430 }
431-
432- virtual size_t GetSize () {
433- return 0 ;
434- }
435431};
436432
437433class GLShaderManager {
@@ -577,10 +573,6 @@ class GLUniformSampler : protected GLUniform {
577573 }
578574
579575 public:
580- size_t GetSize () override {
581- return sizeof ( GLuint64 );
582- }
583-
584576 void SetValue ( GLuint value ) {
585577 if ( !CacheValue ( &value ) ) {
586578 return ;
@@ -644,11 +636,6 @@ class GLUniform1i : protected GLUniform
644636 ShaderProgramDescriptor* p = _shader->GetProgram ();
645637 glUniform1i ( p->uniformLocations [ _locationIndex ], value );
646638 }
647- public:
648- size_t GetSize () override
649- {
650- return sizeof ( int );
651- }
652639};
653640
654641class GLUniform1ui : protected GLUniform {
@@ -665,10 +652,6 @@ class GLUniform1ui : protected GLUniform {
665652 ShaderProgramDescriptor* p = _shader->GetProgram ();
666653 glUniform1ui ( p->uniformLocations [_locationIndex], value );
667654 }
668- public:
669- size_t GetSize () override {
670- return sizeof ( uint );
671- }
672655};
673656
674657class GLUniform1Bool : protected GLUniform {
@@ -686,11 +669,6 @@ class GLUniform1Bool : protected GLUniform {
686669 ShaderProgramDescriptor* p = _shader->GetProgram ();
687670 glUniform1i ( p->uniformLocations [_locationIndex], value );
688671 }
689-
690- public:
691- size_t GetSize () override {
692- return sizeof ( int );
693- }
694672};
695673
696674class GLUniform1f : protected GLUniform
@@ -709,11 +687,6 @@ class GLUniform1f : protected GLUniform
709687 ShaderProgramDescriptor* p = _shader->GetProgram ();
710688 glUniform1f ( p->uniformLocations [ _locationIndex ], value );
711689 }
712- public:
713- size_t GetSize () override
714- {
715- return sizeof ( float );
716- }
717690};
718691
719692class GLUniform1fv : protected GLUniform
@@ -750,11 +723,6 @@ class GLUniform2f : protected GLUniform
750723 ShaderProgramDescriptor* p = _shader->GetProgram ();
751724 glUniform2f ( p->uniformLocations [ _locationIndex ], v[ 0 ], v[ 1 ] );
752725 }
753-
754- size_t GetSize () override
755- {
756- return sizeof ( vec2_t );
757- }
758726};
759727
760728class GLUniform3f : protected GLUniform
@@ -773,11 +741,6 @@ class GLUniform3f : protected GLUniform
773741 ShaderProgramDescriptor* p = _shader->GetProgram ();
774742 glUniform3f ( p->uniformLocations [ _locationIndex ], v[ 0 ], v[ 1 ], v[ 2 ] );
775743 }
776- public:
777- size_t GetSize () override
778- {
779- return sizeof ( vec3_t );
780- }
781744};
782745
783746class GLUniform4f : protected GLUniform
@@ -796,11 +759,6 @@ class GLUniform4f : protected GLUniform
796759 ShaderProgramDescriptor* p = _shader->GetProgram ();
797760 glUniform4f ( p->uniformLocations [ _locationIndex ], v[ 0 ], v[ 1 ], v[ 2 ], v[ 3 ] );
798761 }
799- public:
800- size_t GetSize () override
801- {
802- return sizeof ( vec4_t );
803- }
804762};
805763
806764class GLUniform4fv : protected GLUniform
@@ -837,11 +795,6 @@ class GLUniformMatrix4f : protected GLUniform
837795 ShaderProgramDescriptor* p = _shader->GetProgram ();
838796 glUniformMatrix4fv ( p->uniformLocations [ _locationIndex ], 1 , transpose, m );
839797 }
840- public:
841- size_t GetSize () override
842- {
843- return sizeof ( matrix_t );
844- }
845798};
846799
847800class GLUniformMatrix32f : protected GLUniform {
@@ -861,10 +814,6 @@ class GLUniformMatrix32f : protected GLUniform {
861814 ShaderProgramDescriptor* p = _shader->GetProgram ();
862815 glUniformMatrix3x2fv ( p->uniformLocations [_locationIndex], 1 , transpose, m );
863816 }
864- public:
865- size_t GetSize () override {
866- return 6 * sizeof ( float );
867- }
868817};
869818
870819class GLUniformMatrix4fv : protected GLUniform
0 commit comments