radeonsi: use a compiler queue with a low priority for optimized shaders
[mesa.git] / src / gallium / drivers / ddebug / dd_util.h
index c217c8eed6826e24add96cec4bdf1fd905c93262..4e1a945c57d4c31c76bf2986ece6062ca7aa53d0 100644 (file)
@@ -33,6 +33,7 @@
 #include <unistd.h>
 #include <sys/stat.h>
 
+#include "c99_alloca.h"
 #include "os/os_process.h"
 #include "util/u_debug.h"
 
@@ -40,7 +41,7 @@
 #define DD_DIR "ddebug_dumps"
 
 static inline FILE *
-dd_get_debug_file()
+dd_get_debug_file(bool verbose)
 {
    static unsigned index;
    char proc_name[128], dir[256], name[512];
@@ -65,7 +66,33 @@ dd_get_debug_file()
       return NULL;
    }
 
+   if (verbose)
+      fprintf(stderr, "dd: dumping to file %s\n", name);
+
    return f;
 }
 
+static inline void
+dd_parse_apitrace_marker(const char *string, int len, unsigned *call_number)
+{
+   unsigned num;
+   char *s;
+
+   if (len <= 0)
+      return;
+
+   /* Make it zero-terminated. */
+   s = alloca(len + 1);
+   memcpy(s, string, len);
+   s[len] = 0;
+
+   /* Parse the number. */
+   errno = 0;
+   num = strtol(s, NULL, 10);
+   if (errno)
+      return;
+
+   *call_number = num;
+}
+
 #endif /* DD_UTIL_H */