diff options
-rw-r--r-- | src/gallium/auxiliary/driver_noop/noop_pipe.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/driver_noop/noop_pipe.c b/src/gallium/auxiliary/driver_noop/noop_pipe.c index ff93db86bd3..ec619fd33bc 100644 --- a/src/gallium/auxiliary/driver_noop/noop_pipe.c +++ b/src/gallium/auxiliary/driver_noop/noop_pipe.c @@ -156,6 +156,27 @@ static bool noop_resource_get_handle(struct pipe_screen *pscreen, return result; } +static bool noop_resource_get_param(struct pipe_screen *pscreen, + struct pipe_resource *resource, + unsigned int plane, + enum pipe_resource_param param, + uint64_t *value) +{ + struct noop_pipe_screen *noop_screen = (struct noop_pipe_screen*)pscreen; + struct pipe_screen *screen = noop_screen->oscreen; + struct pipe_resource *tex; + bool result; + + /* resource_get_param mustn't fail. Just create something and return it. */ + tex = screen->resource_create(screen, resource); + if (!tex) + return false; + + result = screen->resource_get_param(screen, tex, 0, param, value); + pipe_resource_reference(&tex, NULL); + return result; +} + static void noop_resource_destroy(struct pipe_screen *screen, struct pipe_resource *resource) { @@ -502,6 +523,8 @@ struct pipe_screen *noop_screen_create(struct pipe_screen *oscreen) screen->resource_create = noop_resource_create; screen->resource_from_handle = noop_resource_from_handle; screen->resource_get_handle = noop_resource_get_handle; + if (oscreen->resource_get_param) + screen->resource_get_param = noop_resource_get_param; screen->resource_destroy = noop_resource_destroy; screen->flush_frontbuffer = noop_flush_frontbuffer; screen->get_timestamp = noop_get_timestamp; |