-
Notifications
You must be signed in to change notification settings - Fork 205
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
base: main
Are you sure you want to change the base?
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]>
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]>
fa63202
to
6a3b0c8
Compare
else() | ||
message(STATUS "Skipping automatic build of SPIR-V files for spirv_new") | ||
# Empty custom target | ||
add_custom_target(spirv_new_shaders) |
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.
add_custom_target(spirv_new_shaders) | |
add_custom_target(spirv_new_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.
For the spirv_new tests, "shaders" isn't really the correct term as none of them declare the Shader
Capability. I would suggest to refer to them as "SPIR-V binaries", which aligns with the --spirv-binaries-path
option name.
return() | ||
endif() | ||
|
||
set(shader_sources |
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.
set(shader_sources | |
set(spirv_sources |
vector_times_scalar_half.spvasm32 | ||
vector_times_scalar_half.spvasm64) | ||
|
||
set(assembled_shaders "") |
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.
set(assembled_shaders "") | |
set(assembled_spirv_binaries "") |
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
.