[Mesa-dev] [PATCH 4/6] st/dri: add drisw image extension

Gurchetan Singh gurchetansingh at chromium.org
Fri Jul 28 03:48:31 UTC 2017


Since the revelant functions have been moved to dri_helpers,
drisw.c can make use of the extension. Note we have version 6
of the extension, since we want to support createImageFromTexture.
---
 src/gallium/state_trackers/dri/drisw.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/gallium/state_trackers/dri/drisw.c b/src/gallium/state_trackers/dri/drisw.c
index 5c82c7f9f9..7a58fd57d4 100644
--- a/src/gallium/state_trackers/dri/drisw.c
+++ b/src/gallium/state_trackers/dri/drisw.c
@@ -362,6 +362,14 @@ drisw_update_tex_buffer(struct dri_drawable *drawable,
    pipe_transfer_unmap(pipe, transfer);
 }
 
+static __DRIimageExtension driSWImageExtension = {
+    .base = { __DRI_IMAGE, 6 },
+
+    .createImageFromRenderbuffer  = dri2_create_image_from_renderbuffer,
+    .createImageFromTexture = dri2_create_from_texture,
+    .destroyImage = dri2_destroy_image,
+};
+
 /*
  * Backend function for init_screen.
  */
@@ -371,6 +379,7 @@ static const __DRIextension *drisw_screen_extensions[] = {
    &dri2RendererQueryExtension.base,
    &dri2ConfigQueryExtension.base,
    &dri2FenceExtension.base,
+   &driSWImageExtension.base,
    NULL
 };
 
@@ -411,6 +420,8 @@ drisw_init_screen(__DRIscreen * sPriv)
    if (!configs)
       goto fail;
 
+   screen->lookup_egl_image = dri2_lookup_egl_image;
+
    return configs;
 fail:
    dri_destroy_screen_helper(screen);
-- 
2.14.0.rc0.400.g1c36432dff-goog



More information about the mesa-dev mailing list