Flutter Engine
The Flutter Engine
|
Namespaces | |
namespace | testing |
Classes | |
class | AutoLogger |
class | Compiler |
struct | CompilerBackend |
class | CompilerSkSL |
struct | IncludeDir |
class | Includer |
struct | IncluderData |
struct | InputDescription |
struct | KnownType |
class | Reflector |
class | RuntimeStageData |
class | ShaderBundleData |
struct | ShaderConfig |
A shader config parsed as part of a ShaderBundleConfig. More... | |
struct | SourceOptions |
class | SPIRVCompiler |
struct | SPIRVCompilerOptions |
struct | SPIRVCompilerSourceProfile |
struct | SPIRVCompilerTargetEnv |
struct | StructMember |
class | Switches |
struct | UniformDescription |
class | UniqueIncluder |
Wraps a shared includer so unique includers may be created to satisfy the shaderc API. This is a simple proxy object and does nothing. More... | |
struct | VertexType |
Typedefs | |
using | ShaderBundleConfig = std::unordered_map< std::string, ShaderConfig > |
Enumerations | |
enum class | SourceType { kUnknown , kVertexShader , kFragmentShader , kComputeShader } |
enum class | TargetPlatform { kUnknown , kMetalDesktop , kMetalIOS , kOpenGLES , kOpenGLDesktop , kVulkan , kRuntimeStageMetal , kRuntimeStageGLES , kRuntimeStageVulkan , kSkSL } |
enum class | SourceLanguage { kUnknown , kGLSL , kHLSL } |
Functions | |
static uint32_t | ParseMSLVersion (const std::string &msl_version) |
static CompilerBackend | CreateMSLCompiler (const spirv_cross::ParsedIR &ir, const SourceOptions &source_options, std::optional< uint32_t > msl_version_override={}) |
static CompilerBackend | CreateVulkanCompiler (const spirv_cross::ParsedIR &ir, const SourceOptions &source_options) |
static CompilerBackend | CreateGLSLCompiler (const spirv_cross::ParsedIR &ir, const SourceOptions &source_options) |
static CompilerBackend | CreateSkSLCompiler (const spirv_cross::ParsedIR &ir, const SourceOptions &source_options) |
static bool | EntryPointMustBeNamedMain (TargetPlatform platform) |
static CompilerBackend | CreateCompiler (const spirv_cross::ParsedIR &ir, const SourceOptions &source_options) |
static std::string | JoinStrings (std::vector< std::string > items, const std::string &separator) |
static Reflector::Options | CreateReflectorOptions (const SourceOptions &options, const Switches &switches) |
static std::shared_ptr< RuntimeStageData::Shader > | CompileSkSL (std::shared_ptr< fml::Mapping > source_file_mapping, const Switches &switches) |
static bool | OutputIPLR (const Switches &switches, const std::shared_ptr< fml::Mapping > &source_file_mapping) |
static bool | OutputSLFile (const Compiler &compiler, const Switches &switches) |
static bool | OutputReflectionData (const Compiler &compiler, const Switches &switches, const SourceOptions &options) |
static bool | OutputDepfile (const Compiler &compiler, const Switches &switches) |
bool | Main (const fml::CommandLine &command_line) |
static std::string | ExecutionModelToString (spv::ExecutionModel model) |
static std::string | StringToShaderStage (const std::string &str) |
static std::optional< RuntimeStageBackend > | GetRuntimeStageBackend (TargetPlatform target_platform) |
static std::string | ToString (CompilerBackend::Type type) |
static std::string | TypeNameWithPaddingOfSize (size_t size) |
static std::optional< KnownType > | ReadKnownScalarType (spirv_cross::SPIRType::BaseType type) |
static size_t | GetReflectedStructSize (const std::vector< StructMember > &members) |
Get the reflected struct size. In the vast majority of the cases, this is the same as the declared struct size as given by the compiler. But, additional padding may need to be introduced after the end of the struct to keep in line with the alignment requirement of the individual struct members. This method figures out the actual size of the reflected struct that can be referenced in native code. More... | |
static VertexType | VertexTypeFromInputResource (const spirv_cross::Compiler &compiler, const spirv_cross::Resource *resource) |
static std::optional< fb::Stage > | ToStage (spv::ExecutionModel stage) |
static std::optional< fb::Stage > | ToJsonStage (spv::ExecutionModel stage) |
static std::optional< fb::UniformDataType > | ToUniformType (spirv_cross::SPIRType::BaseType type) |
static std::optional< fb::InputDataType > | ToInputType (spirv_cross::SPIRType::BaseType type) |
static std::optional< uint32_t > | ToJsonType (spirv_cross::SPIRType::BaseType type) |
static std::string | RuntimeStageBackendToString (RuntimeStageBackend backend) |
std::optional< ShaderBundleConfig > | ParseShaderBundleConfig (const std::string &bundle_config_json, std::ostream &error_stream) |
Parse a shader bundle configuration from a given JSON string. More... | |
static std::unique_ptr< fb::shaderbundle::BackendShaderT > | GenerateShaderBackendFB (TargetPlatform target_platform, SourceOptions &options, const std::string &shader_name, const ShaderConfig &shader_config) |
static std::unique_ptr< fb::shaderbundle::ShaderT > | GenerateShaderFB (SourceOptions options, const std::string &shader_name, const ShaderConfig &shader_config) |
std::optional< fb::shaderbundle::ShaderBundleT > | GenerateShaderBundleFlatbuffer (const std::string &bundle_config_json, const SourceOptions &options) |
Parses the JSON shader bundle configuration and invokes the compiler multiple times to produce a shader bundle flatbuffer. More... | |
bool | GenerateShaderBundle (Switches &switches) |
Parses the JSON shader bundle configuration and invokes the compiler multiple times to produce a shader bundle flatbuffer, which is then output to the sl file. More... | |
static std::optional< fb::shaderbundle::ShaderStage > | ToStage (spv::ExecutionModel stage) |
static std::optional< fb::shaderbundle::UniformDataType > | ToUniformType (spirv_cross::SPIRType::BaseType type) |
static std::optional< fb::shaderbundle::InputDataType > | ToInputType (spirv_cross::SPIRType::BaseType type) |
static void | SetDefaultLimitations (shaderc::CompileOptions &compiler_opts) |
static void | SetBindingBaseOffset (shaderc::CompileOptions &options) |
void | report_and_exit (const std::string &msg) |
static TargetPlatform | TargetPlatformFromCommandLine (const fml::CommandLine &command_line) |
static std::vector< TargetPlatform > | RuntimeStagesFromCommandLine (const fml::CommandLine &command_line) |
static SourceType | SourceTypeFromCommandLine (const fml::CommandLine &command_line) |
static bool | StringEndWith (const std::string &string, const std::string &suffix) |
SourceType | SourceTypeFromFileName (const std::string &file_name) |
SourceType | SourceTypeFromString (std::string name) |
SourceLanguage | ToSourceLanguage (const std::string &source_language) |
std::string | TargetPlatformToString (TargetPlatform platform) |
std::string | SourceLanguageToString (SourceLanguage source_language) |
std::string | EntryPointFunctionNameFromSourceName (const std::string &file_name, SourceType type, SourceLanguage source_language, const std::string &entry_point_name) |
bool | TargetPlatformNeedsReflection (TargetPlatform platform) |
std::string | ShaderCErrorToString (shaderc_compilation_status status) |
shaderc_shader_kind | ToShaderCShaderKind (SourceType type) |
spv::ExecutionModel | ToExecutionModel (SourceType type) |
spirv_cross::CompilerMSL::Options::Platform | TargetPlatformToMSLPlatform (TargetPlatform platform) |
std::string | SourceTypeToString (SourceType type) |
std::string | TargetPlatformSLExtension (TargetPlatform platform) |
bool | TargetPlatformIsOpenGL (TargetPlatform platform) |
bool | TargetPlatformIsMetal (TargetPlatform platform) |
bool | TargetPlatformIsVulkan (TargetPlatform platform) |
bool | TargetPlatformBundlesSkSL (TargetPlatform platform) |
bool | SetPermissiveAccess (const std::filesystem::path &p) |
Sets the file access mode of the file at path 'p' to 0644. More... | |
std::string | Utf8FromPath (const std::filesystem::path &path) |
Converts a native format path to a utf8 string. More... | |
std::string | InferShaderNameFromPath (std::string_view path) |
std::string | ToCamelCase (std::string_view string) |
std::string | ToLowerCase (std::string_view string) |
std::string | ConvertToEntrypointName (std::string_view string) |
Ensure that the entrypoint name is a valid identifier in the target language. More... | |
bool | StringStartsWith (const std::string &target, const std::string &prefix) |
Variables | |
constexpr std::string_view | kReflectionHeaderTemplate |
constexpr std::string_view | kReflectionCCTemplate |
constexpr char | kExternalTexturePrefix [] = "SAMPLER_EXTERNAL_OES_" |
static const char * | kStageKey = "stage" |
static const char * | kTargetPlatformKey = "target_platform" |
static const char * | kEntrypointKey = "entrypoint" |
static const char * | kUniformsKey = "uniforms" |
static const char * | kShaderKey = "shader" |
static const char * | kUniformNameKey = "name" |
static const char * | kUniformLocationKey = "location" |
static const char * | kUniformTypeKey = "type" |
static const char * | kUniformRowsKey = "rows" |
static const char * | kUniformColumnsKey = "columns" |
static const char * | kUniformBitWidthKey = "bit_width" |
static const char * | kUniformArrayElementsKey = "array_elements" |
static const std::map< std::string, TargetPlatform > | kKnownPlatforms |
static const std::map< std::string, TargetPlatform > | kKnownRuntimeStages |
static const std::map< std::string, SourceType > | kKnownSourceTypes |
using impeller::compiler::ShaderBundleConfig = typedef std::unordered_map<std::string, ShaderConfig> |
|
strong |
|
strong |
Enumerator | |
---|---|
kUnknown | |
kVertexShader | |
kFragmentShader | |
kComputeShader |
Definition at line 21 of file types.h.
|
strong |
Enumerator | |
---|---|
kUnknown | |
kMetalDesktop | |
kMetalIOS | |
kOpenGLES | |
kOpenGLDesktop | |
kVulkan | |
kRuntimeStageMetal | |
kRuntimeStageGLES | |
kRuntimeStageVulkan | |
kSkSL |
Definition at line 28 of file types.h.
|
static |
Run the shader compiler to geneate SkSL reflection data. If there is an error, prints error text and returns nullptr
.
Definition at line 37 of file impellerc_main.cc.
std::string impeller::compiler::ConvertToEntrypointName | ( | std::string_view | string | ) |
Ensure that the entrypoint name is a valid identifier in the target language.
Definition at line 69 of file utilities.cc.
|
static |
Definition at line 210 of file compiler.cc.
|
static |
Definition at line 135 of file compiler.cc.
|
static |
Definition at line 52 of file compiler.cc.
|
static |
Definition at line 23 of file impellerc_main.cc.
|
static |
Definition at line 185 of file compiler.cc.
|
static |
Definition at line 123 of file compiler.cc.
std::string impeller::compiler::EntryPointFunctionNameFromSourceName | ( | const std::string & | file_name, |
SourceType | type, | ||
SourceLanguage | source_language, | ||
const std::string & | entry_point_name | ||
) |
Definition at line 111 of file types.cc.
|
static |
Definition at line 191 of file compiler.cc.
|
static |
Definition at line 33 of file reflector.cc.
|
static |
Override options.
Definition at line 85 of file shader_bundle.cc.
bool impeller::compiler::GenerateShaderBundle | ( | Switches & | switches | ) |
Parses the JSON shader bundle configuration and invokes the compiler multiple times to produce a shader bundle flatbuffer, which is then output to the sl
file.
Definition at line 210 of file shader_bundle.cc.
std::optional< fb::shaderbundle::ShaderBundleT > impeller::compiler::GenerateShaderBundleFlatbuffer | ( | const std::string & | bundle_config_json, |
const SourceOptions & | options | ||
) |
Parses the JSON shader bundle configuration and invokes the compiler multiple times to produce a shader bundle flatbuffer.
GenerateShaderBundle
directly. Definition at line 179 of file shader_bundle.cc.
|
static |
Definition at line 145 of file shader_bundle.cc.
|
static |
Get the reflected struct size. In the vast majority of the cases, this is the same as the declared struct size as given by the compiler. But, additional padding may need to be introduced after the end of the struct to keep in line with the alignment requirement of the individual struct members. This method figures out the actual size of the reflected struct that can be referenced in native code.
[in] | members | The members |
Definition at line 782 of file reflector.cc.
|
static |
Definition at line 301 of file reflector.cc.
std::string impeller::compiler::InferShaderNameFromPath | ( | std::string_view | path | ) |
Definition at line 34 of file utilities.cc.
|
static |
Definition at line 463 of file compiler.cc.
bool impeller::compiler::Main | ( | const fml::CommandLine & | command_line | ) |
Definition at line 233 of file impellerc_main.cc.
|
static |
Definition at line 196 of file impellerc_main.cc.
|
static |
Definition at line 56 of file impellerc_main.cc.
|
static |
Definition at line 144 of file impellerc_main.cc.
|
static |
Definition at line 126 of file impellerc_main.cc.
|
static |
Definition at line 29 of file compiler.cc.
std::optional< ShaderBundleConfig > impeller::compiler::ParseShaderBundleConfig | ( | const std::string & | bundle_config_json, |
std::ostream & | error_stream | ||
) |
Parse a shader bundle configuration from a given JSON string.
GenerateShaderBundle
directly. Definition at line 19 of file shader_bundle.cc.
|
static |
Definition at line 735 of file reflector.cc.
void impeller::compiler::report_and_exit | ( | const std::string & | msg | ) |
Definition at line 16 of file spirv_sksl.cc.
|
static |
Definition at line 197 of file runtime_stage_data.cc.
|
static |
Definition at line 137 of file switches.cc.
|
static |
Definition at line 210 of file spirv_compiler.cc.
|
static |
Definition at line 92 of file spirv_compiler.cc.
bool impeller::compiler::SetPermissiveAccess | ( | const std::filesystem::path & | p | ) |
Sets the file access mode of the file at path 'p' to 0644.
Definition at line 16 of file utilities.cc.
std::string impeller::compiler::ShaderCErrorToString | ( | shaderc_compilation_status | status | ) |
Definition at line 159 of file types.cc.
std::string impeller::compiler::SourceLanguageToString | ( | SourceLanguage | source_language | ) |
|
static |
Definition at line 148 of file switches.cc.
SourceType impeller::compiler::SourceTypeFromFileName | ( | const std::string & | file_name | ) |
Definition at line 30 of file types.cc.
SourceType impeller::compiler::SourceTypeFromString | ( | std::string | name | ) |
Definition at line 46 of file types.cc.
std::string impeller::compiler::SourceTypeToString | ( | SourceType | type | ) |
Definition at line 232 of file types.cc.
|
static |
bool impeller::compiler::StringStartsWith | ( | const std::string & | target, |
const std::string & | prefix | ||
) |
Definition at line 87 of file utilities.cc.
|
static |
Definition at line 46 of file reflector.cc.
bool impeller::compiler::TargetPlatformBundlesSkSL | ( | TargetPlatform | platform | ) |
Definition at line 320 of file types.cc.
|
static |
Definition at line 119 of file switches.cc.
bool impeller::compiler::TargetPlatformIsMetal | ( | TargetPlatform | platform | ) |
Definition at line 284 of file types.cc.
bool impeller::compiler::TargetPlatformIsOpenGL | ( | TargetPlatform | platform | ) |
Definition at line 266 of file types.cc.
bool impeller::compiler::TargetPlatformIsVulkan | ( | TargetPlatform | platform | ) |
Definition at line 302 of file types.cc.
bool impeller::compiler::TargetPlatformNeedsReflection | ( | TargetPlatform | platform | ) |
Definition at line 141 of file types.cc.
std::string impeller::compiler::TargetPlatformSLExtension | ( | TargetPlatform | platform | ) |
Definition at line 246 of file types.cc.
spirv_cross::CompilerMSL::Options::Platform impeller::compiler::TargetPlatformToMSLPlatform | ( | TargetPlatform | platform | ) |
Definition at line 212 of file types.cc.
std::string impeller::compiler::TargetPlatformToString | ( | TargetPlatform | platform | ) |
Definition at line 74 of file types.cc.
std::string impeller::compiler::ToCamelCase | ( | std::string_view | string | ) |
Definition at line 39 of file utilities.cc.
spv::ExecutionModel impeller::compiler::ToExecutionModel | ( | SourceType | type | ) |
Definition at line 198 of file types.cc.
|
static |
Definition at line 95 of file runtime_stage_data.cc.
|
static |
Definition at line 100 of file shader_bundle_data.cc.
|
static |
Definition at line 47 of file runtime_stage_data.cc.
|
static |
Definition at line 138 of file runtime_stage_data.cc.
std::string impeller::compiler::ToLowerCase | ( | std::string_view | string | ) |
Definition at line 62 of file utilities.cc.
shaderc_shader_kind impeller::compiler::ToShaderCShaderKind | ( | SourceType | type | ) |
Definition at line 184 of file types.cc.
SourceLanguage impeller::compiler::ToSourceLanguage | ( | const std::string & | source_language | ) |
|
static |
Definition at line 33 of file runtime_stage_data.cc.
|
static |
Definition at line 41 of file shader_bundle_data.cc.
|
static |
Definition at line 559 of file reflector.cc.
|
static |
Definition at line 61 of file runtime_stage_data.cc.
|
static |
Definition at line 56 of file shader_bundle_data.cc.
|
static |
Definition at line 724 of file reflector.cc.
std::string impeller::compiler::Utf8FromPath | ( | const std::filesystem::path & | path | ) |
Converts a native format path to a utf8 string.
This utility uses `path::u8string()` to convert native paths to utf8. If the given path doesn't match the underlying native path format, and the native path format isn't utf8 (i.e. Windows, which has utf16 paths), the path will get mangled.
Definition at line 30 of file utilities.cc.
|
static |
Definition at line 1183 of file reflector.cc.
|
static |
Definition at line 186 of file runtime_stage_data.cc.
|
constexpr |
Definition at line 11 of file constants.h.
|
static |
Definition at line 20 of file switches.cc.
|
static |
Definition at line 28 of file switches.cc.
|
static |
Definition at line 35 of file switches.cc.
|
constexpr |
Definition at line 204 of file code_gen_template.h.
|
constexpr |
Definition at line 10 of file code_gen_template.h.
|
static |
Definition at line 188 of file runtime_stage_data.cc.
|
static |
Definition at line 184 of file runtime_stage_data.cc.
|
static |
Definition at line 185 of file runtime_stage_data.cc.
|
static |
Definition at line 195 of file runtime_stage_data.cc.
|
static |
Definition at line 194 of file runtime_stage_data.cc.
|
static |
Definition at line 193 of file runtime_stage_data.cc.
|
static |
Definition at line 190 of file runtime_stage_data.cc.
|
static |
Definition at line 189 of file runtime_stage_data.cc.
|
static |
Definition at line 192 of file runtime_stage_data.cc.
|
static |
Definition at line 187 of file runtime_stage_data.cc.
|
static |
Definition at line 191 of file runtime_stage_data.cc.