Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions backends/vulkan/runtime/gen_vulkan_spv.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,10 +861,6 @@ def generate_src_file(shader_paths_pair):

# Construct generated file name
gen_out_path = os.path.join(output_dir, f"{src_file_name}.{out_file_ext}")
# Construct path of cached generated file
cached_gen_out_path = os.path.join(
cache_dir, f"{src_file_name}.{out_file_ext}"
)

# Execute codegen to generate the output file
with codecs.open(src_file_fullpath, "r", encoding="utf-8") as input_file:
Expand All @@ -875,10 +871,6 @@ def generate_src_file(shader_paths_pair):
with codecs.open(gen_out_path, "w", encoding="utf-8") as output_file:
output_file.write(output_text)

if cache_dir is not None:
# Store the generated file in the cache for SPIR-V compilation
shutil.copyfile(gen_out_path, cached_gen_out_path)

def compile_spirv(shader_paths_pair):
# Extract components from the input tuple
# name of generated .glsl, .glslh, or .h
Expand Down Expand Up @@ -959,7 +951,10 @@ def compile_spirv(shader_paths_pair):
else:
raise RuntimeError(f"{err_msg_base} {e.stderr}") from e

# If compilation was successful, store the source GLSL file and the
# compiled SPIR-V file in the cache for future comparison.
if cache_dir is not None:
shutil.copyfile(gen_out_path, cached_gen_out_path)
shutil.copyfile(spv_out_path, cached_spv_out_path)

return (spv_out_path, gen_out_path)
Expand Down
Loading