diff --git a/src/engine/renderer/gl_shader.cpp b/src/engine/renderer/gl_shader.cpp index f23055feb4..5e149a6c13 100644 --- a/src/engine/renderer/gl_shader.cpp +++ b/src/engine/renderer/gl_shader.cpp @@ -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; } @@ -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 * > ¯os ) const { for (const GLCompileMacro* macro : macros) @@ -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; @@ -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; } @@ -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; } diff --git a/src/engine/renderer/gl_shader.h b/src/engine/renderer/gl_shader.h index 781438e1b5..0f857de57c 100644 --- a/src/engine/renderer/gl_shader.h +++ b/src/engine/renderer/gl_shader.h @@ -952,11 +952,6 @@ class GLCompileMacro return false; } - virtual bool MissesRequiredMacros( size_t, const std::vector& ) const - { - return false; - } - virtual uint32_t GetRequiredVertexAttributes() const { return 0; @@ -1075,7 +1070,6 @@ class GLCompileMacro_USE_VERTEX_SKINNING : } bool HasConflictingMacros( size_t permutation, const std::vector< GLCompileMacro * > ¯os ) const override; - bool MissesRequiredMacros( size_t permutation, const std::vector< GLCompileMacro * > ¯os ) const override; uint32_t GetRequiredVertexAttributes() const override {