summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/trace
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2010-04-17 15:00:13 +0200
committerJosé Fonseca <[email protected]>2010-04-18 10:36:28 +0200
commit53c3c914a786a4a579532671bd9cb79b41cae78d (patch)
tree23c1025f027c75e19ade2452f84ea41644477769 /src/gallium/drivers/trace
parent4b95c9549db721392bf7a1f5ee820af17694fe38 (diff)
trace: Handle transfers with zero strides correctly.
Diffstat (limited to 'src/gallium/drivers/trace')
-rw-r--r--src/gallium/drivers/trace/tr_dump.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gallium/drivers/trace/tr_dump.c b/src/gallium/drivers/trace/tr_dump.c
index 8ff25fb1e85..51a4ea96335 100644
--- a/src/gallium/drivers/trace/tr_dump.c
+++ b/src/gallium/drivers/trace/tr_dump.c
@@ -478,8 +478,16 @@ void trace_dump_box_bytes(const void *data,
unsigned stride,
unsigned slice_stride)
{
- size_t size = MAX2(util_format_get_nblocksy(format, box->height) * stride,
- box->depth * 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);
+ }
+
trace_dump_bytes(data, size);
}