summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_screen.h
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-01-09 18:38:54 +0100
committerCorbin Simpson <MostAwesomeDude@gmail.com>2010-01-17 01:02:12 -0800
commit08edbe9f14712f719f838769c61123f83768af76 (patch)
treeffb8e02e6e1129f8fedcb159ee244dd56c0e9823 /src/gallium/drivers/r300/r300_screen.h
parent21f3bbf1495ce44ecde4f353fed9f85e6e0fdd2d (diff)
r300g: move debug flags into r300_screen
Diffstat (limited to 'src/gallium/drivers/r300/r300_screen.h')
-rw-r--r--src/gallium/drivers/r300/r300_screen.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h
index 2217988add..580fda3984 100644
--- a/src/gallium/drivers/r300/r300_screen.h
+++ b/src/gallium/drivers/r300/r300_screen.h
@@ -35,6 +35,9 @@ struct r300_screen {
/* Chipset capabilities */
struct r300_capabilities* caps;
+
+ /** Combination of DBG_xxx flags */
+ unsigned debug;
};
struct r300_transfer {
@@ -60,4 +63,44 @@ r300_transfer(struct pipe_transfer* transfer)
/* Creates a new r300 screen. */
struct pipe_screen* r300_create_screen(struct radeon_winsys* radeon_winsys);
+/* Debug functionality. */
+
+/**
+ * Debug flags to disable/enable certain groups of debugging outputs.
+ *
+ * \note These may be rather coarse, and the grouping may be impractical.
+ * If you find, while debugging the driver, that a different grouping
+ * of these flags would be beneficial, just feel free to change them
+ * but make sure to update the documentation in r300_debug.c to reflect
+ * those changes.
+ */
+/*@{*/
+#define DBG_HELP 0x0000001
+#define DBG_FP 0x0000002
+#define DBG_VP 0x0000004
+#define DBG_CS 0x0000008
+#define DBG_DRAW 0x0000010
+#define DBG_TEX 0x0000020
+#define DBG_FALL 0x0000040
+/*@}*/
+
+static INLINE boolean SCREEN_DBG_ON(struct r300_screen * screen, unsigned flags)
+{
+ return (screen->debug & flags) ? TRUE : FALSE;
+}
+
+static INLINE void SCREEN_DBG(struct r300_screen * screen, unsigned flags,
+ const char * fmt, ...)
+{
+ if (SCREEN_DBG_ON(screen, flags)) {
+ va_list va;
+ va_start(va, fmt);
+ debug_vprintf(fmt, va);
+ va_end(va);
+ }
+}
+
+void r300_init_debug(struct r300_screen* ctx);
+
#endif /* R300_SCREEN_H */
+