st/egl: native_helper: Add resource_surface_import_resource
authorBenjamin Franzke <benjaminfranzke@googlemail.com>
Fri, 4 Feb 2011 11:25:04 +0000 (12:25 +0100)
committerBenjamin Franzke <benjaminfranzke@googlemail.com>
Mon, 7 Feb 2011 12:55:29 +0000 (13:55 +0100)
src/gallium/state_trackers/egl/common/native_helper.c
src/gallium/state_trackers/egl/common/native_helper.h

index 0f2d02032b575707d08ce7f587c503fa44030640..a9d8f32e007bc35dc81020212e0289c923104683 100644 (file)
@@ -143,6 +143,14 @@ resource_surface_add_resources(struct resource_surface *rsurf,
    return ((rsurf->resource_mask & resource_mask) == resource_mask);
 }
 
+void
+resource_surface_import_resource(struct resource_surface *rsurf,
+                                 enum native_attachment which,
+                                 struct pipe_resource *pres)
+{
+       pipe_resource_reference(&rsurf->resources[which], pres);
+       rsurf->resource_mask |= 1 << which;
+}
 
 void
 resource_surface_get_resources(struct resource_surface *rsurf,
index d1569ac3ea6dd561564527f6eee19897af88ecc6..03995de19ae30c5afe3b3c39b325f340c9eaae13 100644 (file)
@@ -50,6 +50,11 @@ boolean
 resource_surface_add_resources(struct resource_surface *rsurf,
                                uint resource_mask);
 
+void
+resource_surface_import_resource(struct resource_surface *rsurf,
+                                 enum native_attachment which,
+                                 struct pipe_resource *pres);
+
 void
 resource_surface_get_resources(struct resource_surface *rsurf,
                                struct pipe_resource **resources,