glslprep.js icon indicating copy to clipboard operation
glslprep.js copied to clipboard

webgl2 support: only glsl "version 100" minifies

Open nylki opened this issue 6 years ago • 2 comments

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 avatar Apr 11 '18 09:04 nylki

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?

nylki avatar Apr 11 '18 09:04 nylki

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

tschw avatar Mar 24 '21 23:03 tschw