diff options
author | Philipp Zabel <[email protected]> | 2017-01-19 15:05:42 +0100 |
---|---|---|
committer | Lucas Stach <[email protected]> | 2017-01-20 15:30:30 +0100 |
commit | a37cf630b4d1434925b570e13f009e9c3f8f23af (patch) | |
tree | 92ea4f218a5c1ec2b33596db23f7d9bf5043292e /src/gallium/drivers/trace | |
parent | 97de7e658664865f042b1729f3f959ee0fb7b6a4 (diff) |
gallium: add pipe_screen::resource_changed callback wrappers
Add resource_changed to the ddebug, rbug, and trace wrappers. Since it
is optional, there is no need to add it to noop.
Signed-off-by: Philipp Zabel <[email protected]>
Suggested-by: Nicolai Hähnle <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Signed-off-by: Lucas Stach <[email protected]>
Diffstat (limited to 'src/gallium/drivers/trace')
-rw-r--r-- | src/gallium/drivers/trace/tr_screen.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c index 493725cbcaa..aaf2e2607fe 100644 --- a/src/gallium/drivers/trace/tr_screen.c +++ b/src/gallium/drivers/trace/tr_screen.c @@ -350,7 +350,26 @@ trace_screen_resource_get_handle(struct pipe_screen *_screen, resource, handle, usage); } +static void +trace_screen_resource_changed(struct pipe_screen *_screen, + struct pipe_resource *_resource) +{ + struct trace_screen *tr_scr = trace_screen(_screen); + struct trace_resource *tr_res = trace_resource(_resource); + struct pipe_screen *screen = tr_scr->screen; + struct pipe_resource *resource = tr_res->resource; + + assert(resource->screen == screen); + trace_dump_call_begin("pipe_screen", "resource_changed"); + + trace_dump_arg(ptr, screen); + trace_dump_arg(ptr, resource); + + screen->resource_changed(screen, resource); + + trace_dump_call_end(); +} static void trace_screen_resource_destroy(struct pipe_screen *_screen, @@ -499,6 +518,9 @@ trace_screen_create(struct pipe_screen *screen) if (!tr_scr) goto error2; +#define SCR_INIT(_member) \ + tr_scr->base._member = screen->_member ? trace_screen_##_member : NULL + tr_scr->base.destroy = trace_screen_destroy; tr_scr->base.get_name = trace_screen_get_name; tr_scr->base.get_vendor = trace_screen_get_vendor; @@ -513,6 +535,7 @@ trace_screen_create(struct pipe_screen *screen) tr_scr->base.resource_create = trace_screen_resource_create; tr_scr->base.resource_from_handle = trace_screen_resource_from_handle; tr_scr->base.resource_get_handle = trace_screen_resource_get_handle; + SCR_INIT(resource_changed); tr_scr->base.resource_destroy = trace_screen_resource_destroy; tr_scr->base.fence_reference = trace_screen_fence_reference; tr_scr->base.fence_finish = trace_screen_fence_finish; |