summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-01-14 15:18:13 -0700
committerBrian Paul <[email protected]>2013-01-14 18:15:41 -0700
commitf5eb1b123fdd64f713c1226f14758de4690c6fc2 (patch)
treecee68112a13fc8d74c53e23d3f277db66b34c44f
parentcb6ef3d112fa48fd3960583fd39c7ab11052c54f (diff)
st/mesa: add some simple buffer/draw debug code
Reviewed-by: José Fonseca <[email protected]>
-rw-r--r--src/mesa/state_tracker/st_cb_bufferobjects.c5
-rw-r--r--src/mesa/state_tracker/st_debug.c2
-rw-r--r--src/mesa/state_tracker/st_debug.h2
-rw-r--r--src/mesa/state_tracker/st_draw.c9
4 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
index cf291c1c176..d5167352c40 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -38,6 +38,7 @@
#include "st_context.h"
#include "st_cb_bufferobjects.h"
+#include "st_debug.h"
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
@@ -230,6 +231,10 @@ st_bufferobj_data(struct gl_context *ctx,
pipe_resource_reference( &st_obj->buffer, NULL );
+ if (ST_DEBUG & DEBUG_BUFFER) {
+ debug_printf("Create buffer size %lu bind 0x%x\n", size, bind);
+ }
+
if (size != 0) {
st_obj->buffer = pipe_buffer_create(pipe->screen, bind,
pipe_usage, size);
diff --git a/src/mesa/state_tracker/st_debug.c b/src/mesa/state_tracker/st_debug.c
index 850fab92503..d0abf5f8ca9 100644
--- a/src/mesa/state_tracker/st_debug.c
+++ b/src/mesa/state_tracker/st_debug.c
@@ -53,6 +53,8 @@ static const struct debug_named_value st_debug_flags[] = {
{ "fallback", DEBUG_FALLBACK, NULL },
{ "screen", DEBUG_SCREEN, NULL },
{ "query", DEBUG_QUERY, NULL },
+ { "draw", DEBUG_DRAW, NULL },
+ { "buffer", DEBUG_BUFFER, NULL },
DEBUG_NAMED_VALUE_END
};
diff --git a/src/mesa/state_tracker/st_debug.h b/src/mesa/state_tracker/st_debug.h
index 4a060d7759c..1c6e9eea17f 100644
--- a/src/mesa/state_tracker/st_debug.h
+++ b/src/mesa/state_tracker/st_debug.h
@@ -44,6 +44,8 @@ st_print_current(void);
#define DEBUG_FALLBACK 0x20
#define DEBUG_QUERY 0x40
#define DEBUG_SCREEN 0x80
+#define DEBUG_DRAW 0x100
+#define DEBUG_BUFFER 0x200
#ifdef DEBUG
extern int ST_DEBUG;
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 7de2bb9b853..de539ca5a6f 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -48,6 +48,7 @@
#include "st_atom.h"
#include "st_cb_bufferobjects.h"
#include "st_cb_xformfb.h"
+#include "st_debug.h"
#include "st_draw.h"
#include "st_program.h"
@@ -254,6 +255,14 @@ st_draw_vbo(struct gl_context *ctx,
info.max_index = info.start + info.count - 1;
}
+ if (ST_DEBUG & DEBUG_DRAW) {
+ debug_printf("st/draw: mode %s start %u count %u indexed %d\n",
+ u_prim_name(info.mode),
+ info.start,
+ info.count,
+ info.indexed);
+ }
+
if (info.count_from_stream_output) {
cso_draw_vbo(st->cso_context, &info);
}