Repository navigation
Fix shader output directory dependency - #557
Open
dbiswas2808 wants to merge 1 commit into
Open
dbiswas2808 wants to merge 1 commit into
dbiswas2808 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Using the output directory as a normal prerequisite can trigger unnecessary shader recompilation on subsequent Make builds; both helpers need a distinct stamp file touched after directory creation.
1 open issue
What changed in this PR
This PR addresses clean-build failures in the tutorial by explicitly ordering shader output-directory creation before compilation.
Changes:
- Adds
${SHADERS_DIR}as a dependency of both GLSL and Slang compilation commands. - Ensures parallel Unix Makefiles builds create the working directory before invoking shader compilers.
| File | Description |
|---|---|
attachments/CMakeLists.txt |
Adds output-directory dependencies to both shader compilation helpers. |
Review effort: Balanced
| ARGS --target-env vulkan1.0 ${SHADER_SOURCES} --quiet | ||
| WORKING_DIRECTORY ${SHADERS_DIR} | ||
| DEPENDS ${SHADER_SOURCES} | ||
| DEPENDS ${SHADER_SOURCES} ${SHADERS_DIR} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Issue
Building the tutorial from a clean build directory can fail during shader compilation with Unix Makefiles:
CMake defines separate custom commands for creating the shader output directory and compiling the shaders. However, the shader compilation commands did not depend on the directory-creation output.
During parallel builds, Make could therefore start shader compilation before creating the output directory. Compilation would then fail when attempting to use the missing directory as its working directory.
Fix
Add
${SHADERS_DIR}to the dependencies of both the GLSL and Slang shader compilation commands.This gives CMake an explicit ordering relationship:
Users can now follow the documented build instructions without manually creating shader directories.
Testing
Verified by configuring the project and successfully building the previously failing target: