29 #ifndef PXCUDACONTEXTMANAGER_PXCUDACONTEXTMANAGER_H 30 #define PXCUDACONTEXTMANAGER_PXCUDACONTEXTMANAGER_H 34 #if PX_SUPPORT_GPU_PHYSX 43 typedef struct CUctx_st *CUcontext;
44 typedef struct CUgraphicsResource_st *CUgraphicsResource;
51 struct PxCudaInteropMode
67 struct PxCudaInteropRegisterFlag
73 eWRITE_DISCARD = 0x02,
75 eTEXTURE_GATHER = 0x08
85 PX_FLAGS_OPERATORS(PxCudaInteropRegisterFlag::Enum, uint32_t)
87 class PxCudaContextManagerDesc
121 void *graphicsDevice;
123 #if PX_SUPPORT_GPU_PHYSX 140 PxCudaInteropMode::Enum interopMode;
158 uint32_t memoryBaseSize[PxCudaBufferMemorySpace::COUNT];
169 uint32_t memoryPageSize[PxCudaBufferMemorySpace::COUNT];
177 uint32_t maxMemorySize[PxCudaBufferMemorySpace::COUNT];
182 interopMode = PxCudaInteropMode::NO_INTEROP;
184 #if PX_SUPPORT_GPU_PHYSX 187 for(uint32_t i = 0; i < PxCudaBufferMemorySpace::COUNT; i++)
189 memoryBaseSize[i] = 0;
190 memoryPageSize[i] = 2 * 1024*1024;
191 maxMemorySize[i] = UINT32_MAX;
208 class PxCudaContextManager
220 virtual void acquireContext() = 0;
228 virtual void releaseContext() = 0;
233 virtual CUcontext getContext() = 0;
241 virtual PxCudaMemoryManager *getMemoryManager() = 0;
250 virtual bool contextIsValid()
const = 0;
254 virtual bool supportsArchSM10()
const = 0;
255 virtual bool supportsArchSM11()
const = 0;
256 virtual bool supportsArchSM12()
const = 0;
257 virtual bool supportsArchSM13()
const = 0;
258 virtual bool supportsArchSM20()
const = 0;
259 virtual bool supportsArchSM30()
const = 0;
260 virtual bool supportsArchSM35()
const = 0;
261 virtual bool supportsArchSM50()
const = 0;
262 virtual bool supportsArchSM52()
const = 0;
263 virtual bool supportsArchSM60()
const = 0;
264 virtual bool isIntegrated()
const = 0;
265 virtual bool canMapHostMemory()
const = 0;
266 virtual int getDriverVersion()
const = 0;
267 virtual size_t getDeviceTotalMemBytes()
const = 0;
268 virtual int getMultiprocessorCount()
const = 0;
269 virtual unsigned int getClockRate()
const = 0;
270 virtual int getSharedMemPerBlock()
const = 0;
271 virtual int getSharedMemPerMultiprocessor()
const = 0;
272 virtual unsigned int getMaxThreadsPerBlock()
const = 0;
273 virtual const char *getDeviceName()
const = 0;
274 virtual CUdevice getDevice()
const = 0;
275 virtual PxCudaInteropMode::Enum getInteropMode()
const = 0;
277 virtual void setUsingConcurrentStreams(
bool) = 0;
278 virtual bool getUsingConcurrentStreams()
const = 0;
301 virtual bool registerResourceInCudaGL(CUgraphicsResource &resource, uint32_t buffer, PxCudaInteropRegisterFlags
flags = PxCudaInteropRegisterFlags()) = 0;
323 virtual bool registerResourceInCudaD3D(CUgraphicsResource &resource,
void *resourcePointer, PxCudaInteropRegisterFlags
flags = PxCudaInteropRegisterFlags()) = 0;
332 virtual bool unregisterResourceInCuda(CUgraphicsResource resource) = 0;
341 virtual int usingDedicatedGPU()
const = 0;
356 virtual void release() = 0;
363 virtual ~PxCudaContextManager() {}
369 class PxScopedCudaLock
375 PxScopedCudaLock(PxCudaContextManager& ctx) : mCtx(&ctx)
377 mCtx->acquireContext();
385 mCtx->releaseContext();
393 PxCudaContextManager* mCtx;
398 #endif // PX_SUPPORT_GPU_PHYSX 399 #endif // PXCUDACONTEXTMANAGER_PXCUDACONTEXTMANAGER_H Definition: GuContactBuffer.h:37
PxU16 flags
a set of Px1DConstraintFlags
Definition: PxConstraintDesc.h:110
Container for bitfield flag variables associated with a specific enum type.
Definition: PxFlags.h:73
#define PX_INLINE
Definition: PxPreprocessor.h:336