There is a keyword _ENABLE_SOME_FEATURE in a shader;
Create two materials from this shader and toggle the keyword on one of the materials;
Remove the keyword from shader that would make the an out of date keyword remain in the previous material.
Attemp to render these two materials with SRP batch on;
After that in the frame debugger you would see these two materials were not able to SRP batch with a reason: materials have different keywords.
Open the material by a text editor locate the out of date keyword and remove it manually then render them again;
Now this time you could see them are successfully SRP batched.
Can the SRP batcher auto ignores the invalid keywords? For now I have to create a script myself to check hundreds of materials once a shader was changed to remove the invalid keywords.
The description Unity - Scripting API: Material.EnableKeyword says “Sets a shader keyword that is enabled on this material”. This doesn’t mean you can’t enable a keyword that doesn’t exist or doesn’t match the shader keywords.
Can you please report a bug?