Prototype for GLSL static value range analysis, which shall prevent cases like that:
gl_FragColor.r = sin(something)+1.; //WARN: color shall be between 0 and 1
Very-very alpha. It supports ~5% of GLSL functionality. But at least it covers the case from "What is it" section :)
- Install
SConstruct
(required for unit tests only) - Install
node
+npm
- Install
google test
in your environment - How I did it in MAC, and that shall work for Linux too:
git clone https://github.com/google/googletest
cd googletest
mkdir build
cd build
cmake ..
make
make install
- Install https://leaningtech.com/cheerp/
- Run
npm install
in root folder - Depending on your OS:
- MacOS - nothing else required
- Windows/Linux - please replace path to
cheerp/bin/clang++
with valid one for your OS
npm run wasm
- to build dataflow analyzer from C to WebAssembly using cheerp. WASM is added tohtml
foldernpm run js
- to build js parser and UInpm run server
- to run web server on port 3355. Go to http://localhost:3355 and try editornpm run dataflow-tests
- to run some unit-tests for dataflow analyzer
glsl
- contains test UI, and also converter for GLSL to Command Sequence which goes to data flow analyzerast2dataflow.js
contains most of conversion logicindex.js
callsast2dataflow.js
and passes result to data flow analyzerdataflow
- contains data flow analyzer, which goes through command sequence and tries to predict variables rangesanalyzer.h
- main facade interfaceanalisys_context.h
- common processing logic, all about variables and branches managementops/buildin_ops.cpp
- list of supported GLSL operations and functions