Comments (4)
The fragment shader execution is already "asynchronous" in that it runs on the GPU timeline, whereas the UI and raster threads are on the CPU timeline. however, if the execution of the shader workload is expensive enough you will find that it will essentially hog the GPU preventing the raster thread from being able to submit workloads, which in turn prevents the raster workload from finishing. This is the limit of splitting up work across threads: you can't increase access of shared resources like disk, network, GPU, et cetera.
Its also possible that certain laptops are falling back to Skia software rendering due to lack of hardware support. I couldn't tell you if this is the case from the information here, but if it was there would be little we could do.
So now I'm looking for alternative solutions. The first thing I tried is limiting the framerate of the background through the ShaderPainter.shouldRepaint method, but due to the high render time this had negligible impact.
That isn't what that method does. It only controls if the paint method is called. If that shader is used in a scene that is included in any part of a frame, whether or not the painter painted or the widgets rebuilt, it gets executed. The only way to limit how often it runs is to cache the rendered results to a texture (see SnapshotWidget for an example of how to do that).
In general, I would recommend designing your application to support the target hardware you want to support. If older laptops are important, then your app/game/et cetera needs to cut costs. You can do that by simplifying the shader, or reducing the amount of work done by reducing the size of the painter. Or find a mechanism to detect older hardware (Android API level?) and substitute a reduced quality effect.
from flutter.
Oh, if you're running with Skia - you're probably getting some of the SnapshotWidget behavior automatically via raster caching. But that will only get you so far, as once you have to repaint you'll drop the frame again (one of the reasons automatic raster caching is a bad idea)
from flutter.
This was informative. Thank you!
from flutter.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v
and a minimal reproduction of the issue.
from flutter.
Related Issues (20)
- SearchAnchor tries to use its controller after being disposed HOT 1
- mac-14 lost external connection from phone device. HOT 1
- Graphics corruption when scrolling with Android Impeller on Fairphone 3+ HOT 10
- Impeller macOS app cannot load glyphs - "Break on 'ImpellerValidationBreak' to inspect point of failure: Could not create valid atlas." HOT 2
- mac-37 lost external connection from phone device. HOT 1
- mac-6 lost external connection from phone device. HOT 1
- mac-9 lost external connection from phone device. HOT 1
- [tool_crash] RPCError HOT 1
- ToggleButton border radius and fill gets inverted only in Flutter Web with HTML renderer HOT 1
- [YearPicker] Hover/Splash goes out of clipped bounds
- Can't click through `CarouselView` widget. HOT 3
- [tool_crash] RPCError HOT 1
- [tool_crash] ProcessException: Process exited abnormally with exit code 1:FAILURE: Build failed with an exception.* What went wrong:Cannot locate tasks that match 'app:tasks' as project 'app' not found in root project 'android'.* Try:> Run gradlew projects to get a list of available projects.> Run with --stacktrace option to get the stack trace.> Run with --info or --debug option to get more log output.> Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 4s Command: C:\Users\KimoStore\newtask\android\gradlew.bat, OS error code: 1 HOT 2
- ExpansionPanel mouse cursor changes when hovering the expand/collapse icon when ExpansionPanel.canTapOnHeader is true HOT 1
- Camera Web example doesn't work on Safari HOT 2
- [go_router] Add simple way to check if a dialog is shown
- [Android] : Black screen after minimizing the app and turning the screen off and on specific device api 22 (Gertec GPOS700A) HOT 5
- flutter build fails due visionOS (updated) HOT 2
- [camera_android_camerax] CameraX Version 1.4
- SliderTickMarkShape paint() arguments
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter.