Specialization constants was always switching shader even when the constants were not changed. An early exit path was never taken. The performance improvement should not be noticable to end users. But would match with the intention of the design of specialization constants. Pull Request: https://projects.blender.org/blender/blender/pulls/118315