Comments (8)
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 OpName
instructions (where present) could be used to map %IDs to source names.
from spirv-tools.
Good point. I should be able to create diagnostic messages based on the (OpName) commands and verify the output using this approach.
from spirv-tools.
Keep in mind that OpName instructions are optional.
Also, the validator is checking binaries coming from any front end, which could be much more than the assembler in SPIR-V Tools.
So I see using the OpName values in validator diagnostics as nice-to-have, but not essential.
from spirv-tools.
Similarly, not every front end can furnish spvValidate() with a %ID mapping
proposed in OP.
On Thu, 3 Dec 2015 at 14:43 David Neto [email protected] wrote:
Keep in mind that OpName instructions are optional.
Also, the validator is checking binaries coming from any front end, which
could be much more than the assembler in SPIR-V Tools.
So I see using the OpName values in validator diagnostics as nice-to-have,
but not essential.—
Reply to this email directly or view it on GitHub
#41 (comment)
.
Sent from a mobile device.
from spirv-tools.
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
ID 32 has not been defined
With OpName
ID 32[foo] has not been defined
This should be pretty easy to implement. I can then use regex to parse the message to verify the unit tests.
from spirv-tools.
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
Those tests first assemble some text, then disassemble text but fail with a message. (They use TextToBinaryTestBase::EncodeSuccessfullyDecodeFailed)
from spirv-tools.
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.
from spirv-tools.
I'm not sure if there is anything to do here,spirv-dis
does the name mapping when possible already. Can this be closed?
from spirv-tools.
Related Issues (20)
- new release https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/vulkan-sdk-1.3.280.0/SPIRV-Tools-1.3.280.0.tar.gz HOT 1
- [ spirv-opt ] Infinite recursion/crash with shader HOT 6
- SPIRV code fails validation after optimization HOT 3
- Wrong validation error when using RTA in SPV1.4? HOT 2
- Request: allow SpirvToolsEliminateDeadInputComponents() to strip non-trailing members from blocks HOT 2
- SpirvToolsEliminateDeadInputComponents() doesn't seem to be trimming array size down HOT 1
- spirv-val false positive error HOT 6
- Compilation error in validate_atomics.cpp HOT 2
- Using opt C API makes no change to shader HOT 1
- v2024.1 flatpak build fails: validation_state.cpp error: ‘BlockMatchSamplerQCOM’ is not a member of ‘spv::Decoration’ HOT 2
- How to add a new OpName with DescriptorSet and Binding HOT 2
- spirv-opt fma folding causes large performance degradation on Adreno HOT 6
- how to remove the OpVariable inst??
- Implicit LOD functions can be supported when compute shader derivatives are supported HOT 6
- How to compile on arm platform HOT 3
- Disallows TypeManager::GetId on non unique types
- Slang produces spv that works on win/linux but not with MoltenVk
- Incorrect codegen when there is redundant `float16_t` conversion HOT 1
- spirv-opt: loop unroll pass with shader produces spirv-val failure
- Generator comment in spirv-dis output is failing to look up name from spir-v.xml HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spirv-tools.