https://github.com/jglrxavpok/sbm
SPIR-V Binary code Manipulation
https://github.com/jglrxavpok/sbm
bytecode manipulation spir-v
Last synced: about 1 month ago
JSON representation
SPIR-V Binary code Manipulation
- Host: GitHub
- URL: https://github.com/jglrxavpok/sbm
- Owner: jglrxavpok
- License: mit
- Created: 2016-04-10T17:41:27.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-07-10T15:26:55.000Z (about 7 years ago)
- Last Synced: 2025-07-06T19:42:52.347Z (3 months ago)
- Topics: bytecode, manipulation, spir-v
- Language: Java
- Size: 607 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SBM - SPIR-V Binary Manipulation library
=======
SBM is an ObjectWeb's ASM like library to manipulate SPIR-V binary code with Java.
The library uses a visitor model, meaning that SPIR-V modules will be
generated/read with objects having a function for each instruction possible
in the SPIR-V Specifications (up to 1.1 as to 2017/03/03). Those objects are what are called visitors.Each visitor function name contains the corresponding instruction name with a few variations:
* OpType<TypeName> instructions are converted to CodeVisitor::visit<TypeName>Type(*args...*)
* OpExecutionMode does not have the exact same arguments as the corresponding instruction:
the operands array is directly accessible in the ExecutionMode object.Code generation
===============
The `CodeWriter`, `CodeVisitor`, `FunctionVisitor`, `MemoryVisitor`, `ModuleReaderDispatcher`, `TypeVisitor` and `Opcodes` classes are generated thanks to [Spir-V Spec to Json](https://github.com/jglrxavpok/SpirvSpecToJson)