Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
runtime_types.cc
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
6
7namespace impeller {
8
10 size_t size = 0;
11 if (!padding_layout.empty()) {
13 if (byte_type == RuntimePaddingType::kFloat) {
14 size += sizeof(float);
15 }
16 }
17 } else {
18 size = dimensions.rows * dimensions.cols * bit_width / 8u;
19 }
20 if (array_elements.value_or(0) > 0) {
21 // Covered by check on the line above.
22 // NOLINTNEXTLINE(bugprone-unchecked-optional-access)
23 size *= array_elements.value();
24 }
25 return size;
26}
27
29 size_t size = 0;
30 if (padding_layout.empty()) {
31 size = dimensions.rows * dimensions.cols * bit_width / 8u;
32 } else {
33 size = sizeof(float) * padding_layout.size();
34 }
35 if (array_elements.value_or(0) > 0) {
36 // Covered by check on the line above.
37 // NOLINTNEXTLINE(bugprone-unchecked-optional-access)
38 size *= array_elements.value();
39 }
40 return size;
41}
42
43} // namespace impeller
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< RuntimePaddingType > padding_layout
std::optional< size_t > array_elements