

def reload_shaders(self):
    ' This method augo-generates a shader which copies all textures specified\n        as "from-tex" to the textures specified as "to-tex". '
    uniforms = []
    lines = []
    for (i, (from_tex, to_tex)) in enumerate(self._transfers):
        index = str(i)
        uniforms.append(((self.get_sampler_type(from_tex) + ' SrcTex') + index))
        uniforms.append(((self.get_sampler_type(to_tex, True) + ' DestTex') + index))
        lines += [((('\n  // Copying ' + from_tex.get_name()) + ' to ') + to_tex.get_name()), self.get_sampler_lookup(from_tex, ('data' + index), ('SrcTex' + index), 'coord_2d_int'), self.get_store_code(to_tex, ('DestTex' + index), 'coord_2d_int', ('data' + index)), '\n']
    fragment = '#version 430\n'
    fragment += '\n// Autogenerated, do not edit! Your changes will be lost.\n\n'
    for uniform in uniforms:
        fragment += (('uniform ' + uniform) + ';\n')
    fragment += '\nvoid main() {\n'
    fragment += '  ivec2 coord_2d_int = ivec2(gl_FragCoord.xy);\n'
    for line in lines:
        fragment += (('  ' + line) + '\n')
    fragment += '}\n'
    shader_dest = '/$$rptemp/$$update_previous_pipes.frag.glsl'
    with open(shader_dest, 'w') as handle:
        handle.write(fragment)
    self._target.shader = self.load_shader(shader_dest)

dataset/ETHPy150Open tobspr/RenderPipeline/rpcore/stages/update_previous_pipes_stage.py UpdatePreviousPipesStage.reload_shaders/original