laurentlb / shader-minifier

Minify and obfuscate GLSL or HLSL code
https://ctrl-alt-test.fr/minifier/
Apache License 2.0
424 stars 29 forks source link

Checker overhaul: Compile tests with glslang, fix tests, compile golden tests #400

Closed therontarigo closed 1 month ago

therontarigo commented 1 month ago
therontarigo commented 1 month ago

The following failures are known:

tests/out/real/to_the_road_of_ribbon.minind.frag
  Minifier bug: same name used for a variable and for a function
  (Nvidia) 1(28) : error C1105: cannot call a non-function
  (Nvidia) 1(34) : error C1105: cannot call a non-function

tests/out/real/audio-flight-v2.minind.frag
tests/out/real/orchard.minind.frag
  Glslang bug?  Does the spec allow omitting the space?
  (Glslang) WARNING: 1:11: '#define' : missing space after macro name
  (Glslang) ERROR: 1:178: 'MINDIST' : undeclared identifier

tests/unit/inline.frag
  Minifier bug - I haven't checked what went wrong here
  (Glslang) ERROR: stdin:2: 'c' : undeclared identifier
  (Mesa) 0:2(740): error: `c' undeclared
  (Mesa) 0:2(733): error: could not implicitly convert return value to float, in
 function `D'
  (Nvidia) 0(2) : error C1016: expression type incompatible with function return
 type

tests/unit/shadowing.frag
  Minifier bug: "return i+++++i+i"
  (Glslang) ERROR: 1:1: '++' :  l-value required
  (Mesa) 1:1(30): error: assignment to post-increment operation
  (Nvidia) 1(1) : error C1070: increment/decrement of non-lvalue
therontarigo commented 1 month ago

Continuous Integration is attempting to run Checker\bin\Debug\Checker.exe --skip-glsl-compile but that option no longer exists. I think this is set somewhere external to the repository.

laurentlb commented 1 month ago

Thanks a lot!

New build with Checker.exe --compile-golden: https://ci.appveyor.com/project/laurentlb/shader-minifier-r5gmt/builds/49868383

therontarigo commented 1 month ago

Should the failing tests be disabled for now until the minifier bugs can be individually fixed?

laurentlb commented 1 month ago

Yes, please. We can fix the issues separately, but I'd like the CI to be green to merge the change.

laurentlb commented 1 month ago

Merged

Thanks a lot! ❤️

eldritchconundrum commented 1 month ago

Shouldn't layout.* replace precision.frag?

therontarigo commented 1 month ago

Right, I should have deleted everything from precision.frag that's now duplicated in layout.* - but it's good to keep a test of precision qualifier as well. I didn't know if there is some reason both needed to be tested in the same file, it looks like not.

therontarigo commented 1 month ago

Oops, I've reset the auto-merge. That's all of the failing tests now filed as issues and identified in comments.