Repository navigation
Conversation
053fc29 to
f3471f5
Compare
|
I'll also cherry-pick this into the 4.1.x release branch and publish a new stable version next week, as this is definitely an improvement worth delivering. |
kblaschke
left a comment
There was a problem hiding this comment.
Thanks for fixing this!
I'll wait for the build checks to complete and will merge later today.
|
@kblaschke just happy to be of assistance, if your willing i wouldn't mind a shout-out to my Android tv version that's open source and better then the paid app if I say so myself ;) https://github.com/johnneerdael/ProjectM-TV |
Oh, no problem: we have a link list in the ReadMe and also our wiki here in this repo. Just make the edits, open a PR and I'll merge them ASAP! |
|
@kblaschke PR is ready for README, I added the seperate link to the paid google tv app under a seperate Google/Android TV section and included my own version (made more sense then keep it all under android), mentioning my contributions to 4.1.8 when its out, if you want something changed just let me know and I will adjust it, on the wiki I updated it. I will probably soon add Milkbeat to the list ;) with only the tiniest knod to Winamp and Milkdrop.... As in itself its a regular offline music player although there is some plugin support ...
|


Summary
Fixes #1033 (floating-point/vector remainder).
Fixes #1034 (operator precedence).
I maintain ProjectM TV, an open-source Android TV integration of projectM. I discovered this accidentally while listening to music: ORB - Burnt Ice --- Isosceles edit showed only a tiny white element in the centre, even with bass-heavy music. Tracing its unchanged preset through the evaluator and generated GLSL exposed three linked HLSL translator defects.
This restores floating-point/vector remainder and correct multiplicative precedence, while retaining integer remainder for integer expressions. The diff contains only the compiler changes and regression tests; reproduction presets, images and documentation are linked from a separate evidence branch.
Defects and fix
GetBinaryOpResultTypeforced every%expression to scalarint, discarding float and vector result types. Use the existing arithmetic type-promotion rules.GLSLGeneratorcast both operands to scalarint. Emit component-wisemodfor float expressions and preserve the promoted integer type for integer%; keep vector dimensions in the legacy GLSL fallback._binaryOpPriorityomitted the%entry, shifting subsequent entries. Add its multiplicative priority and a compile-time check that the table matches the operator enum.For Burnt Ice,
ret = one % two * 2uses two float3 colour samples. It became scalar integer remainder ofoneandtwo * 2, then grayscale output. It now becomesmod(one, two) * 2with float3 values intact. HLSL supports floating-point remainder; GLSLmodagrees in HLSL%'s defined same-sign domain (Microsoft specification). This does not alter the existingfmodintrinsic mapping.Real music and real preset evidence
I compared unchanged community presets on old and fixed engines with the same 1926 – Rainy Melody (Original Mix) excerpt, 1:00–1:20, using matched clocks, random seeds, audio and textures.
1-q28%2/4grouped as(1-q28)%(2/4); mostly flat pale outputint(...)%8-4grouped asint(...)%(8-4)A staged build on Elusive Impressions separates precedence from result typing: precedence alone still emits integer division
(int(q28)%2)/4; adding correct result typing emits division by4.0and matches the full fix byte-for-byte in the measured window. Integer-valued q28 makes the remaining operand cast harmless in that particular experiment. Comparison/bitwise priority effects outside these expressions are covered by parser tests, without claiming a separate real-preset reproduction.Real-music comparisons, videos, original presets, generated GLSL and staged-build measurements. Public videos are muted; the music recording is not included.
The same float3 expression is confirmed in ten presets under controlled audio. All ten per-preset comparisons and downloadable originals are on a separate evidence branch to keep this code diff focused. Other source-scan matches remain unverified; two additional real presets produced no difference in the selected track excerpt and are recorded as negative results.
Reproduction and validation
Visual measurements come from the patched 4.1.7 integration on Apple M4 Pro / desktop OpenGL 4.1 at 256×144 and 30 fps. Upstream master is independently covered by its full test suite. The evidence records these settings, measurements and preset fingerprints.