Skip to content

Commit aff81e0

Browse files
committed
Invert build script logic for shader output paths
Use presence of parent Cargo.toml to determine output location rather than maintaining hardcoded list of directories
1 parent ab02b21 commit aff81e0

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

shaders/rust/compileshaders.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ def compile_shader(shader_dir):
6767
source_path.rename(final_path)
6868
print(f" Created {final_path.name} (entry point: {entry_point})")
6969

70-
# Special case: move to parent directory for nested shader structures
71-
if shader_dir.parent.name in ["base", "descriptorsets", "dynamicuniformbuffer", "multisampling", "pipelines", "specializationconstants", "computeshader", "texturearray", "screenshot", "negativeviewportheight", "stencilbuffer", "parallaxmapping", "computecloth", "ssao", "shadowmapping", "deferred", "computenbody", "bloom", "hdr", "radialblur", "pbribl", "indirectdraw", "instancing", "texturecubemap", "renderheadless", "sphericalenvmapping", "occlusionquery"]:
72-
parent_dir = shader_dir.parent
70+
# Move to parent directory unless there's a top-level Cargo.toml
71+
# (top-level shaders like triangle, texture, etc. have their own Cargo.toml)
72+
parent_dir = shader_dir.parent
73+
if not (parent_dir / "Cargo.toml").exists():
7374
parent_final_path = parent_dir / f"{shader_name}.{shader_type}.spv"
7475
shutil.move(str(final_path), str(parent_final_path))
7576
print(f" Moved to {parent_dir.name}/{shader_name}.{shader_type}.spv")

0 commit comments

Comments
 (0)