|
16 | 16 | #else
|
17 | 17 | float z;
|
18 | 18 | #endif
|
19 |
| -};struct f{float intensity;vec3 position;float one,two;};uniform f Light[4];void main(){vec4 g=vec4(Light[0].position.xyz*Light[0].intensity,0.0);vec4 h=projectionMatrix*modelViewMatrix*vec4(0,0,0,1);vec4 i=d.projectionMatrix*d.modelViewMatrix*vec4(0,0,0,1);if(false){}pc_FragColor=vec4(texture(map,vUv).rgb,0.0);float j=0.0;pc_FragColor.a+=1.0+j;}" |
| 19 | +};struct f{float intensity;vec3 position;float one,two;};uniform f Light[4];invariant g;void main(){vec4 h=vec4(Light[0].position.xyz*Light[0].intensity,0.0);vec4 i=projectionMatrix*modelViewMatrix*vec4(0,0,0,1);vec4 j=d.projectionMatrix*d.modelViewMatrix*vec4(0,0,0,1);if(false){}g=vec4(texture(map,vUv).rgb,0.0);float k=0.0;g.a+=1.0+k;}" |
20 | 20 | `;
|
21 | 21 |
|
22 | 22 | exports[`minify > can mangle GLSL 2`] = `
|
|
52 | 52 | #else
|
53 | 53 | float z;
|
54 | 54 | #endif
|
55 |
| -};struct m{float intensity;vec3 position;float one,two;};uniform m n[4];void main(){vec4 o=vec4(n[0].position.xyz*n[0].intensity,0.0);vec4 p=projectionMatrix*modelViewMatrix*vec4(0,0,0,1);vec4 q=k.projectionMatrix*k.modelViewMatrix*vec4(0,0,0,1);if(false){}h=vec4(texture(f,g).rgb,0.0);float e=0.0;h.a+=1.0+e;}" |
| 55 | +};struct m{float intensity;vec3 position;float one,two;};uniform m n[4];invariant h;void main(){vec4 o=vec4(n[0].position.xyz*n[0].intensity,0.0);vec4 p=projectionMatrix*modelViewMatrix*vec4(0,0,0,1);vec4 q=k.projectionMatrix*k.modelViewMatrix*vec4(0,0,0,1);if(false){}h=vec4(texture(f,g).rgb,0.0);float e=0.0;h.a+=1.0+e;}" |
56 | 56 | `;
|
57 | 57 |
|
58 | 58 | exports[`minify > can mangle externals in GLSL 2`] = `
|
@@ -116,7 +116,7 @@ int y;
|
116 | 116 | #else
|
117 | 117 | float z;
|
118 | 118 | #endif
|
119 |
| -};struct LightData{float intensity;vec3 position;float one,two;};uniform LightData Light[4];void main(){vec4 lightNormal=vec4(Light[0].position.xyz*Light[0].intensity,0.0);vec4 clipPosition=projectionMatrix*modelViewMatrix*vec4(0,0,0,1);vec4 clipPositionGlobals=globals.projectionMatrix*globals.modelViewMatrix*vec4(0,0,0,1);if(false){}pc_FragColor=vec4(texture(map,vUv).rgb,0.0);float bar=0.0;pc_FragColor.a+=1.0+bar;}" |
| 119 | +};struct LightData{float intensity;vec3 position;float one,two;};uniform LightData Light[4];invariant pc_FragColor;void main(){vec4 lightNormal=vec4(Light[0].position.xyz*Light[0].intensity,0.0);vec4 clipPosition=projectionMatrix*modelViewMatrix*vec4(0,0,0,1);vec4 clipPositionGlobals=globals.projectionMatrix*globals.modelViewMatrix*vec4(0,0,0,1);if(false){}pc_FragColor=vec4(texture(map,vUv).rgb,0.0);float bar=0.0;pc_FragColor.a+=1.0+bar;}" |
120 | 120 | `;
|
121 | 121 |
|
122 | 122 | exports[`minify > can minify WGSL 1`] = `"struct LightData{intensity:f32,position:vec3<f32>,one:f32,two:f32,};struct Uniforms{projectionMatrix:mat4x4<f32>,modelViewMatrix:mat4x4<f32>,normalMatrix:mat3x3<f32>,one:f32,two:f32,lights:array<LightData,4>,};@binding(0)@group(0)var<uniform>uniforms:Uniforms;@binding(1)@group(0)var sample:sampler;@binding(2)@group(0)var map:texture_2d<f32>;struct VertexIn{@location(0)position:vec4<f32>,@location(1)uv:vec2<f32>,};struct VertexOut{@builtin(position)position:vec4<f32>,@location(0)uv:vec2<f32>,};@vertex fn vert_main(input:VertexIn)->VertexOut{var output:VertexOut;output.position=input.position;output.uv=input.uv;return output;}@fragment fn frag_main(uv:vec2<f32>)->vec4<f32>{var lightNormal=vec4<f32>(uniforms.lights[0].position*uniforms.lights[0].intensity,0.0);var clipPosition=uniforms.projectionMatrix*uniforms.modelViewMatrix*vec4<f32>(0.0,0.0,0.0,1.0);var color=textureSample(map,sample,uv);color.a+=1.0;return color;}"`;
|
@@ -1228,6 +1228,28 @@ exports[`tokenize > can tokenize GLSL 1`] = `
|
1228 | 1228 | "type": "whitespace",
|
1229 | 1229 | "value": "
|
1230 | 1230 |
|
| 1231 | + ", |
| 1232 | + }, |
| 1233 | + { |
| 1234 | + "type": "keyword", |
| 1235 | + "value": "invariant", |
| 1236 | + }, |
| 1237 | + { |
| 1238 | + "type": "whitespace", |
| 1239 | + "value": " ", |
| 1240 | + }, |
| 1241 | + { |
| 1242 | + "type": "identifier", |
| 1243 | + "value": "pc_FragColor", |
| 1244 | + }, |
| 1245 | + { |
| 1246 | + "type": "symbol", |
| 1247 | + "value": ";", |
| 1248 | + }, |
| 1249 | + { |
| 1250 | + "type": "whitespace", |
| 1251 | + "value": " |
| 1252 | +
|
1231 | 1253 | ",
|
1232 | 1254 | },
|
1233 | 1255 | {
|
|
0 commit comments