-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Compute in Vulkan #42294
[Impeller] Compute in Vulkan #42294
Changes from all commits
efbb8b3
eab8f2c
37eaae7
f07bfd9
28d1457
2168461
9301a82
c88dd19
355eaed
14f4076
8615211
b2b37ec
becb828
45aeb3b
53220ac
454ed44
d26abf2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,13 +124,23 @@ bool CommandEncoderVK::IsValid() const { | |
return is_valid_; | ||
} | ||
|
||
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 commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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 :) |
||
if (!IsValid()) { | ||
if (fail_callback) { | ||
callback(false); | ||
} | ||
return false; | ||
} | ||
|
||
// Success or failure, you only get to submit once. | ||
fml::ScopedCleanupClosure reset([&]() { Reset(); }); | ||
fml::ScopedCleanupClosure reset([&]() { | ||
if (fail_callback) { | ||
callback(false); | ||
} | ||
Reset(); | ||
}); | ||
|
||
InsertDebugMarker("QueueSubmit"); | ||
|
||
|
@@ -155,10 +165,16 @@ bool CommandEncoderVK::Submit() { | |
return false; | ||
} | ||
|
||
// Submit will proceed, call callback with true when it is done and do not | ||
// call when `reset` is collected. | ||
fail_callback = false; | ||
|
||
return fence_waiter_->AddFence( | ||
std::move(fence), [tracked_objects = std::move(tracked_objects_)] { | ||
// Nothing to do, we just drop the tracked | ||
// objects on the floor. | ||
std::move(fence), | ||
[callback, tracked_objects = std::move(tracked_objects_)] { | ||
if (callback) { | ||
callback(true); | ||
} | ||
}); | ||
} | ||
|
||
|
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,
engine/impeller/renderer/backend/vulkan/command_buffer_vk.cc
Line 89 in 64bed95
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)