|
Blender V5.3
|
#include <processor.hh>
Classes | |
| struct | Result |
Public Types | |
| using | ErrorHandler = parser::ErrorHandler |
| using | Parser = parser::IntermediateForm<parser::FullLexer, parser::FullParser> |
| using | Scope = parser::Scope |
| using | Token = parser::Token |
| using | Tokens = std::vector<parser::Token> |
Public Member Functions | |
| SourceProcessor (const std::string &source, const std::string &filepath, Language language, const std::vector< std::string > &file_list) | |
| Result | convert (metadata::Source external_sources_symbols={}) |
| metadata::Source | parse_include_and_symbols () |
| metadata::Source | parse_include_and_symbols (SourceManager &sources, bsl::SymbolTable &symbols, std::vector< std::string > &visited_files) |
| std::string | remove_comments () |
Static Public Member Functions | |
| static uint32_t | hash_string (const std::string &str) |
| static bool | has_pragma (Parser &parser, std::string_view pragma_str) |
| static std::string | strip_whitespace (const std::string &str) |
| static std::string | template_arguments_mangle (const Scope template_args) |
| static std::string | get_create_info_placeholder (const std::string &name) |
| static void | guarded_scope_mutation (Parser &parser, Scope scope, const std::string &condition, Token fn_type) |
| static std::string | line_directive_prefix (const std::string &filename) |
Static Public Attributes | |
| static constexpr const char * | namespace_separator = "_" |
| static constexpr const char * | method_call_prefix = "_" |
| static constexpr const char * | linted_struct_suffix = "_host_shared_" |
| static constexpr const char * | uniform_struct_suffix = "uniform_" |
Shader source preprocessor that allow to mutate shader sources into cross API source that can be interpreted by the different GPU backends. Some syntax are mutated or reported as incompatible.
Definition at line 42 of file processor.hh.
Definition at line 44 of file processor.hh.
| using blender::gpu::shader::SourceProcessor::Parser = parser::IntermediateForm<parser::FullLexer, parser::FullParser> |
Definition at line 45 of file processor.hh.
Definition at line 46 of file processor.hh.
Definition at line 47 of file processor.hh.
| using blender::gpu::shader::SourceProcessor::Tokens = std::vector<parser::Token> |
Definition at line 48 of file processor.hh.
|
inline |
Definition at line 105 of file processor.hh.
| SourceProcessor::Result blender::gpu::shader::SourceProcessor::convert | ( | metadata::Source | external_sources_symbols = {} | ) |
Definition at line 387 of file processor.cc.
References blender::gpu::shader::BLENDER_GLSL, blender::gpu::shader::BSL, blender::gpu::shader::CPP, blender::gpu::shader::GLSL, blender::gpu::shader::INFO, blender::gpu::shader::MSL, and blender::gpu::shader::UNKNOWN.
Referenced by blender::GPU_shader_preprocess_source(), main(), and blender::gpu::tests::process_test_string().
|
static |
Definition at line 660 of file processor.cc.
|
static |
Definition at line 1538 of file processor.cc.
References blender::gpu::shader::parser::Scope::back(), condition, blender::gpu::shader::parser::Scope::front(), lexit::Token::is_valid(), lexit::Token::next(), lexit::Token::prev(), lexit::Token::str(), and blender::gpu::to_string().
|
static |
Definition at line 831 of file processor.cc.
References has_pragma(), lexit::Hash, lexit::Token::next(), lexit::Token::str(), and lexit::Token::type().
Referenced by has_pragma().
|
inlinestatic |
Definition at line 143 of file processor.hh.
References str.
|
static |
Definition at line 2680 of file processor.cc.
| metadata::Source blender::gpu::shader::SourceProcessor::parse_include_and_symbols | ( | ) |
Definition at line 416 of file processor.cc.
References remove_comments(), and str.
Referenced by scan_external_symbols().
| metadata::Source blender::gpu::shader::SourceProcessor::parse_include_and_symbols | ( | SourceManager & | sources, |
| bsl::SymbolTable & | symbols, | ||
| std::vector< std::string > & | visited_files ) |
|
inline |
Definition at line 137 of file processor.hh.
References remove_comments().
Referenced by parse_include_and_symbols(), and remove_comments().
|
static |
|
static |
Definition at line 20 of file template.cc.
References blender::gpu::shader::parser::Scope::foreach_scope(), blender::gpu::shader::parser::Scope::str(), str, and template_arguments_mangle().
Referenced by template_arguments_mangle().
|
staticconstexpr |
Definition at line 54 of file processor.hh.
|
staticconstexpr |
Definition at line 53 of file processor.hh.
|
staticconstexpr |
Definition at line 51 of file processor.hh.
Referenced by blender::gpu::shader::lower_namespace().
|
staticconstexpr |
Definition at line 55 of file processor.hh.