glslprep.js
glslprep.js copied to clipboard
webgl2 support: only glsl "version 100" minifies
At the moment only shader code that defines its version as "version 100" is minified. as soon as it is defined as something higher (eg. "version 200" or "version 300 es"), even without actually changing any of the code itself, it reads in and outputs the code unmodified instead of minified.
I would like to use "version 300 es" glsl code (for array constructions) in a current project that works in webgl2 capable browsers.
Here is a sample webgl2 glsl fragment shader sample that doesn't get minified:
#version 300 es
precision highp float;
in vec2 v_st;
out vec4 color;
void main()
{
color = vec4(1.0, 1.0, 0.0, 1.0);
}
I just checked the glsl-unit
repo, it seems there hasn't been any activity since 2012, which makes it unlikely to get support for webgl2?
If it's only that, we might be able to patch it. I had to do that for glsl-unit
already, because it did some questionable transforms on arithmetic expressions