trace: Dump PIPE_QUERY_* enums.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 27 Nov 2013 11:43:54 +0000 (11:43 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 28 Nov 2013 12:19:42 +0000 (12:19 +0000)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/util/u_dump.h
src/gallium/auxiliary/util/u_dump_defines.c
src/gallium/drivers/trace/tr_context.c
src/gallium/drivers/trace/tr_dump_defines.h [new file with mode: 0644]
src/gallium/drivers/trace/tr_dump_state.c
src/gallium/drivers/trace/tr_dump_state.h
src/gallium/drivers/trace/tr_screen.c

index 71750a635d31b4d3e5562e801edd41f33c51ce7c..58e7dfd8244e4b9e125be52cb115668db3cdd08f 100644 (file)
@@ -85,6 +85,9 @@ util_dump_tex_mipfilter(unsigned value, boolean shortened);
 const char *
 util_dump_tex_filter(unsigned value, boolean shortened);
 
+const char *
+util_dump_query_type(unsigned value, boolean shortened);
+
 
 /*
  * p_state.h, through a FILE
index cc626877382c9ae8b27cc43a7ed842598770ae9e..03fd15d0c44fd23e099ca317444b53353c489427 100644 (file)
@@ -359,3 +359,36 @@ util_dump_tex_filter_short_names[] = {
 };
 
 DEFINE_UTIL_DUMP_CONTINUOUS(tex_filter)
+
+
+static const char *
+util_dump_query_type_names[] = {
+   "PIPE_QUERY_OCCLUSION_COUNTER",
+   "PIPE_QUERY_OCCLUSION_PREDICATE",
+   "PIPE_QUERY_TIMESTAMP",
+   "PIPE_QUERY_TIMESTAMP_DISJOINT",
+   "PIPE_QUERY_TIME_ELAPSED",
+   "PIPE_QUERY_PRIMITIVES_GENERATED",
+   "PIPE_QUERY_PRIMITIVES_EMITTED",
+   "PIPE_QUERY_SO_STATISTICS",
+   "PIPE_QUERY_SO_OVERFLOW_PREDICATE",
+   "PIPE_QUERY_GPU_FINISHED",
+   "PIPE_QUERY_PIPELINE_STATISTICS",
+};
+
+static const char *
+util_dump_query_type_short_names[] = {
+   "occlusion_counter",
+   "occlusion_predicate",
+   "timestamp",
+   "timestamp_disjoint",
+   "time_elapsed",
+   "primitives_generated",
+   "primitives_emitted",
+   "so_statistics",
+   "so_overflow_predicate",
+   "gpu_finished",
+   "pipeline_statistics",
+};
+
+DEFINE_UTIL_DUMP_CONTINUOUS(query_type)
index d9afb0aba7c6ac5d9af3726ea373f958a51f761b..4ac7d9b50b2a00b6f8a3ca3910b89107640d355f 100644 (file)
@@ -33,6 +33,7 @@
 #include "pipe/p_screen.h"
 
 #include "tr_dump.h"
+#include "tr_dump_defines.h"
 #include "tr_dump_state.h"
 #include "tr_public.h"
 #include "tr_screen.h"
@@ -135,7 +136,7 @@ trace_context_create_query(struct pipe_context *_pipe,
    trace_dump_call_begin("pipe_context", "create_query");
 
    trace_dump_arg(ptr, pipe);
-   trace_dump_arg(uint, query_type);
+   trace_dump_arg(query_type, query_type);
 
    query = pipe->create_query(pipe, query_type);
 
diff --git a/src/gallium/drivers/trace/tr_dump_defines.h b/src/gallium/drivers/trace/tr_dump_defines.h
new file mode 100644 (file)
index 0000000..0c83c2b
--- /dev/null
@@ -0,0 +1,58 @@
+/**************************************************************************
+ *
+ * Copyright 2013 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#ifndef TR_DUMP_DEFINES_H_
+#define TR_DUMP_DEFINES_H_
+
+#include "pipe/p_compiler.h"
+#include "util/u_format.h"
+#include "util/u_dump.h"
+#include "tr_dump.h"
+
+
+static INLINE void
+trace_dump_format(enum pipe_format format)
+{
+   if (!trace_dumping_enabled_locked())
+      return;
+
+   trace_dump_enum(util_format_name(format));
+}
+
+
+static INLINE void
+trace_dump_query_type(unsigned value)
+{
+   if (!trace_dumping_enabled_locked())
+      return;
+
+   trace_dump_enum(util_dump_query_type(value, FALSE));
+}
+
+
+
+#endif /* TR_DUMP_DEFINES_H_ */
index c1e5361254d0a93103ac00437e8defc163398450..8f32e9e27794e6120b3bdee2f6453bf2781772e5 100644 (file)
 #include "tgsi/tgsi_dump.h"
 
 #include "tr_dump.h"
+#include "tr_dump_defines.h"
 #include "tr_dump_state.h"
 
 
-void trace_dump_format(enum pipe_format format)
-{
-   if (!trace_dumping_enabled_locked())
-      return;
-
-   trace_dump_enum(util_format_name(format) );
-}
-
-
 void trace_dump_resource_template(const struct pipe_resource *templat)
 {
    if (!trace_dumping_enabled_locked())
index 6151a0a021463981ae200c297b4600fede696e74..be87f480fe214c0d5d0ea6762c3a18985cf44510 100644 (file)
 #ifndef TR_DUMP_STATE_H_
 #define TR_DUMP_STATE_H_
 
-#include "pipe/p_format.h"
 #include "pipe/p_state.h"
 #include "pipe/p_shader_tokens.h"
 
 
-void trace_dump_format(enum pipe_format format);
-
 void trace_dump_resource_template(const struct pipe_resource *templat);
 
 void trace_dump_box(const struct pipe_box *box);
index 5281ba8b47bbdd48e891c4cdf419110f5757b85a..c6745af09f2f76cd621ff6c8427d85737422db10 100644 (file)
 #include "util/u_simple_list.h"
 
 #include "tr_dump.h"
+#include "tr_dump_defines.h"
 #include "tr_dump_state.h"
 #include "tr_texture.h"
 #include "tr_context.h"
 #include "tr_screen.h"
 #include "tr_public.h"
 
-#include "pipe/p_format.h"
-
 
 static boolean trace = FALSE;