| Flutter Impeller |

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 <optional>
10 #include <string>
11 #include <vector>
12
13 namespace impeller {
14
15 enum class RuntimeStageBackend {
16 kSkSL,
17 kMetal,
18 kOpenGLES,
19 kVulkan,
20 };
21
22 enum RuntimeUniformType {
23 kFloat,
24 kSampledImage,
25 kStruct,
26 };
27
28 enum class RuntimeShaderStage {
29 kVertex,
30 kFragment,
31 kCompute,
32 };
33
34 struct RuntimeUniformDimensions {
35 size_t rows = 0;
36 size_t cols = 0;
37 };
38
39 struct RuntimeUniformDescription {
40 std::string name;
41 size_t location = 0u;
42 RuntimeUniformType type = RuntimeUniformType::kFloat;
43 RuntimeUniformDimensions dimensions = {};
44 size_t bit_width = 0u;
45 std::optional<size_t> array_elements;
46 std::vector<uint8_t> struct_layout = {};
47 size_t struct_float_count = 0u;
48
49 /// @brief Computes the total number of bytes that this uniform requires.
50 size_t GetSize() const;
51 };
52
53 } // namespace impeller
54
55 #endif // FLUTTER_IMPELLER_CORE_RUNTIME_TYPES_H_
impeller::RuntimeUniformDescription::GetSize
size_t GetSize() const
Computes the total number of bytes that this uniform requires.
Definition: runtime_types.cc:9
impeller::RuntimeUniformDescription
Definition: runtime_types.h:39
impeller::kFloat
@ kFloat
Definition: runtime_types.h:23
impeller::RuntimeShaderStage
RuntimeShaderStage
Definition: runtime_types.h:28
impeller::RuntimeStageBackend::kVulkan
@ kVulkan
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
impeller::kSampledImage
@ kSampledImage
Definition: runtime_types.h:24
impeller::RuntimeStageBackend::kOpenGLES
@ kOpenGLES
impeller::RuntimeUniformDimensions
Definition: runtime_types.h:34
impeller::RuntimeShaderStage::kVertex
@ kVertex
impeller::RuntimeShaderStage::kFragment
@ kFragment
impeller::RuntimeStageBackend
RuntimeStageBackend
Definition: runtime_types.h:15
impeller::RuntimeUniformType
RuntimeUniformType
Definition: runtime_types.h:22
impeller::RuntimeUniformDescription::name
std::string name
Definition: runtime_types.h:40
impeller::RuntimeUniformDescription::struct_float_count
size_t struct_float_count
Definition: runtime_types.h:47
impeller::RuntimeUniformDescription::struct_layout
std::vector< uint8_t > struct_layout
Definition: runtime_types.h:46
impeller::RuntimeUniformDescription::type
RuntimeUniformType type
Definition: runtime_types.h:42
impeller::kStruct
@ kStruct
Definition: runtime_types.h:25
impeller::RuntimeUniformDescription::location
size_t location
Definition: runtime_types.h:41
impeller::RuntimeUniformDescription::bit_width
size_t bit_width
Definition: runtime_types.h:44
impeller::RuntimeStageBackend::kSkSL
@ kSkSL
impeller::RuntimeShaderStage::kCompute
@ kCompute
impeller::RuntimeUniformDescription::array_elements
std::optional< size_t > array_elements
Definition: runtime_types.h:45
impeller::RuntimeStageBackend::kMetal
@ kMetal
impeller
Definition: aiks_blur_unittests.cc:20