[Mesa-dev] [PATCH v6 2/3] clover: override ret_object

Serge Martin edb+mesa at sigluy.net
Thu Dec 31 08:19:40 PST 2015


Return an API object from an intrusive reference to a Clover object,
incrementing the reference count of the object.

Reviewed-by: Francisco Jerez <currojerez at riseup.net>
---
 src/gallium/state_trackers/clover/api/util.hpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/gallium/state_trackers/clover/api/util.hpp b/src/gallium/state_trackers/clover/api/util.hpp
index 31e20e4..18ba143 100644
--- a/src/gallium/state_trackers/clover/api/util.hpp
+++ b/src/gallium/state_trackers/clover/api/util.hpp
@@ -68,6 +68,18 @@ namespace clover {
          *p = desc(v());
       }
    }
+
+   ///
+   /// Return an API object from an intrusive reference to a 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.5.0



More information about the mesa-dev mailing list