summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/trace/tr_dump.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2013-06-20 19:37:31 +0100
committerJosé Fonseca <[email protected]>2013-06-21 14:30:19 +0100
commita8f7e12d92a8c3dab8ec2e821f51ed711849f1b5 (patch)
tree485bf3b45dbf9758c911d607dfd4bc8b5fe620c4 /src/gallium/drivers/trace/tr_dump.c
parentbbd2d575e649c0929d125c7dd44723aeabcb2323 (diff)
trace: Don't dump texture transfers.
Huge trace files with little value. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/trace/tr_dump.c')
-rw-r--r--src/gallium/drivers/trace/tr_dump.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/gallium/drivers/trace/tr_dump.c b/src/gallium/drivers/trace/tr_dump.c
index 7111e0d174d..b6ab5038197 100644
--- a/src/gallium/drivers/trace/tr_dump.c
+++ b/src/gallium/drivers/trace/tr_dump.c
@@ -495,19 +495,28 @@ void trace_dump_bytes(const void *data,
}
void trace_dump_box_bytes(const void *data,
- enum pipe_format format,
+ struct pipe_resource *resource,
const struct pipe_box *box,
unsigned stride,
unsigned slice_stride)
{
size_t size;
- if (slice_stride)
- size = box->depth * slice_stride;
- else if (stride)
- size = util_format_get_nblocksy(format, box->height) * stride;
- else {
- size = util_format_get_nblocksx(format, box->width) * util_format_get_blocksize(format);
+ /*
+ * Only dump buffer transfers to avoid huge files.
+ * TODO: Make this run-time configurable
+ */
+ if (resource->target != PIPE_BUFFER) {
+ size = 0;
+ } else {
+ enum pipe_format format = resource->format;
+ if (slice_stride)
+ size = box->depth * slice_stride;
+ else if (stride)
+ size = util_format_get_nblocksy(format, box->height) * stride;
+ else {
+ size = util_format_get_nblocksx(format, box->width) * util_format_get_blocksize(format);
+ }
}
trace_dump_bytes(data, size);