Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/gpu/intern/gpu_shader_log.cc')
-rw-r--r--source/blender/gpu/intern/gpu_shader_log.cc31
1 files changed, 29 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_shader_log.cc b/source/blender/gpu/intern/gpu_shader_log.cc
index 5859afb7fbf..12459b4b721 100644
--- a/source/blender/gpu/intern/gpu_shader_log.cc
+++ b/source/blender/gpu/intern/gpu_shader_log.cc
@@ -177,14 +177,41 @@ char *GPULogParser::skip_severity(char *log_line,
return log_line;
}
-char *GPULogParser::skip_separators(char *log_line, char sep1, char sep2, char sep3) const
+char *GPULogParser::skip_separators(char *log_line, const StringRef separators) const
{
- while (ELEM(log_line[0], sep1, sep2, sep3)) {
+ while (at_any(log_line, separators)) {
log_line++;
}
return log_line;
}
+char *GPULogParser::skip_until(char *log_line, char stop_char) const
+{
+ char *cursor = log_line;
+ while (!ELEM(cursor[0], '\n', '\0')) {
+ if (cursor[0] == stop_char) {
+ return cursor;
+ }
+ cursor++;
+ }
+ return log_line;
+}
+
+bool GPULogParser::at_number(const char *log_line) const
+{
+ return log_line[0] >= '0' && log_line[0] <= '9';
+}
+
+bool GPULogParser::at_any(const char *log_line, const StringRef chars) const
+{
+ return chars.find(log_line[0]) != StringRef::not_found;
+}
+
+int GPULogParser::parse_number(const char *log_line, char **r_new_position) const
+{
+ return (int)strtol(log_line, r_new_position, 10);
+}
+
/** \} */
} // namespace blender::gpu