-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.team-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Use case
I have an external texture that I want to render using FragmentShader. I see that FragmentShader.setImageSampler accepts Image only, and there's no way to pass Texture sampler.
I don't have a workaround for now, but I'm considering using decodeImageFromPixels instead of working with Texture directly.
Proposal
Future<FragmentShader> loadShader() async {
var textureId = await _createExternalTexture();
var texture = Texture(textureId: textureId);
var program = await FragmentProgram.fromAsset('shaders/myshader.frag');
var shader = program.fragmentShader();
shader.setImageSampler(0, texture);
return shader;
}Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.team-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team