// Update the uniforms for the current image size
_myEffectUniforms.Add("fTexWidth", (float)(image?.Width ?? 0));
_myEffectUniforms.Add("fTexHeight", (float)(image?.Height ?? 0));
// Attach the image as a "child" to the runtimeeffect
SKRuntimeEffectChildren children = new SKRuntimeEffectChildren(_myEffect);
if (image != null)
{
children.Add("image", image.ToShader()); // This call is very expensive
}
// Rebuild the shader using the new child
_myPaint.Shader = _myEffect.ToShader(_myEffectUniforms, children);
// Update the uniforms for the current image size
_myEffectUniforms.Add("fTexWidth", (float)(image?.Width ?? 0));
_myEffectUniforms.Add("fTexHeight", (float)(image?.Height ?? 0));
// Attach the image as a "child" to the runtimeeffect
SKRuntimeEffectChildren children = new SKRuntimeEffectChildren(_myEffect);
if (image != null)
{
children.Add("image", image.ToShader()); // This call is very expensive
}
// Rebuild the shader using the new child
_myPaint.Shader = _myEffect.ToShader(_myEffectUniforms, children);