Git Product home page Git Product logo

spirq-rs's Introduction

SPIR-Q

Crate Documentation

SPIR-Q is a light weight library for SPIR-V pipeline metadata query.

Why SPIR-Q?

Back in days of OpenGL, we have glGetActiveUniformsiv and other APIs to get pipeline metadata, so that we can determine the sizes, names, array strides and other information dynamically at runtime. However, the next-gen API, Vulkan, was deisgned not to support shader reflection so that the driver can be kept as thin as possible. SPIR-Q is an attempt to fill this gap.

SPIR-Q can be very useful for scenarios where we want some dynamic in pipeline construction, so that we don't have to refill those redundantly long VkXxxCreateInfos all the time. It can also be used to automate filler code generation at compile time.

It should be noted that SPIR-V is targeting at Vulkan so OpenCL binaries are not supported.

Usage

The project is approaching the finish line. Please refer to the attached examples:

  • query: Query separate entry points in SPIR-V binaries.
  • pipeline: Query a (conceptual) pipeline built from multiple shader modules.
  • spirv-spec: Reflection of an example fragment shader program, which can be found in section 1.10 of the SPIR-V specification.
  • walk: Enumerate offsets, symbols and types of all descriptor variables.

Sample output are attached in the same directories as the code files.

To-do

We are looking forward to improve SPIR-Q with features specified in SPIR-V 1.4. E.g. we no longer need to scan through function implementations to see what variables are used by an entry point. But unfortunately we have been blocked by spirv_headers. SPIR-Q will follow up as soon as spirv-headers updates.

License

This project is licensed under either of

at your option.

spirq-rs's People

Contributors

penguinliong avatar fintelia avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.