Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
shader_function_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#ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SHADER_FUNCTION_MTL_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SHADER_FUNCTION_MTL_H_
7
8#include <Metal/Metal.h>
9
10#include "flutter/fml/macros.h"
13
14namespace impeller {
15
17 : public ShaderFunction,
18 public BackendCast<ShaderFunctionMTL, ShaderFunction> {
19 public:
20 // |ShaderFunction|
22
23 id<MTLFunction> GetMTLFunction() const;
24
25 using CompileCallback = std::function<void(id<MTLFunction>)>;
26
27 void GetMTLFunctionSpecialized(const std::vector<Scalar>& constants,
28 const CompileCallback& callback) const;
29
30 private:
31 friend class ShaderLibraryMTL;
32
33 id<MTLFunction> function_ = nullptr;
34 id<MTLLibrary> library_ = nullptr;
35
36 ShaderFunctionMTL(UniqueID parent_library_id,
37 id<MTLFunction> function,
38 id<MTLLibrary> library,
39 std::string name,
40 ShaderStage stage);
41
42 ShaderFunctionMTL(const ShaderFunctionMTL&) = delete;
43
44 ShaderFunctionMTL& operator=(const ShaderFunctionMTL&) = delete;
45};
46
47} // namespace impeller
48
49#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SHADER_FUNCTION_MTL_H_
void GetMTLFunctionSpecialized(const std::vector< Scalar > &constants, const CompileCallback &callback) const
std::function< void(id< MTLFunction >)> CompileCallback
id< MTLFunction > GetMTLFunction() const
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
Dart_NativeFunction function
Definition fuchsia.cc:51
const char * name
Definition fuchsia.cc:50