Mesa (master): st/dri: Implement DRIimageExtension::dupImage

Benjamin Franzke bnf at kemper.freedesktop.org
Thu Jun 23 12:07:59 PDT 2011


Module: Mesa
Branch: master
Commit: 15d7f1c1c73735eb108710a01806712b11ce5e8a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=15d7f1c1c73735eb108710a01806712b11ce5e8a

Author: Benjamin Franzke <benjaminfranzke at googlemail.com>
Date:   Wed Mar  9 20:55:02 2011 +0100

st/dri: Implement DRIimageExtension::dupImage

---

 src/gallium/state_trackers/dri/drm/dri2.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c
index e471e8e..0296a78 100644
--- a/src/gallium/state_trackers/dri/drm/dri2.c
+++ b/src/gallium/state_trackers/dri/drm/dri2.c
@@ -564,6 +564,24 @@ dri2_query_image(__DRIimage *image, int attrib, int *value)
    }
 }
 
+static __DRIimage *
+dri2_dup_image(__DRIimage *image, void *loaderPrivate)
+{
+   __DRIimage *img;
+
+   img = CALLOC_STRUCT(__DRIimageRec);
+   if (!img)
+      return NULL;
+
+   img->texture = NULL;
+   pipe_resource_reference(&img->texture, image->texture);
+   img->level = image->level;
+   img->layer = image->layer;
+   img->loader_private = loaderPrivate;
+
+   return img;
+}
+
 static void
 dri2_destroy_image(__DRIimage *img)
 {
@@ -578,6 +596,7 @@ static struct __DRIimageExtensionRec dri2ImageExtension = {
     dri2_destroy_image,
     dri2_create_image,
     dri2_query_image,
+    dri2_dup_image,
 };
 
 /*



More information about the mesa-commit mailing list