-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate the SPIR-V shaders automatically at build time #2200
Conversation
`FindPython3` and `FindPython2` were added in version 3.12. Used by the spirv_new suite. Signed-off-by: Ahmed Hesham <[email protected]>
Signed-off-by: Ahmed Hesham <[email protected]>
fa63202
to
6a3b0c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave this a try today and it seems to be working, but there appears to be an issue with the dependencies and it's re-generating the SPIR-V modules even when nothing is changing. Is this a problem on my side?
Example:
$ make spirv_new_shaders
Generating assume.spv32 [... and lots more output]
Built target spirv_new_shaders
$ make spirv_new_shaders
Generating assume.spv32 [... and lots more output]
Built target spirv_new_shaders
The same is happening if I build a project dependent on spirv_new_shaders
, e.g. spirv_new
.
I can confirm that I can reproduce this on my setup as well. I will fix this. Files should only be regenerated if the sources are modified. |
Move the SPIR-V assembly helper Python script to the `spirv_asm` subdirectory. Add custom commands and targets to automatically assemble and validate the SPIR-V shaders used by the test. Automatic assembly depends on finding `python3`, `spirv-as` and `spirv-val`. `SPIRV_TOOLS_DIR` can be defined by the user during configuration to provide an override path. Default behaviour assumes that the binaries exist in PATH. Signed-off-by: Ahmed Hesham <[email protected]>
6a3b0c8
to
d1f6e88
Compare
Addressed the outstanding review comments and updated the patch such that the SPIR-V files are only re-generated when the source files are modified. Note that because the Python script works on all files in a given source directory, if one SPIR-V source changes, all SPIR-V files are regenerated. This can be improved later to have better correspondance, i.e. changing a SPIR-V source file only regenerates the relevant binaries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is working for me now, and this is a nice improvement!
Merging as discussed in the February 11th teleconference. |
Add custom commands and targets to automatically assemble and validate the SPIR-V shaders used by the test.
Automatic assembly depends on finding
python3
,spirv-as
andspirv-val
.SPIRV_TOOLS_DIR
can be defined by the user during configuration to provide an override path. Default behaviour assumes that the binaries exist inPATH
.