def _bind_pipes_to_stage(self, stage):
        """ Sets all required pipes on a stage """
        for pipe in stage.required_pipes:

            # Check if there is an input block named like the pipe
            if pipe in self.input_blocks:
                self.input_blocks[pipe].bind_to(stage)
                continue

            if pipe.startswith("PreviousFrame::"):
                # Special case: Pipes from the previous frame. We assume those
                # pipes have the same size as the window and a format of
                # F_rgba16. Could be subject to change.
                pipe_name = pipe.split("::")[-1]
                if pipe_name not in self.previous_pipes:
                    tex_format = "RGBA16"

                    # XXX: Assuming we have a depth texture whenever "depth"
                    # occurs in the textures name
                    if "depth" in pipe_name.lower():
                        tex_format = "R32"

                    pipe_tex = Image.create_2d("Prev-" + pipe_name, 0, 0, tex_format)
                    pipe_tex.clear_image()
                    self.previous_pipes[pipe_name] = pipe_tex
                stage.set_shader_input("Previous_" + pipe_name, self.previous_pipes[pipe_name])
                continue

            elif pipe.startswith("FuturePipe::"):
                # Special case: Future Pipes which are not available yet.
                # They will contain the unmodified data from the last
                # frame.
                pipe_name = pipe.split("::")[-1]
                self.debug("Awaiting future pipe", pipe_name)
                self.future_bindings.append((pipe_name, stage))
                continue

            if pipe not in self.pipes:
                self.fatal("Pipe '" + pipe + "' is missing for", stage)
                return False

            pipe_value = self.pipes[pipe]
            if isinstance(pipe_value, list) or isinstance(pipe_value, tuple):
                stage.set_shader_input(pipe, *pipe_value)
            else:
                stage.set_shader_input(pipe, pipe_value)
        return True
 Sets all required pipes on a stage 
metadrive/render_pipeline/rpcore/stage_manager.py