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 0f2d020..a9d8f32 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 d1569ac..03995de 100644 (file)
@@ -51,6 +51,11 @@ 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,
                                uint resource_mask);