-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed as not planned
Closed as not planned
Copy link
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecte: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requestsengineflutter/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
Use case
We would like to be able to dynamically load shaders at runtime like https://www.shadertoy.com or https://www.alma.sh/. Currently FragmentProgram only has a static method for loading assets, which seems a bit limiting as it is just shader bytecode that is being put into the bundle. For instance, web implements this as such:
@override
Future<ui.FragmentProgram> createFragmentProgram(String assetKey) {
if (_programs.containsKey(assetKey)) {
return _programs[assetKey]!;
}
return _programs[assetKey] = assetManager.load(assetKey).then((ByteData data) {
return CkFragmentProgram.fromBytes(assetKey, data.buffer.asUint8List());
});
}Proposal
The functionality already exists behind the scenes, so I just suggest it becomes part of the top level FragmentProgram api:
For instance this already exists:
static Future<CkFragmentProgram> fromBytes(String name, Uint8List data)chipweinberger, h35han, anlumo, Pingear, hectorAguero and 12 moretejainecetejainece
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecte: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requestsengineflutter/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