diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-10-22 17:39:01 +0200 |
---|---|---|
committer | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-11-06 11:09:49 +0100 |
commit | 9d0517c769d155073ff65772babeb668c774ca18 (patch) | |
tree | 7005713c7cb1eb5386b31a605099177789618999 | |
parent | c7c3b9168920f7401622af62e82289336816f71a (diff) |
ddebug: dump context and before/after times of draws
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r-- | src/gallium/drivers/ddebug/dd_draw.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/ddebug/dd_pipe.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/ddebug/dd_draw.c b/src/gallium/drivers/ddebug/dd_draw.c index a856d0142a..182d6f297a 100644 --- a/src/gallium/drivers/ddebug/dd_draw.c +++ b/src/gallium/drivers/ddebug/dd_draw.c @@ -790,6 +790,11 @@ dd_free_record(struct pipe_screen *screen, struct dd_draw_record *record) static void dd_write_record(FILE *f, struct dd_draw_record *record) { + PRINT_NAMED(ptr, "pipe", record->dctx->pipe); + PRINT_NAMED(ns, "time before (API call)", record->time_before); + PRINT_NAMED(ns, "time after (driver done)", record->time_after); + fprintf(f, "\n"); + dd_dump_call(f, &record->draw_state.base, &record->call); if (record->log_page) { @@ -1013,6 +1018,8 @@ dd_before_draw(struct dd_context *dctx, struct dd_draw_record *record) struct pipe_context *pipe = dctx->pipe; struct pipe_screen *screen = dscreen->screen; + record->time_before = os_time_get_nano(); + if (dscreen->timeout_ms > 0) { if (dscreen->flush_always && dctx->num_draw_calls >= dscreen->skip_count) { pipe->flush(pipe, &record->prev_bottom_of_pipe, 0); @@ -1040,6 +1047,7 @@ dd_after_draw_async(void *data) struct dd_screen *dscreen = dd_screen(dctx->base.screen); record->log_page = u_log_new_page(&dctx->log); + record->time_after = os_time_get_nano(); if (!util_queue_fence_is_signalled(&record->driver_finished)) util_queue_fence_signal(&record->driver_finished); diff --git a/src/gallium/drivers/ddebug/dd_pipe.h b/src/gallium/drivers/ddebug/dd_pipe.h index d1965be9a1..607ebbb2b9 100644 --- a/src/gallium/drivers/ddebug/dd_pipe.h +++ b/src/gallium/drivers/ddebug/dd_pipe.h @@ -224,6 +224,8 @@ struct dd_draw_record { struct list_head list; struct dd_context *dctx; + int64_t time_before; + int64_t time_after; unsigned draw_call; struct pipe_fence_handle *prev_bottom_of_pipe; |