trace_dump_arg_begin("data");
trace_dump_box_bytes(tr_trans->map,
- resource->format,
+ resource,
box,
stride,
layer_stride);
trace_dump_arg_begin("data");
trace_dump_box_bytes(data,
- resource->format,
+ resource,
box,
stride,
layer_stride);
}
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);
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);