SPIRV-Tools/tools/sva
dependabot[bot] 5c8442f7fc
build(deps-dev): bump rollup from 3.23.0 to 3.29.5 in /tools/sva (#5826)
Bumps [rollup](https://github.com/rollup/rollup) from 3.23.0 to 3.29.5.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v3.23.0...v3.29.5)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-26 13:45:37 -04:00
..
bin Add WebGPU SPIR-V Assembler in JavaScript. (#2876) 2019-09-18 18:11:10 -04:00
src SPV_KHR_quad_control (#5547) 2024-01-26 15:49:56 -05:00
tests Add WebGPU SPIR-V Assembler in JavaScript. (#2876) 2019-09-18 18:11:10 -04:00
tools Add WebGPU SPIR-V Assembler in JavaScript. (#2876) 2019-09-18 18:11:10 -04:00
.eslintrc.json Add WebGPU SPIR-V Assembler in JavaScript. (#2876) 2019-09-18 18:11:10 -04:00
.gitignore Add WebGPU SPIR-V Assembler in JavaScript. (#2876) 2019-09-18 18:11:10 -04:00
mocha.opts Add WebGPU SPIR-V Assembler in JavaScript. (#2876) 2019-09-18 18:11:10 -04:00
package.json build(deps-dev): bump rollup from 3.23.0 to 3.29.5 in /tools/sva (#5826) 2024-09-26 13:45:37 -04:00
README.md Fix various source comment (doxygen) typos (#4680) 2022-01-26 15:13:08 -05:00
rollup.config.js Add WebGPU SPIR-V Assembler in JavaScript. (#2876) 2019-09-18 18:11:10 -04:00
yarn.lock build(deps-dev): bump rollup from 3.23.0 to 3.29.5 in /tools/sva (#5826) 2024-09-26 13:45:37 -04:00

SVA

SPIR-V Assembler for WebGPU. The SPIR-V Assembler is a JavaScript library to convert SPIR-V assembly (as produced by spirv-dis in SPIR-V Tools) into a SPIR-V binary. The assembler assumes it is generating WebGPU SPIR-V and thus has the following limitations.

  • Only 32 bit integers and floats supported
  • Only GLSL accepted as an extended instruction set
  • Doesn't support ! syntax for integers
  • Doesn't support hex encoding for float
yarn install
yarn test

You can also use yarn watch to watch all of the files and re-run tests as needed.

Webserver

Using yarn serve will start a webserver on localhost:5000. If you load the tests/index.html file this will load the SVA files into browser.

Command Line

There is a simple assembler binary with can be executed from the command line.

yarn sva tests/simple.spv_asm

The above will generate a o.sva file in the current directory.

Update spirv.data.json

If there is a new spirv-headers release update the externals folder checkout and then:

./tools/process_grammar.rb > src/spirv.data.json