]> gitweb.factorcode.org Git - factor.git/commitdiff
cuda.gl: add free-resource word to release interop handles
authorJoe Groff <arcata@gmail.com>
Fri, 14 May 2010 23:17:03 +0000 (16:17 -0700)
committerJoe Groff <arcata@gmail.com>
Fri, 14 May 2010 23:17:03 +0000 (16:17 -0700)
extra/cuda/gl/gl.factor

index 268d270e7f0fe8de992658bd8677c93b67ea6118..2250c895e0112c14fecd1421ba823a58f4f82582 100644 (file)
@@ -30,6 +30,10 @@ IN: cuda.gl
 
 DESTRUCTOR: unmap-resource
 
+: free-resource ( resource -- )
+    cuGraphicsUnregisterResource cuda-error ; inline
+
+DESTRUCTOR: free-resource
+
 : with-mapped-resource ( ..a resource quot: ( ..a device-ptr size -- ..b ) -- ..b )
     over [ map-resource ] 2dip '[ _ unmap-resource ] [ ] cleanup ; inline
-