Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
[mesa.git] / src / gallium / include / pipe / p_debug.h
index f87247994bff56d86283e7dd54f14329c30171a7..a5816c3cbb70f8958050132ee6386b49d69bfe0b 100644 (file)
@@ -59,6 +59,12 @@ extern "C" {
 #endif
 #endif
 
+   
+/* MSVC bebore VC7 does not have the __FUNCTION__ macro */
+#if defined(_MSC_VER) && _MSC_VER < 1300
+#define __FUNCTION__ "???"
+#endif
+
 
 void _debug_vprintf(const char *format, va_list ap);
    
@@ -112,7 +118,7 @@ void debug_print_blob( const char *name, const void *blob, unsigned size );
 
 /* Print a message along with a prettified format string
  */
-void debug_print_format(const char *msg, enum pipe_format fmt );
+void debug_print_format(const char *msg, unsigned fmt );
 #else
 #define debug_print_blob(_name, _blob, _size) ((void)0)
 #define debug_print_format(_msg, _fmt) ((void)0)
@@ -126,10 +132,10 @@ void _debug_break(void);
  * Hard-coded breakpoint.
  */
 #ifdef DEBUG
-#if (defined(__i386__) || defined(__386__)) && defined(__GNUC__)
+#if defined(PIPE_ARCH_X86) && defined(PIPE_CC_GCC)
 #define debug_break() __asm("int3")
-#elif (defined(__i386__) || defined(__386__)) && defined(__MSC__)
-#define debug_break()  _asm {int 3}
+#elif defined(PIPE_ARCH_X86) && defined(PIPE_CC_MSVC)
+#define debug_break()  do { _asm {int 3} } while(0)
 #else
 #define debug_break() _debug_break()
 #endif
@@ -283,7 +289,7 @@ boolean
 debug_get_bool_option(const char *name, boolean dfault);
 
 long
-debug_get_unsigned_option(const char *name, long dfault);
+debug_get_num_option(const char *name, long dfault);
 
 unsigned long
 debug_get_flags_option(const char *name, 
@@ -314,6 +320,28 @@ void
 debug_memory_end(unsigned long beginning);
 
 
+#if defined(PROFILE) && defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY)
+
+void
+debug_profile_start(void);
+
+void 
+debug_profile_stop(void);
+
+#endif
+
+
+#ifdef DEBUG
+void debug_dump_image(const char *prefix,
+                      unsigned format, unsigned cpp,
+                      unsigned width, unsigned height,
+                      unsigned pitch,
+                      const void *data);
+#else
+#define debug_dump_image(prefix, format, cpp, width, height, pitch, data) ((void)0)
+#endif
+
+
 #ifdef __cplusplus
 }
 #endif