| Flutter Impeller |

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
5 #include "impeller/core/runtime_types.h"
6
7 namespace impeller {
8
9 size_t RuntimeUniformDescription::GetSize() const {
10 size_t size = dimensions.rows * dimensions.cols * bit_width / 8u;
11 if (array_elements.value_or(0) > 0) {
12 // Covered by check on the line above.
13 // NOLINTNEXTLINE(bugprone-unchecked-optional-access)
14 size *= array_elements.value();
15 }
16 size += sizeof(float) * struct_layout.size();
17 return size;
18 }
19
20 } // namespace impeller
impeller::RuntimeUniformDescription::GetSize
size_t GetSize() const
Computes the total number of bytes that this uniform requires.
Definition: runtime_types.cc:9
impeller::RuntimeUniformDimensions::cols
size_t cols
Definition: runtime_types.h:36
impeller::RuntimeUniformDescription::dimensions
RuntimeUniformDimensions dimensions
Definition: runtime_types.h:43
impeller::RuntimeUniformDimensions::rows
size_t rows
Definition: runtime_types.h:35
runtime_types.h
impeller::RuntimeUniformDescription::struct_layout
std::vector< uint8_t > struct_layout
Definition: runtime_types.h:46
impeller::RuntimeUniformDescription::bit_width
size_t bit_width
Definition: runtime_types.h:44
impeller::RuntimeUniformDescription::array_elements
std::optional< size_t > array_elements
Definition: runtime_types.h:45
impeller
Definition: aiks_blur_unittests.cc:20