[Mesa-dev] [PATCH 6/8] ddebug/rbug/trace: add get_disk_shader_cache() to pass-throughs
Nicolai Hähnle
nhaehnle at gmail.com
Wed Feb 22 11:09:13 UTC 2017
On 22.02.2017 04:45, Timothy Arceri wrote:
> ---
> src/gallium/drivers/ddebug/dd_screen.c | 9 +++++++++
> src/gallium/drivers/rbug/rbug_screen.c | 9 +++++++++
> src/gallium/drivers/trace/tr_screen.c | 21 +++++++++++++++++++++
> 3 files changed, 39 insertions(+)
>
> diff --git a/src/gallium/drivers/ddebug/dd_screen.c b/src/gallium/drivers/ddebug/dd_screen.c
> index 58e496a..996ff85 100644
> --- a/src/gallium/drivers/ddebug/dd_screen.c
> +++ b/src/gallium/drivers/ddebug/dd_screen.c
> @@ -55,6 +55,14 @@ dd_screen_get_device_vendor(struct pipe_screen *_screen)
> return screen->get_device_vendor(screen);
> }
>
> +static struct disk_cache *
> +dd_screen_get_disk_shader_cache(struct pipe_screen *_screen)
> +{
> + struct pipe_screen *screen = dd_screen(_screen)->screen;
> +
> + return screen->get_disk_shader_cache(screen);
> +}
> +
> static int
> dd_screen_get_param(struct pipe_screen *_screen,
> enum pipe_cap param)
> @@ -378,6 +386,7 @@ ddebug_screen_create(struct pipe_screen *screen)
> dscreen->base.get_name = dd_screen_get_name;
> dscreen->base.get_vendor = dd_screen_get_vendor;
> dscreen->base.get_device_vendor = dd_screen_get_device_vendor;
> + dscreen->base.get_disk_shader_cache = dd_screen_get_disk_shader_cache;
This should use SCR_INIT since the function pointer might be NULL. The
same applies to rbug and trace.
Cheers,
Nicolai
> dscreen->base.get_param = dd_screen_get_param;
> dscreen->base.get_paramf = dd_screen_get_paramf;
> dscreen->base.get_compute_param = dd_screen_get_compute_param;
> diff --git a/src/gallium/drivers/rbug/rbug_screen.c b/src/gallium/drivers/rbug/rbug_screen.c
> index 8fbbe73..0ea5139 100644
> --- a/src/gallium/drivers/rbug/rbug_screen.c
> +++ b/src/gallium/drivers/rbug/rbug_screen.c
> @@ -77,6 +77,14 @@ rbug_screen_get_device_vendor(struct pipe_screen *_screen)
> return screen->get_device_vendor(screen);
> }
>
> +static struct disk_cache *
> +rbug_screen_get_disk_shader_cache(struct pipe_screen *_screen)
> +{
> + struct pipe_screen *screen = rbug_screen(_screen)->screen;
> +
> + return screen->get_disk_shader_cache(screen);
> +}
> +
> static int
> rbug_screen_get_param(struct pipe_screen *_screen,
> enum pipe_cap param)
> @@ -283,6 +291,7 @@ rbug_screen_create(struct pipe_screen *screen)
> rb_screen->base.destroy = rbug_screen_destroy;
> rb_screen->base.get_name = rbug_screen_get_name;
> rb_screen->base.get_vendor = rbug_screen_get_vendor;
> + rb_screen->base.get_disk_shader_cache = rbug_screen_get_disk_shader_cache;
> rb_screen->base.get_device_vendor = rbug_screen_get_device_vendor;
> rb_screen->base.get_param = rbug_screen_get_param;
> rb_screen->base.get_shader_param = rbug_screen_get_shader_param;
> diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c
> index aaf2e26..4256855 100644
> --- a/src/gallium/drivers/trace/tr_screen.c
> +++ b/src/gallium/drivers/trace/tr_screen.c
> @@ -103,6 +103,26 @@ trace_screen_get_device_vendor(struct pipe_screen *_screen)
> }
>
>
> +static struct disk_cache *
> +trace_screen_get_disk_shader_cache(struct pipe_screen *_screen)
> +{
> + struct trace_screen *tr_scr = trace_screen(_screen);
> + struct pipe_screen *screen = tr_scr->screen;
> +
> + trace_dump_call_begin("pipe_screen", "get_disk_shader_cache");
> +
> + trace_dump_arg(ptr, screen);
> +
> + struct disk_cache *result = screen->get_disk_shader_cache(screen);
> +
> + trace_dump_ret(ptr, result);
> +
> + trace_dump_call_end();
> +
> + return result;
> +}
> +
> +
> static int
> trace_screen_get_param(struct pipe_screen *_screen,
> enum pipe_cap param)
> @@ -525,6 +545,7 @@ trace_screen_create(struct pipe_screen *screen)
> tr_scr->base.get_name = trace_screen_get_name;
> tr_scr->base.get_vendor = trace_screen_get_vendor;
> tr_scr->base.get_device_vendor = trace_screen_get_device_vendor;
> + tr_scr->base.get_disk_shader_cache = trace_screen_get_disk_shader_cache;
> tr_scr->base.get_param = trace_screen_get_param;
> tr_scr->base.get_shader_param = trace_screen_get_shader_param;
> tr_scr->base.get_paramf = trace_screen_get_paramf;
>
More information about the mesa-dev
mailing list