File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -801,8 +801,7 @@ def process_shader(shader_paths_pair):
801801 output_file .write (output_text )
802802
803803 if cache_dir is not None :
804- # Otherwise, store the generated and source GLSL files in the cache
805- shutil .copyfile (source_glsl , cached_source_glsl )
804+ # Otherwise, store the generated GLSL files in the cache
806805 shutil .copyfile (glsl_out_path , cached_glsl_out_path )
807806
808807 # If no GLSL compiler is specified, then only write out the generated GLSL shaders.
@@ -852,6 +851,15 @@ def process_shader(shader_paths_pair):
852851 ):
853852 output_file_map [spv_out_path ] = glsl_out_path
854853
854+ # Save all source GLSL files to the cache. Only do this at the very end since
855+ # multiple variants may use the same source file.
856+ if cache_dir is not None :
857+ for _ , source_glsl in self .glsl_src_files .items ():
858+ cached_source_glsl = os .path .join (
859+ cache_dir , os .path .basename (source_glsl ) + ".t"
860+ )
861+ shutil .copyfile (source_glsl , cached_source_glsl )
862+
855863 return output_file_map
856864
857865
You can’t perform that action at this time.
0 commit comments