20 : context_(context) {}
25 const std::vector<std::shared_ptr<CommandBuffer>>& buffers,
27 if (buffers.empty()) {
29 "No command buffers provided.");
33 if (completion_callback) {
38 std::vector<vk::CommandBuffer> vk_buffers;
39 std::vector<std::shared_ptr<TrackedObjectsVK>> tracked_objects;
40 vk_buffers.reserve(buffers.size());
41 tracked_objects.reserve(buffers.size());
42 for (
const std::shared_ptr<CommandBuffer>&
buffer : buffers) {
44 if (!
encoder->EndCommandBuffer()) {
46 "Failed to end command buffer.");
48 tracked_objects.push_back(
encoder->tracked_objects_);
49 vk_buffers.push_back(
encoder->GetCommandBuffer());
53 auto context = context_.lock();
58 auto [fence_result, fence] = context->GetDevice().createFenceUnique({});
59 if (fence_result != vk::Result::eSuccess) {
64 vk::SubmitInfo submit_info;
65 submit_info.setCommandBuffers(vk_buffers);
66 auto status = context->GetGraphicsQueue()->Submit(submit_info, *fence);
67 if (status != vk::Result::eSuccess) {
74 auto added_fence = context->GetFenceWaiter()->AddFence(
75 std::move(fence), [completion_callback, tracked_objects = std::move(
76 tracked_objects)]()
mutable {
79 tracked_objects.clear();
80 if (completion_callback) {
Wraps a closure that is invoked in the destructor unless released by the caller.
static CommandBufferVK & Cast(CommandBuffer &base)
const std::shared_ptr< CommandEncoderVK > & GetEncoder()
~CommandQueueVK() override
fml::Status Submit(const std::vector< std::shared_ptr< CommandBuffer > > &buffers, const CompletionCallback &completion_callback={}) override
Submit one or more command buffer objects to be encoded and executed on the GPU.
CommandQueueVK(const std::weak_ptr< ContextVK > &context)
std::function< void(CommandBuffer::Status)> CompletionCallback
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
static SkString to_string(int n)