diff --git a/src/gallium/auxiliary/driver_trace/tr_context.c b/src/gallium/auxiliary/driver_trace/tr_context.c index b32a1ec30f1..e404a17eea5 100644 --- a/src/gallium/auxiliary/driver_trace/tr_context.c +++ b/src/gallium/auxiliary/driver_trace/tr_context.c @@ -2276,6 +2276,30 @@ static void trace_context_make_image_handle_resident(struct pipe_context *_pipe, pipe->make_image_handle_resident(pipe, handle, access, resident); } +static void trace_context_set_global_binding(struct pipe_context *_pipe, + unsigned first, unsigned count, + struct pipe_resource **resources, + uint32_t **handles) +{ + struct trace_context *tr_ctx = trace_context(_pipe); + struct pipe_context *pipe = tr_ctx->pipe; + + trace_dump_call_begin("pipe_context", "set_global_binding"); + trace_dump_arg(ptr, pipe); + trace_dump_arg(uint, first); + trace_dump_arg(uint, count); + trace_dump_arg_array(ptr, resources, count); + trace_dump_arg_array_val(uint, handles, count); + + pipe->set_global_binding(pipe, first, count, resources, handles); + + /* TODO: the handles are 64 bit if ADDRESS_BITS are 64, this is better than + * nothing though + */ + trace_dump_ret_array_val(uint, handles, count); + trace_dump_call_end(); +} + struct pipe_context * trace_context_create(struct trace_screen *tr_scr, struct pipe_context *pipe) @@ -2409,6 +2433,7 @@ trace_context_create(struct trace_screen *tr_scr, TR_CTX_INIT(invalidate_resource); TR_CTX_INIT(set_context_param); TR_CTX_INIT(set_debug_callback); + TR_CTX_INIT(set_global_binding); #undef TR_CTX_INIT diff --git a/src/gallium/auxiliary/driver_trace/tr_dump.h b/src/gallium/auxiliary/driver_trace/tr_dump.h index 51bbc241ed4..75b3fa7b73b 100644 --- a/src/gallium/auxiliary/driver_trace/tr_dump.h +++ b/src/gallium/auxiliary/driver_trace/tr_dump.h @@ -145,14 +145,14 @@ bool trace_dump_is_triggered(void); trace_dump_ret_end(); \ } while(0) -#define trace_dump_array(_type, _obj, _size) \ +#define trace_dump_array_impl(_type, _obj, _size, _prefix) \ do { \ if (_obj) { \ size_t idx; \ trace_dump_array_begin(); \ for(idx = 0; idx < (_size); ++idx) { \ trace_dump_elem_begin(); \ - trace_dump_##_type((_obj)[idx]); \ + trace_dump_##_type(_prefix(_obj)[idx]); \ trace_dump_elem_end(); \ } \ trace_dump_array_end(); \ @@ -161,6 +161,12 @@ bool trace_dump_is_triggered(void); } \ } while(0) +#define trace_dump_array(_type, _obj, _size) \ + trace_dump_array_impl(_type, _obj, _size, ); + +#define trace_dump_array_val(_type, _obj, _size) \ + trace_dump_array_impl(_type, _obj, _size, *); + #define trace_dump_struct_array(_type, _obj, _size) \ do { \ if (_obj) { \ @@ -191,6 +197,20 @@ bool trace_dump_is_triggered(void); trace_dump_arg_end(); \ } while(0) +#define trace_dump_arg_array_val(_type, _arg, _size) \ + do { \ + trace_dump_arg_begin(#_arg); \ + trace_dump_array_val(_type, _arg, _size); \ + trace_dump_arg_end(); \ + } while(0) + +#define trace_dump_ret_array_val(_type, _arg, _size) \ + do { \ + trace_dump_ret_begin(); \ + trace_dump_array_val(_type, _arg, _size); \ + trace_dump_ret_end(); \ + } while(0) + #define trace_dump_member_array(_type, _obj, _member) \ do { \ trace_dump_member_begin(#_member); \