Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageFilter.MakeRuntimeShader with array of children #2601

Open
eyu0415 opened this issue Aug 29, 2024 · 0 comments
Open

ImageFilter.MakeRuntimeShader with array of children #2601

eyu0415 opened this issue Aug 29, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@eyu0415
Copy link

eyu0415 commented Aug 29, 2024

Description

const shader = Skia.RuntimeEffect.Make(`
  uniform shader image;
  uniform shader input;

  half4 main(float2 xy) {
    vec4 color = image.eval(xy);
    // use image & input
    return color;
  }
`);

There is no way to set array of children in Skia.ImageFilter.MakeRuntimeShader

In JSX possible like follows

    <Shader source={shader}>
      {children}
      <ImageShader fit="none" image={image} width={512} height={512} />
    </Shader>

and using shader also possible

shader.makeShaderWithChildren(uniforms, [image, input])

But if I want to using ImageFilter.MakeRuntimeShader with set childShader and input then dynamic source is gone

  const srcBuilder = Skia.RuntimeShaderBuilder(shader);
  const srcFilter = Skia.ImageFilter.MakeRuntimeShader(srcBuilder, null, null); // 'image' uniform will be received
  const srcFilter = Skia.ImageFilter.MakeRuntimeShader(srcBuilder, 'input', input); // 'input' is set but 'image' is gone

So, There is no way to set array of childShader like follow

Skia.ImageFilter.MakeRuntimeShader(srcBuilder, ['image', 'input'], [null, input])

Please help

@eyu0415 eyu0415 added the enhancement New feature or request label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant