HumbleUI/Skija

How to update shader uniforms?

Opened this issue · 1 comments

I have made a runtime effect with RuntimeEffect.makeForShader(shaderSrc);
I have created the shader with effect.makeShader(Data.makeFromBytes(data), null, null, false) (data being a byte buffer of uniforms)
I created the paint with paint = new Paint(); paint.setShader(shader);

The problem is, none of these classes have a method to update the uniforms in the shader.
How do I do this? I can't just re create the shader as it takes ~3ms to create and uniforms need to be updated each frame.

Hm. It takes only 0.02..0.06 ms for me

var shader = _effectForShader.makeShader(data, new Shader[] { child }, null);

You can try asking on https://groups.google.com/g/skia-discuss/, if there’s a better way I’m happy to provide API for it