summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2016-01-24 17:50:46 +0100
committerSamuel Pitoiset <[email protected]>2016-01-24 19:53:53 +0100
commit429371f22acb16862f0df7592d4c085d4a10c767 (patch)
tree9898ff50227787b7965884bb0cbc537429814a7a /src
parent24ea81a4916091f487d132e22aaaaf0e88742d36 (diff)
trace: fix a segfault when tracing indirect draw calls
Like other resources, the indirect draw buffer must be unwrapped. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/trace/tr_context.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
index b5ab9249835..6e703f76499 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -119,7 +119,22 @@ trace_context_draw_vbo(struct pipe_context *_pipe,
trace_dump_trace_flush();
- pipe->draw_vbo(pipe, info);
+ if (info->indirect) {
+ struct pipe_draw_info *_info = NULL;
+
+ _info = MALLOC(sizeof(*_info));
+ if (!_info)
+ return;
+
+ memcpy(_info, info, sizeof(*_info));
+ _info->indirect = trace_resource_unwrap(tr_ctx, _info->indirect);
+ _info->indirect_params = trace_resource_unwrap(tr_ctx,
+ _info->indirect_params);
+ pipe->draw_vbo(pipe, _info);
+ FREE(_info);
+ } else {
+ pipe->draw_vbo(pipe, info);
+ }
trace_dump_call_end();
}