-
Notifications
You must be signed in to change notification settings - Fork 542
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
spvTextToBinary to return a mapping of textual ID names to numeric IDs #41
Comments
This would be nice to have, though it's not essential for checking the diagnostic messages even now. The message text around %IDs can be checked, and |
Good point. I should be able to create diagnostic messages based on the (OpName) commands and verify the output using this approach. |
Keep in mind that OpName instructions are optional. |
Similarly, not every front end can furnish spvValidate() with a %ID mapping On Thu, 3 Dec 2015 at 14:43 David Neto notifications@github.com wrote:
Sent from a mobile device. |
I understand. I was plan on formatting the diagnostic message to display the id and only display the name if an OpName command references the ID. For example No OpName
With OpName
This should be pretty easy to implement. I can then use regex to parse the message to verify the unit tests. |
Yes, that would work. Alternately, you could use the same strategy the assembler tests use: rely on the fact that the assembler assigns Id indices via a counter, starting at 1. See, for example, some disassembler diagnostics tests at https://github.com/KhronosGroup/SPIRV-Tools/blob/master/test/BinaryToText.cpp#L181 |
That sounds like it would be dependent on the implementation. I wouldn't feel comfortable writing tests like that. It could also become complicated once we test more complicated cases. |
Reserve number 16 to Mesa-IR/SPIR-V Translator
I'm not sure if there is anything to do here, |
Use Case:
Unit test in the validation rely on the error codes validate the result of the
spvValidate
function. Ideally the tests should check both the error code and the diagnostic message to verify that the test case has accurately passed. This is currently not possible because the named ID representation is lost during the Text to Binary conversion.The
spvTextToBinary
function should return a map which contains a mapping from ID to ID names used in the textual representation of the SPIR-V.The text was updated successfully, but these errors were encountered: