|
Blender V5.0
|
#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) |
| static size_t | line_number (const std::string &file_str, size_t pos) |
| static size_t | line_number (const std::smatch &smatch) |
| static size_t | char_number (const std::string &file_str, size_t pos) |
| static size_t | char_number (const std::smatch &smatch) |
| static std::string | line_str (const std::string &file_str, size_t pos) |
| static std::string | line_str (const std::smatch &smatch) |
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 159 of file glsl_preprocess.hh.
| Enumerator | |
|---|---|
| UNKNOWN | |
| CPP | |
| MSL | |
| GLSL | |
| BLENDER_GLSL | |
Definition at line 176 of file glsl_preprocess.hh.
|
inlinestatic |
|
inlinestatic |
Definition at line 2561 of file glsl_preprocess.hh.
References char_number().
|
inlinestatic |
|
inlinestatic |
Definition at line 2485 of file glsl_preprocess.hh.
References pos, scopes_scan_for_char(), and str.
|
inlinestatic |
Definition at line 2340 of file glsl_preprocess.hh.
References balance(), i, and input.
Referenced by blender::gpu::tests::test_preprocess_utilities().
|
inlinestatic |
|
inlinestatic |
Definition at line 2456 of file glsl_preprocess.hh.
References char_count(), and str.
Referenced by line_number().
|
inlinestatic |
Definition at line 2546 of file glsl_preprocess.hh.
References line_number().
|
inlinestatic |
Definition at line 2534 of file glsl_preprocess.hh.
References line_count(), and pos.
Referenced by line_number().
|
inlinestatic |
Definition at line 2577 of file glsl_preprocess.hh.
References line_str().
|
inlinestatic |
|
inline |
Definition at line 285 of file glsl_preprocess.hh.
|
inline |
Definition at line 201 of file glsl_preprocess.hh.
References BLENDER_GLSL, CPP, GLSL, MSL, str, and UNKNOWN.
Referenced by GPU_shader_preprocess_source(), process(), and blender::gpu::tests::process_test_string().
|
inlinestatic |
Definition at line 2464 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 2442 of file glsl_preprocess.hh.
References str.
|
inlinestatic |
Definition at line 2430 of file glsl_preprocess.hh.
References str.
Referenced by split_string_not_between_balanced_pair().
|
inlinestatic |
Definition at line 2377 of file glsl_preprocess.hh.
Referenced by split_string_not_between_balanced_pair(), and blender::gpu::tests::test_preprocess_utilities().
|
inlinestatic |
Definition at line 2506 of file glsl_preprocess.hh.
Referenced by default_argument_search(), and reference_search().
|
inlinestatic |
Definition at line 2401 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 2415 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().