-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Vulkan support in the Embedder API #29391
Conversation
351508c
to
668cd92
Compare
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.
embedder.h LGTM so far :)
shell/platform/embedder/embedder.h
Outdated
const FlutterVulkanImage* /* image */); | ||
typedef uint64_t* (*Uint64Callback)(void* /* user data */); | ||
|
||
typedef uint64_t* (*FlutterVulkanPresentImageCallback)(void* /* user data */, |
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.
Is this one used?
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.
Whoops, removed this.
shell/platform/embedder/embedder.h
Outdated
FlutterVulkanPhysicalDeviceHandle physical_device; | ||
// VkDevice handle. | ||
FlutterVulkanDeviceHandle device; | ||
ProcResolver get_proc_address_callback; |
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.
Where is "ProcResolver" defined? How is this one different from "get_instance_proc_address_callback"?
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.
Ah, this signature is used in the GL renderer. I think this was supposed to be instance-less vkGetInstanceProcAddr in the doc, but on second thought I don't see a reason why this would be useful as a separate callback. Removed.
62671fa
to
f3ecb6e
Compare
b1a8771
to
2962099
Compare
Is this in a state where I could try testing it w/ Fuchsia code -- IE try to get Fuchsia to use EmbedderSurfaceVulkan? |
249e0fa
to
5ae6eeb
Compare
I think this is about ready for trying out through the Embedder API surface itself (compositor and all), but the build's broken right now due to test harness stuff; I'll be fixing up the build later today |
46ad11b
to
8ae6fa2
Compare
@bdero thanks for your hard work on this. I will start working with this on Monday. |
8b91867
to
55f571a
Compare
…) to add missing implementations in SubzeroReactor.cpp. Corresponding buildroot PR: flutter/buildroot#529 Needed for flutter#29391.
…) to add missing implementations in SubzeroReactor.cpp. Corresponding buildroot PR: flutter/buildroot#529 Needed for flutter#29391. (cherry picked from commit dca7211)
1de7ccd
to
184c2a7
Compare
…) to add missing implementations in SubzeroReactor.cpp. Corresponding buildroot PR: flutter/buildroot#529 Needed for flutter#29391.
…) to add missing implementations in SubzeroReactor.cpp. Corresponding buildroot PR: flutter/buildroot#529 Needed for flutter#29391.
…) to add missing implementations in SubzeroReactor.cpp. Corresponding buildroot PR: flutter/buildroot#529 Needed for flutter#29391.
cae71d3
to
63f0b5f
Compare
In flutter#29391 we extracted EmbedderTestContextVulkan, but didn't move the vulkan_context_ to that class. Since it's no longer used in the base class, we push it down to avoid the precompiler macros.
In flutter#29391 we extracted EmbedderTestContextVulkan, but didn't move the vulkan_context_ to that class. Since it's no longer used in the base class, we push it down to avoid the ifdef guards.
In #29391 we extracted EmbedderTestContextVulkan, but didn't move the vulkan_context_ to that class. Since it's no longer used in the base class, we push it down to avoid the ifdef guards. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Please take a look and see if the
embedder.h
API looks like it works for your use case. /cc @jwinarske @arbreng @chinmaygardeSee
FlutterVulkanBackingStore.image
andFlutterVulkanRendererConfig.get_next_image_callback/present_image_callback
for a full description of the default synchronization behavior for both the layer and root image writing cases respectively (the behavior is essentially the same).My thought is that by default, we can simply have the engine internally host sync (with VkFences) before calling "present" callbacks. This matches the Fuchsia embedder's current behavior.
Later on, we can enable embedders to take full control over synchronization by adding an optional
FlutterVulkanImage.semaphore
field that, when present, will trigger the engine to automatically disable the default fence+present callback behavior, and the engine will instead signal the semaphore on device after pipeline execution. If the embedder provides a semaphore, the embedder can then submit pipeline commands ahead of time that will start executing on device immediately after the engine is done writing the image, eliminating an unnecessary device->host sync + host->device queue submit from the rendering time in cases where it's not desirable to render directly into swapchain images.