Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
runtime_types.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_CORE_RUNTIME_TYPES_H_
6#define FLUTTER_IMPELLER_CORE_RUNTIME_TYPES_H_
7
8#include <cstddef>
9#include <cstdint>
10#include <optional>
11#include <string>
12#include <vector>
13
14namespace impeller {
15
17 kSkSL,
18 kMetal,
21 kVulkan,
22};
23
29
31 kVertex,
34};
35
37 size_t rows = 0;
38 size_t cols = 0;
39};
40
41enum class RuntimePaddingType : uint8_t {
42 kPadding = 0,
43 kFloat = 1,
44};
45
47 std::string name;
48 // The size in bytes of this field, not including padding.
49 size_t byte_size;
50};
51
53 std::string name;
54 size_t location = 0u;
55 /// Location, but for Vulkan.
56 size_t binding = 0u;
59 size_t bit_width = 0u;
60 std::optional<size_t> array_elements;
61 std::vector<RuntimePaddingType> padding_layout = {};
62 // The fields of the struct. Necessary on Vulkan, where everything is
63 // packed into a struct.
64 std::vector<StructField> struct_fields = {};
65 size_t struct_float_count = 0u;
66
67 /// @brief Computes the total number of bytes that this uniform requires for
68 /// representation in the Dart float buffer.
69 size_t GetDartSize() const;
70
71 /// @brief Computes the total number of bytes that this uniform requires for
72 /// representation in the GPU.
73 size_t GetGPUSize() const;
74};
75
76} // namespace impeller
77
78#endif // FLUTTER_IMPELLER_CORE_RUNTIME_TYPES_H_
constexpr auto kPadding
size_t GetGPUSize() const
Computes the total number of bytes that this uniform requires for representation in the GPU.
RuntimeUniformDimensions dimensions
size_t GetDartSize() const
Computes the total number of bytes that this uniform requires for representation in the Dart float bu...
std::vector< StructField > struct_fields
std::vector< RuntimePaddingType > padding_layout
std::optional< size_t > array_elements
size_t binding
Location, but for Vulkan.