r300g: add debug option for buffer upload logging
authorMarek Olšák <maraeo@gmail.com>
Sun, 9 Jan 2011 21:40:50 +0000 (22:40 +0100)
committerMarek Olšák <maraeo@gmail.com>
Mon, 10 Jan 2011 04:45:10 +0000 (05:45 +0100)
src/gallium/drivers/r300/r300_debug.c
src/gallium/drivers/r300/r300_screen.h
src/gallium/drivers/r300/r300_screen_buffer.c

index 52031dd97b5c239da488cfa1a6d414740f5cd5b0..d6aa90bd0530d38190806acff463694732e174fa 100644 (file)
@@ -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" },
index 5847fe1ffc892048226f67b51ea13091d5cd6cf4..752f53b7579842a43faeca29c43848e4c2843176 100644 (file)
@@ -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)
index b349849cf3777f78655e8a0b6c95864bf63f1520..cc3c1d7687edebb807036cbfdc1e31a823f783f5 100644 (file)
@@ -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,