tschw / glslprep.js

GLSL preparation build step based on glsl-unit and glsl-optimizier including minifier library
Apache License 2.0
20 stars 4 forks source link

webgl2 support: only glsl "version 100" minifies #3

Open nylki opened 6 years ago

nylki commented 6 years ago

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);
}
nylki commented 6 years ago

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?

tschw commented 3 years ago

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