Git Product home page Git Product logo

soulcrush's Introduction

TL;DR

Soulcrush is a small, experimental tool to remove unused code from OpenGL shaders.

Description

Soulcrush might some day become a full fledged GLSL minifier, but for now it only removes unused functions (functions not called directly or indirectly from main). The output from soulcrush can of course be passed to another minifier tool.

Despite the limited scope, this can still be useful. For instance, you could maintain a library of utility functions, include the whole library in your shaders (via a preprocessor or just file concatenation) and then use Soulcrush to remove unused code, and Shader Minifier to minify the output further.

Build

Run cargo build --release, and the binary should be built as target/release/soulcrush.

Run

Run target/release/soulcrush <filename>.glsl, and the output should be printed to standard output.

Known issues

Function calls from top-level variable initializers are currently not detected correctly, which can cause too much code to be removed. Also, unused top-level variables are not currently removed.

Did I mention that this project is experimental? It has only been used for a few toy projects, so expect bugs.

soulcrush's People

Contributors

knutae avatar

Watchers

 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.