Refactored shader generation into its own compilation unit.