| Flutter Impeller |

Public Member Functions | Public Attributes | List of all members
impeller::RuntimeUniformDescription Struct Reference

`#include <runtime_types.h>`

## Public Member Functions
size_t | GetDartSize () const
| Computes the total number of bytes that this uniform requires for representation in the Dart float buffer. More...
size_t | GetGPUSize () const
| Computes the total number of bytes that this uniform requires for representation in the GPU. More...

## Public Attributes
std::string | name
size_t | location = 0u
size_t | binding = 0u
| Location, but for Vulkan. More...
RuntimeUniformType | type = RuntimeUniformType::kFloat
RuntimeUniformDimensions | dimensions = {}
size_t | bit_width = 0u
std::optional< size_t > | array_elements
std::vector< RuntimePaddingType > | padding_layout = {}
std::vector< StructField > | struct_fields = {}
size_t | struct_float_count = 0u

## Detailed Description

Definition at line 52 of file runtime_types.h.

## Member Function Documentation

## ◆ GetDartSize()

size_t impeller::RuntimeUniformDescription::GetDartSize | ( |  | ) | const

Computes the total number of bytes that this uniform requires for representation in the Dart float buffer.

Definition at line 9 of file runtime_types.cc.

9 {
10 size_t size = 0;
11 if (!padding_layout.empty()) {
12 for (impeller::RuntimePaddingType byte_type : padding_layout) {
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 }
impeller::RuntimePaddingType
RuntimePaddingType
Definition: runtime_types.h:41
impeller::RuntimePaddingType::kFloat
@ kFloat
impeller::RuntimeUniformDescription::dimensions
RuntimeUniformDimensions dimensions
Definition: runtime_types.h:58
impeller::RuntimeUniformDescription::padding_layout
std::vector< RuntimePaddingType > padding_layout
Definition: runtime_types.h:61
impeller::RuntimeUniformDescription::array_elements
std::optional< size_t > array_elements
Definition: runtime_types.h:60
impeller::RuntimeUniformDescription::bit_width
size_t bit_width
Definition: runtime_types.h:59
impeller::RuntimeUniformDimensions::cols
size_t cols
Definition: runtime_types.h:38
impeller::RuntimeUniformDimensions::rows
size_t rows
Definition: runtime_types.h:37

References array_elements, bit_width, impeller::RuntimeUniformDimensions::cols, dimensions, impeller::kFloat, padding_layout, and impeller::RuntimeUniformDimensions::rows.

## ◆ GetGPUSize()

size_t impeller::RuntimeUniformDescription::GetGPUSize | ( |  | ) | const

Computes the total number of bytes that this uniform requires for representation in the GPU.

Definition at line 28 of file runtime_types.cc.

28 {
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 }

References array_elements, bit_width, impeller::RuntimeUniformDimensions::cols, dimensions, padding_layout, and impeller::RuntimeUniformDimensions::rows.

Referenced by impeller::RuntimeEffectContents::EmplaceUniform(), and impeller::testing::TEST_P().

## Member Data Documentation

## ◆ array_elements

std::optional<size_t> impeller::RuntimeUniformDescription::array_elements

Definition at line 60 of file runtime_types.h.

Referenced by impeller::RuntimeStage::Create(), GetDartSize(), GetGPUSize(), and impeller::MakeShaderMetadata().

## ◆ binding

size_t impeller::RuntimeUniformDescription::binding = 0u

Location, but for Vulkan.

Definition at line 56 of file runtime_types.h.

Referenced by impeller::RuntimeStage::Create().

## ◆ bit_width

size_t impeller::RuntimeUniformDescription::bit_width = 0u

Definition at line 59 of file runtime_types.h.

Referenced by impeller::RuntimeStage::Create(), impeller::RuntimeEffectContents::EmplaceUniform(), GetDartSize(), GetGPUSize(), and impeller::MakeShaderMetadata().

## ◆ dimensions

RuntimeUniformDimensions impeller::RuntimeUniformDescription::dimensions = {}

Definition at line 58 of file runtime_types.h.

Referenced by impeller::RuntimeStage::Create(), GetDartSize(), GetGPUSize(), and impeller::MakeShaderMetadata().

## ◆ location

size_t impeller::RuntimeUniformDescription::location = 0u

Definition at line 54 of file runtime_types.h.

Referenced by impeller::RuntimeStage::Create().

## ◆ name

std::string impeller::RuntimeUniformDescription::name

Definition at line 53 of file runtime_types.h.

Referenced by impeller::RuntimeStage::Create(), and impeller::MakeShaderMetadata().

## ◆ padding_layout

std::vector<RuntimePaddingType> impeller::RuntimeUniformDescription::padding_layout = {}

Definition at line 61 of file runtime_types.h.

Referenced by impeller::RuntimeStage::Create(), impeller::RuntimeEffectContents::EmplaceUniform(), GetDartSize(), GetGPUSize(), and impeller::testing::TEST_P().

## ◆ struct_fields

std::vector<StructField> impeller::RuntimeUniformDescription::struct_fields = {}

Definition at line 64 of file runtime_types.h.

Referenced by impeller::RuntimeStage::Create(), and impeller::testing::TEST_P().

## ◆ struct_float_count

size_t impeller::RuntimeUniformDescription::struct_float_count = 0u

Definition at line 65 of file runtime_types.h.

Referenced by impeller::RuntimeStage::Create(), and impeller::testing::TEST_P().

## ◆ type

RuntimeUniformType impeller::RuntimeUniformDescription::type = RuntimeUniformType::kFloat

Definition at line 57 of file runtime_types.h.

Referenced by impeller::RuntimeStage::Create(), impeller::MakeShaderMetadata(), and impeller::testing::TEST_P().

The documentation for this struct was generated from the following files:

- impeller/core/runtime_types.h
- impeller/core/runtime_types.cc