Open kpet opened 5 years ago
I did it a couple of years ago in a fork. Is there anyone working on it? The current support to text-format spirv makes the spt test cases difficult to read and write. It would be great to lean against either KhronosGroup/SPIRV-Tools or KhronosGroup/glslang.
You can write .spvasm
tests as of 9977928 ("Add SPIR-V assembly tests", 2019-08-01).
@svenvh Thanks. I see, in this way both text formats are supported.
@svenvh @MrSidims It's an old topic but it's relevant againt. The current approach is: We should go into using spirv-tools as our default test format and SPT usage should be minimized. In addition to that binary and text formats should be split in parser implementation to improve performance and readability of our main hot path. In the long run SPT should be removed completely and tests should only use spirv-tools. Unfortunately there are a few Intel extensions in preview stage which are supported by translator but aren't in spirv-tools. The possible discussed approaches to extensions problem:
The translator currently supports its own textual format for SPIR-V assembly. This format is incompatible with the official format handled by the SPIRV-Tools. It is furthermore poorly tested, probably doesn't support all the corner cases and is generally a liability to the translator code base.
The translator currently produces or consumes this format via three different options:
--spirv-text
for a translation from IR to the SPIR-V text format--to-binary
to assemble a SPIR-V text file to a SPIR-V binary--to-text
to disassemble a SPIR-V binary to a SPIR-V text fileI'm tempted to suggest that none of this functionality belongs in the translator and that we should get rid of it entirely, using the relevant SPIR-V Tools for testing.
A possible staged approach could be to:
--to-text
and usespirv-dis
. There are 11 uses in tests.--to-binary
and usespirv-as
. There are 17 uses in tests.--spirv-text
completely (125 uses in tests) and usespirv-dis
in testing. The various name map data structures could be kept for in-debugger use (I know @neildhickey has been thinking about this).These changes would make it easier to reuse code from SPIR-V tools as suggested in #32.