Comments (2)
Hey @aioob, thanks for your interest and certainly appreciate if you can contribute! :)
- The data representation is intended to faithfully represent the SPIR-V binary module at a low-level for data inspection; while the structured representation is intended to represent the SPIR-V module at a high-level structured way to facilitate transformations. The former is suitable for use by disassemblers and trivial analyses where we don't really need to trace through an instruction chain for information; while real optimizations will need to do that frequently so we need to connect related instructions more tightly. The former guarantee roundtrip while the latter does not (it's intended for transformation anyway). I think there is also historical reasons. I initially only planed the data representation part with the parser and its consumer. It's much more easier to use the data representation as the format handed back by the parser to the consumer and defer all the complicated logic to the consumer itself, instead of trying to build the whole IR inside the parser. It's more complicated so we need the full picture so we cannot invoke the consumer after decoding each instruction, and not all consumers need that anyway. I guess I don't have strong preference to always keep these two representations. But given data representation is basically there and we are still developing structured representation, I think they will co-exist for a while. We can re-evaluate the situation after we have a more full-fledged structured representation. :)
- I listed a few potential use cases in the master README. Util now, the only concrete use case that I've realized is a SPIR-V disassembler (if we think the parser is a neural API that can serve many use cases).
javelin
is the current use case that we are trying to support. I'm happy to facilitate others interested. The API (structured representation) should generally be guided by proved compiler practices so that they can serve different use cases. - I think the parser should only do the minimal structural validation; that is, must-have validation to correctly parsing the SPIR-V binary. We can view the parser as a deserialization tool. I prefer to have all other validations happening in a later stage. The benefits is that we have a clear separation of concerns and better layering. Besides, the error message can potentially be much better at a later stage when we have the full picture.
I hope the above is helpful. Let me know if there are unclear points. :)
from rspirv.
Thank you very much, that's cleared up all the questions I have (so far!).
from rspirv.
Related Issues (20)
- Update derive_more dependency HOT 3
- Parsing with `parse_bytes` fails but shader runs with opengl HOT 2
- Floating-point literals should store bits in integers, not use host f32/f64. HOT 2
- New spirv_headers release HOT 1
- ImageFormat::Rgb10a2ui uses inconsistent casing. HOT 4
- Published 1.5.1 broke public API HOT 8
- Switch spirv_headers to SemVer HOT 5
- Rename "required_capabilities" for clarity
- `IdResult` and `IdResultType` on SR?
- Publish rspirv 0.8 ? HOT 1
- LiftContext::convert struggles with linked multi-stage SPIRV
- Unable to retrieve decorations in structured representation HOT 3
- Store all instructions in one `Vec`?
- LiftContext::lift_op responsible for ~25% of the generated llvm ir
- spirv: Vulkan SDK based versioning HOT 6
- Disassembling constant literals is broken HOT 2
- LICENSE files in package subdirs HOT 3
- Update spirv's version of bitflags to 1.0.4
- Multiple operations with same opcode HOT 4
- Bug: selection_merge ends block.
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 rspirv.