Unity 2020.3.34 LTS shader warnings

Avatar
  • updated
Shader warning in 'Shapes/Rect Lighten': integer modulus may be much slower, try using uints if possible. at Core.cginc(131) (on gles)
Shader warning in 'Shapes/Rect Lighten': integer modulus may be much slower, try using uints if possible. at Core.cginc(133) (on gles)
Shader warning in 'Shapes/Triangle Lighten': integer modulus may be much slower, try using uints if possible. at Core.cginc(228) (on gles)

Looks like the numerical constants just need to be marked as unsigned.

For example:

uint quadrantPrev = (quadrant+3u)%4u;

Reporting a bug? please specify Unity version:
2020.3.34
Reporting a bug? please specify Shapes version:
4.1.3
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Avatar
good luck, have fun

The uint issue is still occurring in Unity 2022.3.9f1, using Shapes 4.3.1, with the Triangle Core and Rect Core .cginc files.

I *think* to trigger these warnings, you have to set Quality settings higher than Unity's default for mobile. In my case they appear at "Very High" Quality setting when building for Android.

Avatar
Justin Wasilenko
Shader warning in 'Shapes/Triangle Multiplicative': use of potentially uninitialized variable (tRadial) at Core.cginc(210) (on vulkan)
Shader warning in 'Shapes/Triangle Darken': use of potentially uninitialized variable (tRadial) at Core.cginc(210) (on vulkan)
Shader warning in 'Shapes/Triangle Lighten': use of potentially uninitialized variable (tRadial) at Core.cginc(210) (on vulkan)
Shader warning in 'Shapes/Triangle Transparent': use of potentially uninitialized variable (tRadial) at Core.cginc(210) (on vulkan)
Shader warning in 'Shapes/Triangle LinearBurn': use of potentially uninitialized variable (tRadial) at Core.cginc(210) (on vulkan)
Shader warning in 'Shapes/Triangle ColorBurn': use of potentially uninitialized variable (tRadial) at Core.cginc(210) (on vulkan)
Shader warning in 'Shapes/Triangle Screen': use of potentially uninitialized variable (tRadial) at Core.cginc(210) (on vulkan)
Shader warning in 'Shapes/Triangle Subtractive': use of potentially uninitialized variable (tRadial) at Core.cginc(210) (on vulkan)
Shader warning in 'Shapes/Triangle Additive': use of potentially uninitialized variable (tRadial) at Core.cginc(210) (on vulkan)
Shader warning in 'Shapes/Triangle Opaque': use of potentially uninitialized variable (tRadial) at Core.cginc(210) (on vulkan)
Shader warning in 'Shapes/Triangle ColorDodge': use of potentially uninitialized variable (tRadial) at Core.cginc(210) (on vulkan)

^These are the warnings I am getting in Unity 2021.3.5 when using Android + Vulkan: