Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions src/engine/renderer/gl_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,11 @@ static bool IsUnusedPermutation( const char *compileMacros )
const char* token;
while ( *( token = COM_ParseExt2( &compileMacros, false ) ) )
{
if ( strcmp( token, "USE_DELUXE_MAPPING" ) == 0 )
if ( strcmp( token, "USE_VERTEX_SKINNING" ) == 0 )
{
if ( !glConfig.vboVertexSkinningAvailable ) return true;
}
else if ( strcmp( token, "USE_DELUXE_MAPPING" ) == 0 )
{
if ( !glConfig.deluxeMapping ) return true;
}
Expand Down Expand Up @@ -2042,11 +2046,6 @@ bool GLCompileMacro_USE_VERTEX_SKINNING::HasConflictingMacros( size_t permutatio
return false;
}

bool GLCompileMacro_USE_VERTEX_SKINNING::MissesRequiredMacros( size_t /*permutation*/, const std::vector< GLCompileMacro * > &/*macros*/ ) const
{
return !glConfig.vboVertexSkinningAvailable;
}

bool GLCompileMacro_USE_VERTEX_ANIMATION::HasConflictingMacros( size_t permutation, const std::vector< GLCompileMacro * > &macros ) const
{
for (const GLCompileMacro* macro : macros)
Expand Down Expand Up @@ -2117,6 +2116,12 @@ bool GLCompileMacro_USE_GRID_DELUXE_MAPPING::HasConflictingMacros(size_t permuta
{
return true;
}

// grid lighting is required
if ((macro->GetType() == USE_GRID_LIGHTING) && !(permutation & macro->GetBit()))
{
return true;
}
}

return false;
Expand Down Expand Up @@ -2246,10 +2251,6 @@ uint32_t GLShader::GetUniqueCompileMacros( size_t permutation, const int type )
continue;
}

if ( macro->MissesRequiredMacros( permutation, _compileMacros ) ) {
continue;
}

if ( !( macro->GetShaderTypes() & type ) ) {
continue;
}
Expand All @@ -2270,10 +2271,6 @@ bool GLShader::GetCompileMacrosString( size_t permutation, std::string &compileM
return false;
}

if ( macro->MissesRequiredMacros( permutation, _compileMacros ) ) {
return false;
}

if ( !( macro->GetShaderTypes() & type ) ) {
return false;
}
Expand Down
6 changes: 0 additions & 6 deletions src/engine/renderer/gl_shader.h
Original file line number Diff line number Diff line change
Expand Up @@ -952,11 +952,6 @@ class GLCompileMacro
return false;
}

virtual bool MissesRequiredMacros( size_t, const std::vector<GLCompileMacro*>& ) const
{
return false;
}

virtual uint32_t GetRequiredVertexAttributes() const
{
return 0;
Expand Down Expand Up @@ -1075,7 +1070,6 @@ class GLCompileMacro_USE_VERTEX_SKINNING :
}

bool HasConflictingMacros( size_t permutation, const std::vector< GLCompileMacro * > &macros ) const override;
bool MissesRequiredMacros( size_t permutation, const std::vector< GLCompileMacro * > &macros ) const override;

uint32_t GetRequiredVertexAttributes() const override
{
Expand Down
Loading