projectM-visualizer / projectm

projectM - Cross-platform Music Visualization Library. Open-source and Milkdrop-compatible.
https://discord.gg/mMrxAqaa3W
GNU Lesser General Public License v2.1
3.4k stars 376 forks source link

Properly cast argument types in GLSL #785

Closed dpw13 closed 9 months ago

dpw13 commented 9 months ago

I was occasionally getting type errors around the pow function after https://github.com/projectM-visualizer/projectm/pull/779. This appears to be because the type casting used in OutputExpressionList was being omitted. For the other functions with an added abs call, I use OutputExpressionList to recapture the previous casting behavior and for pow I use the function's return type, ensuring that all arguments are expanded into vectors where possible. pow in particular is often used in presets where the base or exponent is a scalar and the other argument is a vector.