From 9d33e4e16c8d2271ef2a965d7210a9aee40680d2 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 9 Jan 2011 22:40:50 +0100 Subject: r300g: add debug option for buffer upload logging --- src/gallium/drivers/r300/r300_debug.c | 1 + src/gallium/drivers/r300/r300_screen.h | 1 + src/gallium/drivers/r300/r300_screen_buffer.c | 7 +++++++ 3 files changed, 9 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_debug.c b/src/gallium/drivers/r300/r300_debug.c index 52031dd97b..d6aa90bd05 100644 --- a/src/gallium/drivers/r300/r300_debug.c +++ b/src/gallium/drivers/r300/r300_debug.c @@ -41,6 +41,7 @@ static const struct debug_named_value debug_options[] = { { "fb", DBG_FB, "Log framebuffer" }, { "cbzb", DBG_CBZB, "Log fast color clear info" }, { "hyperz", DBG_HYPERZ, "Log HyperZ info" }, + { "upload", DBG_UPLOAD, "Log user buffer upload info" }, { "scissor", DBG_SCISSOR, "Log scissor info" }, { "fakeocc", DBG_FAKE_OCC, "Use fake occlusion queries" }, { "anisohq", DBG_ANISOHQ, "Use high quality anisotropic filtering" }, diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h index 5847fe1ffc..752f53b757 100644 --- a/src/gallium/drivers/r300/r300_screen.h +++ b/src/gallium/drivers/r300/r300_screen.h @@ -93,6 +93,7 @@ r300_winsys_screen(struct pipe_screen *screen) { #define DBG_CBZB (1 << 11) #define DBG_HYPERZ (1 << 12) #define DBG_SCISSOR (1 << 13) +#define DBG_UPLOAD (1 << 14) /* Features. */ #define DBG_ANISOHQ (1 << 16) #define DBG_NO_TILING (1 << 17) diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c index b349849cf3..cc3c1d7687 100644 --- a/src/gallium/drivers/r300/r300_screen_buffer.c +++ b/src/gallium/drivers/r300/r300_screen_buffer.c @@ -105,6 +105,12 @@ void r300_upload_user_buffers(struct r300_context *r300, size = r300->velems->hw_format_size[i]; } + DBG(r300, DBG_UPLOAD, + "Uploading %i bytes, index: %i, buffer: %p, userptr: %p " + "offset: %i, stride: %i.\n", + size, index, userbuf, userbuf->user_buffer, + vb->buffer_offset, vb->stride); + u_upload_data(r300->upload_vb, first, size, userbuf->user_buffer + first, &vb->buffer_offset, @@ -124,6 +130,7 @@ void r300_upload_user_buffers(struct r300_context *r300, assert(r300->valid_vertex_buffer[index]); } } + DBG(r300, DBG_UPLOAD, "-------\n"); } static void r300_buffer_destroy(struct pipe_screen *screen, -- cgit v1.2.3