5#ifndef FLUTTER_LIB_GPU_SHADER_H_
6#define FLUTTER_LIB_GPU_SHADER_H_
12#include "flutter/lib/gpu/context.h"
13#include "flutter/lib/ui/dart_wrapper.h"
24 DEFINE_WRAPPERTYPEINFO();
25 FML_FRIEND_MAKE_REF_COUNTED(
Shader);
34 const std::string&
name)
const;
40 std::string entrypoint,
42 std::shared_ptr<fml::Mapping> code_mapping,
43 std::vector<impeller::ShaderStageIOSlot>
inputs,
44 std::vector<impeller::ShaderStageBufferLayout> layouts,
45 std::unordered_map<std::string, UniformBinding> uniform_structs,
46 std::unordered_map<std::string, impeller::SampledImageSlot>
48 std::vector<impeller::DescriptorSetLayout> descriptor_set_layouts);
67 const std::string&
name)
const;
72 std::string entrypoint_;
74 std::shared_ptr<fml::Mapping> code_mapping_;
75 std::vector<impeller::ShaderStageIOSlot> inputs_;
76 std::vector<impeller::ShaderStageBufferLayout> layouts_;
77 std::unordered_map<std::string, UniformBinding> uniform_structs_;
78 std::unordered_map<std::string, impeller::SampledImageSlot> uniform_textures_;
79 std::vector<impeller::DescriptorSetLayout> descriptor_set_layouts_;
81 FML_DISALLOW_COPY_AND_ASSIGN(
Shader);
An immutable collection of shaders loaded from a shader bundle asset.
const Shader::UniformBinding * GetUniformStruct(const std::string &name) const
impeller::ShaderStage GetShaderStage() const
bool IsRegistered(Context &context)
bool RegisterSync(Context &context)
static fml::RefPtr< Shader > Make(std::string entrypoint, impeller::ShaderStage stage, std::shared_ptr< fml::Mapping > code_mapping, std::vector< impeller::ShaderStageIOSlot > inputs, std::vector< impeller::ShaderStageBufferLayout > layouts, std::unordered_map< std::string, UniformBinding > uniform_structs, std::unordered_map< std::string, impeller::SampledImageSlot > uniform_textures, std::vector< impeller::DescriptorSetLayout > descriptor_set_layouts)
std::shared_ptr< impeller::VertexDescriptor > CreateVertexDescriptor() const
const std::vector< impeller::DescriptorSetLayout > & GetDescriptorSetLayouts() const
const impeller::SampledImageSlot * GetUniformTexture(const std::string &name) const
std::shared_ptr< const impeller::ShaderFunction > GetFunctionFromLibrary(impeller::ShaderLibrary &library)
struct _Dart_Handle * Dart_Handle
#define FLUTTER_GPU_EXPORT
FLUTTER_GPU_EXPORT int InternalFlutterGpu_Shader_GetUniformMemberOffset(flutter::gpu::Shader *wrapper, Dart_Handle struct_name_handle, Dart_Handle member_name_handle)
FLUTTER_GPU_EXPORT int InternalFlutterGpu_Shader_GetUniformStructSize(flutter::gpu::Shader *wrapper, Dart_Handle struct_name_handle)
DEF_SWITCHES_START aot vmservice shared library name
Metadata required to bind a combined texture and sampler.