def write_autoconfig(self):
        """ Writes the shader auto config, based on the defines specified by the
        different stages """
        self.debug("Writing shader config")

        # Generate autoconfig as string
        output = "#pragma once\n\n"
        output += "// Autogenerated by the render pipeline\n"
        output += "// Do not edit! Your changes will be lost.\n\n"

        for key, value in sorted(iteritems(self.defines)):
            if isinstance(value, bool):
                value = 1 if value else 0
            output += "#define " + key + " " + str(value) + "\n"

        try:
            with open("/$$rptemp/$$pipeline_shader_config.inc.glsl", "w") as handle:
                handle.write(output)
        except IOError as msg:
            self.error("Error writing shader autoconfig:", msg)
 Writes the shader auto config, based on the defines specified by the
        different stages 
metadrive/render_pipeline/rpcore/stage_manager.py