aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_debug.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-10-17 08:07:33 +0200
committermarha <marha@users.sourceforge.net>2012-10-17 08:07:33 +0200
commit856fbbaf1e53303d8307bfae1761f1ba96871f1e (patch)
treee029665439ddbccfb253271a5f5290d72c2b2168 /mesalib/src/gallium/auxiliary/util/u_debug.c
parentf15a40afaf6d1b3a4841d25631f947da1b289f89 (diff)
parentded57b5a4131a213d57f5a20d50b819b7a8924df (diff)
downloadvcxsrv-856fbbaf1e53303d8307bfae1761f1ba96871f1e.tar.gz
vcxsrv-856fbbaf1e53303d8307bfae1761f1ba96871f1e.tar.bz2
vcxsrv-856fbbaf1e53303d8307bfae1761f1ba96871f1e.zip
Merge remote-tracking branch 'origin/released'
* origin/released: pixman mesa git update 17 oct 2012
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_debug.c')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_debug.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_debug.c b/mesalib/src/gallium/auxiliary/util/u_debug.c
index c41585fdd..b26192a8b 100644
--- a/mesalib/src/gallium/auxiliary/util/u_debug.c
+++ b/mesalib/src/gallium/auxiliary/util/u_debug.c
@@ -691,4 +691,45 @@ error1:
;
}
+
+/**
+ * Print PIPE_TRANSFER_x flags with a message.
+ */
+void
+debug_print_transfer_flags(const char *msg, unsigned usage)
+{
+#define FLAG(x) { x, #x }
+ static const struct {
+ unsigned bit;
+ const char *name;
+ } flags[] = {
+ FLAG(PIPE_TRANSFER_READ),
+ FLAG(PIPE_TRANSFER_WRITE),
+ FLAG(PIPE_TRANSFER_MAP_DIRECTLY),
+ FLAG(PIPE_TRANSFER_DISCARD_RANGE),
+ FLAG(PIPE_TRANSFER_DONTBLOCK),
+ FLAG(PIPE_TRANSFER_UNSYNCHRONIZED),
+ FLAG(PIPE_TRANSFER_FLUSH_EXPLICIT),
+ FLAG(PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE)
+ };
+ unsigned i;
+
+ debug_printf("%s ", msg);
+
+ for (i = 0; i < Elements(flags); i++) {
+ if (usage & flags[i].bit) {
+ debug_printf("%s", flags[i].name);
+ usage &= ~flags[i].bit;
+ if (usage) {
+ debug_printf(" | ");
+ }
+ }
+ }
+
+ debug_printf("\n");
+#undef FLAG
+}
+
+
+
#endif