summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2016-02-07 22:33:33 +0100
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>2016-02-08 00:06:22 +0100
commit1dacbb7b46f458dcc09a42f7ac1bb18983f17075 (patch)
treecdcefc12f4731b34b58de9c1b3dc06cc1cdc6e35 /src
parentccaf734275ede89bfc86f274a64570be715fed94 (diff)
downloadexternal_mesa3d-1dacbb7b46f458dcc09a42f7ac1bb18983f17075.zip
external_mesa3d-1dacbb7b46f458dcc09a42f7ac1bb18983f17075.tar.gz
external_mesa3d-1dacbb7b46f458dcc09a42f7ac1bb18983f17075.tar.bz2
trace: remove useless MALLOC() in trace_context_draw_vbo()
There is no need to allocate memory when unwrapping the indirect buf. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/trace/tr_context.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
index 4d03fe1..066a0ee 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -120,18 +120,13 @@ trace_context_draw_vbo(struct pipe_context *_pipe,
trace_dump_trace_flush();
if (info->indirect) {
- struct pipe_draw_info *_info = NULL;
+ struct pipe_draw_info _info;
- _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);
+ 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);
} else {
pipe->draw_vbo(pipe, info);
}