st/mesa: add some simple buffer/draw debug code

Reviewed-by: José Fonseca <jfonseca@vmware.com>
This commit is contained in:
Brian Paul 2013-01-14 15:18:13 -07:00
parent cb6ef3d112
commit f5eb1b123f
4 changed files with 18 additions and 0 deletions

View File

@ -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);

View File

@ -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
};

View File

@ -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;

View File

@ -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);
}