|
Blender V4.5
|
#include <glsl_preprocess.hh>
Public Types | |
| enum | SourceLanguage { UNKNOWN = 0 , CPP , MSL , GLSL , BLENDER_GLSL } |
Public Member Functions | |
| std::string | process (SourceLanguage language, std::string str, const std::string &filename, bool do_parse_function, bool do_small_type_linting, report_callback report_error, metadata::Source &r_metadata) |
| std::string | process (const std::string &str) |
Static Public Member Functions | |
| static SourceLanguage | language_from_filename (const std::string &filename) |
| static std::string | get_content_between_balanced_pair (const std::string &input, char start_delimiter, char end_delimiter, const bool backwards=false) |
| static std::string | replace_char_between_balanced_pair (const std::string &input, const char start_delimiter, const char end_delimiter, const char from, const char to) |
| static std::vector< std::string > | split_string (const std::string &str, const char delimiter) |
| static std::vector< std::string > | split_string_not_between_balanced_pair (const std::string &str, const char delimiter, const char pair_start, const char pair_end) |
| static void | replace_all (std::string &str, const std::string &from, const std::string &to) |
| static void | replace_all (std::string &str, const char from, const char to) |
| static int64_t | char_count (const std::string &str, char c) |
| static int64_t | line_count (const std::string &str) |
| static void | reference_search (std::string &str, std::function< void(int, int, char &)> callback) |
| static void | default_argument_search (std::string &str, std::function< void(int, int, char &)> callback) |
| static void | scopes_scan_for_char (std::string &str, char search_char, std::function< void(size_t, int, int, char &)> callback) |
Shader source preprocessor that allow to mutate GLSL into cross API source that can be interpreted by the different GPU backends. Some syntax are mutated or reported as incompatible.
Implementation speed is not a huge concern as we only apply this at compile time or on python shaders source.
Definition at line 150 of file glsl_preprocess.hh.
| Enumerator | |
|---|---|
| UNKNOWN | |
| CPP | |
| MSL | |
| GLSL | |
| BLENDER_GLSL | |
Definition at line 164 of file glsl_preprocess.hh.
|
inlinestatic |
|
inlinestatic |
Definition at line 1677 of file glsl_preprocess.hh.
References pos, scopes_scan_for_char(), and str.
|
inlinestatic |
Definition at line 1532 of file glsl_preprocess.hh.
References balance(), i, and input.
Referenced by blender::gpu::tests::test_preprocess_utilities().
|
inlinestatic |
|
inlinestatic |
Definition at line 1648 of file glsl_preprocess.hh.
References char_count(), and str.
|
inline |
Definition at line 253 of file glsl_preprocess.hh.
|
inline |
Definition at line 189 of file glsl_preprocess.hh.
References BLENDER_GLSL, CPP, GLSL, str, and UNKNOWN.
Referenced by GPU_shader_preprocess_source(), process(), and blender::gpu::tests::process_test_string().
|
inlinestatic |
Definition at line 1656 of file glsl_preprocess.hh.
References pos, scopes_scan_for_char(), and str.
Referenced by blender::gpu::tests::test_preprocess_utilities().
|
inlinestatic |
Definition at line 1634 of file glsl_preprocess.hh.
References str.
|
inlinestatic |
Definition at line 1622 of file glsl_preprocess.hh.
References str.
Referenced by split_string_not_between_balanced_pair().
|
inlinestatic |
Definition at line 1569 of file glsl_preprocess.hh.
Referenced by split_string_not_between_balanced_pair(), and blender::gpu::tests::test_preprocess_utilities().
|
inlinestatic |
Definition at line 1698 of file glsl_preprocess.hh.
Referenced by default_argument_search(), and reference_search().
|
inlinestatic |
Definition at line 1593 of file glsl_preprocess.hh.
References str.
Referenced by split_string_not_between_balanced_pair(), and blender::gpu::tests::test_preprocess_utilities().
|
inlinestatic |
Definition at line 1607 of file glsl_preprocess.hh.
References replace_all(), replace_char_between_balanced_pair(), split(), split_string(), and str.
Referenced by blender::gpu::tests::test_preprocess_utilities().