]> git.cworth.org Git - apitrace/commitdiff
glsl edit: grep multiline error/warning messages
authorgregory <gregory.hainaut@gmail.com>
Fri, 6 Jul 2012 19:48:59 +0000 (21:48 +0200)
committergregory <gregory.hainaut@gmail.com>
Fri, 6 Jul 2012 21:10:38 +0000 (23:10 +0200)
Useful for GL shader errors which spawn multiple lines error message like that:
    >> 2135: warning: Vertex shader failed to compile with the following errors:
    >> ERROR: 1:1: error(#132) Syntax error: 'sdfsafasf' parse error
    >> ERROR: error(#273) 1 compilation errors.  No code generated

gui/retracer.cpp

index 69dca6c6b26f542845b5857952177692210f19e7..bbe638ca0fc0635f41e10ff9ffdbcf225f0bd0a5 100644 (file)
@@ -406,6 +406,14 @@ void Retracer::run()
             error.type = regexp.cap(2);
             error.message = regexp.cap(3);
             errors.append(error);
+        } else if (!errors.isEmpty()) {
+            // Probably a multiligne message
+            ApiTraceError &previous = errors.last();
+            if (line.endsWith("\n")) {
+                line.chop(1);
+            }
+            previous.message.append('\n');
+            previous.message.append(line);
         }
     }