diff options
author | Jakob Bornecrantz <[email protected]> | 2009-03-12 15:37:13 +0100 |
---|---|---|
committer | Jakob Bornecrantz <[email protected]> | 2009-03-12 16:35:43 +0100 |
commit | 53e5248b0a71b1e72b1a613046a1b3e5d145d072 (patch) | |
tree | 95f0bc0f450f099c8f1073794ba2e31a48a645c4 /src/gallium/drivers/trace/tr_dump.c | |
parent | 6aa6ae8cffd493fab8ef3174e9bfc6c9d72f8efb (diff) |
trace: Add dump util functions for wrapped pointers
Diffstat (limited to 'src/gallium/drivers/trace/tr_dump.c')
-rw-r--r-- | src/gallium/drivers/trace/tr_dump.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/gallium/drivers/trace/tr_dump.c b/src/gallium/drivers/trace/tr_dump.c index 0f29ba7e7e5..6837c94542d 100644 --- a/src/gallium/drivers/trace/tr_dump.c +++ b/src/gallium/drivers/trace/tr_dump.c @@ -52,6 +52,8 @@ #include "tr_dump.h" #include "tr_screen.h" +#include "tr_texture.h" +#include "tr_buffer.h" static struct util_stream *stream = NULL; @@ -403,3 +405,49 @@ void trace_dump_ptr(const void *value) else trace_dump_null(); } + +void trace_dump_buffer_ptr(struct pipe_buffer *_buffer) +{ + if (_buffer) { + struct trace_screen *tr_scr = trace_screen(_buffer->screen); + struct trace_buffer *tr_buf = trace_buffer(tr_scr, _buffer); + trace_dump_ptr(tr_buf->buffer); + } else { + trace_dump_null(); + } +} + +void trace_dump_texture_ptr(struct pipe_texture *_texture) +{ + if (_texture) { + struct trace_screen *tr_scr = trace_screen(_texture->screen); + struct trace_texture *tr_tex = trace_texture(tr_scr, _texture); + trace_dump_ptr(tr_tex->texture); + } else { + trace_dump_null(); + } +} + +void trace_dump_surface_ptr(struct pipe_surface *_surface) +{ + if (_surface) { + struct trace_screen *tr_scr = trace_screen(_surface->texture->screen); + struct trace_texture *tr_tex = trace_texture(tr_scr, _surface->texture); + struct trace_surface *tr_surf = trace_surface(tr_tex, _surface); + trace_dump_ptr(tr_surf->surface); + } else { + trace_dump_null(); + } +} + +void trace_dump_transfer_ptr(struct pipe_transfer *_transfer) +{ + if (_transfer) { + struct trace_screen *tr_scr = trace_screen(_transfer->texture->screen); + struct trace_texture *tr_tex = trace_texture(tr_scr, _transfer->texture); + struct trace_transfer *tr_tran = trace_transfer(tr_tex, _transfer); + trace_dump_ptr(tr_tran->transfer); + } else { + trace_dump_null(); + } +} |