diff options
author | Marek Olšák <[email protected]> | 2017-02-22 23:40:53 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-02-25 00:03:09 +0100 |
commit | d17b8d08a3e51df7ff218adf54600b34fa015a4f (patch) | |
tree | 6c5af2d90f06ede498c6982ad5ec4dacadd03667 /src/gallium/drivers/trace/tr_screen.c | |
parent | 4a883966c1f74f43afc145d2c3d27af7b8c5e01a (diff) |
trace: remove pipe_resource wrapping
Not needed. ddebug does the same thing. The limitation is that drivers
can only use pipe_resource::screen through pipe_resource_reference.
This unbreaks trace, because pipe_context uploaders aren't wrapped,
so trace doesn't understand buffers returned by them.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/trace/tr_screen.c')
-rw-r--r-- | src/gallium/drivers/trace/tr_screen.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c index 13505af7a0a..a4440688575 100644 --- a/src/gallium/drivers/trace/tr_screen.c +++ b/src/gallium/drivers/trace/tr_screen.c @@ -277,15 +277,13 @@ trace_screen_context_create(struct pipe_screen *_screen, void *priv, static void trace_screen_flush_frontbuffer(struct pipe_screen *_screen, - struct pipe_resource *_resource, + struct pipe_resource *resource, unsigned level, unsigned layer, void *context_private, struct pipe_box *sub_box) { 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; trace_dump_call_begin("pipe_screen", "flush_frontbuffer"); @@ -327,8 +325,8 @@ trace_screen_resource_create(struct pipe_screen *_screen, trace_dump_call_end(); - result = trace_resource_create(tr_scr, result); - + if (result) + result->screen = _screen; return result; } @@ -346,23 +344,21 @@ trace_screen_resource_from_handle(struct pipe_screen *_screen, result = screen->resource_from_handle(screen, templ, handle, usage); - result = trace_resource_create(trace_screen(_screen), result); - + if (result) + result->screen = _screen; return result; } static boolean trace_screen_resource_get_handle(struct pipe_screen *_screen, struct pipe_context *_pipe, - struct pipe_resource *_resource, + struct pipe_resource *resource, struct winsys_handle *handle, unsigned usage) { struct trace_screen *tr_screen = trace_screen(_screen); struct trace_context *tr_pipe = _pipe ? trace_context(_pipe) : NULL; - struct trace_resource *tr_resource = trace_resource(_resource); struct pipe_screen *screen = tr_screen->screen; - struct pipe_resource *resource = tr_resource->resource; /* TODO trace call */ @@ -372,14 +368,10 @@ trace_screen_resource_get_handle(struct pipe_screen *_screen, static void trace_screen_resource_changed(struct pipe_screen *_screen, - struct pipe_resource *_resource) + 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"); @@ -393,14 +385,10 @@ trace_screen_resource_changed(struct pipe_screen *_screen, static void trace_screen_resource_destroy(struct pipe_screen *_screen, - struct pipe_resource *_resource) + 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_destroy"); @@ -409,7 +397,7 @@ trace_screen_resource_destroy(struct pipe_screen *_screen, trace_dump_call_end(); - trace_resource_destroy(tr_scr, tr_res); + screen->resource_destroy(screen, resource); } |