Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/andreas-jonsson/spirv

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/andreas-jonsson/spirv

  • v0.0.0-20160225104100-43defed50556
  • Source
  • Go
  • Socket score

Version published
Created
Source

SPIR-V

Build Coverage GoDoc Bountysource

Package SPIR-V is a Go encoder/decoder for the Vulkan SPIR-V format. This is based on the preliminary specificationn (pdf) and is subject to change as the specification matures.

Additional SPIR-V information can be found here (pdf) and here. A video lecture on Vulkan and SPIR can be seen here.

Usage

By itself, this package is not very useful. All it does is decode SPIR-V binary into sets of 32-bit words data structure and vice-versa. It is intended as a tool to facilitate the creation of SPIR-V debugging tools, compilers, and whatever else you may require.

At the highest level, one can operate on complete modules. They can be loaded, saved and verified to be correct:

module, err := spirv.Load(r)
...

err := module.Verify()
...

err := module.Save(w)
...

The Encoder and Decoder can be used directly if you wish. They offer working with data on a per-instruction basis and if you opt out of deserialization into typed structures, you can examine them without any allocation overhead.

About

SPIR-V is a binary intermediate language for representing graphical-shader stages and compute kernels for multiple Khronos APIs. Each function in a SPIR-V module contains a control-flow graph (CFG) of basic blocks, with additional instructions and constraints to retain source-code structured flow control.

SPIR-V has the following goals:

  • Provide a simple binary intermediate language for all functionality appearing in Khronos shaders/kernels.
  • Have a short, transparent, self-contained specification (sections Specification and Binary Form).
  • Map easily to other IRs, including LLVM IR.
  • Be the form passed by an API into a driver to set shaders/kernels.
  • Can be targeted by new front ends for novel high-level languages.
  • Allow the first parts of the source compilation and reflection process to be done offline.
  • Be low-level enough to require a reverse-engineering step to reconstruct source code.
  • Improve portability by enabling shared tools to generate or operate on it.
  • Allow separation of core specification from source language-specific sets of built-in functions.
  • Reduce compile time during application run time. (Eliminating most of the compile time during application run time is not a goal of this IL. Target-specific register allocation and scheduling are expected to still take significant time.)
  • Allow some optimizations to be done offline.

Install

go get github.com/andreas-jonsson/spirv

Acknowledgement

This library was originally written by Jim Teeuwen.

License

Unless otherwise stated, all of the work in this project is subject to a 1-clause BSD license. Its contents can be found in the enclosed LICENSE file.

FAQs

Package last updated on 25 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc