-
Notifications
You must be signed in to change notification settings - Fork 6k
[Flutter GPU] Add Textures. #48118
[Flutter GPU] Add Textures. #48118
Conversation
jonahwilliams
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Lets get this moving!
chinmaygarde
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figure we will keep tinkering on this further but I think we should stick to the underlying API more closely with allocators, descriptors, etc.. This PR is also a fascinating look into the kind of friction we will run into with FFI and something to think more deeply about.
|
|
||
| part of flutter_gpu; | ||
|
|
||
| base class Texture extends NativeFieldWrapperClass1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be more faithful to the the C++ API with the concept of descriptors and allocators obtaining texture handles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'm interested in hearing your thoughts around this. These breaks from Impeller are intentional, but indeed we'll keep tinkering and I'm super open to changing these things.
Will we ever need multiple device allocators? We ended up not using multiple for Entities, and most HALs seem to just tie allocations to the device. We did discuss the possibility of making contexts for multiple devices/having a device selection scheme in the future in the doc. There's a rough plan in case we need it, but those use cases are pretty eccentric.
The Flutter GPU doc removed a lot of descriptors from the beginning, opting for just using optional params in a lot of places instead. I think we should still have them for the more complicated config substructures like RenderPass attachments, but not sure we're gaining anything usability-wise by using them for texture and buffer creation?
3908f7c to
4dffb08
Compare
4dffb08 to
c0a0b75
Compare
…138637) flutter/engine@90c3ada...141a01c 2023-11-17 [email protected] Reland "[Impeller] Fail if software backend is chosen and Impeller is enabled on iOS." (flutter/engine#46275) 2023-11-17 [email protected] Make `impeller/geometry/...` compatible with `.clang-tidy`. (flutter/engine#48154) 2023-11-17 [email protected] Make `impeller/{archivist|compiler|core|entity}/...` compatible with â�¦ (flutter/engine#48153) 2023-11-17 [email protected] Assign mojom `kSwitch` role to switches (flutter/engine#48146) 2023-11-17 [email protected] [web] Move scene DOM management to DomManager (flutter/engine#47460) 2023-11-17 [email protected] [Impeller] Unify around "transform" (flutter/engine#48184) 2023-11-17 [email protected] Roll Dart SDK from a9c212f2f54b to 03cddb5d740d (1 revision) (flutter/engine#48182) 2023-11-17 [email protected] Actually make `status_or.h` compatible with `.clang-tidy`. (flutter/engine#48151) 2023-11-17 [email protected] [Impeller] Cleanups to geometry interfaces. (flutter/engine#48180) 2023-11-17 [email protected] [web] Move all DOM creation to DomManager (flutter/engine#48123) 2023-11-17 [email protected] Reenable UnobstructedPlatformViewTests testMultiplePlatformViewsWithOverlays (flutter/engine#48139) 2023-11-17 [email protected] Roll Dart SDK from 46e8b18047eb to a9c212f2f54b (1 revision) (flutter/engine#48176) 2023-11-17 [email protected] Roll Skia from bcd22e8f95bc to 8e9e168418a0 (1 revision) (flutter/engine#48173) 2023-11-17 [email protected] Roll Fuchsia Linux SDK from M0zM3CJLIrd5lb0u0... to Bcq9TZdt-vtTSL5YH... (flutter/engine#48172) 2023-11-17 [email protected] Roll Skia from c8ee25282849 to bcd22e8f95bc (1 revision) (flutter/engine#48170) 2023-11-17 [email protected] [Flutter GPU] Add Textures. (flutter/engine#48118) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from M0zM3CJLIrd5 to Bcq9TZdt-vtT If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Going light on the docstrings so we can get to experimenting faster.
Textures! They can be written to by the host with
Texture.overwriteand used as aui.ImagewithTexture.asImage.Right now we need to capture the "texture coordinate system" concept in order for Impeller to handle drawing textures in the right orientation on a
Canvas. The user of the API may switch from host authoring to render target usage at any time. Similar to Unity, users targeting GLES will need to use this information to handle the texture flip when sampling from shaders -- this will be important to document comprehensively.Flutter GPU textures being drawn with a CustomPainter:
Screen.Recording.2023-11-16.at.1.58.03.AM.mov