summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorLucas Stach <[email protected]>2019-09-16 15:09:38 +0200
committerLucas Stach <[email protected]>2019-10-18 10:12:07 +0000
commit93d47932b843aecdad7277287bf1850c16bf2f29 (patch)
tree57dc4c210ca6fcef389298b2640c2a8a1ed3dfac /src/gallium
parent5b3e57059c3449cfc886550849c9f94b1f4a9677 (diff)
rbug: implement resource creation with modifier
Signed-off-by: Lucas Stach <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/driver_rbug/rbug_screen.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/driver_rbug/rbug_screen.c b/src/gallium/auxiliary/driver_rbug/rbug_screen.c
index 6c7a7cfc9ea..1a27618ef49 100644
--- a/src/gallium/auxiliary/driver_rbug/rbug_screen.c
+++ b/src/gallium/auxiliary/driver_rbug/rbug_screen.c
@@ -138,6 +138,23 @@ rbug_screen_is_format_supported(struct pipe_screen *_screen,
tex_usage);
}
+static void
+rbug_screen_query_dmabuf_modifiers(struct pipe_screen *_screen,
+ enum pipe_format format, int max,
+ uint64_t *modifiers,
+ unsigned int *external_only, int *count)
+{
+ struct rbug_screen *rb_screen = rbug_screen(_screen);
+ struct pipe_screen *screen = rb_screen->screen;
+
+ screen->query_dmabuf_modifiers(screen,
+ format,
+ max,
+ modifiers,
+ external_only,
+ count);
+}
+
static struct pipe_context *
rbug_screen_context_create(struct pipe_screen *_screen,
void *priv, unsigned flags)
@@ -180,6 +197,25 @@ rbug_screen_resource_create(struct pipe_screen *_screen,
}
static struct pipe_resource *
+rbug_screen_resource_create_with_modifiers(struct pipe_screen *_screen,
+ const struct pipe_resource *templat,
+ const uint64_t *modifiers, int count)
+{
+ struct rbug_screen *rb_screen = rbug_screen(_screen);
+ struct pipe_screen *screen = rb_screen->screen;
+ struct pipe_resource *result;
+
+ result = screen->resource_create_with_modifiers(screen,
+ templat,
+ modifiers,
+ count);
+
+ if (result)
+ return rbug_resource_create(rb_screen, result);
+ return NULL;
+}
+
+static struct pipe_resource *
rbug_screen_resource_from_handle(struct pipe_screen *_screen,
const struct pipe_resource *templ,
struct winsys_handle *handle,
@@ -371,9 +407,11 @@ rbug_screen_create(struct pipe_screen *screen)
rb_screen->base.get_shader_param = rbug_screen_get_shader_param;
rb_screen->base.get_paramf = rbug_screen_get_paramf;
rb_screen->base.is_format_supported = rbug_screen_is_format_supported;
+ SCR_INIT(query_dmabuf_modifiers);
rb_screen->base.context_create = rbug_screen_context_create;
SCR_INIT(can_create_resource);
rb_screen->base.resource_create = rbug_screen_resource_create;
+ SCR_INIT(resource_create_with_modifiers);
rb_screen->base.resource_from_handle = rbug_screen_resource_from_handle;
SCR_INIT(check_resource_capability);
rb_screen->base.resource_get_handle = rbug_screen_resource_get_handle;