summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
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
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')
-rw-r--r--src/gallium/drivers/trace/tr_context.c4
-rw-r--r--src/gallium/drivers/trace/tr_dump.c23
-rw-r--r--src/gallium/drivers/trace/tr_dump.h2
3 files changed, 19 insertions, 10 deletions
diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
index d78dd3ed347..5514f62239c 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -1418,7 +1418,7 @@ trace_context_transfer_unmap(struct pipe_context *_context,
trace_dump_arg_begin("data");
trace_dump_box_bytes(tr_trans->map,
- resource->format,
+ resource,
box,
stride,
layer_stride);
@@ -1464,7 +1464,7 @@ trace_context_transfer_inline_write(struct pipe_context *_context,
trace_dump_arg_begin("data");
trace_dump_box_bytes(data,
- resource->format,
+ resource,
box,
stride,
layer_stride);
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);
diff --git a/src/gallium/drivers/trace/tr_dump.h b/src/gallium/drivers/trace/tr_dump.h
index 4737a93a6c3..4758755fcf4 100644
--- a/src/gallium/drivers/trace/tr_dump.h
+++ b/src/gallium/drivers/trace/tr_dump.h
@@ -88,7 +88,7 @@ void trace_dump_uint(long long unsigned value);
void trace_dump_float(double value);
void trace_dump_bytes(const void *data, size_t size);
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);