Flutter Engine
The Flutter Engine
Classes | Namespaces | Functions
shader.h File Reference
#include <algorithm>
#include <memory>
#include <string>
#include "flutter/lib/gpu/context.h"
#include "flutter/lib/ui/dart_wrapper.h"
#include "fml/memory/ref_ptr.h"
#include "impeller/core/shader_types.h"
#include "impeller/renderer/shader_function.h"
#include "impeller/renderer/vertex_descriptor.h"

Go to the source code of this file.

Classes

class  flutter::gpu::Shader
 An immutable collection of shaders loaded from a shader bundle asset. More...
 
struct  flutter::gpu::Shader::UniformBinding
 

Namespaces

namespace  flutter
 
namespace  flutter::gpu
 

Functions

FLUTTER_GPU_EXPORT int InternalFlutterGpu_Shader_GetUniformStructSize (flutter::gpu::Shader *wrapper, Dart_Handle struct_name_handle)
 
FLUTTER_GPU_EXPORT int InternalFlutterGpu_Shader_GetUniformMemberOffset (flutter::gpu::Shader *wrapper, Dart_Handle struct_name_handle, Dart_Handle member_name_handle)
 

Function Documentation

◆ InternalFlutterGpu_Shader_GetUniformMemberOffset()

FLUTTER_GPU_EXPORT int InternalFlutterGpu_Shader_GetUniformMemberOffset ( flutter::gpu::Shader wrapper,
Dart_Handle  struct_name_handle,
Dart_Handle  member_name_handle 
)

Definition at line 143 of file shader.cc.

146 {
147 auto struct_name = tonic::StdStringFromDart(struct_name_handle);
148 const auto* uniform = wrapper->GetUniformStruct(struct_name);
149 if (uniform == nullptr) {
150 return -1;
151 }
152
153 auto member_name = tonic::StdStringFromDart(member_name_handle);
154 const auto* member = uniform->GetMemberMetadata(member_name);
155 if (member == nullptr) {
156 return -1;
157 }
158
159 return member->offset;
160}
const Shader::UniformBinding * GetUniformStruct(const std::string &name) const
Definition: shader.cc:106
std::string StdStringFromDart(Dart_Handle handle)

◆ InternalFlutterGpu_Shader_GetUniformStructSize()

FLUTTER_GPU_EXPORT int InternalFlutterGpu_Shader_GetUniformStructSize ( flutter::gpu::Shader wrapper,
Dart_Handle  struct_name_handle 
)

Exports

Definition at line 131 of file shader.cc.

133 {
134 auto name = tonic::StdStringFromDart(struct_name_handle);
135 const auto* uniform = wrapper->GetUniformStruct(name);
136 if (uniform == nullptr) {
137 return -1;
138 }
139
140 return uniform->size_in_bytes;
141}
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32