AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
ClGlShareHandle.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17
18#ifndef AGX_CL_GL_SHARE_HANDLE_H
19#define AGX_CL_GL_SHARE_HANDLE_H
20
21#if 0 // Not used right now.
22
25#include <agx/config.h>
26
27#if AGX_USE_OPENCL() && AGX_USE_OPENGL()
28
29#include <agx/agxCore_export.h>
30
31#include <agxGL/OpenGL.h>
32#include <agxCL/OpenCL.h>
33#include <agxData/Buffer.h>
34#include <agxData/ShareHandle.h>
35
36
37namespace agxData
38{
39 class AGXCORE_EXPORT ClGlShareHandle : public ShareHandle
40 {
41 public:
42
43 // Creating a sharing between an OpenCL and an OpenGL buffer will discard the OpenCL content.
44 ClGlShareHandle(agxData::Buffer* buffer1, agxData::Buffer* buffer2);
45
46 virtual void acquire(const agxData::Buffer* buffer);
47 virtual bool isAcquired(const agxData::Buffer* buffer);
48 virtual agxData::Buffer* other(const agxData::Buffer* buffer);
49
50 void acquireOpenCL();
51 void acquireOpenGL();
52
53 private:
54 bool assignBuffers(agxData::Buffer* buffer1, agxData::Buffer* buffer2);
55 void passMemoryToOpenCL();
56
57 private:
58 friend class agxCL::Buffer;
59 friend class agxGL::Buffer;
60 agxGL::BufferRef m_glBuffer;
61 agxCL::BufferRef m_clBuffer;
62 CurrentHolder m_holder;
63
64 };
65}
66
67#endif // OPENCL & OPENGL
68
69#endif
70
71#endif // _CL_GL_SHARE_HANDLE_H_
#define AGXCORE_EXPORT
Abstract representation of a data buffer.
Definition: Buffer.h:56
Contains classes for low level data storage for AGX.
Definition: Container.h:23