1. Create a FragmentShader per canvas.drawXXX. Yeah the documentation says you can reuse, but since you’re into fragment shader, I guess you want per draw per frame change by setting uniforms. Reuse the FragmentProgram. Load it from your shader file once, keep it in your provider, state, etc. and create FragmentShader objects from it right before you call canvas.drawXXX. This tripped me - as I barely read documentation and let my Windsurf handle the coding. For the most part.

  2. Also, Flutter will trim unused uniforms so your setFloat calls can start throwing index errors. Be wary.

Chalk drawing