summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/trace/tr_dump.c
diff options
context:
space:
mode:
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);