st/dri: Implement DRIimageExtension::dupImage
authorBenjamin Franzke <benjaminfranzke@googlemail.com>
Wed, 9 Mar 2011 19:55:02 +0000 (20:55 +0100)
committerBenjamin Franzke <benjaminfranzke@googlemail.com>
Thu, 23 Jun 2011 19:07:17 +0000 (21:07 +0200)
src/gallium/state_trackers/dri/drm/dri2.c

index e471e8e5be2f2f8b8f31a8b739d6c0bd4fc48193..0296a78092aa57f87e5b353608c15510e9c09975 100644 (file)
@@ -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,
 };
 
 /*