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
Add inline-assembly support #1769
Conversation
8a30cb6
to
4ddc59b
Compare
The LLPC code coverage report is available at https://storage.googleapis.com/amdvlk-llpc-github-ci-artifacts-public/coverage_release_clang_shadercache_coverage_assertions_2103206623/index.html. |
The LLPC code coverage report is available at https://storage.googleapis.com/amdvlk-llpc-github-ci-artifacts-public/coverage_release_clang_coverage_2103206623/index.html. |
retest this please |
Test summary for commit 4ddc59bCTS tests (Failed: 0/195808)
Rhel 8.2, Gfx10Ubuntu 18.04, Gfx9Ubuntu 20.04, Gfx8 |
V2: Include SPIR-V header, move code into a function and use llvm diagnostics for errors so that it also works in release mode. Still missing some documentation (is there a better place for documenting this than the comment in SPIRVReader.cpp?). |
The LLPC code coverage report is available at https://storage.googleapis.com/amdvlk-llpc-github-ci-artifacts-public/coverage_release_clang_coverage_2150024286/index.html. |
The LLPC code coverage report is available at https://storage.googleapis.com/amdvlk-llpc-github-ci-artifacts-public/coverage_release_clang_shadercache_coverage_assertions_2150024286/index.html. |
Test summary for commit ac184dcCTS tests (Failed: 0/195808)
Rhel 8.2, Gfx10Ubuntu 18.04, Gfx9Ubuntu 20.04, Gfx8 |
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.
If you feed it is necessary, you can add a brief doc. But currently, the functionality seems straightforward by reading the inline comments.
So far, it is complicated and time-consuming to test the behavior of certain instructions or their interactions. The easiest method to test a sequence of instructions to date, is to make a simple graphics test, disassemble the pipelines, edit the assembly, recompile them and use pipeline replacement to load the edited code. This patch adds a simpler and more robust way by letting one write inline assembly in glsl. glsl allows strings only in a single place, which is the debug print instruction. Using the special '%ra' format specifier [0] triggers llpc to interpret the second argument as an inline assembly string. The arguments to printf are: - "%ra" for radeon-assembly - assembly instructions - variable constraints - "no output" or a variable where the output is stored (optional if there are no further arguments) - zero or more arguments See the llvm reference for more details on how to write the constraint string: https://llvm.org/docs/LangRef.html#inline-assembler-expressions The added tests contain an example of how inline assembly can be used. [0]: The list of existing format specifiers does not include a %r: https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/master/docs/debug_printf.md#debug-printf-format-string
V3: Add an example to the inline comment |
The LLPC code coverage report is available at https://storage.googleapis.com/amdvlk-llpc-github-ci-artifacts-public/coverage_release_clang_coverage_2153351864/index.html. |
The LLPC code coverage report is available at https://storage.googleapis.com/amdvlk-llpc-github-ci-artifacts-public/coverage_release_clang_shadercache_coverage_assertions_2153351864/index.html. |
Test summary for commit e8b0a67CTS tests (Failed: 0/195808)
Rhel 8.2, Gfx10Ubuntu 18.04, Gfx9Ubuntu 20.04, Gfx8 |
@Flakebi There are some internal discussions about this PR. Please check them with Nicolai. The porting is blocked. |
So far, it is complicated and time-consuming to test the behavior of
certain instructions or their interactions. The easiest method to test
a sequence of instructions to date, is to make a simple graphics test,
disassemble the pipelines, edit the assembly, recompile them and use
pipeline replacement to load the edited code.
This patch adds a simpler and more robust way by letting one write
inline assembly in glsl.
glsl allows strings only in a single place, which is the debug print
instruction. Using the special '%ra' format specifier [0] triggers llpc
to interpret the second argument as an inline assembly string.
The arguments to printf are:
there are no further arguments)
See the llvm reference for more details on how to write the constraint
string: https://llvm.org/docs/LangRef.html#inline-assembler-expressions
The added tests contain an example of how inline assembly can be used.
[0]: The list of existing format specifiers does not include a %r:
https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/master/docs/debug_printf.md#debug-printf-format-string