| Flutter Impeller |

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

`#include <runtime_types.h>`

## Public Member Functions
size_t | GetSize () const
| Computes the total number of bytes that this uniform requires. 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< uint8_t > | struct_layout = {}
size_t | struct_float_count = 0u

## Detailed Description

Definition at line 41 of file runtime_types.h.

## Member Function Documentation

## ◆ GetSize()

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

Computes the total number of bytes that this uniform requires.

Definition at line 9 of file runtime_types.cc.

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

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

Referenced by impeller::MakeShaderMetadata().

## Member Data Documentation

## ◆ array_elements

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

Definition at line 49 of file runtime_types.h.

Referenced by GetSize(), and impeller::RuntimeStage::RuntimeStage().

## ◆ binding

size_t impeller::RuntimeUniformDescription::binding = 0u

Location, but for Vulkan.

Definition at line 45 of file runtime_types.h.

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

## ◆ bit_width

size_t impeller::RuntimeUniformDescription::bit_width = 0u

Definition at line 48 of file runtime_types.h.

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

## ◆ dimensions

RuntimeUniformDimensions impeller::RuntimeUniformDescription::dimensions = {}

Definition at line 47 of file runtime_types.h.

Referenced by GetSize(), and impeller::RuntimeStage::RuntimeStage().

## ◆ location

size_t impeller::RuntimeUniformDescription::location = 0u

Definition at line 43 of file runtime_types.h.

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

## ◆ name

std::string impeller::RuntimeUniformDescription::name

Definition at line 42 of file runtime_types.h.

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

## ◆ struct_float_count

size_t impeller::RuntimeUniformDescription::struct_float_count = 0u

Definition at line 51 of file runtime_types.h.

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

## ◆ struct_layout

std::vector<uint8_t> impeller::RuntimeUniformDescription::struct_layout = {}

Definition at line 50 of file runtime_types.h.

Referenced by impeller::RuntimeEffectContents::EmplaceVulkanUniform(), GetSize(), and impeller::RuntimeStage::RuntimeStage().

## ◆ type

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

Definition at line 46 of file runtime_types.h.

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

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

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

impeller::RuntimeUniformDimensions::cols
size_t cols
Definition: runtime_types.h:38
impeller::RuntimeUniformDescription::dimensions
RuntimeUniformDimensions dimensions
Definition: runtime_types.h:47
impeller::RuntimeUniformDimensions::rows
size_t rows
Definition: runtime_types.h:37
impeller::RuntimeUniformDescription::struct_layout
std::vector< uint8_t > struct_layout
Definition: runtime_types.h:50
impeller::RuntimeUniformDescription::bit_width
size_t bit_width
Definition: runtime_types.h:48
impeller::RuntimeUniformDescription::array_elements
std::optional< size_t > array_elements
Definition: runtime_types.h:49