[arrayfire] 149/248: Fix for cuda backend surface rendering function
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Tue Nov 17 15:54:18 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch dfsg-clean
in repository arrayfire.
commit 9436f1047a67e5092a54f78514870276a6b82c4c
Author: pradeep <pradeep at arrayfire.com>
Date: Thu Oct 29 12:42:43 2015 -0400
Fix for cuda backend surface rendering function
Interopmanager get resource method for surface objects was missing
earlier.
---
src/backend/cuda/interopManager.cu | 17 +++++++++++++++++
src/backend/cuda/interopManager.hpp | 1 +
2 files changed, 18 insertions(+)
diff --git a/src/backend/cuda/interopManager.cu b/src/backend/cuda/interopManager.cu
index dcee681..b492a5e 100644
--- a/src/backend/cuda/interopManager.cu
+++ b/src/backend/cuda/interopManager.cu
@@ -116,6 +116,23 @@ cudaGraphicsResource* InteropManager::getBufferResource(const fg::Histogram* key
return interop_maps[device][key_value];
}
+cudaGraphicsResource* InteropManager::getBufferResource(const fg::Surface* key)
+{
+ int device = getActiveDeviceId();
+ void* key_value = (void*)key;
+
+ iter_t iter = interop_maps[device].find(key_value);
+
+ if(interop_maps[device].find(key_value) == interop_maps[device].end()) {
+ cudaGraphicsResource *cudaVBOResource;
+ // Register VBO with CUDA
+ CUDA_CHECK(cudaGraphicsGLRegisterBuffer(&cudaVBOResource, key->vbo(), cudaGraphicsMapFlagsWriteDiscard));
+ interop_maps[device][key_value] = cudaVBOResource;
+ }
+
+ return interop_maps[device][key_value];
+}
+
}
#endif
diff --git a/src/backend/cuda/interopManager.hpp b/src/backend/cuda/interopManager.hpp
index 6508b08..e586d38 100644
--- a/src/backend/cuda/interopManager.hpp
+++ b/src/backend/cuda/interopManager.hpp
@@ -42,6 +42,7 @@ class InteropManager
cudaGraphicsResource* getBufferResource(const fg::Plot* handle);
cudaGraphicsResource* getBufferResource(const fg::Plot3* handle);
cudaGraphicsResource* getBufferResource(const fg::Histogram* handle);
+ cudaGraphicsResource* getBufferResource(const fg::Surface* handle);
protected:
InteropManager() {}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git
More information about the debian-science-commits
mailing list