Skip to content

Commit 300c735

Browse files
committed
NUKE unused GLUniform.GetSize()
1 parent 7101d4f commit 300c735

File tree

1 file changed

+1
-53
lines changed

1 file changed

+1
-53
lines changed

src/engine/renderer/gl_shader.h

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@ class GLUniform {
345345
// In multiples of 4 bytes
346346
// FIXME: the uniform structs are actually std140 so it would be more relevant to provide std140 info
347347
const GLuint _std430BaseSize;
348-
GLuint _std430Size; // includes padding that depends on the other uniforms in the struct
349348
const GLuint _std430Alignment;
350349
GLuint _nextUniformOffset;
351350

@@ -374,7 +373,7 @@ class GLUniform {
374373
_shader->RegisterUniform( this );
375374
}
376375

377-
bool CacheValue( void* value ) {
376+
bool CacheValue( const void* value ) {
378377
uint32_t* currentValue;
379378

380379
const bool bufferUniform = ( _shader->UseMaterialSystem() && _updateType == MATERIAL_OR_PUSH )
@@ -433,10 +432,6 @@ class GLUniform {
433432
void UpdateShaderProgramUniformLocation( ShaderProgramDescriptor* shaderProgram ) {
434433
shaderProgram->uniformLocations[_locationIndex] = glGetUniformLocation( shaderProgram->id, _name.c_str() );
435434
}
436-
437-
virtual size_t GetSize() {
438-
return 0;
439-
}
440435
};
441436

442437
class GLShaderManager {
@@ -586,10 +581,6 @@ class GLUniformSampler : protected GLUniform {
586581
}
587582

588583
public:
589-
size_t GetSize() override {
590-
return sizeof( GLuint64 );
591-
}
592-
593584
void SetValue( GLuint value ) {
594585
if ( !CacheValue( &value ) ) {
595586
return;
@@ -653,11 +644,6 @@ class GLUniform1i : protected GLUniform
653644
ShaderProgramDescriptor* p = _shader->GetProgram();
654645
glUniform1i( p->uniformLocations[ _locationIndex ], value );
655646
}
656-
public:
657-
size_t GetSize() override
658-
{
659-
return sizeof( int );
660-
}
661647
};
662648

663649
class GLUniform1ui : protected GLUniform {
@@ -674,10 +660,6 @@ class GLUniform1ui : protected GLUniform {
674660
ShaderProgramDescriptor* p = _shader->GetProgram();
675661
glUniform1ui( p->uniformLocations[_locationIndex], value );
676662
}
677-
public:
678-
size_t GetSize() override {
679-
return sizeof( uint );
680-
}
681663
};
682664

683665
class GLUniform1Bool : protected GLUniform {
@@ -695,11 +677,6 @@ class GLUniform1Bool : protected GLUniform {
695677
ShaderProgramDescriptor* p = _shader->GetProgram();
696678
glUniform1i( p->uniformLocations[_locationIndex], value );
697679
}
698-
699-
public:
700-
size_t GetSize() override {
701-
return sizeof( int );
702-
}
703680
};
704681

705682
class GLUniform1f : protected GLUniform
@@ -718,11 +695,6 @@ class GLUniform1f : protected GLUniform
718695
ShaderProgramDescriptor* p = _shader->GetProgram();
719696
glUniform1f( p->uniformLocations[ _locationIndex ], value );
720697
}
721-
public:
722-
size_t GetSize() override
723-
{
724-
return sizeof( float );
725-
}
726698
};
727699

728700
class GLUniform1fv : protected GLUniform
@@ -759,11 +731,6 @@ class GLUniform2f : protected GLUniform
759731
ShaderProgramDescriptor* p = _shader->GetProgram();
760732
glUniform2f( p->uniformLocations[ _locationIndex ], v[ 0 ], v[ 1 ] );
761733
}
762-
763-
size_t GetSize() override
764-
{
765-
return sizeof( vec2_t );
766-
}
767734
};
768735

769736
class GLUniform3f : protected GLUniform
@@ -782,11 +749,6 @@ class GLUniform3f : protected GLUniform
782749
ShaderProgramDescriptor* p = _shader->GetProgram();
783750
glUniform3f( p->uniformLocations[ _locationIndex ], v[ 0 ], v[ 1 ], v[ 2 ] );
784751
}
785-
public:
786-
size_t GetSize() override
787-
{
788-
return sizeof( vec3_t );
789-
}
790752
};
791753

792754
class GLUniform4f : protected GLUniform
@@ -805,11 +767,6 @@ class GLUniform4f : protected GLUniform
805767
ShaderProgramDescriptor* p = _shader->GetProgram();
806768
glUniform4f( p->uniformLocations[ _locationIndex ], v[ 0 ], v[ 1 ], v[ 2 ], v[ 3 ] );
807769
}
808-
public:
809-
size_t GetSize() override
810-
{
811-
return sizeof( vec4_t );
812-
}
813770
};
814771

815772
class GLUniform4fv : protected GLUniform
@@ -846,11 +803,6 @@ class GLUniformMatrix4f : protected GLUniform
846803
ShaderProgramDescriptor* p = _shader->GetProgram();
847804
glUniformMatrix4fv( p->uniformLocations[ _locationIndex ], 1, transpose, m );
848805
}
849-
public:
850-
size_t GetSize() override
851-
{
852-
return sizeof( matrix_t );
853-
}
854806
};
855807

856808
class GLUniformMatrix32f : protected GLUniform {
@@ -870,10 +822,6 @@ class GLUniformMatrix32f : protected GLUniform {
870822
ShaderProgramDescriptor* p = _shader->GetProgram();
871823
glUniformMatrix3x2fv( p->uniformLocations[_locationIndex], 1, transpose, m );
872824
}
873-
public:
874-
size_t GetSize() override {
875-
return 6 * sizeof( float );
876-
}
877825
};
878826

879827
class GLUniformMatrix4fv : protected GLUniform

0 commit comments

Comments
 (0)