st/dri: add drisw image extension
authorGurchetan Singh <gurchetansingh@chromium.org>
Tue, 1 Aug 2017 21:49:33 +0000 (14:49 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 7 Aug 2017 17:16:52 +0000 (18:16 +0100)
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.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/state_trackers/dri/drisw.c

index c0f3058272c733e698c9672713c58e7a40421472..9466cfdb203667d3f2f07e01cdbffd922e3ae958 100644 (file)
@@ -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.
  */
@@ -372,6 +380,7 @@ static const __DRIextension *drisw_screen_extensions[] = {
    &dri2ConfigQueryExtension.base,
    &dri2FenceExtension.base,
    &dri2NoErrorExtension.base,
+   &driSWImageExtension.base,
    NULL
 };
 
@@ -413,6 +422,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);