| Flutter Impeller |

compute_pass_mtl.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #pragma once
6
7 #include <Metal/Metal.h>
8
9 #include "flutter/fml/macros.h"
10 #include "impeller/renderer/compute_pass.h"
11
12 namespace impeller {
13
14 class ComputePassMTL final : public ComputePass {
15 public:
16 // |RenderPass|
17 ~ComputePassMTL() override;
18
19 private:
20 friend class CommandBufferMTL;
21
22 id<MTLCommandBuffer> buffer_ = nil;
23 std::string label_;
24 bool is_valid_ = false;
25
26 ComputePassMTL(std::weak_ptr<const Context> context,
27 id<MTLCommandBuffer> buffer);
28
29 // |ComputePass|
30 bool IsValid() const override;
31
32 // |ComputePass|
33 void OnSetLabel(const std::string& label) override;
34
35 // |ComputePass|
36 bool OnEncodeCommands(const Context& context,
37 const ISize& grid_size,
38 const ISize& thread_group_size) const override;
39
40 bool EncodeCommands(const std::shared_ptr<Allocator>& allocator,
41 id<MTLComputeCommandEncoder> pass,
42 const ISize& grid_size,
43 const ISize& thread_group_size) const;
44
45 FML_DISALLOW_COPY_AND_ASSIGN(ComputePassMTL);
46 };
47
48 } // namespace impeller
impeller::ComputePassMTL
Definition: compute_pass_mtl.h:14
impeller::ComputePass::EncodeCommands
bool EncodeCommands() const
Encode the recorded commands to the underlying command buffer.
Definition: compute_pass.cc:50
impeller::TSize< int64_t >
impeller::ComputePassMTL::~ComputePassMTL
~ComputePassMTL() override
impeller::CommandBufferMTL
Definition: command_buffer_mtl.h:14
impeller::Context
To do anything rendering related with Impeller, you need a context.
Definition: context.h:47
compute_pass.h
impeller
Definition: aiks_context.cc:10
impeller::ComputePass
Compute passes encode compute shader into the underlying command buffer.
Definition: compute_pass.h:25