[Mesa-dev] [PATCH 6/7] clover: override ret_object

EdB edb+mesa at sigluy.net
Sun Dec 14 02:31:26 PST 2014


Return an API object from an intrusive smart reference Clover object,
incrementing the reference count of the object.
---
 src/gallium/state_trackers/clover/api/util.hpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/gallium/state_trackers/clover/api/util.hpp b/src/gallium/state_trackers/clover/api/util.hpp
index 918df61..a7adaa4 100644
--- a/src/gallium/state_trackers/clover/api/util.hpp
+++ b/src/gallium/state_trackers/clover/api/util.hpp
@@ -61,6 +61,17 @@ namespace clover {
          *p = desc(v());
       }
    }
+
+   ///
+   /// Return an API object from an intrusive smart reference Clover object,
+   /// incrementing the reference count of the object.
+   ///
+   template<typename T>
+   typename T::descriptor_type *
+   ret_object(const intrusive_ref<T> &v) {
+      v().retain();
+      return desc(v());
+   }
 }
 
 #endif
-- 
2.2.0



More information about the mesa-dev mailing list