Skip to content

Commit 291601c

Browse files
committed
gl_shader: do not build the lightMapping permutation with deluxe grid but not light grid
1 parent 8fe0baa commit 291601c

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/engine/renderer/gl_shader.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,15 +874,23 @@ int GLShaderManager::GetDeformShaderIndex( deformStage_t *deforms, int numDeform
874874

875875
static bool IsUnusedPermutation( const char *compileMacros )
876876
{
877+
bool hasGridLighting = false;
878+
bool hasGridDeluxeMapping = false;
879+
877880
const char* token;
878881
while ( *( token = COM_ParseExt2( &compileMacros, false ) ) )
879882
{
880-
if ( strcmp( token, "USE_DELUXE_MAPPING" ) == 0 )
883+
if ( strcmp( token, "USE_GRID_LIGHTING" ) == 0 )
884+
{
885+
hasGridLighting = true;
886+
}
887+
else if ( strcmp( token, "USE_DELUXE_MAPPING" ) == 0 )
881888
{
882889
if ( !glConfig.deluxeMapping ) return true;
883890
}
884891
else if ( strcmp( token, "USE_GRID_DELUXE_MAPPING" ) == 0 )
885892
{
893+
hasGridDeluxeMapping = true;
886894
if ( !glConfig.deluxeMapping ) return true;
887895
}
888896
else if ( strcmp( token, "USE_PHYSICAL_MAPPING" ) == 0 )
@@ -906,6 +914,11 @@ static bool IsUnusedPermutation( const char *compileMacros )
906914
}
907915
}
908916

917+
if ( !hasGridLighting && hasGridDeluxeMapping )
918+
{
919+
return true;
920+
}
921+
909922
return false;
910923
}
911924

0 commit comments

Comments
 (0)