blob: 0a2db5798d444041c31396f0b7b03a2729601667 [file] [log] [blame]
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <Metal/Metal.h>
#include "flutter/fml/macros.h"
#include "impeller/renderer/compute_pass.h"
namespace impeller {
class ComputePassMTL final : public ComputePass {
public:
// |RenderPass|
~ComputePassMTL() override;
private:
friend class CommandBufferMTL;
id<MTLCommandBuffer> buffer_ = nil;
std::string label_;
bool is_valid_ = false;
ComputePassMTL(std::weak_ptr<const Context> context,
id<MTLCommandBuffer> buffer);
// |ComputePass|
bool IsValid() const override;
// |ComputePass|
void OnSetLabel(std::string label) override;
// |ComputePass|
bool OnEncodeCommands(const Context& context) const override;
bool EncodeCommands(const std::shared_ptr<Allocator>& allocator,
id<MTLComputeCommandEncoder> pass) const;
FML_DISALLOW_COPY_AND_ASSIGN(ComputePassMTL);
};
} // namespace impeller