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
[Impeller] Compute in Vulkan #42294
[Impeller] Compute in Vulkan #42294
Conversation
@@ -330,12 +343,14 @@ bool CapabilitiesVK::SupportsFramebufferFetch() const { | |||
|
|||
// |Capabilities| | |||
bool CapabilitiesVK::SupportsCompute() const { | |||
return false; | |||
// Vulkan 1.1 requires support for compute. |
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.
oh, this will work?
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.
It's not wired up yet. But capabilities wise it is supported.
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.
More specifically,
IMPELLER_UNIMPLEMENTED; |
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 think we'll start crashing on drawPoints on Vulkan if this returns true before its completely ready?
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.
Ahh, yes. I'm not sure how big of a deal that is. I could make this patch still return false here but true on supports subgroups for now...?
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.
sg
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.
(We'll hit a codepath that ends up doing an IMPELLER_UNIMPLEMENTED which will abort)
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 with question
I'm going to hold off on landing this until I either get a sense of how long it'll take to fix the comptue implementation on Vulkan or I set the return value to false for now |
@@ -31,7 +31,10 @@ void main() { | |||
value = input_data.data[ident]; | |||
} | |||
|
|||
memory[ident] = value; | |||
if (ident < BLOCK_SIZE) { |
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.
Technically we need to use a function constant sizing of the memory size so that it exactly corresponds to the threadgroup size.
auto label is removed for flutter/engine, pr: 42294, due to - The status or check suite Linux linux_license has failed. Please fix the issues identified (or deflake) before re-applying this label. |
} | ||
return submit; | ||
return encoder_->Submit([callback](bool submit) { | ||
if (!submit) { |
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.
You missed the early return after the callback invocation on error. Thats why I prefer this stylistically too (and its drier).
callback(submitted ? kCompleted : kError);
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.
That doesn't work - it fires the callback too early.
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.
Ahh NVM I see.
bool CommandEncoderVK::Submit() { | ||
bool CommandEncoderVK::Submit(SubmitCallback callback) { | ||
// Make sure to call callback with `false` if anything returns early. | ||
bool fail_callback = !!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.
Prefer a ScopedCleanupClosure that returns false by default. On the one success case, release the closure and invoke it with true once.
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.
That's being done below.
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.
fail_callback
is used in the ScopedCleanupClosure.
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.
Oh, I think I see what you mean.
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 thought there was some way to make this a little clearer with a second fml::ScopedCleanupClosure but I'm missing it. Maybe we can sync up offline.
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.
Argh, nevermind again, I misread this and now I understand what you're saying :)
Sorry, just noticed an error on a second pass. Also some nits but those are not blockers. |
auto label is removed for flutter/engine, pr: 42294, due to - The status or check suite Mac mac_host_engine has failed. Please fix the issues identified (or deflake) before re-applying this label.
|
auto label is removed for flutter/engine, pr: 42294, due to - The status or check suite Linux Host clang-tidy has failed. Please fix the issues identified (or deflake) before re-applying this label. |
…128119) flutter/engine@02d6fbb...c6e9383 2023-06-02 jason-simmons@users.noreply.github.com [Impeller] clang-tidy fixes (flutter/engine#42503) 2023-06-02 103135467+sealesj@users.noreply.github.com Allow for optional label to trigger vuln scan on patch PRs (flutter/engine#42494) 2023-06-02 skia-flutter-autoroll@skia.org Roll Skia from 881a8df6f9e9 to 47b0db43f6a4 (1 revision) (flutter/engine#42512) 2023-06-02 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from X4Pkixxtt3BkjRW9P... to PuYA-6NVHeHPlkCdk... (flutter/engine#42511) 2023-06-02 skia-flutter-autoroll@skia.org Roll Skia from 7777ee2bf7ef to 881a8df6f9e9 (1 revision) (flutter/engine#42510) 2023-06-02 skia-flutter-autoroll@skia.org Roll Dart SDK from 3d4d29d8f16b to 9d8df2a5210b (2 revisions) (flutter/engine#42509) 2023-06-02 skia-flutter-autoroll@skia.org Roll Skia from 02e706e9761b to 7777ee2bf7ef (2 revisions) (flutter/engine#42508) 2023-06-02 skia-flutter-autoroll@skia.org Roll Skia from 0c75f1877b37 to 02e706e9761b (2 revisions) (flutter/engine#42506) 2023-06-02 dkwingsmt@users.noreply.github.com Revert "[Rasterizer] Make resubmit information temporary" (flutter/engine#42455) 2023-06-02 skia-flutter-autoroll@skia.org Roll Skia from f4854a3d009d to 0c75f1877b37 (1 revision) (flutter/engine#42505) 2023-06-02 skia-flutter-autoroll@skia.org Roll Dart SDK from 0d3c310fd6d9 to 3d4d29d8f16b (3 revisions) (flutter/engine#42502) 2023-06-02 skia-flutter-autoroll@skia.org Roll Skia from 082a7d1f72f7 to f4854a3d009d (4 revisions) (flutter/engine#42500) 2023-06-01 godofredoc@google.com Do not retry lint or clang tidy tests. (flutter/engine#42498) 2023-06-01 dnfield@google.com [Impeller] Compute in Vulkan (flutter/engine#42294) 2023-06-01 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from yqJfBsLdfLP4_vbFu... to JQRQ1nH1ILNA--N_b... (flutter/engine#42499) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from X4Pkixxtt3Bk to PuYA-6NVHeHP fuchsia/sdk/core/mac-amd64 from yqJfBsLdfLP4 to JQRQ1nH1ILNA 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 jonahwilliams@google.com,rmistry@google.com,zra@google.com 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Fixes flutter/flutter#110622
kComplete
status to callers when it should really bekPending
.